query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
eb7b028bc113c0ca4caf2aec453b7700
zorder of a point given coords and inverse of the longer side of data bbox
[ { "docid": "0b7e787d26c4e13b1cd2dacf274a2750", "score": "0.6661566", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\n\tx = 32767 * ( x - minX ) * invSize;\n\ty = 32767 * ( y - minY ) * invSize;\n\n\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\treturn x | ( y << 1 );\n\n}", "title": "" } ]
[ { "docid": "eee51a0972e08c068b55af537e93a109", "score": "0.6767461", "text": "function zOrder(x, y, minX, minY, size) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) / size;\n\t y = 32767 * (y - minY) / size;\n\t\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n\t x = (x | (x << 1)) & 0x55555555;\n\t\n\t y = (y | (y << 8)) & 0x00FF00FF;\n\t y = (y | (y << 4)) & 0x0F0F0F0F;\n\t y = (y | (y << 2)) & 0x33333333;\n\t y = (y | (y << 1)) & 0x55555555;\n\t\n\t return x | (y << 1);\n\t}", "title": "" }, { "docid": "eee51a0972e08c068b55af537e93a109", "score": "0.6767461", "text": "function zOrder(x, y, minX, minY, size) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) / size;\n\t y = 32767 * (y - minY) / size;\n\t\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n\t x = (x | (x << 1)) & 0x55555555;\n\t\n\t y = (y | (y << 8)) & 0x00FF00FF;\n\t y = (y | (y << 4)) & 0x0F0F0F0F;\n\t y = (y | (y << 2)) & 0x33333333;\n\t y = (y | (y << 1)) & 0x55555555;\n\t\n\t return x | (y << 1);\n\t}", "title": "" }, { "docid": "eee51a0972e08c068b55af537e93a109", "score": "0.6767461", "text": "function zOrder(x, y, minX, minY, size) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) / size;\n\t y = 32767 * (y - minY) / size;\n\t\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n\t x = (x | (x << 1)) & 0x55555555;\n\t\n\t y = (y | (y << 8)) & 0x00FF00FF;\n\t y = (y | (y << 4)) & 0x0F0F0F0F;\n\t y = (y | (y << 2)) & 0x33333333;\n\t y = (y | (y << 1)) & 0x55555555;\n\t\n\t return x | (y << 1);\n\t}", "title": "" }, { "docid": "5e9295e29bb8702a1cdef79c921f1ed5", "score": "0.675784", "text": "function zOrder(x, y, minX, minY, size) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) / size;\n\t y = 32767 * (y - minY) / size;\n\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n\t x = (x | (x << 1)) & 0x55555555;\n\n\t y = (y | (y << 8)) & 0x00FF00FF;\n\t y = (y | (y << 4)) & 0x0F0F0F0F;\n\t y = (y | (y << 2)) & 0x33333333;\n\t y = (y | (y << 1)) & 0x55555555;\n\n\t return x | (y << 1);\n\t}", "title": "" }, { "docid": "419da6a3818645b4e7d04e99eca856d1", "score": "0.67541", "text": "function zOrder(x, y, minX, minY, invSize) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) * invSize;\n\t y = 32767 * (y - minY) * invSize;\n\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n\t x = (x | (x << 1)) & 0x55555555;\n\n\t y = (y | (y << 8)) & 0x00FF00FF;\n\t y = (y | (y << 4)) & 0x0F0F0F0F;\n\t y = (y | (y << 2)) & 0x33333333;\n\t y = (y | (y << 1)) & 0x55555555;\n\n\t return x | (y << 1);\n\t}", "title": "" }, { "docid": "a1d9aba8f8ddc7432c39c1ef62fce831", "score": "0.67422116", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\tx = ( x - minX ) * invSize | 0;\n\ty = ( y - minY ) * invSize | 0;\n\n\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\treturn x | ( y << 1 );\n\n}", "title": "" }, { "docid": "e925f06730d302f75afef1d6e87df7a0", "score": "0.6720592", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into (0..1000) integer range\n x = 1000 * (x - minX) / size;\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = 1000 * (y - minY) / size;\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "27a4f097539635a230841de7674940ad", "score": "0.66750723", "text": "static zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n return x | (y << 1);\n }", "title": "" }, { "docid": "119bb2b94b069155053f56eb67fa2576", "score": "0.6671666", "text": "function zOrder(x, y, minX, minY, invSize) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\n\tx = 32767 * (x - minX) * invSize;\n\ty = 32767 * (y - minY) * invSize;\n\n\tx = (x | x << 8) & 0x00FF00FF;\n\tx = (x | x << 4) & 0x0F0F0F0F;\n\tx = (x | x << 2) & 0x33333333;\n\tx = (x | x << 1) & 0x55555555;\n\n\ty = (y | y << 8) & 0x00FF00FF;\n\ty = (y | y << 4) & 0x0F0F0F0F;\n\ty = (y | y << 2) & 0x33333333;\n\ty = (y | y << 1) & 0x55555555;\n\n\treturn x | y << 1;\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "dbf38eef0a4db3b2f6ea396297af9401", "score": "0.663567", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "5354ac1da7a79fd3da3f0a7e77de9ced", "score": "0.6626114", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | x << 8) & 0x00FF00FF;\n x = (x | x << 4) & 0x0F0F0F0F;\n x = (x | x << 2) & 0x33333333;\n x = (x | x << 1) & 0x55555555;\n\n y = (y | y << 8) & 0x00FF00FF;\n y = (y | y << 4) & 0x0F0F0F0F;\n y = (y | y << 2) & 0x33333333;\n y = (y | y << 1) & 0x55555555;\n\n return x | y << 1;\n}", "title": "" }, { "docid": "5354ac1da7a79fd3da3f0a7e77de9ced", "score": "0.6626114", "text": "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) / size;\n y = 32767 * (y - minY) / size;\n\n x = (x | x << 8) & 0x00FF00FF;\n x = (x | x << 4) & 0x0F0F0F0F;\n x = (x | x << 2) & 0x33333333;\n x = (x | x << 1) & 0x55555555;\n\n y = (y | y << 8) & 0x00FF00FF;\n y = (y | y << 4) & 0x0F0F0F0F;\n y = (y | y << 2) & 0x33333333;\n y = (y | y << 1) & 0x55555555;\n\n return x | y << 1;\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.66220224", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}", "title": "" }, { "docid": "e98c134955c1bca13c266ed881821fe5", "score": "0.6561959", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t\t// coords are transformed into non-negative 15-bit integer range\n\t\tx = 32767 * ( x - minX ) * invSize;\n\t\ty = 32767 * ( y - minY ) * invSize;\n\n\t\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\t\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\t\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\t\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\t\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\t\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\t\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\t\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\t\treturn x | ( y << 1 );\n\n\t}", "title": "" }, { "docid": "9be9574ff18c6c6fa9facc0a5ebd0832", "score": "0.6530909", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t\t// coords are transformed into non-negative 15-bit integer range\n\n\t\tx = 32767 * ( x - minX ) * invSize;\n\t\ty = 32767 * ( y - minY ) * invSize;\n\n\t\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\t\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\t\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\t\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\t\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\t\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\t\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\t\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\t\treturn x | ( y << 1 );\n\n\t}", "title": "" }, { "docid": "9be9574ff18c6c6fa9facc0a5ebd0832", "score": "0.6530909", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t\t// coords are transformed into non-negative 15-bit integer range\n\n\t\tx = 32767 * ( x - minX ) * invSize;\n\t\ty = 32767 * ( y - minY ) * invSize;\n\n\t\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\t\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\t\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\t\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\t\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\t\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\t\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\t\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\t\treturn x | ( y << 1 );\n\n\t}", "title": "" }, { "docid": "9be9574ff18c6c6fa9facc0a5ebd0832", "score": "0.6530909", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t\t// coords are transformed into non-negative 15-bit integer range\n\n\t\tx = 32767 * ( x - minX ) * invSize;\n\t\ty = 32767 * ( y - minY ) * invSize;\n\n\t\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\t\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\t\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\t\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\t\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\t\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\t\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\t\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\t\treturn x | ( y << 1 );\n\n\t}", "title": "" }, { "docid": "0b8c5de7b632c8ec2aca8a0eed318069", "score": "0.56792045", "text": "_updateZOrder() {}", "title": "" }, { "docid": "bda268ef831546b2af0c58308fb19a17", "score": "0.5626448", "text": "function getZIndex(el) {return _zIndex && !isNaN(_zIndex) ? (_zIndex - 0) : $XH.getZIndex(el);}", "title": "" }, { "docid": "bda268ef831546b2af0c58308fb19a17", "score": "0.5626448", "text": "function getZIndex(el) {return _zIndex && !isNaN(_zIndex) ? (_zIndex - 0) : $XH.getZIndex(el);}", "title": "" }, { "docid": "a73011345da15521a23f95df6b311cf2", "score": "0.56172", "text": "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "title": "" }, { "docid": "a73011345da15521a23f95df6b311cf2", "score": "0.56172", "text": "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "title": "" }, { "docid": "e493a80fa9e89bfd9090fcfeb93f098a", "score": "0.55335474", "text": "function inverse$j(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = adjust_lon(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "6d5e0306d503057fd06cacaa81e12c63", "score": "0.5505798", "text": "zigZag(){\t\n\t\tthis.x -= this.xSpeed;\n\t\tif (this.y < this.oYPos - this.bound || this.y > this.oYPos + this.bound || this.y - this.h/2 < 0 || this.y + this.h /2 > h){\n\t\t\tthis.ySpeed *= -1;\n\t\t}\n\t\tthis.y += this.ySpeed;\n\t\tfor (let hitBox of this.hitBoxes){\n\t\t\thitBox.x -=this.xSpeed;\n\t\t\thitBox.y +=this.ySpeed;\n\t\t}\n\t}", "title": "" }, { "docid": "f93e11cc3b0fcb26ea5ee00c2ad38568", "score": "0.54673374", "text": "get offsetZ() {}", "title": "" }, { "docid": "b0c3e1622b9a9e88f5741ed54e2e0d9f", "score": "0.54374945", "text": "function inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = adjust_lon(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "b387afc9a4dc63fc0a6f1ba80dee61d9", "score": "0.5430017", "text": "function Z(){var e=c.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||c[t]:e.height||c[t]}", "title": "" }, { "docid": "8fbf8db96b34d5e88dee5974011cb323", "score": "0.5415242", "text": "transform_point(z) {\n let z1 = this.mirror ? z.conj : z;\n\n return this.multiplier.mult(z1).add(this.offset);\n }", "title": "" }, { "docid": "e9d9afe4b7afe4f184924e074c6601f8", "score": "0.5381962", "text": "reverse() {\n return Point(\n 0 - this.x,\n 0 - this.y\n )\n }", "title": "" }, { "docid": "f8ac7dee19ca6d23c62393d24ab7d44a", "score": "0.53708816", "text": "reverse() {\n const { _coords } = this\n const numCoords = _coords.length\n const numVertices = numCoords / 2\n let tmp\n\n for (let i = 0; i < numVertices; i += 2) {\n tmp = _coords[i]\n _coords[i] = _coords[numCoords - i - 2]\n _coords[numCoords - i - 2] = tmp\n\n tmp = _coords[i + 1]\n _coords[i + 1] = _coords[numCoords - i - 1]\n _coords[numCoords - i - 1] = tmp\n }\n }", "title": "" }, { "docid": "0f8f06c5d485f8982c8519a1be84de5d", "score": "0.536806", "text": "function inverse$f(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);\n lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "e4700cce96cecbd2aa94db6c02cf139d", "score": "0.5345257", "text": "function zOrder(polyList)\n\t\t{\n\t\t\tpolyList.sort(function(a, b){\n\t\t\t\tvar pa = a.points()[0].min.apply(null, a),\n\t\t\t\t\tpb = b.points()[0].min.apply(null, b);\n\n\t\t\t\treturn (pa.x + pa.y) - (pb.x + pb.y);\n\t\t\t});\n\t\t\treturn polyList;\n\t\t}", "title": "" }, { "docid": "ec8e4c364997c72db0b7401d1b4211ae", "score": "0.5336605", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = Object(_common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, 2 * p.y * this.k0 / this.a);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "cf41cb5e471e0ac849460b3281328cd2", "score": "0.53072655", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "dc4df5e4048715dcefdc249a2a68c05f", "score": "0.5303587", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "24183a0394128cce6b914330a5b64d9f", "score": "0.53026587", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_iqsfnz__[\"a\" /* default */])(this.e, 2 * p.y * this.k0 / this.a);\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "2b918241fd6575994dd1bb2a1d4c80b4", "score": "0.53003055", "text": "static zSort(up, type, elements_data) {\t\n\t\t\tlet layer = canvas.getLayerByEmbeddedName(type);\n\t\t\tconst siblings = layer.placeables;\t\n\t\t\t// Determine target sort index\n\t\t\tlet z = 0;\n\t\t\tif ( up ) {\n\t\t\t\telements_data.sort((a, b) => a.z - b.z);\n\t\t\t \tz = siblings.length ? Math.max(...siblings.map(o => o.data.z)) + 1 : 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\telements_data.sort((a, b) => b.z - a.z);\n\t\t\t \tz = siblings.length ? Math.min(...siblings.map(o => o.data.z)) - 1 : -1;\n\t\t\t}\n\t\t\n\t\t\t// Update all controlled objects\n\t\t\tfor (let i = 0; i < elements_data.length; i++) {\n\t\t\t\tlet d = up ? i : i * -1;\n\t\t\t\telements_data[i].z = z + d;\t\t\t\t\n\t\t\t}\n\t\t\treturn elements_data;\n\t\t}", "title": "" }, { "docid": "50301801c35763c4d1fa19b98a57bd2c", "score": "0.5282616", "text": "function _(px,py,pz) {\n var e = 0.01;\n nx = F(px+e, py, pz) - F(px-e, py, pz);\n ny = F(px, py+e, pz) - F(px, py-e, pz);\n nz = F(px, py, pz+e) - F(px, py, pz-e);\n nl = R(nx*nx+ny*ny+nz*nz);\n if (nl==0)return;\n nx/=nl;\n ny/=nl;\n nz/=nl;\n }", "title": "" }, { "docid": "a6f1c7e95954f4b572dd9b85db0fa9c8", "score": "0.5280601", "text": "function inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "2ada68d0ac38e93f55a77cf822a65371", "score": "0.5269835", "text": "reverseAlongXAxis() {\n for (let i = 0; i < this.height; i++) {\n var begin = this.width * i;\n var end = this.width * (i + 1);\n var tempR = this.r.slice(begin, end).reverse();\n var tempG = this.g.slice(begin, end).reverse();\n var tempB = this.b.slice(begin, end).reverse();\n var tempA = this.a.slice(begin, end).reverse();\n for (let j = 0; j < this.width; j++) {\n this.r[begin + j] = tempR[j];\n this.g[begin + j] = tempG[j];\n this.b[begin + j] = tempB[j];\n this.a[begin + j] = tempA[j];\n }\n }\n return this;\n }", "title": "" }, { "docid": "064e6ef0179dc68ec13148c49977ff16", "score": "0.5254492", "text": "function gameZ(x,y,z) {\n\t\t\tswitch (viewDir) {\n\t\t\t\tcase 0:\n\t\t\t\t\tvar zIndex = (200 - (z-y-x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tvar zIndex = (200 - (z-y+x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tvar zIndex = (200 - (z+y+x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tvar zIndex = (200 - (z+y-x)*2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn zIndex;\n\t\t}", "title": "" }, { "docid": "15e3b97defd34c8fb1aa57944d490923", "score": "0.5253963", "text": "function inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"b\" /* HALF_PI */] - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_phi2z__[\"a\" /* default */])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "52be7412f1e5b23f12088035d5792c8f", "score": "0.5235169", "text": "function comeBackZIndex(){\n\t var children = layer.getChildren();\n\t var newArr = [];\n\t \n\t children.forEach(function(obj, i, a) {\n\t \tnewArr.push(obj);\n\t });\n\n\t newArr.forEach(function(obj, i, a) {\n\t\tif(obj.attrs.myZIndex){\n\t \t\tobj.setZIndex(obj.attrs.myZIndex);\n\t \t\tlayer.draw();\n\t\t}\n\t });\n}", "title": "" }, { "docid": "721dd32ea3b7c8ca1dd673bfaf29fbbe", "score": "0.5229043", "text": "function rotate_z() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.y * (-curr_sin));\n this.y = (this.x * curr_sin) + (this.y * (curr_cos));\n this.x = x;\n }", "title": "" }, { "docid": "b7216cbf515d82e38805de1fb8c0433d", "score": "0.5189657", "text": "invert() {\n this.polygons.forEach(p => p.flip());\n this.plane.flip();\n if (this.front !== null) {\n this.front.invert();\n }\n if (this.back !== null) {\n this.back.invert();\n }\n let temp = this.front;\n this.front = this.back;\n this.back = temp;\n }", "title": "" }, { "docid": "a9af48c508dac325469a375e44f58d2d", "score": "0.5162898", "text": "function inverse$9(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -HALF_PI;\n }\n lon = adjust_lon(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "573e623aa70d2692d1819787904a9b90", "score": "0.51321715", "text": "function getSmoothNormz(outer, inner, nface, store) {\r\n var k = 0;\r\n while (k < outer-1){\r\n var rowAbove = nface[k];\r\n var rowBelow = nface[k+1];\r\n for(var t=0; t < inner-1; t++){\r\n \r\n // first 2 vertices in polygon\r\n for(var j=k; j<=k+1; j++){\r\n \r\n rowAbove = nface[j];\r\n rowBelow = nface[j+1];\r\n \r\n var x = rowAbove[t].x + rowAbove[t+1].x + rowBelow[t].x + rowBelow[t+1].x;\r\n var y = rowAbove[t].y + rowAbove[t+1].y + rowBelow[t].y + rowBelow[t+1].y;\r\n var z = rowAbove[t].z + rowAbove[t+1].z + rowBelow[t].z + rowBelow[t+1].z;\r\n\r\n var Vnorm = new Vector3([x, y, z]);\r\n Vnorm.normalize();\r\n \r\n vertexNormz.push(Vnorm.elements[0], Vnorm.elements[1], Vnorm.elements[2]);\r\n store.push(new coord(Vnorm.elements[0], Vnorm.elements[1], Vnorm.elements[2]));\r\n }\r\n \r\n // second 2 vertices in polygon\r\n for(var j=k+1; j>=k; j--){\r\n \r\n rowAbove = nface[j];\r\n rowBelow = nface[j+1];\r\n \r\n var x = rowAbove[t+1].x + rowAbove[t+2].x + rowBelow[t+1].x + rowBelow[t+2].x;\r\n var y = rowAbove[t+1].y + rowAbove[t+2].y + rowBelow[t+1].y + rowBelow[t+2].y;\r\n var z = rowAbove[t+1].z + rowAbove[t+2].z + rowBelow[t+1].z + rowBelow[t+2].z;\r\n\r\n var Vnorm = new Vector3([x, y, z]);\r\n Vnorm.normalize();\r\n vertexNormz.push(Vnorm.elements[0], Vnorm.elements[1], Vnorm.elements[2]);\r\n store.push(new coord(Vnorm.elements[0], Vnorm.elements[1], Vnorm.elements[2]));\r\n }\r\n }\r\n k++;\r\n }\r\n}", "title": "" }, { "docid": "76acd8b4bbe0ef83b574a5bf75c24f91", "score": "0.51254517", "text": "function zt(a,b){this.D=[];this.X=a;this.W=b||null;this.B=this.j=!1;this.v=void 0;this.ia=this.da=this.L=!1;this.G=0;this.o=null;this.A=0}", "title": "" }, { "docid": "8f0cecfb54377cc00d43370ce2a0cd3c", "score": "0.51214933", "text": "_sortFeaturesZIndex(layer) {\n\t\t// First, lines\n\t\tlayer.eachLayer(l => {\n\t\t\tif(l.feature && l instanceof Polyline && !(l instanceof Polygon)) {\n\t\t\t\tl.bringToFront();\n\t\t\t}\n\t\t});\n\t\t// Last, nodes\n\t\tlayer.eachLayer(l => {\n\t\t\tif(l.feature && l.feature.id.startsWith(\"node/\")) {\n\t\t\t\tl.bringToFront();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "02c77ff8a6a8e18249b8ab31689cc999", "score": "0.5103703", "text": "function xZIndex(e,uZ)\r\n{\r\n if(!(e=xGetElementById(e))) return 0;\r\n if(e.style && xDef(e.style.zIndex)) {\r\n if(xNum(uZ)) e.style.zIndex=uZ;\r\n uZ=parseInt(e.style.zIndex);\r\n }\r\n return uZ;\r\n}", "title": "" }, { "docid": "60d8ef1ee66429e22d4989d5f60dc0f6", "score": "0.5103461", "text": "function inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}", "title": "" }, { "docid": "905aea5250e5dcb5719e34faf5937266", "score": "0.50828946", "text": "set offsetZ(value) {}", "title": "" }, { "docid": "8a8e65291cd8c05ee36f186ba0d31898", "score": "0.5063531", "text": "function bezFunction() {\n var math = Math;\n function pointOnLine2D(x1, y1, x2, y2, x3, y3) {\n var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;\n return det1 > -0.001 && det1 < 0.001;\n }\n function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {\n if (z1 === 0 && z2 === 0 && z3 === 0) return pointOnLine2D(x1, y1, x2, y2, x3, y3);\n var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));\n var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));\n var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));\n var diffDist;\n if (dist1 > dist2) {\n if (dist1 > dist3) diffDist = dist1 - dist2 - dist3;\n else diffDist = dist3 - dist2 - dist1;\n } else if (dist3 > dist2) diffDist = dist3 - dist2 - dist1;\n else diffDist = dist2 - dist1 - dist3;\n return diffDist > -0.0001 && diffDist < 0.0001;\n }\n var getBezierLength = function() {\n return function(pt1, pt2, pt3, pt4) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point = [];\n var lastPoint = [];\n var lengthData = bezierLengthPool.newElement();\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint[i] !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n lastPoint[i] = point[i];\n }\n if (ptDistance) {\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n }\n lengthData.percents[k] = perc;\n lengthData.lengths[k] = addedLength;\n }\n lengthData.addedLength = addedLength;\n return lengthData;\n };\n }();\n function getSegmentsLength(shapeData) {\n var segmentsLength = segmentsLengthPool.newElement();\n var closed = shapeData.c;\n var pathV = shapeData.v;\n var pathO = shapeData.o;\n var pathI = shapeData.i;\n var i;\n var len = shapeData._length;\n var lengths = segmentsLength.lengths;\n var totalLength = 0;\n for(i = 0; i < len - 1; i += 1){\n lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);\n totalLength += lengths[i].addedLength;\n }\n if (closed && len) {\n lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);\n totalLength += lengths[i].addedLength;\n }\n segmentsLength.totalLength = totalLength;\n return segmentsLength;\n }\n function BezierData(length) {\n this.segmentLength = 0;\n this.points = new Array(length);\n }\n function PointData(partial, point) {\n this.partialLength = partial;\n this.point = point;\n }\n var buildBezierData = function() {\n var storedData = {\n };\n return function(pt1, pt2, pt3, pt4) {\n var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\\./g, 'p');\n if (!storedData[bezierName]) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point;\n var lastPoint = null;\n if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) curveSegments = 2;\n var bezierData = new BezierData(curveSegments);\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n point = createSizedArray(len);\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n }\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n bezierData.points[k] = new PointData(ptDistance, point);\n lastPoint = point;\n }\n bezierData.segmentLength = addedLength;\n storedData[bezierName] = bezierData;\n }\n return storedData[bezierName];\n };\n }();\n function getDistancePerc(perc, bezierData) {\n var percents = bezierData.percents;\n var lengths = bezierData.lengths;\n var len = percents.length;\n var initPos = bmFloor((len - 1) * perc);\n var lengthPos = perc * bezierData.addedLength;\n var lPerc = 0;\n if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) return percents[initPos];\n var dir = lengths[initPos] > lengthPos ? -1 : 1;\n var flag = true;\n while(flag){\n if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {\n lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);\n flag = false;\n } else initPos += dir;\n if (initPos < 0 || initPos >= len - 1) {\n // FIX for TypedArrays that don't store floating point values with enough accuracy\n if (initPos === len - 1) return percents[initPos];\n flag = false;\n }\n }\n return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;\n }\n function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {\n var t1 = getDistancePerc(percent, bezierData);\n var u1 = 1 - t1;\n var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;\n var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;\n return [\n ptX,\n ptY\n ];\n }\n var bezierSegmentPoints = createTypedArray('float32', 8);\n function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {\n if (startPerc < 0) startPerc = 0;\n else if (startPerc > 1) startPerc = 1;\n var t0 = getDistancePerc(startPerc, bezierData);\n endPerc = endPerc > 1 ? 1 : endPerc;\n var t1 = getDistancePerc(endPerc, bezierData);\n var i;\n var len = pt1.length;\n var u0 = 1 - t0;\n var u1 = 1 - t1;\n var u0u0u0 = u0 * u0 * u0;\n var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0t0 = t0 * t0 * t0;\n //\n var u0u0u1 = u0 * u0 * u1;\n var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0t1 = t0 * t0 * t1;\n //\n var u0u1u1 = u0 * u1 * u1;\n var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1t1 = t0 * t1 * t1;\n //\n var u1u1u1 = u1 * u1 * u1;\n var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1t1 = t1 * t1 * t1;\n for(i = 0; i < len; i += 1){\n bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n }\n return bezierSegmentPoints;\n }\n return {\n getSegmentsLength: getSegmentsLength,\n getNewSegment: getNewSegment,\n getPointInSegment: getPointInSegment,\n buildBezierData: buildBezierData,\n pointOnLine2D: pointOnLine2D,\n pointOnLine3D: pointOnLine3D\n };\n }", "title": "" }, { "docid": "29b5a2cb14a36b1cc2bda25bcb88d361", "score": "0.50508183", "text": "function zAxis (orders, t, e, b, w) {\r\n\tvar c = this;\r\n\tzAxisConstructor(c, zo.extend({\r\n\t\ttype:\"zAxis\",\r\n\t\tdc:new zDataCube(1).importDumb(), d:0, A:[\"all\"],\r\n\t\trange:[0, 100], // Min/max values for axis (same as .domain in d3.js)\r\n\t\ttitle:null, // Title for axis, will be displayed by axisTitle\r\n\t\tlayout:{rotation:0},\r\n\t\tstyle:{\r\n\t\t\textension:0,\r\n\t\t\tmaxNotches:10,\r\n\t\t\tclipMargin:20,\r\n\t\t\tlabel:{\r\n\t\t\t\tformat:{dp:10},\r\n\t\t\t\tradialStart:0, // Set a negative radialStart to create gridlines\r\n\t\t\t\tradialEnd:6,\r\n\t\t\t\tmargin:10\r\n\t\t\t}\r\n\t\t},\r\n\t\t// Labels outside of the clip-rect will not be shown\r\n\t\tgetClipRect:function () {\r\n\t\t\tif (c.L.rotation == 0 || c.L.rotation == 180) {\r\n\t\t\t\treturn [\r\n\t\t\t\t\tc.L.left - c.Y.clipMargin, 0,\r\n\t\t\t\t\tc.L.right - c.L.left + c.Y.clipMargin * 2, PAPER.height\r\n\t\t\t\t];\r\n\t\t\t} else if (c.L.rotation == 90 || c.L.rotation == 270) {\r\n\t\t\t\treturn [\r\n\t\t\t\t\t0, c.L.top - c.Y.clipMargin,\r\n\t\t\t\t\tPAPER.width, c.L.bottom - c.L.top + c.Y.clipMargin * 2\r\n\t\t\t\t];\r\n\t\t\t};\r\n\t\t},\r\n\t\t// Get offset to a point (anchor point + x-offset + y-offset + z-offset == 3D point! == WIN!)\r\n\t\tgetOffset:function (val) {return c.L.getOffset(zt.calcDec(val, c.range[0], c.range[1]), 0, true)},\r\n\t\t// Special setShown for zAxis only\r\n\t\tsetShown:function (range, t, e, b, w) {\r\n\t\t\tvar i, notchGap, startVal, toRemove, newShown = [];\r\n\t\t\trange = range || c.range;\r\n\t\t\tif (isNaN(range[0]) || isNaN(range[1]) || range[0] == range[1]) return logger(\"zAxis(): Called with invalid range \" + zt.asString(range));\r\n\t\t\trange = za.sort(range);\r\n\t\t\t// Calculate notchGap\r\n\t\t\tnotchGap = (range[1] - range[0]) / (c.Y.maxNotches || 10); // Optimal notchGap (divide range evenly by maximum number of notches)\r\n\t\t\tnotchGap = zt.getFactorOfTen(notchGap); // Find the first factor of 10 higher than this value\r\n\t\t\tif (c.Y.minNotchGap) notchGap = Math.max(notchGap, c.Y.minNotchGap);\r\n\t\t\t// Create newShown\r\n\t\t\tstartVal = notchGap * Math.ceil(range[0] / notchGap); // First shown notch\r\n\t\t\tfor (i = startVal; i <= range[1]; i += notchGap) {\r\n\t\t\t\tnewShown.push(zt.round(i, 10)); // All shown notches\r\n\t\t\t};\r\n\t\t\ttoRemove = za.subtract(c.A[0], newShown);\r\n\t\t\tc.A = c.aSpace = [newShown];\r\n\t\t\t// Redraw\r\n\t\t\tif (c.P[\"label\"] && !c.P[\"label\"].ignore) c.add(\"label\");\r\n\t\t\tc.remove({a:toRemove});\r\n\t\t\tc.range = range;\r\n\t\t\tc.refresh(\"all\", t, e, b, w);\r\n\t\t},\r\n\t\tplan:{\r\n\t\t\tlabel:{\r\n\t\t\t\ttype:\"zTextBox\", mask:\"mask\",\r\n\t\t\t\tinit:function (S, D, mode) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttext:D.A[0],\r\n\t\t\t\t\t\tlayout:{\r\n\t\t\t\t\t\t\tradial:(S.L.rotation || 0) + ((S.L.yAlign == \"top\") ? 90 : -90),\r\n\t\t\t\t\t\t\tradialStart:D.Y.radialStart,\r\n\t\t\t\t\t\t\tradialEnd:D.Y.radialEnd\r\n\t\t\t\t\t\t},\r\n \t\t\t\t\t\t\"clip-rect\":S.getClipRect(),\r\n\t\t\t\t\t\tbranch:(D.A[0] == 0) ? D.Y.baseBranch : D.Y.branch\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t\tcurr:function (S, D, mode) {\r\n\t\t\t\t\treturn {layout:S.getPoint(D.A[0])};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}, orders));\r\n\t// Create swarm\r\n\tif (c.updateData) c.updateData(t, e, null, c.K);\r\n\tc.add(\"fixed\", t, e, null, c.K);\r\n\tc.add(\"all\", t, e, b, w);\r\n\tc.layer();\r\n}", "title": "" }, { "docid": "92506ce92e9277fba094fd6f959972a9", "score": "0.5040002", "text": "function inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lat__[\"a\" /* default */])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}", "title": "" }, { "docid": "402aa609fb0dfcb06cb7101e1658494e", "score": "0.5023887", "text": "function _translateBehind() {\n if (this._zNode) {\n this._zNode = this._zNode.add(new Modifier({\n transform: Transform.behind\n }));\n }\n else {\n this._zNode = this.add(new Modifier({\n transform: Transform.behind\n }));\n }\n return this._zNode;\n }", "title": "" }, { "docid": "8f3770d32a68338f404e4312d89168e4", "score": "0.5021071", "text": "function inverse(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_phi2z__[\"a\" /* default */])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -__WEBPACK_IMPORTED_MODULE_5__constants_values__[\"b\" /* HALF_PI */];\n }\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_adjust_lon__[\"a\" /* default */])(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "8f3e77f12064e41148819d4c9e7ccc42", "score": "0.5020493", "text": "function inverse(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"];\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "436a02c8efa840e32da36f79c9496521", "score": "0.4992626", "text": "function calculateZ(depth,zInLevel){var zb=depth * Z_BASE + zInLevel;return (zb - 1) / zb;}", "title": "" }, { "docid": "233903ec80b1d1f3d2d066c7e60ac4f3", "score": "0.4983289", "text": "function applyBoundaries(pos){\r\n\tif(pos.x < -planeWidth/2+5) pos.x = -planeWidth/2 + 5;\r\n\tif(pos.x > planeWidth/2-5) pos.x = planeWidth/2-5; \r\n\tif(pos.y > planeHeight/2-5) pos.y = planeHeight/2-5;\r\n\tif(pos.y < -planeHeight/2+5) pos.y = -planeHeight/2+5;\r\n}", "title": "" }, { "docid": "8bc95732c0ac64efcc5c16e70a692876", "score": "0.49595055", "text": "place_on_slope(xcord,zcord) {\n var px = xcord % this.grid_spacing;\n var pz = zcord % this.grid_spacing;\n var cell_x = Math.trunc(xcord / this.grid_spacing) % this.grid_size;\n var cell_z = Math.trunc(zcord / this.grid_spacing) % this.grid_size;\n var normal;\n if(px + pz < this.grid_spacing) { //lower triangle\n var l11_index = cell_x + (cell_z+1) * (this.grid_size+1);\n var l12_index = cell_x + cell_z*(this.grid_size+1);\n var l21_index = (cell_x + 1) + cell_z * (this.grid_size+1);\n var l22_index = l12_index;\n normal = vec3.normalize(vec3.cross([this.verts[l21_index*3] - this.verts[l22_index*3],\n this.verts[l21_index*3+1] - this.verts[l22_index*3+1],\n this.verts[l21_index*3+2] - this.verts[l22_index*3+2]],\n [this.verts[l11_index*3] - this.verts[l12_index*3],\n this.verts[l11_index*3+1] - this.verts[l12_index*3+1],\n this.verts[l11_index*3+2] - this.verts[l12_index*3+2]],\n\n new Float32Array(3)\n ), new Float32Array(3)\n )\n } else { //higher triagnle\n var l11_index = (cell_x+1) + cell_z * (this.grid_size+1);\n var l12_index = (cell_x+1) + (cell_z+1)*(this.grid_size+1);\n var l21_index = cell_x + (cell_z+1) * (this.grid_size+1);\n var l22_index = l12_index;\n normal = vec3.normalize(vec3.cross([this.verts[l21_index*3] - this.verts[l22_index*3],\n this.verts[l21_index*3+1] - this.verts[l22_index*3+1],\n this.verts[l21_index*3+2] - this.verts[l22_index*3+2]],\n [this.verts[l11_index*3] - this.verts[l12_index*3],\n this.verts[l11_index*3+1] - this.verts[l12_index*3+1],\n this.verts[l11_index*3+2] - this.verts[l12_index*3+2]],\n\n new Float32Array(3)\n ), new Float32Array(3)\n )\n }\n //don't place on walls\n if(normal[1] <= 0.5) {\n return;\n }\n //find elevation of terrain\n var index = (cell_x + 1) + cell_z * (this.grid_size + 1);\n var ycord = -(((xcord - this.verts[index*3]) * normal[0] +\n (zcord- this.verts[index*3+2]) * normal[2])\n / normal[1]) + this.verts[index*3+1];\n //do not place under water\n if(ycord < 0) {\n return;\n }\n\n //var position = new Float32Array([this.parent.position[0] + xcord,this.parent.position[1] + ycord,this.parent.position[2] + zcord,0]);\n var position = new Float32Array([xcord,ycord,zcord,0]);\n var rotation = quaternion.getRotaionBetweenVectors([0,1,0],normal,new Float32Array(4));\n var model = null;\n if(ycord < 0.5) { //TODO: move measurements to shared place\n model = this.weighted_choice(this.beach_models)\n } else if(ycord < 3.0) {\n model = this.weighted_choice(this.grass_models);\n } else {\n //place less things on hills\n if( Math.random() < 0.75 ) return;\n model = this.weighted_choice(this.hill_models);\n }\n if(model in this.bakers){\n this.bakers[model].addInstance(position, rotation);\n }else{\n var baker = new InstanceBaker(new Float32Array(this.parent.position), new Float32Array(this.parent.rotation),model);\n baker.addInstance(position, rotation);\n this.bakers[model] = baker;\n }\n }", "title": "" }, { "docid": "d3303adbec326c3736ae72940ad22100", "score": "0.49394244", "text": "reverseInPlace() {\n if (this._points.length >= 2) {\n let i0 = 0;\n let i1 = this._points.length - 1;\n while (i0 < i1) {\n const a = this._points[i0];\n this._points[i1] = this._points[i0];\n this._points[i0] = a;\n i0++;\n i1--;\n }\n }\n }", "title": "" }, { "docid": "fb6455a3110e0df7bf50868f938b5cd6", "score": "0.49230847", "text": "expandAABB3Point3(aabb, p) {\n\n if (aabb[0] > p[0]) {\n aabb[0] = p[0];\n }\n\n if (aabb[1] > p[1]) {\n aabb[1] = p[1];\n }\n\n if (aabb[2] > p[2]) {\n aabb[2] = p[2];\n }\n\n if (aabb[3] < p[0]) {\n aabb[3] = p[0];\n }\n\n if (aabb[4] < p[1]) {\n aabb[4] = p[1];\n }\n\n if (aabb[5] < p[2]) {\n aabb[5] = p[2];\n }\n\n return aabb;\n }", "title": "" }, { "docid": "1f36ab4a927ab90c5d45d21963e26d58", "score": "0.49188927", "text": "function transz(geo, n) {\n for (var i = 0; i < geo.vertices.length; i++) {\n geo.vertices[i].z += n;\n }\n }", "title": "" }, { "docid": "a2d022088f2a20950518ba77260891d1", "score": "0.48910895", "text": "function l(n) {\n return n ? n.hasZ ? [n.xmax - n.xmin / 2, n.ymax - n.ymin / 2, n.zmax - n.zmin / 2] : [n.xmax - n.xmin / 2, n.ymax - n.ymin / 2] : null;\n }", "title": "" }, { "docid": "23304d67b7602a564e73930cec2f1178", "score": "0.48819837", "text": "function inverse$g(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}", "title": "" }, { "docid": "68da820fe317745efebba074d582a7bd", "score": "0.48737204", "text": "function inverse(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < __WEBPACK_IMPORTED_MODULE_1__constants_values__[\"a\" /* EPSLN */]) {\n lon = this.long0;\n }\n else {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "3195e306eb845147c87d3353d17ea29a", "score": "0.4870472", "text": "function get_z_order(name) {\n if (z_orders[name]) {\n\treturn z_orders[name];\n }\n var found = true;\n var z = 0;\n while (found) {\n\tfound = false;\n\tz = z + 1;\n\tfor (var name in z_orders) {\n\t if (z == z_orders[name]) {\n\t\tfound = true;\n\t\tbreak;\n\t }\n\t}\n }\n z_orders[name] = z;\n return z;\n}", "title": "" }, { "docid": "5ea05b7d594af327ed0b8a78c13e20c6", "score": "0.4865825", "text": "function getZValue()\n{\n // If we have no depth information, assume we're at the surface. This\n // will be ignored by the map server\n var zIndex = $('zValues').selectedIndex;\n var zValue = $('zValues').options.length == 0 ? 0 : $('zValues').options[zIndex].firstChild.nodeValue;\n return zPositive ? zValue : -zValue;\n}", "title": "" }, { "docid": "07ca98e1a2c478737a907b6827d822e2", "score": "0.48646086", "text": "function PlaneGeometry() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, PlaneGeometry);\n\n var _opts$type = opts.type,\n type = _opts$type === undefined ? 'x,y' : _opts$type,\n _opts$offset = opts.offset,\n offset = _opts$offset === undefined ? 0 : _opts$offset,\n _opts$flipCull = opts.flipCull,\n flipCull = _opts$flipCull === undefined ? false : _opts$flipCull,\n _opts$unpack = opts.unpack,\n unpack = _opts$unpack === undefined ? false : _opts$unpack,\n _opts$id = opts.id,\n id = _opts$id === undefined ? Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"uid\"])('plane-geometry') : _opts$id;\n\n\n var coords = type.split(',');\n // width, height\n var c1len = opts[coords[0] + 'len'];\n var c2len = opts[coords[1] + 'len'];\n // subdivisionsWidth, subdivisionsDepth\n var subdivisions1 = opts['n' + coords[0]] || 1;\n var subdivisions2 = opts['n' + coords[1]] || 1;\n var numVertices = (subdivisions1 + 1) * (subdivisions2 + 1);\n\n var positions = new Float32Array(numVertices * 3);\n var normals = new Float32Array(numVertices * 3);\n var texCoords = new Float32Array(numVertices * 2);\n\n if (flipCull) {\n c1len = -c1len;\n }\n\n var i2 = 0;\n var i3 = 0;\n for (var z = 0; z <= subdivisions2; z++) {\n for (var x = 0; x <= subdivisions1; x++) {\n var u = x / subdivisions1;\n var v = z / subdivisions2;\n texCoords[i2 + 0] = flipCull ? 1 - u : u;\n texCoords[i2 + 1] = v;\n\n switch (type) {\n case 'x,y':\n positions[i3 + 0] = c1len * u - c1len * 0.5;\n positions[i3 + 1] = c2len * v - c2len * 0.5;\n positions[i3 + 2] = offset;\n\n normals[i3 + 0] = 0;\n normals[i3 + 1] = 0;\n normals[i3 + 2] = flipCull ? 1 : -1;\n break;\n\n case 'x,z':\n positions[i3 + 0] = c1len * u - c1len * 0.5;\n positions[i3 + 1] = offset;\n positions[i3 + 2] = c2len * v - c2len * 0.5;\n\n normals[i3 + 0] = 0;\n normals[i3 + 1] = flipCull ? 1 : -1;\n normals[i3 + 2] = 0;\n break;\n\n case 'y,z':\n positions[i3 + 0] = offset;\n positions[i3 + 1] = c1len * u - c1len * 0.5;\n positions[i3 + 2] = c2len * v - c2len * 0.5;\n\n normals[i3 + 0] = flipCull ? 1 : -1;\n normals[i3 + 1] = 0;\n normals[i3 + 2] = 0;\n break;\n\n default:\n break;\n }\n\n i2 += 2;\n i3 += 3;\n }\n }\n\n var numVertsAcross = subdivisions1 + 1;\n var indices = new Uint16Array(subdivisions1 * subdivisions2 * 6);\n\n for (var _z = 0; _z < subdivisions2; _z++) {\n for (var _x2 = 0; _x2 < subdivisions1; _x2++) {\n var index = (_z * subdivisions1 + _x2) * 6;\n // Make triangle 1 of quad.\n indices[index + 0] = (_z + 0) * numVertsAcross + _x2;\n indices[index + 1] = (_z + 1) * numVertsAcross + _x2;\n indices[index + 2] = (_z + 0) * numVertsAcross + _x2 + 1;\n\n // Make triangle 2 of quad.\n indices[index + 3] = (_z + 1) * numVertsAcross + _x2;\n indices[index + 4] = (_z + 1) * numVertsAcross + _x2 + 1;\n indices[index + 5] = (_z + 0) * numVertsAcross + _x2 + 1;\n }\n }\n\n // Optionally, unpack indexed geometry\n if (unpack) {\n var positions2 = new Float32Array(indices.length * 3);\n var normals2 = new Float32Array(indices.length * 3);\n var texCoords2 = new Float32Array(indices.length * 2);\n\n for (var _x3 = 0; _x3 < indices.length; ++_x3) {\n var _index = indices[_x3];\n positions2[_x3 * 3 + 0] = positions[_index * 3 + 0];\n positions2[_x3 * 3 + 1] = positions[_index * 3 + 1];\n positions2[_x3 * 3 + 2] = positions[_index * 3 + 2];\n normals2[_x3 * 3 + 0] = normals[_index * 3 + 0];\n normals2[_x3 * 3 + 1] = normals[_index * 3 + 1];\n normals2[_x3 * 3 + 2] = normals[_index * 3 + 2];\n texCoords2[_x3 * 2 + 0] = texCoords[_index * 2 + 0];\n texCoords2[_x3 * 2 + 1] = texCoords[_index * 2 + 1];\n }\n\n positions = positions2;\n normals = normals2;\n texCoords = texCoords2;\n indices = undefined;\n }\n\n var attributes = {\n positions: positions,\n normals: normals,\n texCoords: texCoords\n };\n\n if (indices) {\n attributes.indices = indices;\n }\n\n return _possibleConstructorReturn(this, (PlaneGeometry.__proto__ || Object.getPrototypeOf(PlaneGeometry)).call(this, Object.assign({}, opts, { attributes: attributes, id: id })));\n }", "title": "" }, { "docid": "08a4b7fc822919c7ed2f4dbb57a2d76f", "score": "0.48629904", "text": "function fixupEdgePoints(g) {\n g.eachEdge(function(e, s, t, a) { if (a.reversed) a.points.reverse(); });\n }", "title": "" }, { "docid": "08a4b7fc822919c7ed2f4dbb57a2d76f", "score": "0.48629904", "text": "function fixupEdgePoints(g) {\n g.eachEdge(function(e, s, t, a) { if (a.reversed) a.points.reverse(); });\n }", "title": "" }, { "docid": "08a4b7fc822919c7ed2f4dbb57a2d76f", "score": "0.48629904", "text": "function fixupEdgePoints(g) {\n g.eachEdge(function(e, s, t, a) { if (a.reversed) a.points.reverse(); });\n }", "title": "" }, { "docid": "d7f952c7ffbd91079e5bb9a1e4221fc8", "score": "0.48594525", "text": "function forward$d(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * adjust_lon(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}", "title": "" }, { "docid": "77bb6bfd39005ed8b9a2b8bbe41c2659", "score": "0.4857472", "text": "function zRy(y,z){\r\n\t\r\n\tz = z + sciMonk.Depth/2; \t\r\n\ty = y + sciMonk.Height/2;\t\r\n\treturn yOnCanvas(\r\n\t\t\ty + ((sciMonk.Depth-z)*(sciMonk.Depth/(z)))*Math.sin(yAngle(yGraph(y),0.5))\r\n\t\t);\r\n}", "title": "" }, { "docid": "9806294a69f83d755d30935dcde9cc1c", "score": "0.48574156", "text": "function getZIndex(component) {\n return parseInt(component.computedStyle().zIndex) || 0;\n }", "title": "" }, { "docid": "f82ffef47ba240d694f2df6812970248", "score": "0.4853109", "text": "function crossProductZ( pointA, pointB, pointC)\r\n\t\t\t{\r\n\t\t\t\tvar bX = pointB.x;\r\n\t\t\t\tvar bY = pointB.y;\r\n\t\t\t\treturn ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));\r\n\t\t\t}", "title": "" }, { "docid": "f82ffef47ba240d694f2df6812970248", "score": "0.4853109", "text": "function crossProductZ( pointA, pointB, pointC)\r\n\t\t\t{\r\n\t\t\t\tvar bX = pointB.x;\r\n\t\t\t\tvar bY = pointB.y;\r\n\t\t\t\treturn ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));\r\n\t\t\t}", "title": "" }, { "docid": "c10688cb67094ae9022bbe05fa34045c", "score": "0.48488772", "text": "function zr(e,t,a,n){var r=t,f=t;return\"number\"==typeof t?f=T(e,z(e,t)):r=D(t),null==r?null:(n(f,r)&&e.cm&&yn(e.cm,r,a),f)}", "title": "" }, { "docid": "a3e253dcc3f78d3da2162248161aefeb", "score": "0.48361436", "text": "function SwapYZ( param )\r\n{\r\n\tmeshDrawer.swapYZ( param.checked );\r\n\tDrawScene();\r\n}", "title": "" }, { "docid": "7c469bc9f82ae287b7f2c3f09db4ee2b", "score": "0.48325732", "text": "function PlaneGeometry() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, PlaneGeometry);\n\n var _opts$type = opts.type,\n type = _opts$type === void 0 ? 'x,y' : _opts$type,\n _opts$offset = opts.offset,\n offset = _opts$offset === void 0 ? 0 : _opts$offset,\n _opts$flipCull = opts.flipCull,\n flipCull = _opts$flipCull === void 0 ? false : _opts$flipCull,\n _opts$unpack = opts.unpack,\n unpack = _opts$unpack === void 0 ? false : _opts$unpack,\n _opts$id = opts.id,\n id = _opts$id === void 0 ? (0, _utils.uid)('plane-geometry') : _opts$id;\n var coords = type.split(','); // width, height\n\n var c1len = opts[\"\".concat(coords[0], \"len\")];\n var c2len = opts[\"\".concat(coords[1], \"len\")]; // subdivisionsWidth, subdivisionsDepth\n\n var subdivisions1 = opts[\"n\".concat(coords[0])] || 1;\n var subdivisions2 = opts[\"n\".concat(coords[1])] || 1;\n var numVertices = (subdivisions1 + 1) * (subdivisions2 + 1);\n var positions = new Float32Array(numVertices * 3);\n var normals = new Float32Array(numVertices * 3);\n var texCoords = new Float32Array(numVertices * 2);\n\n if (flipCull) {\n c1len = -c1len;\n }\n\n var i2 = 0;\n var i3 = 0;\n\n for (var z = 0; z <= subdivisions2; z++) {\n for (var x = 0; x <= subdivisions1; x++) {\n var u = x / subdivisions1;\n var v = z / subdivisions2;\n texCoords[i2 + 0] = flipCull ? 1 - u : u;\n texCoords[i2 + 1] = v;\n\n switch (type) {\n case 'x,y':\n positions[i3 + 0] = c1len * u - c1len * 0.5;\n positions[i3 + 1] = c2len * v - c2len * 0.5;\n positions[i3 + 2] = offset;\n normals[i3 + 0] = 0;\n normals[i3 + 1] = 0;\n normals[i3 + 2] = flipCull ? 1 : -1;\n break;\n\n case 'x,z':\n positions[i3 + 0] = c1len * u - c1len * 0.5;\n positions[i3 + 1] = offset;\n positions[i3 + 2] = c2len * v - c2len * 0.5;\n normals[i3 + 0] = 0;\n normals[i3 + 1] = flipCull ? 1 : -1;\n normals[i3 + 2] = 0;\n break;\n\n case 'y,z':\n positions[i3 + 0] = offset;\n positions[i3 + 1] = c1len * u - c1len * 0.5;\n positions[i3 + 2] = c2len * v - c2len * 0.5;\n normals[i3 + 0] = flipCull ? 1 : -1;\n normals[i3 + 1] = 0;\n normals[i3 + 2] = 0;\n break;\n\n default:\n break;\n }\n\n i2 += 2;\n i3 += 3;\n }\n }\n\n var numVertsAcross = subdivisions1 + 1;\n var indices = new Uint16Array(subdivisions1 * subdivisions2 * 6);\n\n for (var _z = 0; _z < subdivisions2; _z++) {\n for (var _x = 0; _x < subdivisions1; _x++) {\n var index = (_z * subdivisions1 + _x) * 6; // Make triangle 1 of quad.\n\n indices[index + 0] = (_z + 0) * numVertsAcross + _x;\n indices[index + 1] = (_z + 1) * numVertsAcross + _x;\n indices[index + 2] = (_z + 0) * numVertsAcross + _x + 1; // Make triangle 2 of quad.\n\n indices[index + 3] = (_z + 1) * numVertsAcross + _x;\n indices[index + 4] = (_z + 1) * numVertsAcross + _x + 1;\n indices[index + 5] = (_z + 0) * numVertsAcross + _x + 1;\n }\n } // Optionally, unpack indexed geometry\n\n\n if (unpack) {\n var positions2 = new Float32Array(indices.length * 3);\n var normals2 = new Float32Array(indices.length * 3);\n var texCoords2 = new Float32Array(indices.length * 2);\n\n for (var _x2 = 0; _x2 < indices.length; ++_x2) {\n var _index = indices[_x2];\n positions2[_x2 * 3 + 0] = positions[_index * 3 + 0];\n positions2[_x2 * 3 + 1] = positions[_index * 3 + 1];\n positions2[_x2 * 3 + 2] = positions[_index * 3 + 2];\n normals2[_x2 * 3 + 0] = normals[_index * 3 + 0];\n normals2[_x2 * 3 + 1] = normals[_index * 3 + 1];\n normals2[_x2 * 3 + 2] = normals[_index * 3 + 2];\n texCoords2[_x2 * 2 + 0] = texCoords[_index * 2 + 0];\n texCoords2[_x2 * 2 + 1] = texCoords[_index * 2 + 1];\n }\n\n positions = positions2;\n normals = normals2;\n texCoords = texCoords2;\n indices = undefined;\n }\n\n var attributes = {\n positions: positions,\n normals: normals,\n texCoords: texCoords\n };\n\n if (indices) {\n attributes.indices = indices;\n }\n\n return _possibleConstructorReturn(this, (PlaneGeometry.__proto__ || Object.getPrototypeOf(PlaneGeometry)).call(this, Object.assign({}, opts, {\n attributes: attributes,\n id: id\n })));\n }", "title": "" } ]
747f007503b86a70e035736924581eac
Cache timeout in 1 day Common utility for getAll functions return all the requested data in json format.
[ { "docid": "34356ee3ff84a52a134fb95cef693640", "score": "0.0", "text": "function getAllFromCacheOrDB(tableName,cacheKey,whereClause,keyName,callback) {\n var data = cache.get(cacheKey);\n //First get the data from cache,\n //if there's no data in cache, query from DB and then put it into cache.\n if(data) {\n console.info(\"Cache hits, getting \" +cacheKey+ \" from Cache.\");\n callback(data);\n } else {\n loadDataFromDBToCache(tableName,cacheKey,whereClause,keyName,callback);\n }\n}", "title": "" } ]
[ { "docid": "5196cbe02c20e8c7515398e8fe3c6409", "score": "0.63187885", "text": "async getAll() {\n try {\n const response = await fetch(baseUrl + this.entity);\n const dataJson = await response.json(); \n return dataJson;\n\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "c33ec6bde5dc84ecfcda524e48513034", "score": "0.631693", "text": "async getAllNoCache() {\n\t\tlet output = {};\n\t\tfor (const key of await this.listNoCache()) {\n\t\t\tlet value = await this.getNoCache(key);\n\t\t\toutput[key] = value;\n\t\t}\n\t\treturn output;\n\t}", "title": "" }, { "docid": "535986c3e1723d0185944995061d14b6", "score": "0.612991", "text": "getAll(req, res) {\n Cache.find({}).then((data) => {\n\n const totalCache = data.map((record) => {\n return { key: record.key, value: record.value }\n });\n\n return res.send(totalCache);\n });\n }", "title": "" }, { "docid": "1db58a7860878b509ab8af75caedc67e", "score": "0.6112384", "text": "function getData()\n {\n var currentTime = new Date().getTime();\n var refresh_time = currentSettings.refresh_time;\n\n // The url has an url as a REST API of RESTHeart to retrieve data, which is a REST API server for MongoDB.\n var url = \"http://\";\n url += currentSettings.rest;\n\n //\n // Support the following operators used for filtering data in a MongoDB collection.\n // {\"$gt\"|\"$gte\"|\"$eq\"|\"$date\":\"$latest\"}\n //\n // The $gt, $gte, $eq and $date operators are from RESTHeart and handled by RESTHeart.\n // The $latest operator is added and handled by this plugin. It is replaced with a time in interger value or ISO string format.\n // \n var regexp = /\\{\\s*(['\"])(\\$gt|\\$gte|\\$eq|\\$date)['\"]\\s*:\\s*(['\"]\\$latest['\"])\\s*\\}/g;\n var rest_api = currentSettings.rest_api;\n url += rest_api.replace(regexp, function(match, p1, p2, p3, offset, string) {\n if (p2 == \"$gt\" || p2 == \"$gte\" || p2 == \"$eq\") {\n // If $latest is specified with $gt, $gte or $eq, then replace it with an interger value representing a previous expiration time.\n var thresholdTime = currentTime - refresh_time;\n return \"{\" + p1 + p2 + p1 + \":\" + thresholdTime + \"}\";\n } else if (p2 == \"$date\") {\n // If $latest is specified with $date, then replace it with a string in ISO format representing a previous expiration time.\n var thresholdTime = new Date(currentTime - refresh_time).toISOString();\n return \"{\" + p1 + p2 + p1 + \":\" + p1 + thresholdTime +p1 + \"}\";\n } else {\n return match;\n }\n });\n\n // Import rest api modules provided by the external package \"rest\".\n var rest = require('rest/client/xhr');\n var defaultRequest = require('rest/interceptor/defaultRequest');\n var client = rest.wrap(defaultRequest, {method: 'GET', headers:{'Content-Type':'application/json'}});\n\n // Invoke a REST API of RESTHeart to retrieve data.\n client(url).then(function(response) {\n var message = JSON.parse(response.entity);\n if (message._returned > 0) {\n // Pass data to Freeboard.\n updateCallback(message);\n }\n });\n }", "title": "" }, { "docid": "b156362523c750028c97eda68bf34b6b", "score": "0.6096689", "text": "function getAll() {\n request.get(config.address + '/all', { json: true }, (err, res, body) => {\n if (err) { \n return console.log('[Avoid API] Error: ' + err); \n }\n\n return body;\n });\n}", "title": "" }, { "docid": "61cc12fe8622e0a0dd087875043074ca", "score": "0.602953", "text": "getCacheData() {\n\t\treturn this.cache.getJSON();\n\t}", "title": "" }, { "docid": "8f49ce241dc645d5f4cc56784e113c60", "score": "0.5948696", "text": "async function getAllData() {\n const countriesNotCached = findMissingKeys(masterWatchList, cachedData);\n let results = await Promise.all(\n countriesNotCached.map((country) => {\n return getData(country).catch((error) => {\n console.log(\"Error: \", error);\n });\n })\n );\n return results.filter((result) => !(result instanceof Error));\n}", "title": "" }, { "docid": "526cc52f1aec65eeef5cc6b73f29b60d", "score": "0.59218585", "text": "static async get_all(body) {\n let expired = Bank.get_expired_units(); // VERIFIED: FilterUnits\n return { list: expired };\n }", "title": "" }, { "docid": "95a282cf1bdb796b268b5c08a402abbc", "score": "0.5885293", "text": "function getAllSchedule() {\n // check in caches\n if (\"cachs\" in window) {\n caches.match(ENDPOINT_schedule).then(function (response) {\n if (response) {\n response.json().then(function (data) {\n showSchedule(data);\n });\n }\n });\n }\n\n fetch(ENDPOINT_schedule, {\n\n headers: {\n\n \"X-Auth-Token\": api_token\n\n\n },\n\n })\n .then(status)\n .then(json)\n .then(function (data) {\n showSchedule(data);\n })\n .catch(error);\n}", "title": "" }, { "docid": "75d2667bcaaff9e885bc22b541dea2ee", "score": "0.5861763", "text": "async getAll() {\n let response = await this.client.get(this.baseResource)\n return response.data\n }", "title": "" }, { "docid": "e0c1387db78bd28344896437f6e1a5e5", "score": "0.5833349", "text": "function getDataCacheHitRate() {\n return getJSONForTable('/rest/statistics/time/dataCacheHitRate', 'dataCache');\n}", "title": "" }, { "docid": "799f44098382d96d41263212271e60de", "score": "0.58140546", "text": "function getTime() {\n\t\t\t\t//$promise.then allows us to intercep the results and modify array in real time\n\t\t\t\treturn Time.query().$promise.then(function(results) {\n\t\t\t\t\tangular.forEach(results, function(result) {\n\t\t\t\t\t\t//Add the loggedTime property which calls\n\t\t\t\t\t\t// getTimeDiff to give us duration object result\n\t\t\t\t\t\t//pass in start and end times found in the static data from example JSON\n\t\t\t\t\t\tresult.loggedTime = result.start_time//getTimeDiff(result.start_time, result.end_time);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn results;\n\t\t\t\t}, function(error) {\n\t\t\t\t\t//check for errors\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "a32f917261c55f88a2a2d12d1d8a58b6", "score": "0.58105236", "text": "function getData() {\n return getJSON(url, data, function(json, status) {\n if ( status == 'notmodified' ) {\n // Just return if the response has a 304 status code\n return false;\n }\n\n while (true) {\n try {\n localStorage[key] = JSON.stringify(json);\n localStorage[key + \":date\"] = new Date;\n break;\n } catch (e) {\n if (e.name == \"QUOTA_EXCEEDED_ERR\" || e.name ==\n \"NS_ERROR_DOM_QUOTA_REACHED\") {\n cleanupLocalStorage();\n }\n }\n }\n\n // If this is a follow-up request, create an object\n // containing both the original time of the cached\n // data and the time that the data was originally\n // retrieved from the cache. With this information,\n // users of jQuery Offline can provide the user\n // with improved feedback if the lag is large\n var data = text && { cachedAt: date, retrievedAt: retrieveDate };\n fn(json, status, data);\n });\n }", "title": "" }, { "docid": "70eee315709b8f7199d9e60a5dd5f2f1", "score": "0.5773398", "text": "function cachedResponse() {\n var options = {\n headers: {\n Authorization: \"Basic <%= encode(iparam.freshservice_api_key)%>\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n cache: true,\n ttl: 1000\n };\n client.iparams.get('freshservice_subdomain').then(function (iparam) {\n client.request.get(`https://${iparam.freshservice_subdomain}.freshservice.com/api/v2/agents`, options)\n .then(function (data) {\n try {\n data = JSON.parse(data.response);\n data = data.agents;\n renderTable(data);\n\n } catch (error) {\n console.error(\"Error while attempting to show issue\", error);\n notify('error', 'Error while attempting to show issue, kindly refresh the page ');\n }\n })\n .catch(function (error) {\n console.error(\"error\", error);\n notify('error', 'Error while attempting to show issue, kindly refresh the page ');\n });\n })\n}", "title": "" }, { "docid": "0b1be772bab7528e62446e11eab82c52", "score": "0.5769301", "text": "function getAll() {\n return $http({\n method: \"GET\",\n url: BASE_URL\n }).then(function(result) {\n return result.data;\n });\n }", "title": "" }, { "docid": "166fe4c039258d6136908a18b7fa2a47", "score": "0.57462186", "text": "async getAll() {\n\t\tlet output = {};\n\t\tfor (const key of await this.list()) {\n\t\t\tlet value = await this.get(key);\n\t\t\toutput[key] = value;\n\t\t}\n\t\treturn output;\n\t}", "title": "" }, { "docid": "bf45dcb91a9ddac8c8387a689b7b866a", "score": "0.573859", "text": "function getAll(){\n\t\t\n\t\treturn $http({\n\t\t\tmethod\t: 'GET',\n\t\t\turl \t: API_URL + 'whoPharmarket',\n\t\t\theaders: {'key': 'dragonteam'},\n\t\t\tcache\t: true\n\t\t});\n\t}", "title": "" }, { "docid": "e3f488693ef7af2f2634a00fd8560521", "score": "0.5732307", "text": "GetAll() {\n let filters = Gundert.Cache.Get('filters');\n if (filters == undefined)\n return {};\n else\n return filters;\n }", "title": "" }, { "docid": "85e1838a2d0cc0eb7c4695a67d781ccb", "score": "0.57242286", "text": "async function getAll(){\n\t\t\t$rootScope.loading = true;\n\t\t\ttry {\n\t\t\t const datasver = await $http({\n\t method: 'GET',\n\t url: config.baseApi()+'datapendaftaran_id/'+$state.params.id\n\t });\n\t $scope.data = datasver.data;\n\t $scope.data.pindahan_kelas = $scope.data.pindahan_kelas === 'non' ? \"\" : $scope.data.pindahan_kelas;\n\t $scope.tanggal_lahir = moment($scope.data.tanggal_lahir,\"DD/MM/YYYY\");\n\t\t\t\t$rootScope.loading = false;\n\t\t\t\t$scope.$apply();\n\t\t \t} catch(err) {\n\t\t \t\tif (err.status === 401 && err.data.status==='error') {\n\t\t \t\t\t$rootScope.loading = false;\n\t\t \t\t$state.go('login');\n\t\t \t\t}else{\n\t\t \t\t\t$rootScope.loading = false;\n \t\tswangular.alert(\"Error load data...\");\n \t\t$scope.$apply();\n\t\t \t\t}\n\t\t \t}\n\t\t}", "title": "" }, { "docid": "a04151a1eaf78ebf44366c75156ebd2b", "score": "0.5719376", "text": "function getAll(){\n return fetch(URL)\n .then(res => res.json())\n .catch(err => console.error(err));\n}", "title": "" }, { "docid": "27c715a9cb8f98ac92efff6ba3ea6f27", "score": "0.5676673", "text": "function getJSON(api) {\n\n if (api == \"routes\") {\n options.url = route;\n } else if (api == \"trips\") { \n options.url = trip;\n } else if (api == \"positions\") {\n options.url = position;\n } else if (api == \"stops\") {\n options.url = stops;\n } else if (api == \"shapes\") {\n options.url = shapes;\n } else {\n console.log(\"need arguemnt\");\n return 0;\n }\n request(options, function(error, response, body) { \n var time = Date.now() - start;\n var res = body.response\n if (api == \"routes\" || api == \"trips\") {\n res = body.response; //get rid of status and error from response\n } else if (api == 'positions' || api == \"trip_updates\") {\n res = body.response.entity;\n var arr = [];\n for (var i = 0; i < res.length; i += 1) { //need to loop res as trip_update is an array \n if (res[i].vehicle.trip.start_time > \"24:00:00\") { //######need to fix times!!!!!\n console.log(res[i].vehicle.trip.start_time);\n res[i].vehicle.trip.start_time = null;\n }\n arr.push(res[i].vehicle);\n }\n res = arr;\n } else if (api == \"stops\") {\n res = body.response; \n } else {\n console.log(\"error\");\n return 0;\n }\n var s = JSON.stringify(res);\n if (error) { \n return console.log(error); \n }\n console.log( '\\n' + (Buffer.byteLength(s)/1000).toFixed(2)+ \" kilobytes downloaded in: \" + (time/1000) + \" sec\");\n switch (api) {\n case \"routes\":\n path = \"/Users/matt/FindMyBus/api/model/json/routes.json\";\n break;\n case \"trips\":\n path = \"/Users/matt/FindMyBus/api/model/json/trips.json\";\n break;\n case \"positions\":\n path = \"/Users/matt/FindMyBus/api/model/json/positions.json\";\n break;\n case \"stops\":\n path = \"/Users/matt/FindMyBus/api/model/json/stops.json\";\n break;\n case \"shapes\":\n path = \"/Users/matt/FindMyBus/api/model/json/shapes.json\";\n break;\n default:\n //console.log(path);\n console.log(\"error\");\n return 0;\n \n }\n fs.writeFile(path, s, function(err) {\n if (err) {\n return console.log(err);\n } else {\n var time = Date.now() - start;\n console.log(res.length + \" records written to file: \" + path + '\\n');\n }\n }); //end write\n }); //end request\n } //end getJSON", "title": "" }, { "docid": "533b8d03b5c9e2238f8cc37b9a587625", "score": "0.56723934", "text": "get cachePerformance() {\n return {\n /** results found in IndexedDB */\n hits: this._cacheHits,\n /** had to go to Firebase for results */\n misses: this._cacheMisses,\n /** ignored the request as results were already in Vuex */\n ignores: this._cacheIgnores\n };\n }", "title": "" }, { "docid": "e4443d9cfe6ea522d25adc6ae1b616ba", "score": "0.56676924", "text": "function getAPIdata() {\n Axios.get(`/api/ETfLiveArbitrage/AllTickers`)\n .then(({ data }) => {\n setTableData(data);\n setDataForTime(data[0][\"Timestamp\"]);\n // setFilteredData(data);\n })\n .catch((err) => {\n setErrorCode(err.response.status);\n });\n }", "title": "" }, { "docid": "44a50180c10221c653cdd9dffac06c65", "score": "0.5657883", "text": "getAll_() {\r\n return fetch(this.endPoint)\r\n .then( (resp)=> {\r\n return resp.json();\r\n } );\r\n }", "title": "" }, { "docid": "3cd1210ab599b93236a5c1255b448bbc", "score": "0.5636995", "text": "getAll() {\n return new Promise((resolve, reject) => {\n pool.query(GET_ALL, (err, result) => {\n if (err) return reject(err);\n resolve(result);\n });\n })\n }", "title": "" }, { "docid": "5e9d0c7c12ab1bc91cd563b30e31f7fa", "score": "0.56015074", "text": "getTimes() {\n\t\taxios({\n\t\t\turl: `http://0.0.0.0:3001/api/v1/best_times`, \n\t method: 'get',\n\t headers: {\n\t 'Content-Type': 'application/json',\n\t 'X-User-Email': localStorage.getItem('email'),\n\t 'X-User-Token': localStorage.getItem('authentication_token')\n\t }\n\t }).then((response) => {\n\t \t// Success\n\t \tthis.setBestTimes(response.data);\n\t\t}).catch((error) => {\n\t\t\tthis.rootStore.AlertStore.pushItem('alerts', {\n\t\t\t\ttype: 'danger',\n\t\t\t\tmessage: \"Couldn't retrieve your best times, something went wrong. Please try again.\"\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "9e17ca6402029c3f84020247936a0505", "score": "0.55826074", "text": "async getAllCostItems(){\n const url = 'costitems';\n return await apiService.get(url);\n }", "title": "" }, { "docid": "729831788a22d7f1bf4546912cf17741", "score": "0.55805683", "text": "async getAll() {\n let cpuStats = await this.getCPUStats()\n let memoryStats = await this.getMemoryStats()\n let networkStats = await this.getUpDownloadStats()\n\n return {\n memory: memoryStats,\n cpu: cpuStats,\n network: networkStats\n }\n }", "title": "" }, { "docid": "3f4ad05134d12475b3710a23dd7a9043", "score": "0.55504036", "text": "function getAll() {\n return fetch(\"http://localhost:3000/tasks\")\n .then((response) => response.json())\n}", "title": "" }, { "docid": "b57cacc0b41af7057afe3ef5a99c1ab2", "score": "0.55458504", "text": "function getData(){\n var urlRandomizer = [randomCat(),randomCat(),randomCat(),randomCat(),randomCat(),randomCat()]\n var promises = urlRandomizer.map(function(element) {\n return $http.get(element);\n })\n return $q.all(promises);\n }", "title": "" }, { "docid": "4a5d6c63a7404394188af76691c1a82b", "score": "0.5532581", "text": "static getAll(...args) {\n let url = this.getListUrl(...args);\n\n // Must be caught later\n return this.fetcher.get(url).then(({ response, headers, status }) => {\n let list = this.list(response);\n list.__meta = { headers, status, response };\n return list;\n });\n }", "title": "" }, { "docid": "7743e2a34bbbdf79a23418523eb490ed", "score": "0.55211794", "text": "getData(cb) {\n app.db.retrieve(`/getData`, data => {\n console.log('[DASH]: Fetch all data');\n\n // If recieving the cache data, is should be parsed first\n try {\n data = JSON.parse(data);\n } catch (err) {\n console.log('[DATA] Does not need parsing');\n }\n\n EventModel.processEventData(data.events);\n Organisation.processOrgData(data.organisations);\n Venue.processVenueData(data.venues);\n\n app.localStorageAPI.setObject('cache', data);\n\n cb();\n });\n }", "title": "" }, { "docid": "cb38ded8c792dd490dbfb55dd7723e3d", "score": "0.55148774", "text": "function getAll(callbak){\n var url = \"http://vps286955.ovh.net:80/tetema/model/categorie/\";\n var req ={\n method: 'GET',\n url: url,\n cache :false,\n headers: {\n 'Accept':'Application/json',\n 'Cache-Controle':'no-cache',\n }\n };\n $http(req)\n .success(function(response) {\n callbak(response);\n })\n .error(function (response) {\n console.log(response);\n })\n\n }", "title": "" }, { "docid": "d43d9c2a7f27b6da2b4d92d545db8cd4", "score": "0.54965645", "text": "function getCachedOrApi(cacheKey, apiMethod, entityName)\n {\n var url = Umbraco.Sys.ServerVariables['merchelloUrls']['merchelloSettingsApiBaseUrl'] + apiMethod;\n var deferred = $q.defer();\n\n var dataFromCache = _settingsCache.get(cacheKey);\n\n if (dataFromCache) {\n deferred.resolve(dataFromCache);\n }\n else {\n var promiseFromApi = umbRequestHelper.resourcePromise(\n $http.get(\n url\n ),\n 'Failed to get all ' + entityName);\n\n promiseFromApi.then(function (dataFromApi) {\n _settingsCache.put(cacheKey, dataFromApi);\n deferred.resolve(dataFromApi);\n }, function (reason) {\n deferred.reject(reason);\n });\n }\n\n return deferred.promise;\n }", "title": "" }, { "docid": "d0456e4f38046cf3d342880e12c66d8e", "score": "0.5491337", "text": "function get(){\n request( url + randomIds(20).join(','), function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var songList;\n var temp;\n try {\n songList = JSON.parse(body).data.songList;\n }\n catch (ex) {\n return false;\n }\n \n songList.forEach(function(song){\n // Check the link is not empty\n if (song.songLink) {\n // Dig out things we want\n temp = {\n songId: song.songId,\n songName: song.songName,\n artistId: song.artistId,\n artistName: song.artistName,\n albumId: song.albumId,\n albumName: song.albumName,\n time: song.time\n }\n result.push(temp);\n }\n })\n\n // console.log(result);\n \n }\n \n var rest = total - result.length;\n // End\n if (rest <= 0) {\n ep.emit('finish', result);\n result = [];\n }\n else {\n console.log('== ' + rest + ' to go ==');\n setTimeout(get, 1000);\n }\n\n });\n}", "title": "" }, { "docid": "bfb63f27f2fdebc51891bcaf84605ec3", "score": "0.5468812", "text": "function getAll(clearCache) {\n\n\t\t\tvar defer = $q.defer();\n\n\t\t\tif (svc.shots.length && !clearCache) {\n\t\t\t\tdefer.resolve(svc.shots);\n\t\t\t\treturn defer.promise;\n\t\t\t}\n\n\t\t\tApiService.getShots().then(function(res){\n\t\t\t\tangular.copy(res.data, svc.shots);\n\t\t\t\t// angular.forEach(svc.shots, isLiked)\n\t\t\t\tdefer.resolve(svc.shots);\n\t\t\t}, function(res) { console.log(res); defer.reject(res) });\n\n\t\t\treturn defer.promise;\n\t\t}", "title": "" }, { "docid": "e4e3173cdfdac82d8edd1c24b76aedf8", "score": "0.54654896", "text": "function getIndexCacheHitRate() {\n return getJSONForTable('/rest/statistics/time/indexCacheHitRate', 'indexCache');\n}", "title": "" }, { "docid": "55a8ff21fb4257ad6712f764cb67d05b", "score": "0.5450323", "text": "getAll(requestSize = 2000, acceptHeader = \"application/json;odata=nometadata\") {\n Logger.write(\"Calling items.getAll should be done sparingly. Ensure this is the correct choice. If you are unsure, it is not.\", 2 /* Warning */);\n // this will be used for the actual query\n // and we set no metadata here to try and reduce traffic\n const items = Items(this, \"\").top(requestSize).configure({\n headers: {\n \"Accept\": acceptHeader,\n },\n });\n // let's copy over the odata query params that can be applied\n // $top - allow setting the page size this way (override what we did above)\n // $select - allow picking the return fields (good behavior)\n // $filter - allow setting a filter, though this may fail due for large lists\n this.query.forEach((v, k) => {\n if (/^\\$select|filter|top|expand$/i.test(k)) {\n items.query.set(k, v);\n }\n });\n // give back the promise\n return new Promise((resolve, reject) => {\n // this will eventually hold the items we return\n const itemsCollector = [];\n // action that will gather up our results recursively\n const gatherer = (last) => {\n // collect that set of results\n [].push.apply(itemsCollector, last.results);\n // if we have more, repeat - otherwise resolve with the collected items\n if (last.hasNext) {\n last.getNext().then(gatherer).catch(reject);\n }\n else {\n resolve(itemsCollector);\n }\n };\n // start the cycle\n items.getPaged().then(gatherer).catch(reject);\n });\n }", "title": "" }, { "docid": "f316c424c789e8a0570de049added5a5", "score": "0.5433671", "text": "function getAllStandings(){\n if(\"caches\" in window) {\n caches.match(ENDPOINT_STANDING).then(response => {\n if(response){\n response.json().then(stand => {\n console.log(`Standing Data: ${stand}`);\n showStanding(stand);\n })\n }\n })\n }\n\n fetchAPI(ENDPOINT_STANDING)\n .then(stand => {\n showStanding(stand);\n })\n .catch(error => {\n console.log(error)\n })\n}", "title": "" }, { "docid": "b24f17ba074600c5f4f1e1fcf2088f85", "score": "0.54277056", "text": "static getAllCached() {\n if (TYPE_DEFS) {\n return Promise.resolve(TYPE_DEFS);\n }\n\n return this.getAll();\n }", "title": "" }, { "docid": "7dd8112426080ab86539e4125004fee0", "score": "0.54196644", "text": "function getStationInfo () {\n debug('getter called')\n if (cache) {\n return cache.then(c=>{\n debug('now', posixTime())\n debug('last_updated', c.last_updated)\n debug('delta', posixTime() - c.last_updated)\n debug('cache hit within ttl?', posixTime() - c.last_updated < c.ttl)\n if(posixTime() - c.last_updated < c.ttl) {\n return c\n }\n debug('making http request')\n //cache the promise of request data\n //debug('what is the cache before making the request?', cache)\n cache = hitServer()\n return cache\n })\n }\n debug('no cache')\n cache = hitServer()\n return cache\n}", "title": "" }, { "docid": "cf04f42466b4c609a826a1dcb151f70d", "score": "0.5416164", "text": "getJSONData() {\n var myjson = [];\n // add/remove api endpoints here\n var apis = [];\n this.type.forEach(function(element) {\n var thisfetch = contains(apis, element);\n\tif (thisfetch != null) {\n\t try {\n\t const res = fetch(thisfetch)\n\t .then(res => res.json())\n\t .then(res => {\n\t myjson.push(res);\n\t })\n\t }\n\t catch(error) {\n\t console.log(error);\n\t }\n\t}\n })\n return myjson;\n }", "title": "" }, { "docid": "34ae847ed4e4faa4fba5ae8fb73d7a70", "score": "0.5414769", "text": "get(key, maxAge, data) {\n debug('get', `key=${key}`, `maxAge=${maxAge}`, `data=${JSON.stringify(data)}`);\n return new Promise((resolve, reject) => {\n this.client.get(key, function (err, data) {\n debug('get', `err=${err}`, `data=${data}`)\n if (!err) {\n try {\n resolve(JSON.parse(data));\n } catch (e) {\n reject(e.stack);\n }\n } else {\n reject(err);\n }\n });\n });\n }", "title": "" }, { "docid": "17aa987c68845f801d806822bb4d994a", "score": "0.5408162", "text": "get_all_info(){\n\t\tthis._PARAM = {};\n\t\treturn new Promise(this._GET_ALL_INFO.bind(this));\n\t}", "title": "" }, { "docid": "8b5cea20b8ba3714474e0a0ef5667cb2", "score": "0.5399754", "text": "async function getLatest() {\n\tconst request = await fetch(baseUrl);\n\tconst data = await request.json();\n\treturn data;\n}", "title": "" }, { "docid": "42b82bc54a1066421d104b8ea1bc54f9", "score": "0.5393992", "text": "function readAll() {\r\n $.ajax({\r\n url:\"/readAll\",\r\n type:\"get\",\r\n dataType:\"json\"\r\n\r\n }).done(function (res) {\r\n writeData(res);\r\n allData = res;\r\n })\r\n .fail(function () {\r\n console.log(\"Eror\");\r\n })\r\n} // readAll End", "title": "" }, { "docid": "30e115e97d1ed9f24f8d772988eb188c", "score": "0.5388706", "text": "async function getAllData(res) {\r\n //need first fetch to determine how many requests are needed\r\n totalHits = await getOnePageData(0);\r\n\r\n displayWaitTime(res, totalHits);\r\n\r\n //only send 1 request per 6 seconds since NY Times cap the rate at 10 requests / minute\r\n requestInterval = setInterval(function () {\r\n page++;\r\n if ((page * 10) >= totalHits) {\r\n clearInterval(requestInterval);\r\n display();\r\n progressStatus = statusEnum.Done;\r\n return;\r\n }\r\n getOnePageData(page);\r\n }, 6000);\r\n}", "title": "" }, { "docid": "9713184fc5fc47e900719a065a706c1e", "score": "0.53712994", "text": "function fetchAllEvents() {\n\n var deferred = $q.defer();\n $http.get(REST_API_URI + 'events').then(function (response) {\n deferred.resolve(response.data);\n },\n function (errorResponse) {\n console.log('Error While Fetching Events');\n deferred.reject(errorResponse);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "dc7546b644af819bf5a1a265a0f8422a", "score": "0.53573555", "text": "getHistoricPledges() {\n return new Promise((resolve, reject) => {\n simpleNodeCache.get(\"pledges-historic\", (err, value) => {\n if (!err) {\n if (value != undefined) {\n resolve(value);\n } else {\n\n var historicData = [];\n var dictDates = {};\n this.pledges.find({}, (err,thing) => {\n thing.each( (err, doc) => {\n if (doc != null) {\n var stringDate = moment(doc['added']).format(\"YYYY-MM-DD\");\n if (dictDates[stringDate] == undefined) {\n dictDates[stringDate] = {total:1, amount: doc['amount'] , date:stringDate };\n } else {\n dictDates[stringDate]['total'] += 1;\n if (doc['amount'] == undefined) {\n dictDates[stringDate]['amount'] += 1;\n } else {\n dictDates[stringDate]['amount'] += doc['amount'];\n }\n }\n } else {\n for (var key in dictDates) {\n historicData.push(dictDates[key]);\n }\n simpleNodeCache.set(\"pledges-historic\", historicData , (err, success) => {});\n resolve( historicData );\n }\n });\n });\n\n\n\n }\n }\n });\n });\n }", "title": "" }, { "docid": "10212a57af37746a98ff226369e3a6ec", "score": "0.5344463", "text": "function get_all(filters, cb) {\n STORAGE.get(function (items) {\n // Flatten the object to { host: 'time' } format \n // Original format is { 'yyyy-mm-dd-hh': { 'host': time, ... }, ... }\n\n var data = Object.keys(items).reduce(function (initial, key) {\n // get only date objects and remvoe filters and others\n if (typeof items[key] !== 'object') return initial;\n \n // date filter\n if (filters && filters.date && \n key.substr(0, 10) !== filters.date) {\n return initial;\n }\n \n function sum (init, k) {\n // exclude selected hosts\n if (EXCLUDE_HOST_LIST.includes(k)) return initial;\n\n if (initial[k]) initial[k] += items[key][k];\n else initial[k] = items[key][k];\n return initial;\n }\n\n return Object.keys(items[key]).reduce(sum, {});\n }, {});\n\n // Convert this to array\n var arr = Object.keys(data).map(function (host) {\n return { host: host, value: data[host] };\n }).sort(function (a, b) { return b.value - a.value });\n\n cb(arr);\n });\n }", "title": "" }, { "docid": "b4622596be6ee827b29daf1eb98e2efc", "score": "0.53413385", "text": "async getAll() {\r\n return JSON.parse(\r\n await fs.promises.readFile(this.filename, {\r\n encoding: 'utf8'\r\n })\r\n );\r\n }", "title": "" }, { "docid": "336d10bffb24ff8236e927ea851e8100", "score": "0.5336534", "text": "dehydrate() {\n let json = {};\n this._cache.forEach((value, key) => json[key] = value);\n return json;\n }", "title": "" }, { "docid": "83c987bde8d590d969d983919e26a119", "score": "0.53339344", "text": "async function __cacheGetRawJSON(measurementID) {\n const value = sessionStorage.getItem(measurementID)\n if (value !== null) {\n console.log(`using previously cached measurement value: ${measurementID}`)\n return value\n }\n const url = new URL(\"https://api.ooni.io/api/v1/measurement_meta\")\n url.searchParams.append(\"measurement_uid\", measurementID)\n url.searchParams.append(\"full\", true)\n const response = await fetch(url)\n const data = await response.text()\n console.log(`storing entry into the cache: ${measurementID}`)\n sessionStorage.setItem(measurementID, data)\n return data\n}", "title": "" }, { "docid": "385496385d9a113ee415df41ea2f38ce", "score": "0.5332214", "text": "async memCacheSummary() {\n return await this.memCache.getItemList();\n }", "title": "" }, { "docid": "98f9704739394096f3c61ae7ff4f5845", "score": "0.53129834", "text": "function fetchJson() {\n\t\tconsole.log('fetch json');\n\t\thttp.get(url, function(res) {\n\t\t body = '';\n\n\t\t res.on('data', function(data) {\n\t\t \t\n\t\t body += data;\n\t\t });\n\n\t\t res.on('end', function() {\n\n\t\t \tfs.writeFileSync(cacheFile, body);\n\t\t \t\t\n\t\t setTimeout(fetchJson, 100000); // Fetch it again in a second\n\t\t });\n\t\t});\n\t}", "title": "" }, { "docid": "63ff113d6fa535ed253af85ee2159638", "score": "0.5309837", "text": "get(key, maxAge, data) {\n debug('get', `key=${key}`, `maxAge=${maxAge}`, `data=${JSON.stringify(data)}`);\n return new Promise((resolve, reject) => {\n this.pool.query('SELECT Fsess FROM ?? WHERE Fkey=? AND Fexpires_time>UNIX_TIMESTAMP(NOW()) LIMIT 1',\n [\n this.tableName,\n key\n ],\n (err, results, fields) => {\n debug('get', `err=${err}`, `results=${JSON.stringify(results)}`, `fields=${JSON.stringify(fields)}`)\n if (err) {\n reject(err);\n } else {\n try {\n if (results.length > 0)\n resolve(JSON.parse(results[0].Fsess));\n else\n resolve();\n } catch (e) {\n reject(e);\n }\n }\n }\n );\n });\n }", "title": "" }, { "docid": "27d953b2c63c27c28751aa12435366cf", "score": "0.5302141", "text": "function getItems() {\n\n // Each call can get a maximum number of 20 items, so we have to iterate\n var indexEnd = Math.min(itemIndex + 20, itemIds.length);\n var itemBunch = itemIds.slice(itemIndex, indexEnd);\n itemIndex = indexEnd;\n var requestUrl = requestUrlBase + itemBunch.join(',');\n \n // Ajax calls are made through the background page (not possible from a content script)\n chrome.runtime.sendMessage({action:'ajaxGet', url:requestUrl}, function (data) {\n \n var getMultipleItemsResponse = JSON.parse(data);\n if (getMultipleItemsResponse.Errors)\n return;\n for (var i = 0; i < getMultipleItemsResponse.Item.length; i++) {\n var item = getMultipleItemsResponse.Item[i];\n \n for (var j = 0; j < hzItems.length; j++) {\n if (hzItems[j].id == item.ItemID && item.PictureURL && item.PictureURL.length > 0) {\n var thumb = $(hzItems[j].thumb), data = thumb.data();\n if (item.PictureURL.length == 1) {\n var url = item.PictureURL[0];\n data.hoverZoomSrc = [url];\n data.hoverZoomCaption = item.Title;\n } else {\n data.hoverZoomGallerySrc = [];\n data.hoverZoomGalleryCaption = [];\n for (var k = 0; k < item.PictureURL.length; k++) {\n var url = item.PictureURL[k];\n data.hoverZoomGallerySrc.push([url]);\n data.hoverZoomGalleryCaption.push(item.Title);\n }\n }\n \n res.push(thumb);\n\n // Items are stored to lessen API calls\n //localStorage[cachePrefix + item.ItemID] = JSON.stringify({pictureUrl:url, title:item.Title});\n }\n }\n }\n callback($(res), this.name);\n res = [];\n if (itemIndex < itemIds.length) {\n // Continue with the next 20 items\n getItems();\n }\n });\n }", "title": "" }, { "docid": "a973ce59d7e5827763520242d056fff1", "score": "0.5297454", "text": "function all(){\n return data;\n }", "title": "" }, { "docid": "25ae57bab5c6de3cb632b2812b0bee37", "score": "0.52889913", "text": "function getTags() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/GetTags' + cacheBuster });\n }", "title": "" }, { "docid": "ea8550d00cc551eee39330ff2ae2fda7", "score": "0.5286113", "text": "constructor() {\n this._cache = {};\n this._count = 0;\n this._timeout = 60000;\n this._maxSize = 1000;\n }", "title": "" }, { "docid": "a2f855f2bd46021f96070b8407fda129", "score": "0.52857023", "text": "async getAll() {\n return JSON.parse(\n await fs.promises.readFile(this.filename, { encoding: \"utf8\" })\n );\n }", "title": "" }, { "docid": "bc7bf52e54c48247601a2fb3081f024a", "score": "0.5281335", "text": "all(list) {\n\t\treturn this.$http.get(`${this.path()}${list ? \"?list\" : \"\"}`, {\n\t\t\tcache: list ? false : this.cache\n\t\t}).then(response => response.data);\n\t}", "title": "" }, { "docid": "30200603ed82cdaa853c42811d6ea0c3", "score": "0.5273841", "text": "function getListingData(path) {\n return $.ajax({\n url: path,\n cache: true\n })\n}", "title": "" }, { "docid": "afe4ebfa2f380a2ea2b55c493b153c3c", "score": "0.5264557", "text": "function fakeApiGet() {\n return setTimeout(function(){\n return [1, 2, 3];\n }, 1000);\n}", "title": "" }, { "docid": "6107cce16da657908e5a77eee87faae2", "score": "0.5263951", "text": "function getPictureForDate(apodDate) {\n // Format the date to insert into the url for NASA APOD service\n apodDateString = apodDate.toISOString().substr(0, 10);\n var url = NASA_APOD.API_URL +\"date=\"+ apodDateString + \"&api_key=\" + NASA_APOD.API_KEY;\n\n //Promises simplify asynchronous code by avoiding the so-called pyramid of doom \n //that result from continuously nested callbacks. They also make async error handling easier.\n var deferred = $q.defer();\n\n if (nasaCache.get(apodDateString)) {\n console.log('loaded from cache: '+ apodDateString);\n deferred.resolve(nasaCache.get(apodDateString));\n } else {\n\n // if not in Cache then call out to NASA APOD service over http\n var start = new Date().getTime(); // keep track of how long http takes\n\n $http.get(url)\n .success(function(data, status) {\n var dataApodDateString = \"\";\n // Add date object for sorting results array later\n if (data.date !== null && data.date !== undefined) {\n var split = data.date.split(\"-\");\n var dataApodDate = new Date(split[0], split[1]-1, split[2]);\n data.apodDateVal = dataApodDate.getTime();\n // Add data to cache - key by date in string format.\n dataApodDateString = dataApodDate.toISOString().substr(0, 10);\n nasaCache.put(dataApodDateString, data);\n } \n var now = new Date();\n console.log(now.toLocaleTimeString() + ': time taken for HTTP request on ['+ \n dataApodDateString +']: ' + (now.getTime() - start) + 'ms'); \n \n deferred.resolve(data);\n \n })\n .error(function(error) {\n //process error scenario.\n console.log(\"Error while making HTTP call.\");\n deferred.reject(error);\n });\n }\n // return promise of NASA APOD for given date\n return deferred.promise;\n }", "title": "" }, { "docid": "81171ff349da13f7180915b5aa79e4a5", "score": "0.5263", "text": "function fetch_getAll() {\n const requestOptions = {\n method: 'GET',\n headers: authHeader()\n };\n\n return fetch('/transactions/list', requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "845adce5d2dad1065e0bfa2aeb345cda", "score": "0.52628064", "text": "async function getAllDatas(){\n\n}", "title": "" }, { "docid": "b1a1a899a3fbadfcc116c28f648fb8ae", "score": "0.526053", "text": "function retrieveAll(){\n\t// For a completely restful api, we would need to send some kind of authentication\n\t// token for each request. A simple trivial one is sending the user and password\n\t// an alternative is to send something hashed with the user and password\n\n\t$.ajax({ \n\t\tmethod: \"GET\", \n\t\turl: \"/api/counter/\"\n\t}).done(function(data){\n\t\tconsole.log(JSON.stringify(data));\n\t\tvar allCounters = \"\";\n\t\tfor(i=0;i<data[\"counters\"].length;i++){\n\t\t\tallCounters += \"<br/>\"+data[\"counters\"][i].counterName+\" \"+data[\"counters\"][i].counterValue;\n\t\t}\n\t\t$(\"#allCounters\").html(allCounters);\n\t});\n}", "title": "" }, { "docid": "8ece214a1b1f2800670d9c2fa9f3bcbb", "score": "0.5254357", "text": "function getDataForToday(count) {\n var data = [];\n\n for(var i = 0; i < count; i++) {\n data.push({\n tps: randomValue(50, 5),\n user: randomValue(1000, 100)\n });\n }\n\n return data;\n}", "title": "" }, { "docid": "5408d2140644c7f99e0007b19ea3f284", "score": "0.5249448", "text": "async function getFoodTrucks(givenDate){\n let foodTrucksOpenNow\n\n if(foodTrucksDataCache){//from cache\n //paginated response\n foodTrucksOpenNow = foodTrucksAvailableAtGivenTime(foodTrucksDataCache, new Date())\n return Promise.resolve({total:foodTrucksOpenNow.length, foodTrucksOpenNow})\n }\n //CACHE EXPIRY = 1 day\n else if(!foodTrucksDataCache ||\n ((Date.now() - foodTrucksDataTimestamp) >= cacheExpiry))\n {\n try{\n //Socrate API: https://dev.socrata.com/foundry/data.sfgov.org/jjew-r69b\n //NOTE: Using without AppToken - so will get limitted results\n //get food trucks open today\n let url = 'http://data.sfgov.org/resource/bbb8-hzi6.json'\n const weekDay = getWeekDay(givenDate)\n if(weekDay) url = `${url}?dayofweekstr=${weekDay}`\n\n console.log(chalk.grey(`$$ Fetching ${url} \\n`))\n const res = await fetch(url)\n\n if (res.status >= 400) {\n throw new Error(\"Bad response from server\");\n }\n\n const foodTrucks = await res.json()\n foodTrucksDataTimestamp = Date.now()\n\n //deserialize to model, to detect Public API signature changes\n const foodTrucksDataCache = foodTrucks.map(truck => new FoodTruck(truck))\n\n //find food trucks open now\n foodTrucksOpenNow = foodTrucksAvailableAtGivenTime(foodTrucksDataCache, givenDate)\n\n //Sort ASSUMPTION: Alphabetical sorting is done by the Food Truck's Applicant\n foodTrucksOpenNow = sortByName(foodTrucksOpenNow)\n\n //Unique Food Trucks: API Results are already Unique by (applicant and location)\n\n return Promise.resolve({total:foodTrucksOpenNow.length, foodTrucksOpenNow})\n }catch(err){\n console.log(chalk.red(`Unable to fetch Food Track data! \\n`), err);\n return Promise.reject(err)\n }\n }\n}", "title": "" }, { "docid": "7cd70ac4a82b9b4fac2371900fdafc80", "score": "0.52439505", "text": "async getAll() {\n // // open the file where user's data is stored\n // const contents = await fs.promises.readFile(this.filename, { encoding: 'utf-8' });\n // // read and parse its contents\n // const data = JSON.parse(contents);\n // // return the parsed data\n // return data;\n\n // the three process done above can also be done is a much shorter way->\n return JSON.parse(await fs.promises.readFile(this.filename, { encoding: 'utf-8' }));\n }", "title": "" }, { "docid": "448052cc1a3eaafbe0994fe5dfac1e09", "score": "0.52428013", "text": "function getAllEvent(param) {\n\t\t\t\t\t\t\t var authtokencode=api.authtoken;\n\t\t\t\t\t\t\t var requireauthTokenFormat='Basic ' + api.authtoken;\n\t\t\t\t\t\t\t var currenBaseurl=api.baseUrl;\n\t\t\t\t\t\t\t var serviceurl = api.getAllEvent+param;\n\t\t\t\t\t\t\t var finalUrl=encodeURI(currenBaseurl+serviceurl);\n\t\t\t\t\t\t\t return $http({\n\t\t\t\t\t\t \t\t\t\theaders: {'Authorization':requireauthTokenFormat,'Content-Type': 'application/json'},\n\t\t method: 'GET',\n\t\t dataType: 'jsonp',\n\t\t url: finalUrl,\n\t\t timeout:60000\n\t\t }).success(function (data) {\n\t\t return data;\n\t\t }).error(function (status) {\n\t\t \t\t \t \treturn status;\n\n\t\t });\n\n\n\t\t }", "title": "" }, { "docid": "d5a739ef2e389bfbad3c73eec060f805", "score": "0.5238037", "text": "async time() {\n return this.request(\n this.query({\n path: this.time.name\n })\n )\n }", "title": "" }, { "docid": "da430a8b58b545a089fb721d1a1ead9c", "score": "0.52353466", "text": "function loadAll() {\n\t \t$http.post('/resources/item/list',{id:UserSrvc.getId()}).\n\t success(function(data, status, headers, config) {\n\t my.data = data;\n\t return data.map( function (item) {\n\t \t item.value = item.propertyMap.name.toLowerCase();\n\t \t return item;\n\t \t });\n\t }).\n\t error(function(data, status, headers, config) {\n\t return undefined;\n\t });\n\t \t\n\t \n\t }", "title": "" }, { "docid": "1cec16155a336b7d5920c65e28bbc134", "score": "0.52319294", "text": "async getAllBudgetCycles(){\n const url = 'budgetcycles';\n return await apiService.get(url);\n}", "title": "" }, { "docid": "66165cc42ea9e4251cb52cf913b5c9d5", "score": "0.52285784", "text": "async getAllCData() {\n\n const response = await fetch(this.allCountryData);\n const data = await response.json();\n return data;\n }", "title": "" }, { "docid": "1a3c579a1466083deb0fb2b4c8a470e4", "score": "0.5226086", "text": "getEverything(params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const endpointUrl = `${NewsAPI._URL}/everything`;\n const queries = [querystring.stringify({ apiKey: this._apiKey })];\n if (params.q) {\n queries.push(querystring.stringify({ q: params.q }));\n }\n if (params.qInTitle) {\n queries.push(querystring.stringify({ qInTitle: params.qInTitle }));\n }\n if (params.sources && params.sources.length) {\n queries.push(querystring.stringify({ sources: params.sources.join(',') }));\n }\n if (params.domains && params.domains.length) {\n queries.push(querystring.stringify({ domains: params.domains.join(',') }));\n }\n if (params.excludeDomains && params.excludeDomains.length) {\n queries.push(querystring.stringify({ excludeDomains: params.excludeDomains.join(',') }));\n }\n if (params.from) {\n queries.push(querystring.stringify({ from: params.from }));\n }\n if (params.to) {\n queries.push(querystring.stringify({ to: params.to }));\n }\n if (params.language) {\n queries.push(querystring.stringify({ language: params.language }));\n }\n if (params.sortBy) {\n queries.push(querystring.stringify({ sortBy: params.sortBy }));\n }\n if (params.pageSize) {\n queries.push(querystring.stringify({ pageSize: params.pageSize }));\n }\n if (params.page) {\n queries.push(querystring.stringify({ page: params.page }));\n }\n const response = yield axios_1.default.get(`${endpointUrl}?${queries.join('&')}`);\n return response.data;\n });\n }", "title": "" }, { "docid": "2c52c8dcfcb5eda3cf74dda3900d8593", "score": "0.521727", "text": "function getKeysFunction(){\r\n var since = 365;\r\n console.log(\"get keys funtion\");\r\n var currentDate= new Date;\r\n // Save the current time in the now variable.\r\n var now = parseInt(currentDate.getTime()/1000);\r\n // Instantiate the variable limit and set its value to one day before the now variable.\r\n var limit = currentDate.setDate(currentDate.getDate() - since);\r\n limit = parseInt(currentDate.getTime()/1000);\r\n // Make the CORS request to Altair SmartWorks to get all the streams between now and the limit (one natural day before).\r\n getRequest(\"https://api.altairsmartcore.com/devices/KeysDevice@davidnike18.davidnike18/streams/?at_to=\"+now+\"&at_from=\"+limit, \"day\"); \r\n}", "title": "" }, { "docid": "1585a2ec20f682ba7d8b842f065d2b6b", "score": "0.52158785", "text": "static get data() {\n return data.cache\n }", "title": "" }, { "docid": "a07e94ae623507129c38ceae88da454e", "score": "0.52115524", "text": "function get_data (table_id) {\n //set appropriate variables based on table_id\n switch(table_id) {\n case '#baseball-players-table':\n session_data = 'baseball_player_data'\n session_timestamp = 'baseball_player_timestamp'\n break;\n case '#baseball-pitchers-table':\n session_data = 'baseball_pitcher_data'\n session_timestamp = 'baseball_pitcher_timestamp'\n break;\n default:\n alert('get_data() switch error')\n }\n //check if data and timestamp is in sessionStorage\n if (!(session_data in sessionStorage && session_timestamp in sessionStorage)) {\n //something is missing so fetch all data\n load_default(table_id)\n //return early to allow async of data fetch\n return false\n }\n //else check timestamp to see if data is still valid\n //add 15 minutes to timestamp\n var timestamp = new Date(JSON.parse(sessionStorage.getItem(session_timestamp)) + 15*60000);\n now = new Date();\n\n if (now > timestamp){\n //data is outdated so fetch again\n load_default(table_id)\n return false\n }\n //all checks are good\n //we already have the data. Just return data\n return JSON.parse(sessionStorage.getItem(session_data))\n}", "title": "" }, { "docid": "a40c4c497b7c903a56738100b5cd7971", "score": "0.5201883", "text": "function getData(countryName) {\n return fetch(decodeURI(baseURL + `historical/${countryName}?lastdays=1000`))\n .then(function (result) {\n if (!result.ok) {\n updateInvalidWatchList(countryName);\n updateInvalidCache([countryName]);\n window.alert(`Data not found for country: ${countryName}`);\n } else {\n return result.json();\n }\n })\n .catch((error) => {\n console.log(\"Error: \", error);\n });\n}", "title": "" }, { "docid": "c50ef5488e21487f13a09e1375025911", "score": "0.5197436", "text": "function ListResultCacheMock() {\n return ListResultCache;\n }", "title": "" }, { "docid": "a4922cd3c32f2513523708bb953ee080", "score": "0.5193561", "text": "function getReminders(){\n\t\t$.ajax({\n\t\t\turl:\"/getReminders\",\n\t\t\ttype:\"GET\",\n\t\t\theaders:{\n\t\t\t\t\"Authorization\":token,\n\t\t\t\t\"Content-Type\":\"application/json\"\n\t\t\t},\n\t\t\tsuccess:function(data){\n\t\t\t\ttimings=data;\n\t\t\t\t\t\n\t\t\t}\n\t\t});\t\n\t}", "title": "" }, { "docid": "a274f78a999ac68d6d38c5bed22e2b1d", "score": "0.5183928", "text": "function getAllData(){\n\tconsole.log(\"hi?\")\n\t$.ajax({\n\t\turl: '/api/all',\t\t//directs you to the app.js all data json file\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\t\terror: function(data){\n\t\t\t// console.log(data);\n\t\t\talert(\"Oh No! Try a refresh?\");\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tconsole.log(\"We have data\");\n\t\t\t// console.log(data);\n\t\t\t//Clean up the data on the client\n\t\t\t//You could do this on the server\n\t\t\tvar theData = data.map(function(d){\t\t\t\t//looping through the data, and giving you cleaner data\n\t\t\t\treturn d.doc;\n\t\t\t});\n\t\t\tmakeHTML(theData);\n\n\t\t\t\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "07c6c2912f4fb15c4f9ef8d83054dff6", "score": "0.5181831", "text": "function getAllCultivationResultData() {\n\t\t// make Ajax call to server to get data\n\t\t$.ajax({\n\t\t\turl: \"getCultivationResultData\",\n\t\t\tdata: { \"farmId\": farmIdGlobal, \"areaId\": selectedAreaIdGlobal, \"kindId\": selectedKindIdGlobal },\n\t\t\ttype: \"POST\",\n\t\t\tasync: false,\n\t\t\tsuccess: function(returnedJsonData) {\n\t\t\t\tif (checkSessionTimeout(returnedJsonData) == 1) return;\n\t\t\t\t// store data in global variable\n\t\t\t\tcultivationResultData = returnedJsonData;\n\t\t\t\tif (cultivationResultData.length == 0) {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"getLastUpdateDateProduct\",\n\t\t\t\t\t\tdata: { \"farmId\": farmIdGlobal, \"areaId\": selectedAreaIdGlobal },\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\tsuccess: function(returnedJsonData) {\n\t\t\t\t\t\t\tif (checkSessionTimeout(returnedJsonData) == 1) return;\n\t\t\t\t\t\t\tlastUpdateDateGlobal = returnedJsonData;\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(e) {\n\t\t\t\t\t\t\t// display error message\n\t\t\t\t\t\t\tjWarning(ERROR_MESSAGE.replace('$1', ERROR_MESSAGE_EXCEPTION_CLIENT), DIALOG_TITLE, DIALOG_OK_BUTTON);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(e) {\n\t\t\t\t// display error message\n\t\t\t\tjWarning(ERROR_MESSAGE.replace('$1', ERROR_MESSAGE_EXCEPTION_CLIENT), DIALOG_TITLE, DIALOG_OK_BUTTON);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "754381845e245186cfe7046784e82766", "score": "0.51797915", "text": "function fetchAllCats()\n {\n\t var deferred = $q.defer();\n $http.get(REST_SERVICE_URI+\"cat/\")\n .then(\n function (response) {\n deferred.resolve(response.data);\n\t\t\t\tconsole.log(response.data);\n },\n function(errResponse){\n console.error('Error while fetching cats'+errResponse.data);\n deferred.reject(errResponse);\n }\n );\n return deferred.promise; }", "title": "" }, { "docid": "484bc3dd3c9cdc2668661bc1d306bf09", "score": "0.51748043", "text": "function cacheWellKnownKeys() {\n // get the well known config from google\n request('https://accounts.google.com/.well-known/openid-configuration', function (err, res, body) {\n var config = JSON.parse(body);\n var address = config.jwks_uri; // ex: https://www.googleapis.com/oauth2/v3/certs\n // get the public json web keys\n request(address, function (err, res, body) {\n keyCache.keys = JSON.parse(body).keys;\n // example cache-control header: \n // public, max-age=24497, must-revalidate, no-transform\n var cacheControl = res.headers['cache-control'];\n var values = cacheControl.split(',');\n var maxAge = parseInt(values[1].split('=')[1]);\n // update the key cache when the max age expires\n setTimeout(cacheWellKnownKeys, maxAge * 1000);\n //log('Cached keys = ', keyCache.keys);\n });\n });\n}", "title": "" }, { "docid": "934681f0843a307e7edf576286605a67", "score": "0.5168522", "text": "function get_todays_task()\n{\n\t\n\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: 'http://localhost:52371/api/tasks_table/gett',\n\t\t\tasync:true, \n\t\t\tdataType:\"json\",\n\t\t\theaders:{\n\t\t\t\t\t'Access-Control-Allow-Origin':'*'\n\t\t\t\t},\n\t\t\tcrossDomain:true,\n\t\t\tsuccess: function(response) {\n\t\t\t\t\n\t\t\t\tconsole.log(response);\n\t\t\t\tshow_all_tasks(response);\n\t\t\t}\n\t\t});\n\t\t\t\t\n}", "title": "" }, { "docid": "4e2444f2cae48c407e9f37498af53d54", "score": "0.51681757", "text": "function getPerfData(hostName, serviceName, startTime, endTime, interval, applicationType, success, error) {\n var matchApiToken = /FoundationToken=([^;]*);/.exec(document.cookie);\n var apiToken = (!!matchApiToken ? matchApiToken[1] : null);\n var baseApiUrl = window.location.origin+'/api';\n jQuery.ajax({\n url: baseApiUrl+'/perfdata?'+\n (!!applicationType ? 'appType='+encodeURIComponent(applicationType)+'&' : '')+\n 'serverName='+encodeURIComponent(hostName)+'&'+\n 'serviceName='+encodeURIComponent(serviceName)+'&'+\n 'startTime='+startTime*1000+'&'+\n 'endTime='+endTime*1000+'&'+\n 'interval='+interval*1000,\n dataType: 'json',\n beforeSend: function(xhr) {\n xhr.setRequestHeader('GWOS-API-TOKEN', apiToken);\n xhr.setRequestHeader('GWOS-APP-NAME', 'monitor-dashboard');\n },\n success: function(data) {\n if (!!success) {\n success(data, 200);\n }\n },\n error: function(xhr) {\n var status = xhr.status;\n var statusText = xhr.statusText;\n var data = xhr.response;\n if ((status == 404) && (!!success)) {\n var notFoundData = {\n serverName: hostName,\n serviceName: serviceName,\n startTime: startTime,\n endTime: endTime,\n interval: interval,\n perfDataTimeSeriesValues: []\n };\n if (!!applicationType) {\n notFoundData.applicationType = applicationType;\n }\n success(notFoundData, status);\n } else if (xhr.getResponseHeader('Content-Type') == 'application/json') {\n data = JSON.parse(data);\n if (!data.error && !!success) {\n success(data, status);\n } else {\n if (!!error) {\n error(data.error, status);\n }\n }\n } else if (!!error) {\n error(statusText, status);\n }\n }\n });\n}", "title": "" }, { "docid": "bf761a244c47e612bf0e1570abd78b9b", "score": "0.5167909", "text": "function getData(table){\n\tvar values;\n\tvar data = {};\n\tvar list = jQuery.lastTime[table];\n\tfor(index in list){\n\t\tvalues = [];\n\t\tvalues.push({name:\"last\",value:jQuery.lastTime[table][index]});\n\t\tvalues.push({value:\"accu\",value:jQuery.accumulatedTime[table][index]});\n\t\tdata[index] = values;\n\t}\n\t\n\treturn data;\n}", "title": "" }, { "docid": "6b266229b1ba26080b2d298e5603b982", "score": "0.5167489", "text": "getAllData(){\n return JSON.parse(localStorage.getItem(this.STORAGE_KEY)) || [];\n }", "title": "" }, { "docid": "9974d090a477c2b2061dccf47e502a35", "score": "0.5165062", "text": "function getAllEntries() {\n console.log('Getting all entries in dynamodb budgets table');\n let params = {\n TableName: TABLE\n };\n let entries = getAllEntriesHelper(params);\n console.log('Finished getting all entries');\n return entries;\n}", "title": "" }, { "docid": "9914b938ec3d9273d152ab03002bfcca", "score": "0.5164964", "text": "getJson(){\n return App.phaser.cache.getJSON('gdata'); \n }", "title": "" }, { "docid": "8f4984463e99a3d40c1e7aa10f19fe47", "score": "0.5160044", "text": "constructor() {\n this._cache = {};\n\n /**\n * Gets data off the cache and uses fallback promise if not found\n * \n * @param {object} config contains the caching key and retention strategy\n * @param {object} fallback not found fallback promise\n * \n * @returns {Promise} an execution promise\n */\n this.fetch = (config, fallback) => {\n const promise = new Promise((resolve, reject) => {\n if (this._cache[config.key]) {\n const item = this._cache[config.key];\n this.setExpire(config);\n return resolve(item.value);\n }\n return fallback()\n .then((result) => {\n this._cache[config.key] = {\n \"value\": result\n };\n this.setExpire(config);\n return resolve(result);\n })\n .catch(reject);\n });\n return promise;\n };\n\n /**\n * Sets expire flush method on cached item\n * \n * @param {any} config cached item config\n * @return {undefined}\n */\n this.setExpire = (config) => {\n if (this._cache[config.key] && config.expires) {\n const target = this._cache[config.key];\n const expire = () => {\n this._cache[config.key] = null;\n };\n if (target.reset) {\n clearTimeout(target.reset);\n }\n target.reset = config.expires ? setTimeout(expire, config.expires) : null;\n }\n };\n }", "title": "" }, { "docid": "26ad17852b983baf5ce4a169e1ca0183", "score": "0.51583105", "text": "getAll() {\n return this._toJsonObject(this.storage.getItem(this.cartName));\n }", "title": "" }, { "docid": "bd5c400dcbaf061b532a44e37ff4202c", "score": "0.5157717", "text": "async refreshCacheEntries(maxAge = MAX_AGE, now = Date.now()) {\n await Promise.all([...this.dictionaryCache.values()].map((entry) => this.refreshEntry(entry, maxAge, now)));\n }", "title": "" }, { "docid": "c49bf7dd6246ecb0fc0cbaa66fba5fdf", "score": "0.51517725", "text": "function refreshCache() {}", "title": "" }, { "docid": "6ecf851a541289c7fb1be26e57910b06", "score": "0.51505536", "text": "function getDeviceCache() {\n /*OMM.initOfflineMaps();*/\n clearDeviceCache();\n OMM.OfflineMaps.listCachedFiles().then(function(data) {\n console.log(\"getDeviceCache: \" + data);\n var cachePg = pega.ui.ClientCache.find(\"D_MapCacheFiles\");\n\n var newCache = {};\n var lastFile = \"\";\n var len = data.length;\n for (var i = 0; len > i; i++) {\n\n console.log(\"Start to D_MapCacheFiles: \" + data[i].file);\n var tableNames = \"\";\n if (lastFile != data[i].file) {\n newCache = cachePg.get(\"pxResults\").add();\n } else {\n tableNames = newCache.get(\"TableNames\").getValue();\n }\n\n if (data[i].tableName !== \"\") {\n tableNames += data[i].tableName + \"||\";\n newCache.put(\"TableNames\", tableNames);\n }\n\n newCache.put(\"CacheType\", data[i].type);\n newCache.put(\"PreLoaded\", false);\n newCache.put(\"FileName\", data[i].file);\n newCache.put(\"FileSize\", formatBytes(data[i].fileSize));\n lastFile = data[i].file;\n console.log(\"Added to D_MapCacheFiles: \" + data[i].file);\n }\n console.log(\"Reloading\");\n pega.u.d.refreshSection(\"MobileMapsConfig\");\n\n });\n}", "title": "" }, { "docid": "c8af0ad5af2a2f292df15c6b33486f8e", "score": "0.5150089", "text": "async getAll() {\n // CONDENSED VERSION\n return JSON.parse(\n await fs.promises.readFile(this.filename, {\n encoding: 'utf8'\n })\n )\n\n // ============\n // LONG VERSION\n // ============\n // Open the file called this.filename\n //const contents = await fs.promises.readFile(this.filename, { encoding: 'utf8' });\n // Read its contents\n //console.log(contents)\n // Parse the contents\n //const data = JSON.parse(contents);\n // Return the parsed data\n //return data;\n }", "title": "" }, { "docid": "4de75e79507f9801b9cf1eb82732c58b", "score": "0.5149353", "text": "async getAllStressors(){\n const resp = await fetch(this.stressorURL);\n let json = resp.json();\n return await json;\n }", "title": "" }, { "docid": "16c7143f63860330a7384a2c07084691", "score": "0.5149182", "text": "function retrieveData(){\n getLatestPost();\n newPostTimeout = setTimeout(retrieveData, 1000) ;\n }", "title": "" } ]
4c0b739065a3059d014a8e4721452ee2
creates subscreen for when they START the actual game
[ { "docid": "3cf7940e9b6e8b70d142f87fd3daecf4", "score": "0.0", "text": "function createCardSubScreen(){\n let cardSubScreen = document.createElement(\"div\");\n cardSubScreen.id = \"cardSubScreen\";\n //left side\n let leftScreen = document.createElement(\"div\");\n leftScreen.innerHTML = \"Current Pot: $\" + currPot + \"<br>Your Money: $\" + money + \"<br><br>\";\n let hitButton = document.createElement(\"button\");\n hitButton.innerHTML = \"HIT\";\n hitButton.onclick = hit;\n let checkButton = document.createElement(\"button\");\n checkButton.innerHTML = \"CHECK\";\n checkButton.onclick = check;\n leftScreen.appendChild(hitButton);\n leftScreen.appendChild(checkButton);\n\n //right side: for cards\n let rightScreen = document.createElement(\"div\");\n rightScreen.id = \"cardDisplay\";\n let playersCards = document.createElement(\"div\");\n playersCards.id = \"playersCards\";\n playersCards.innerHTML = \"Your Cards:<br>\";\n\n let playerScore = document.createElement(\"div\");\n playerScore.id = \"playerScore\";\n \n let dealersCards = document.createElement(\"div\");\n dealersCards.id = \"dealersCards\";\n dealersCards.innerHTML = \"Dealers Cards:<br>\";\n rightScreen.appendChild(playersCards);\n rightScreen.appendChild(playerScore);\n rightScreen.appendChild(dealersCards);\n\n cardSubScreen.appendChild(leftScreen);\n cardSubScreen.appendChild(rightScreen);\n return cardSubScreen;\n}", "title": "" } ]
[ { "docid": "be6bc7f4728e7ad80641c4fc4c12f09e", "score": "0.7511931", "text": "function handleStartGame() {\n destroyIntroScreen();\n buildGameScreen();\n }", "title": "" }, { "docid": "b83f338624fff8417d894025f810cebd", "score": "0.73209053", "text": "function startScreen(){\n\t\tloadBackgrounds();\n\t\tstartPage = paper.rect(0, 0, 800, 600);\n\t\tstartPage.attr({fill:\"45-\" + randomColour() + \"-\" + randomColour()});\n\t\tsetupButton();\n\t\tsetupOptions();\n\t}", "title": "" }, { "docid": "3f82ae331556fd160f003ed8c55db72b", "score": "0.72521096", "text": "displayNewGameScreen() {\n // Fill the game screen with the appropriate HTML\n App.$gameArea.html(App.$templateNewGame);\n $('.createRoom').show();\n $('.wait').hide();\n }", "title": "" }, { "docid": "fc4c85c132b14c7e06b74ceed39e8533", "score": "0.72219956", "text": "function startGame() {\n removeSplashScreen();\n if(gameOverScreen){\n removeGameOverScreen();\n }\n createGameScreen();\n\n game = new Game(gameScreen);\n //game.gameScreen = gameScreen;\n game.start();\n}", "title": "" }, { "docid": "bf2998fbb6afab1f79f8aef8dc31d972", "score": "0.7121324", "text": "function startGameScreen() {\n\tsocket.emit('fleet finished', {gameID: gameID, playerID: client.id});\n\tpositionWindow.waitMessage();\n\tdocument.removeEventListener('keydown', positionWindow.moveShips);\n\tsocket.on(gameID + ' ready', function(data) {\n\t\tif (data == client.id) {\n\t\t\tclient.hasTurn = true;\n\t\t}\n\t\tplayWindow = new gameWindow(document.getElementById('gameCanvas'), scaling, client);\n\t\tsocket.off(gameID + ' ready');\n\t\tpositionWindow.cleanUp();\n\t\tpositionWindow = -1;\n\t});\n}", "title": "" }, { "docid": "a505413b11e5e6935bf3d7e8ac57d002", "score": "0.7119112", "text": "function initScreens() {\n elements.overlay.style.display = 'none';\n elements.pauseScreen.style.display = 'none';\n elements.returnToMenu.style.display = 'none';\n elements.puzzleParamScreen.style.display = 'none';\n elements.workingScreen.style.display = 'none';\n elements.playScreen.style.display = 'none';\n elements.completionScreen.style.display = 'none';\n elements.solverScreen.style.display = 'none';\n elements.clearScreen.style.display = 'none';\n elements.helpScreen.style.display = 'none';\n\n activePage = elements.mainMenu;\n }", "title": "" }, { "docid": "2bd0c62e844a3f33acb21fca2171f75e", "score": "0.71142334", "text": "function createStartScreen(){\n\t\tstartScreen = initScene();\n\t\tstartText = initPlaneMesh('startscreen.jpg');\n\t\tstartScreen.add(startText);\n\t\tstartText.scale.set(150,100,1);\n\t\tstartText.position.set(0,0,0);\n\t\tstartScreen.add(startText);\n\t\t//LIGHTS\n\t\tvar light1 = createPointLight();\n\t\tvar light2 = createPointLight();\n\t\tlight1.position.set(10,0,150);\n\t\tlight2.position.set(-10,0,150);\n\t\tstartScreen.add(light1);\n\t\tstartScreen.add(light2);\n\t\t//CAMERA\n\t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 1000 );\n\t\tstartCam.position.set(0,0,50);\n\t\tstartCam.lookAt(0,0,0);\n\t}", "title": "" }, { "docid": "04e1aa26d6d445231070c0f71a2adb3b", "score": "0.70269907", "text": "function openStartPage() {\n renderUsers();\n $(\"#start-screen\").removeClass(\"hide\");\n $(\"#setup-screen\").addClass(\"hide\");\n $(\"#game-screen\").addClass(\"hide\");\n $(\"#history-screen\").addClass(\"hide\");\n}", "title": "" }, { "docid": "c5100b2705b771450375a8f3799f1920", "score": "0.70160127", "text": "function buildGameScreen() {\n var game = new Game(mainContent);\n game.build();\n \n game.onEnded(function(isWin, score) {\n endGame(isWin, score);\n });\n }", "title": "" }, { "docid": "ea3bbf10a7aab4ab2fb4954052558336", "score": "0.6957586", "text": "function startGame() {\n removeWelcomePage();\n createGamePage();\n createCards();\n}", "title": "" }, { "docid": "f96c5425615cce45b19e4151aa94d8a4", "score": "0.6944856", "text": "showInitScreen() {\n App.$gameArea.html(App.$templateIntroScreen);\n App.doTextFit('.title');\n }", "title": "" }, { "docid": "60bb48ea1e65b91aef9338c75490f84b", "score": "0.6923072", "text": "startGame(){\n //The starting screen will not displayed anymore\n const screenOverlay = document.getElementById('overlay');\n screenOverlay.style.display = \"none\";\n //The new screen with the letter buttons and the secret phrase are shown\n this.activePhrases = this.getRandomPhrase();\n this.activePhrases.addPhraseToDisplay();\n }", "title": "" }, { "docid": "85f6eadb7e714c15377a79f9ab615ea3", "score": "0.69224334", "text": "function startScreen() {\n $('.main-content').html('<div class=\"start\">Start</div>');\n }", "title": "" }, { "docid": "cc983d53d4560e48c205fbd804f515df", "score": "0.6914807", "text": "function startScreen() {\n enemies = [];\n push();\n background(backgroundColour);\n fill(255);\n textSize(35);\n text(\"Click to Start\", width / 2, height / 2);\n if (mouseIsPressed && state === \"start\") {\n state = \"play\";\n }\n pop();\n}", "title": "" }, { "docid": "48e0865e1b65181ab9febd0f2510c828", "score": "0.6895461", "text": "function setStartScreen() {\n score = 0;\n showScreen('start-screen');\n document.getElementById('start-btns').addEventListener('click', function (event) {\n if (!event.target.className.includes('btn')) return; //makes sure event is only fired if a button is clicked\n let button = event.target; //sets button to the element that fired the event\n let gameType = button.getAttribute('data-type');\n setGameScreen(gameType);\n });\n }", "title": "" }, { "docid": "79567b3025853e68a854b5d006122abd", "score": "0.6867235", "text": "function startGame() {\n updateDisplay();\n choosePattern();\n setupButtons();\n\n }", "title": "" }, { "docid": "73c80c30af9f15b5c94faa91f6c02fdf", "score": "0.6833575", "text": "function introScreen() {\n createStarBackground();\n createProjectiles1();\n moveProjectiles1();\n\n //Title text\n textSize(64);\n fill('white');\n text('Super Slider', 75, 150);\n\n //Start button\n rect(startButtonX, startButtonY, startButtonW, startButtonH);\n\n textSize(46);\n fill('black');\n text('Start', startButtonX + 25, startButtonY + 50);\n\n //Clicking the start button\n if (mouseX >= startButtonX && mouseX <= startButtonX + startButtonW) {\n if (mouseY >= startButtonY && mouseY <= startButtonY + startButtonH) {\n if (mouseIsPressed) {\n screen = 1;\n }\n }\n }\n\n}", "title": "" }, { "docid": "d7f47fdf88c06cbb58514e8087a18c99", "score": "0.6816522", "text": "function startGame() {\r\n startScreen0.style.display = 'none';\r\n startScreen1.style.display = 'none';\r\n startScreen2.style.display = 'none';\r\n startScreen3.style.display = 'none';\r\n startScreen4.style.display = 'none';\r\n startScreen5.style.display = 'none';\r\n singleClickElement.style.display = 'flex';\r\n doubleClickElement.style.display = 'flex';\r\n initialize();\r\n startTimer();\r\n}", "title": "" }, { "docid": "654a5fd6c71d75db6742dc4e7fb2799f", "score": "0.68160677", "text": "function levelTwoScreen(){\n\t\t\tlevelTwoScreen = initScene();\n\t\t\tvar twoBackground = initPlaneMesh('startlevel2.jpg');\t\t// transition screen\n\t\t\ttwoBackground.scale.set(150,100,1);\n\t\t\ttwoBackground.position.set(0,0,0);\n\t\t\tlevelTwoScreen.add(twoBackground);\n\t\t\t//LIGHTS\n\t\t\tvar light1 = createPointLight();\n\t\t\tvar light2 = createPointLight();\n\t\t\tlight1.position.set(10,0,150);\n\t\t\tlight2.position.set(-10,0,150);\n\t\t\tlevelTwoScreen.add(light1);\n\t\t\tlevelTwoScreen.add(light2);\n\t\t\t//TEXT\n\t\t\t// initTextMesh('Level Two: \\nRegenesis', levelTwoScreen, 0x336633);\n\t\t\t// console.log(\"added textMesh to scene\");\n\t\t\t//CAMERA\n\t\t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 1000 );\n\t\t\tstartCam.position.set(0,0,50);\n\t\t\tstartCam.lookAt(0,0,0);\n\t\t}", "title": "" }, { "docid": "a5bd0076a714773a9df1281779f13bde", "score": "0.6805707", "text": "function startScreen() {\n\thighscoreArea.style.display = 'none';\n\thighScoreButton.style.display = 'block';\n\tstartArea.style.display = 'block';\n}", "title": "" }, { "docid": "9bd069595194e1095c5dd82747a92623", "score": "0.6798516", "text": "function startScreen() {\n textFont('Georgia');\n textSize(55);\n textAlign(CENTER);\n fill(252, 186, 3);\n text(\"TREASURE HUNT\", width/2, height/2 - 90);\n\n //sets up difficulty options\n showEasyButton();\n showMediumButton();\n showHardButton();\n }", "title": "" }, { "docid": "6bc2467d4720215b2980f441cc98243d", "score": "0.6785814", "text": "startGame() {\r\n\t\tthis.resetGameBoard();\r\n\t\tconst screenOverlay = document.getElementById('overlay'); // Get the screen overlay\r\n\t\tscreenOverlay.style.display = 'none'; // Hide the screen overlay\r\n\t\tthis.activePhrase = this.getRandomPhrase(); // Set active phrase to a random phrase\r\n\t\tthis.activePhrase.addPhraseToDisplay(); // render the empty boxes for the active phrase\r\n\t}", "title": "" }, { "docid": "b0418ba3ef7567adaba26c0463460b52", "score": "0.6770842", "text": "function startOver (){\n\tdocument.getElementById(\"overlay\").style.display = \"none\";\n\t//should clear all the divs that were created in previous initscreen\n\tclearScreen(); // define this\n\tinitMatrix();\n\tinitScreen();\n\tStartGame(50);\n}", "title": "" }, { "docid": "fac25010b63d0da415b629b5ef928724", "score": "0.67477816", "text": "function startScreen() {\n\n // push() and pop()\n //\n // To keep the text size, text font, and text alignment\n // from spreading trough other text that I might add\n push();\n\n // Adding a new font\n textFont(quantumfont);\n\n // To adjust my font size\n textSize(70);\n\n // text alignment\n textAlign(CENTER, CENTER);\n\n // No stroke\n noStroke();\n\n // Title of the game\n text(\"Mountain Jump\", width / 2, height / 4);\n\n pop();\n\n // Push and pop\n //\n // Adding new text under the title\n push();\n\n // Adding the same font\n textFont(quantumfont);\n\n // Font size\n textSize(20);\n\n // textAlign\n textAlign(CENTER, CENTER);\n\n // No stroke\n noStroke();\n\n // fill\n fill(255);\n\n // Setting up for text\n let startText = \"Press a button\\n\";\n startText = startText + \"to start\";\n text(startText, width / 2, height - 200);\n\n pop();\n\n // The game starts when a button is pressed\n if (keyIsPressed) {\n state = \"playGame\";\n\n // Play bgm\n mountMusic.playMode(\"untilDone\");\n mountMusic.loop();\n mountMusic.volume = 0.5;\n\n }\n}", "title": "" }, { "docid": "c74da0c2aedfa19239b600b9cdc5a749", "score": "0.6745972", "text": "start() {\n\t\tthis.init();\n\t\t$('#start-game-btn').hide();\n\t}", "title": "" }, { "docid": "05b443160cc234e2e149331e0fdb83c6", "score": "0.67430276", "text": "function openingScreen() {\n\tlet startScreen = \"<p id='startButton' style='background-color: orange; padding: 10px;'>Start the Quiz!</p>\";\n\t$('#gameArea').html(startScreen);\n}", "title": "" }, { "docid": "d8b0fe8c3b8adfe10be2621dc1856039", "score": "0.67394096", "text": "startScene() {\n this.game.scene = 'start';\n this.game.over = false;\n this.game.clearAllEntities();\n this.game.camera = null;\n\n this.greenGloop = new PlayerCharacter(this.game, AM, GLOOP_SHEET_PATHS_GREEN, true);\n this.purpleGloop = new PlayerCharacter(this.game, AM, GLOOP_SHEET_PATHS_PURPLE, true);\n this.orangeGloop = new PlayerCharacter(this.game, AM, GLOOP_SHEET_PATHS_ORANGE, true);\n this.blueGloop = new PlayerCharacter(this.game, AM, GLOOP_SHEET_PATHS_BLUE, true);\n\n this.startScreen = new StartScreen(this.game, AM, this.greenGloop, this.purpleGloop, this.orangeGloop, this.blueGloop);\n this.game.sceneObj = this.startScreen;\n this.startButton = new StartButton(this.game, AM);\n this.arrow = new Arrow(this.game);\n\n this.game.addEntity(this.startButton, 'general');\n this.game.addEntity(this.arrow, 'general');\n\n this.game.addGloop(this.greenGloop, 'green');\n this.game.addGloop(this.purpleGloop, 'purple');\n this.game.addGloop(this.orangeGloop, 'orange');\n this.game.addGloop(this.blueGloop, 'blue');\n\n this.game.draw();\n this.nameForm.style.display = 'none';\n }", "title": "" }, { "docid": "4ef3bae8d2fdb1ad6071eab8f3902877", "score": "0.67356133", "text": "function startScreen() {\r\n\t\t$(\".content\").empty();\r\n\t\t$(\"#intro\").html(\"<h2> Press Start to begin</h2> <p id='start'>start</p>\");\r\n\t}", "title": "" }, { "docid": "5f317b65aff0c79f827aa3f4646c61c0", "score": "0.6731371", "text": "function GameScreenAssistant() { }", "title": "" }, { "docid": "23e18449ebf30a6f5c454fdc98118d34", "score": "0.67303246", "text": "function displayGameScreen()\n{\n\t\n\tdisplayResourceElement();\n\t\t\t\n\tdisplayInfoElement();\n\t\n\tdisplayMapElement();\n\t\n\tjoinGame();\n\t\n\tif(player.onTurn == true)\n\t{\n\t\tdisplayEndTurnElement(\"salmon\");\n\t\t\n\t\tdisplayTurnCounterElement(\"lightGreen\");\n\t}\n\telse\n\t{\n\t\tdisplayEndTurnElement(\"lightSlateGrey\");\n\t\n\t\tdisplayTurnCounterElement(\"salmon\");\n\t}\n\t\n\tgameStarted = true;\n\t\n\tstage.update();\n}", "title": "" }, { "docid": "d2e67046bf23decf86289460f6a82098", "score": "0.6721036", "text": "function startGame() {\n removeSplashScreen();\n game = new Game();\n game.gameScreen = buildGameScreen();\n game.start();\n\n game.passGameOverCallback(function() {\n buildSplashScreen();\n });\n }", "title": "" }, { "docid": "d3a1cdc57695a5651e63d289d502a8a7", "score": "0.6700872", "text": "function startGame()\n{\n\t//remove all children from stage\n\tstage.removeAllChildren();\n\t\n\t//tell other clients to start the game\n\tmessageArray = [\"startGame\"];\n\tupdater(messageArray);\n\t\n\tdisplayGameScreen();\n\t\n}", "title": "" }, { "docid": "d3ba72ea4fae80eb8e9821062e875d51", "score": "0.66973907", "text": "function BeforeGame(){\r\n\tif(StarSc === true){\r\n createScreens(\"StartScreen\");\r\n }\r\n \r\n\tfunction mousePosStart(event) {\r\n var x = event.clientX;\r\n var y = event.clientY;\r\n \r\n //go back to menu screen\r\n if(x > 494 && x < 605 && y > 493 && y < 529 && goBack === true && finished === false){\r\n \tgoBack = false;\r\n \tstopClicks = 0;\r\n \tworld.removeChild(nonGamePlayScreens[\"StartScreen\"]);\r\n \tcreateScreens(\"StartScreen\");\r\n }\r\n \r\n //instruction screen\r\n if(x > 744 && x < 957 && y > 340 && y < 403 && stopClicks === 0 && finished === false){\r\n \tgoBack = true;\r\n \tStarSc = false;\r\n \tstopClicks = 1;\r\n \tworld.removeChild(nonGamePlayScreens[\"Instruction\"]);\r\n \tcreateScreens(\"Instruction\");\r\n }\r\n \r\n //credits screen\r\n if(x > 744 && x < 957 && y > 426 && y < 491 && stopClicks === 0 && finished === false){\r\n \tgoBack = true;\r\n \tStarSc = false;\r\n \tstopClicks = 1;\r\n \tworld.removeChild(nonGamePlayScreens[\"Credits\"]);\r\n \tcreateScreens(\"Credits\");\r\n }\r\n \r\n //start game\r\n if(x > 720 && x < 980 && y > 234 && y < 319 && goBack === false && finished === false){\r\n RemoveScreens();\r\n \tstopClicks = 1;\r\n \tstart = true;\r\n }\r\n\t}\r\n \r\n\t$(\"#canvas\").on(\"click\", function (event) {\r\n mousePosStart(event);\r\n\t});\r\n}", "title": "" }, { "docid": "2b69b9cf77a03b4db1309854685dc097", "score": "0.6697077", "text": "function initPage() {\n // Creamos el juego con 5 capas\n var myGame = new Game(5);\n // Creamos el menu principal\n myGame.registerManagerForStatus(CONS.status.MENU, new Menu(myGame, mainMenuConfig));\n\n // Agregamos el juego que es singleplayer\n myGame.registerManagerForStatus(CONS.status.GAME_SINGLE, new GameSM(myGame, false, false, 0, 2));\n myGame.registerManagerForStatus(CONS.status.GAME_MULTI, new GameSM(myGame, true, true, 0, 2));\n // Establecemos el status inicial como Ejecutando el juego\n myGame.setCurrentStatus(CONS.status.MENU);\n myGame.showFPS(true);\n\n myGame.start();\n}", "title": "" }, { "docid": "04a65f80c46dad8e0380e07ba3e7c86f", "score": "0.6695787", "text": "function startGameScreen() {\n const startGameButton = document.createElement('button');\n startGameButton.classList.add('startBtn');\n startGameButton.classList.add('pulse');\n startGameButton.classList.add('animated');\n startGameButton.classList.add('infinite');\n startGameButton.innerHTML = 'Start Game';\n startScreen.appendChild(startGameButton);\n startGameButton.addEventListener('click', startGame);\n\n //music\n musicOff.addEventListener('click', playMusic);\n musicOn.addEventListener('click', pauseMusic);\n}", "title": "" }, { "docid": "173a8c3e01c4494daba5401060b6245c", "score": "0.66945934", "text": "function startGame() {\n\n\tcloseStartModal();\n\tshuffleCards();\n\tshowTime();\n}", "title": "" }, { "docid": "de988d13b089b6a733b59bebf881a6ee", "score": "0.6687421", "text": "start(){\r\n if(gameState ===0){\r\n player=new Player();\r\n player.getCount();\r\n form =new Form ();\r\n form.display();\r\n }\r\n }", "title": "" }, { "docid": "eeba97219f0781817224f365d4c0b668", "score": "0.66513336", "text": "function initGameScreen() {\n gameGrid = new GameGrid(\n GameConfig.canvasHeight,\n GameConfig.canvasWidth,\n GameConfig.cellSquareSize,\n GameConfig.getIsDarkMode()\n );\n gameGrid.createNewTetrimino(/*1*/);\n gameGrid.drawScreen();\n}", "title": "" }, { "docid": "ce285cca1609972598d208657825a5f2", "score": "0.66442555", "text": "function GameStart () {\n\twindow.scrollTo(0,1);\n\t//document.documentElement.requestFullscreen();\n\tmain = {} ;\n\t//load Graphical Stuff\n\twebGlInit( main ) ; \n\t//load Sounds stuff \n\tsoundInit( main ) ;\n\n\t\n\n\tstartAGame( main )\n\t\n}", "title": "" }, { "docid": "c8129fe2d2e1d5567299c76429b12a9f", "score": "0.6641855", "text": "function startScreen() {\n isClicked = \"false\";\n createjs.Sound.stop();\n this.sound = \"yay\";\n createjs.Sound.play(this.sound);\n road = new objects.road(assets.getResult(\"road\"));\n stage.addChild(road);\n start = new createjs.Bitmap(assets.getResult(\"start\"));\n start.x = 180;\n start.y = 200;\n stage.addChild(start);\n how = new createjs.Bitmap(assets.getResult(\"how\"));\n how.x = 180;\n how.y = 350;\n stage.addChild(how);\n logo = new createjs.Bitmap(assets.getResult(\"logo\"));\n logo.x = 700;\n logo.y = 170;\n stage.addChild(logo);\n start.on(\"click\", startButtonClicked);\n start.on(\"mouseover\", startButtonOver);\n start.on(\"mouseout\", startButtonOut);\n how.on(\"click\", howButtonClicked);\n how.on(\"mouseover\", howButtonOver);\n how.on(\"mouseout\", howButtonOut);\n}", "title": "" }, { "docid": "1d52248981e413f1ecd6f89207a73339", "score": "0.6640503", "text": "startCreation () {\r\n\t\tthis.inCreation = new Game()\r\n\t}", "title": "" }, { "docid": "c7d4ba85aad6824869a55eb7cac2cbc5", "score": "0.66112566", "text": "start() {\r\n if (gameState === 0) {\r\n\r\n player = new Player();\r\n player.getCount();\r\n form = new Form();\r\n form.display();\r\n\r\n }\r\n }", "title": "" }, { "docid": "45978b660da4ac0f58f03d0112bca6f4", "score": "0.6609429", "text": "function levelOneScreen(){\n\t\tlevelOneScreen = initScene();\n\t\tvar oneBackground = initPlaneMesh('startlevel1.jpg');\t// transition screen\n\t\toneBackground.scale.set(150,100,1);\n\t\toneBackground.position.set(0,0,0);\n\t\tlevelOneScreen.add(oneBackground);\n\t\t//LIGHTS\n\t\tvar light1 = createPointLight();\n\t\tvar light2 = createPointLight();\n\t\tlight1.position.set(10,0,150);\n\t\tlight2.position.set(-10,0,150);\n\t\tlevelOneScreen.add(light1);\n\t\tlevelOneScreen.add(light2);\n\t\t//TEXT\n\t\t// initTextMesh('Level One: \\nThe Wasteland', levelOneScreen, 0x8B0000);\n\t\t// console.log(\"added textMesh to scene\");\n\t\t//CAMERA\n\t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 1000 );\n\t\tstartCam.position.set(0,0,50);\n\t\tstartCam.lookAt(0,0,0);\n\t\t//HINT\n\t\tvar infoUp = document.getElementById(\"infoUp\");\n\t\tinfoUp.style.display = 'none';\n\t\t infoUp.innerHTML=\n\t\t\t'<div style=\"font-size:12pt\">Welcome to the wasteland. After years of ' +\n\t\t\t'exploitation, misuse, and abuse by humankind, the planet and it\\'s resources ' +\n\t\t\t'are in a state of total devastation. But there is hope! Perhaps if you spent some '+\n\t\t\t'time cleaning up all of the pollution, you may have a chance to reverse the damage...';\n\t}", "title": "" }, { "docid": "9ca6973d72b6ff1b0140e3371f6dad89", "score": "0.659298", "text": "function startNewGame(){\n\ttoggleNewGameSettings();\n\tnewGame();\n}", "title": "" }, { "docid": "8e3316e3994db3a8930e2a47f67bdbd6", "score": "0.658782", "text": "function init() {\n reset(); // Calls the startScreen function, which draws start screen.\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "39dc96a7a3ad6d2908186cf5f745132a", "score": "0.6585722", "text": "function startScreen() {\n\tbackground(0);\n\tfill(255);\n\ttextSize(70);\n\ttextAlign(CENTER);\n\ttext(\"Welcome to Game Project!\", width / 2, height / 3)\n\ttextSize(50);\n\ttext(\"WASD to move and Left Click to shoot\", width / 2, 0.60 * height)\n\ttext(\"Press Space to Start\", width / 2, 0.75 * height)\n\n\tif (keyIsDown(32)) {\n\t\tstate = \"gameOn\"; //press space and state of game will change\n\t}\n}", "title": "" }, { "docid": "8420fba99ebe6b911c0b4653717a6c8a", "score": "0.6579654", "text": "function startGame() {\n removeSplashScreen();\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n game.start();\n\n game.backgroundMusic.play();\n}", "title": "" }, { "docid": "81d7e2cf5e1d47ce52af39532690d46a", "score": "0.657654", "text": "function startGame() {\n\t\tcountDown();\n\t\tshowCountdown();\n\t\t//displayQuestions();\n\t}", "title": "" }, { "docid": "05f856d220bc67df2205f4cfc47e9278", "score": "0.6569274", "text": "function _OpenStartscreen () {\t\n\tscreenUp = true;\n\tCancelInvoke(\"ActivateInView\");\n\tif (projector.enabled) {\n\t\tprojecting = true;\n\t\tprojector.enabled = false;\n\t} else {\n\t\tprojecting = false;\n\t}\n}", "title": "" }, { "docid": "4f06d03a86067caf113f07a26a3b067d", "score": "0.6567673", "text": "function missionWinScreen() {\n cleanup();\n API.playSoundFrontEnd(\"SCREEN_FLASH\", \"CELEBRATION_SOUNDSET\");\n API.showColorShard(\"Mission Success\", \"Great job and good luck on the next one.\", 2, 18, 5000);\n fullCleanup();\n}", "title": "" }, { "docid": "3f03163175aae65a31a70a025abcc34b", "score": "0.65609854", "text": "function initialScreen() {\n\t\tstartScreen = \"<p class='text-center main-button-container'><a class='btn btn-primary btn-lg btn-block start-button' href='#' role='button'>Start Quiz</a></p>\";\n\t\t$(\".mainArea\").html(startScreen);\n\t}", "title": "" }, { "docid": "aa2472c449e43232b61c4431da35120b", "score": "0.65417075", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n gd.allGameObjects[0].returnToStart();\n gd.landscape.build();\n document.getElementsByClassName('info-panel')[0].textContent = \"Game is running.\"; \n }", "title": "" }, { "docid": "39cef046c8ecff8db462c907566065bb", "score": "0.65355194", "text": "function startGame(){\n\t\tgameSetup();\t\n\t\tkeyboardListeners();\n\t\tshowScores();\n\t}", "title": "" }, { "docid": "6241e4890230804881248080ab724ae0", "score": "0.653487", "text": "function startGame()\n\t{\n\t\t//Create player\n\t\tplayer = createPlayer();\n\t\t\n\t\t//Create worlds\n\t\tworldMidgard = createMidgardWorld();\n\t\tworldVanaheim = createVanaheimWorld();\n\t\tworldJotunheim = createJotunheimWorld();\n\t\tworldMuspells = createMuspellsWorld();\n\t\tworldNiflheim = createNiflheimWorld();\n\t\tworldSvart = createSvartWorld();\n\t\tworldAlf = createAlfWorld();\n\t\t\t\n\t\t//Set current world to Midgard\n\t\tcurWorld = worldMidgard;\n\t\t\t\t\n\t\t//Display room\n\t\tdisplayRoom();\n\t\t\t\n\t\t//Process enter events\n\t\tprocessStartEvents();\n\t}", "title": "" }, { "docid": "3daebf9a2b2b1e1f3848664fbce2de03", "score": "0.6534176", "text": "function initialScreen() {\n\tstartScreen = \"<p class='text-center main-button-container'><a class='btn btn-primary btn-lg btn-block start-button' href='#' role='button'>START</a></p>\";\n\t$(\".mainArea\").html(startScreen);\n}", "title": "" }, { "docid": "3daebf9a2b2b1e1f3848664fbce2de03", "score": "0.6534176", "text": "function initialScreen() {\n\tstartScreen = \"<p class='text-center main-button-container'><a class='btn btn-primary btn-lg btn-block start-button' href='#' role='button'>START</a></p>\";\n\t$(\".mainArea\").html(startScreen);\n}", "title": "" }, { "docid": "9447aaee2ea9576971b8df136a88dde0", "score": "0.6530827", "text": "Start() {\n // add children to the stage\n this.addChild(this._background);\n this.addChild(this._nextBattleLabel);\n this.addChild(this._scoreBoard.ScoreLabelA);\n this.addChild(this._scoreBoard.ScoreLabelB);\n this.addChild(this._descriptionLabel);\n this.addChild(this._nextButton);\n this.Main();\n }", "title": "" }, { "docid": "b0f1af1dcccd33c3c9e29186e7f8475a", "score": "0.6513071", "text": "startGame () {\n const startDiv = document.getElementById('overlay');\n startDiv.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n this.backgroundColor();\n }", "title": "" }, { "docid": "da07d9f5a70c127c1960533acbaedece", "score": "0.6504455", "text": "function startGame() {\n // Fetch usercar\n userCar = new Component(\n 50,\n 100,\n \"./images/user-car.png\",\n lanePosition[carPosition],\n 550,\n \"image\"\n );\n\n //Fetch road\n myBackground = new Component(\n 500,\n 700,\n \"./images/road.png\",\n 0,\n 0,\n \"background\"\n );\n\n //Setup score and bullet and hide the start screen\n myScore = new Component(\"20px\", \"Consolas\", \"white\", 350, 40, \"text\");\n myBullet = new Component(\"20px\", \"Consolas\", \"White\", 40, 40, \"text\");\n startContainer.style.display = \"none\";\n myGameArea.start();\n}", "title": "" }, { "docid": "9d6c11a1bc6d5472692e71bb6e4cd9cd", "score": "0.65014666", "text": "function GUIStartScreen(stage) {\n _super.call(this, stage);\n }", "title": "" }, { "docid": "b07e23b79b4fac40db8871cf63369854", "score": "0.6500702", "text": "function screenSetup() {\n showScreen(currentScreen);\n\n addListeners(\"previous-screen-button\", -1);\n addListeners(\"next-screen-button\", 1);\n}", "title": "" }, { "docid": "94992c68f1a2df232d21e271bcc21221", "score": "0.64973044", "text": "function startGame() {\n\n\t\t// Set up initial game settings\n\t\tplayGame = false;\n\t\t\t\n\t}", "title": "" }, { "docid": "efb8e12f9344be1c8b4cdfd72a9f55db", "score": "0.64805484", "text": "startGame() {\n\t\t//hides start screen overlay on div element\n\t\tdocument.querySelector('#overlay')\n\t\t\t.style.display = 'none';\n\t\t//this.activePhrase equal to this.getRandomPhrase to call this method\n\t\tthis.activePhrase = this.getRandomPhrase();\n\t\t//this.activePhrase used again to call method in phrase.js file\n\t\tthis.activePhrase.addPhraseToDisplay();\n\t}", "title": "" }, { "docid": "62f5c5c3e1106025d7a1adb96cdbfb59", "score": "0.646855", "text": "function levelThreeScreen(){\n\t\t\tlevelThreeScreen = initScene();\n\t\t\tvar threeBackground = initPlaneMesh('startlevel3.jpg');\t\t// transition screen\n\t\t\tthreeBackground.scale.set(150,100,1);\n\t\t\tthreeBackground.position.set(0,0,0);\n\t\t\tlevelThreeScreen.add(threeBackground);\n\t\t\t//LIGHTS\n\t\t\tvar light1 = createPointLight();\n\t\t\tvar light2 = createPointLight();\n\t\t\tlight1.position.set(10,0,150);\n\t\t\tlight2.position.set(-10,0,150);\n\t\t\tlevelThreeScreen.add(light1);\n\t\t\tlevelThreeScreen.add(light2);\n\t\t\t//TEXT\n\t\t\t// initTextMesh('Level Three: \\n Paradise', levelThreeScreen, 0x336633);\n\t\t\t// console.log(\"added textMesh to scene\");\n\t\t\t//CAMERA\n\t\t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 1000 );\n\t\t\tstartCam.position.set(0,0,50);\n\t\t\tstartCam.lookAt(0,0,0);\n\t\t}", "title": "" }, { "docid": "0a82c77ce2e89b008a5d13afc5841684", "score": "0.6468365", "text": "function initialScreen() {\r\n initCoord();\r\n initbricks();\r\n draw();\r\n\r\n //Initial welcome message\r\n ctx.globalAlpha = 0.6;\r\n ctx.fillStyle = \"#004d1a\";\r\n ctx.fillRect(0, 0, width, height);\r\n ctx.globalAlpha = 1;\r\n ctx.font = \"italic 40px Arial Black\";\r\n ctx.fillStyle = \"white\";\r\n ctx.fillText(\"The\", 360, 270);\r\n ctx.font = \"50px Arial Black\";\r\n ctx.fillStyle = \"#000099\";\r\n ctx.fillText(\"BRICK GAME!\", 220, 330);\r\n init_mouse();\r\n }", "title": "" }, { "docid": "16b969755ab6fd0de3971a89d87392a2", "score": "0.6465121", "text": "function startGame() {\n if (!document.querySelector(\"input\").value) {\n inputNameMain = \"filty landlubber\"\n } else {\n var inputNameMain = document.querySelector(\"input\").value;\n }\n\n removeSplashScreen();\n removeGameOverScreen();\n\n game = new Game(inputNameMain);\n game.gameScreen = createGameScreen();\n\n // function that starts the game loop\n game.start();\n\n // after the game loop inside game.start ends, below callback function will run\n game.passGameOverCallback(gameOver);\n }", "title": "" }, { "docid": "2d8a2dbcac3434e891559970687e0461", "score": "0.6463603", "text": "function initScreen(evt)\n{\n\n\n}", "title": "" }, { "docid": "d910f0739a58973094a6702e3766ebf2", "score": "0.64591706", "text": "startGame () {\r\n // Hide the start screen overlay\r\n document.querySelector('#overlay').style.display = 'none';\r\n \r\n // Call the getRandomPhrase method to select mystery phrase for this round\r\n this.activePhrase = this.getRandomPhrase();\r\n \r\n // Draws this.activePhrase to the board \r\n this.activePhrase.addPhraseToDisplay();\r\n }", "title": "" }, { "docid": "058b62c0ad57cf6215f5d979cd3ef09d", "score": "0.64546275", "text": "function startScreen() {\n\n console.log(\"here is the title?\") ;\n textFont(\"Helvetica\");\n textSize(50);\n textAlign(CENTER, CENTER);\n noStroke();\n fill(230, 10, 10);\n text(\"Fruit Blender\", width / 2, height / 4);\n\n if (mouseIsPressed) {\n state = \"game\";\n }\n}", "title": "" }, { "docid": "d1ec9288405c514cd240e8555bea6a76", "score": "0.6453147", "text": "function startScreen(){\n //after the program is restarted, everything on the screen is displaced\n //this corrects that displacement\n if(restarted===true){\n translate(-1/2*width,-1/2*height);\n }\n\n background(100);\n rectMode(CENTER);\n textAlign(CENTER, CENTER);\n textFont(inconsolata);\n \n //sets stroke, size, and fill for title\n noStroke();\n textSize(100);\n fill(0,255,100);\n\n //title\n text(\"3D Snake\",width/2, height/8);\n \n //buttons\n stroke(0);\n strokeWeight(1);\n fill(200);\n rect(width/2, height/2, width/4, height/8);\n rect(width/2, height/2+height*1/4, width/4, height/8);\n\n //displays words\n noStroke();\n textSize(25);\n fill(0);\n text(\"Start Game\",width/2, height/2);\n text(\"Main Menu\",width/2, height/2+height*1/4);\n\n if(mouseX>width/2-width/8&&mouseX<width/2+width/8&&mouseY>height/2-height/16&&mouseY<height/2+height/16&&mouseIsPressed){\n //when mouse clicks options button, sets state to play and calls setup again to start the game\n if(gameMode===\"Two Player\"){\n state=\"Select Game Type\"\n setup();\n }else{\n state=\"Play\";\n setup();\n }\n }else if(mouseX>width/2-width/8&&mouseX<width/2+width/8&&mouseY>height/2+height*1/4-height/16&&mouseY<height/2+height*1/4+height/16&&mouseIsPressed){\n //when mouse clicks options button, sets state to play and calls setup again to start the game\n state=\"Main Menu\";\n setup();\n }\n\n //settings\n if(mouseX>width*1/16-25&&mouseX<width*1/16+25&&mouseY>height*1/8-25&&mouseY<height*1/8+25){\n settingIcon(true);\n if(mouseIsPressed){\n //when mouse clicks options icon, sets state to options and calls setup again to open options screen\n state=\"Options\";\n setup();\n }\n }else{\n settingIcon(false);\n }\n\n //store\n if(gameMode!==\"Two Player\"){\n if(mouseX>width*15/16-25&&mouseX<width*15/16+25&&mouseY>height*1/8-25&&mouseY<height*1/8+25){\n StoreIcon(true);\n if(mouseIsPressed){\n //when mouse clicks store icon, sets state to store and calls setup again to open store screen\n state=\"Store\";\n setup();\n }\n }else{\n StoreIcon(false);\n }\n }\n}", "title": "" }, { "docid": "ebf97e7ed11744689d7044a0a0445617", "score": "0.6451317", "text": "function drawintroscreen() {\n\t// Draw name of the game\n\tdrawDoubleText(\"TRON\", \"green\", \"120px serif\", g_canvas.width/2, 100);\n\n\t// Draw game instructions\n\tdrawText(\"Controls:\", \"\", \"32px serif\", 400, 200)\n\tdrawInstructions(\"Player 1\", \"W\", \"D\", \"S\", \"A\", 350, 300, \"#FF69B4\");\n\tdrawInstructions(\"Player 2\", \"I\", \"L\", \"K\", \"J\", 450, 300, \"#00FFFF\");\n\n\tdrawText(\"press ENTER to start the game\", \"\", \"24px serif\", 400, 380);\n\n\tvar quarterWidth = g_canvas.width/5;\n\tvar halfWidth = g_canvas.width/2;\n\tvar width = quarterWidth-10;\n\n\t// Game modes\n\tvar modes = [\n\t\t{text: \"PvP\", fontColor: \"green\", backgroundColor: \"#ff00ff\"},\n\t\t{text: \"normal play\", fontColor: \"green\", backgroundColor: \"summer\"},\n\t\t{text: \"snake\", fontColor: \"green\", backgroundColor: \"blue\"},\n\t\t{text: \"level play\", fontColor: \"green\", backgroundColor: \"silver\"}\n\t];\n\n\t// Draw different game types\n\tfor(var i = 0; i < modes.length; i++) {\n\t\tvar mode = modes[i];\n\t\tdrawTextInCenteredBox(mode.text, mode.fontColor, \"22px aria\", mode.backgroundColor, quarterWidth*(i+1), 500, width, 40);\n\t}\n\n\t// Draw instructions how to choose game type\n\tdrawText(\"use M to change playmode\", \"\", \"45px aria\", g_canvas.width/2, 550);\n\n\t// Draw the current chosen type\n\tvar currentMode = modes[playmode-1];\n\tdrawText(\"Selected: \", \"#fff\", \"22px aria\", halfWidth-50, 440);\n\tdrawTextInCenteredBox(currentMode.text, currentMode.fontColor, \"22px aria\", currentMode.backgroundColor, halfWidth+50, 440, width, 40);\n}", "title": "" }, { "docid": "37b47221877818b3c204db314e3b9df9", "score": "0.6445065", "text": "function startGame() {\n\t\t// Show the game board with player 1 selected\n\t\tstart.style.display = 'none';\n\t\tboard.style.display = 'block';\n\t\tfinish.style.display = 'none';\n\t\tsetupPlayerOne();\n\n\t\t// Clear all element classes from previous game\n\t\tfor(let index = 0; index < boxes.children.length; index++) {\n\t\t\tboxes.children[index].className = 'box';\n\t\t}\n\t\t\n\t\t// Reset all boxes as unmarked\n\t\tboxList = [new Box(1), new Box(2), new Box(3),\n\t\t\t\t new Box(4), new Box(5), new Box(6),\n\t\t\t\t new Box(7), new Box(8), new Box(9)];\n\t\t\n\t\t// Get and show name of player\n\t\tplayerName = name.value;\n\t\tshowName.textContent = playerName;\n\t}", "title": "" }, { "docid": "a24fffc6c3149c2f82269b4e5e7a268e", "score": "0.6440606", "text": "function startScreen () {\r\n \r\n// creates disembodied elements to append to body\r\nvar $screenStartDiv = $('<div></div>');\r\nvar $screenStartPlayer = $('<h3></h3>');\r\nvar $screenStartHeader = $('<header></header>');\r\nvar $screenStarth1 = $('<h1></h1>');\r\nvar $screenStartAnchor = $('<a></a>');\r\nvar $screenStartP1 = $('<input>');\r\nvar $screenStartP2 = $('<input>');\r\nvar $screenStartCompButton = $('<a></a>');\r\n \r\n//sets attributes of disembodied elements \r\n$screenStartDiv.attr({ \r\n class: 'screen screen-start',\r\n id: 'start'\r\n});\r\n$screenStartAnchor.attr({ //start game button\r\n href: '#',\r\n class: 'button',\r\n id: 'startGame'\r\n});\r\n$screenStartP1.attr({ //Player 1 name input\r\n type: 'text',\r\n id: 'player1input',\r\n placeholder: 'Player 1 Name'\r\n});\r\n$screenStartP1.css({\r\n margin: '20px'\r\n});\r\n$screenStartP2.attr({ ////Player 1 name input\r\n type: 'text',\r\n id: 'player2input',\r\n placeholder: 'Player 2 Name'\r\n});\r\n$screenStartCompButton.attr({ //Play computer button\r\n href: '#',\r\n class: 'button',\r\n id: 'computer'\r\n}); \r\n$screenStartAnchor.text('Start Game');\r\n$screenStarth1.text('Tic Tac Toe'); \r\n$screenStartCompButton.text('Play Computer');\r\n\r\n//Appends disembodied elements to header \r\n$screenStartHeader.append($screenStarth1);\r\n$screenStartHeader.append($screenStartAnchor);\r\n$screenStartPlayer.append($screenStartP1); \r\n$screenStartPlayer.append($screenStartP2);\r\n$screenStartHeader.append($screenStartPlayer);\r\n$screenStartHeader.append($screenStartCompButton);\r\n$screenStartDiv.append($screenStartHeader);\r\n//header appended to body after game board <div> \r\n \r\n$screenStartDiv.insertAfter('#board'); \r\n}", "title": "" }, { "docid": "26aa84dece7484b8fa5df12913b95101", "score": "0.6433464", "text": "function initGame(){\r\n\t// Esconde a form de seleção de char \r\n\tdocument.getElementById(\"divCharCreation\").style.display = \"none\";\r\n\tdocument.getElementById(\"info\").style.display = \"none\";\r\n\r\n\t// Inicia o jogo\r\n\tcube = new Phaser.Game(1024, 768, Phaser.AUTO, \"hypercube_online\", { preload: preload, create: eurecaClientSetup, update: update, render: render});\r\n}", "title": "" }, { "docid": "69ced34945b98ff756972c35486f18bb", "score": "0.64309245", "text": "startNewGame() {\n // FIXME: events are not getting registered\n App.init();\n }", "title": "" }, { "docid": "c5c6711143af41d056e7fbff4d9565cf", "score": "0.6429463", "text": "function showStartScreen(){\n $('.questionScreen').hide();\n $('.answerScreen').hide();\n $('.statScreen').hide();\n $('.startScreen').show();\n}", "title": "" }, { "docid": "1e10f0ed5a6ef20c02263cbace6a369b", "score": "0.6411658", "text": "function startMenu() {\n // start menu\n image(earth, width/2, height/2, width, height);\n\n if (state === 0) {\n // title screen\n fill(217, 128, 38);\n text(\"WELCOME TO EQUESTRIA\", width/2, textTop);\n\n // options\n newGame();\n loadGame();\n }\n\n else if (state === 1) {\n // load game\n backButton();\n showSaves();\n }\n}", "title": "" }, { "docid": "09d46bad4b4fb0aa60df174fe6d81729", "score": "0.64097255", "text": "function drawStartScreen() {\n\t\tcontext.fillStyle = \"rgb(0,0,0)\";\n\t\tcontext.fillRect (0, 0, canvas.width, canvas.height);\n\t\tcontext.fillStyle = \"rgb(255, 255, 255)\";\n\t\tcontext.font = \"bold 16px sans-serif\";\n\t\tcontext.fillText(\"Space Invaders\", canvas.width / 3, canvas.height / 2);\n\t\tcontext.font = \"bold 12px sans-serif\";\n\t\tcontext.fillText(\"Press Space to start!\", \n\t\t\tcanvas.width / 5, canvas.height / 2 + canvas.height / 4);\n\t}", "title": "" }, { "docid": "e6733f862b4210f4fd980467c9c5f929", "score": "0.64002734", "text": "function winScreen() {\n\t\n\tPhaser.State.call(this);\n\t\n}", "title": "" }, { "docid": "9762960ad4fde7ed0df46e0cdf6bcb1e", "score": "0.63978875", "text": "function showStartScreen() {\n $(\"#start-screen\").show();\n $(\"#what-to-expect\").hide();\n $(\"#tips\").hide();\n $(\"#question-display\").hide();\n $(\"#question-result-display\").hide();\n $(\"#test-result-display\").hide();\n }", "title": "" }, { "docid": "f0539f9ca718dc891c85c5c38c9d8e88", "score": "0.63933", "text": "function startScreen() {\n fightCont = $(\"#fighters\");\n const h3 = genElement(\"<h3>\", 'remove-title text-center', null).text(\"Choose a Fighter\");\n const fighterImages = genFighters(fighterObj, \"fighter\");\n fightCont.append(h3, fighterImages);\n $(\".fighter\").click(choosePlayer);\n}", "title": "" }, { "docid": "adbe2036c720934ffbf727e2c6425a3a", "score": "0.63889146", "text": "function handleGameStart() {}", "title": "" }, { "docid": "178dc1c8d7c61e4de14a166d5a186a1c", "score": "0.638692", "text": "startGame() {\n // hide overlay\n const overlay = document.querySelector('#overlay');\n overlay.style.display = 'none';\n\n // Set random phrase as active\n this.activePhrase = new Phrase(this.getRandomPhrase().phrase);\n\n // add phrase to screen\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "938873ed6e5b5728b253040281cb07a2", "score": "0.6385539", "text": "drawStartScreen() {\n this.drawContext.clearRect(0, 0, this.currentWidth, this.currentHeight);\n\n Draw.singleLineText(\n this.drawContext,\n 'Back Online!',\n 'bold 22px Monospace',\n '#535353',\n 140,\n 80);\n\n const lines = [\n 'You just got back online and trex ',\n 'got stuck in the devtools network tab!',\n 'How many kilobytes can it survive?',\n 'Avoid download bars and save on cache!',\n ];\n\n Draw.multiLineText(\n this.drawContext,\n lines,\n '16px Monospace',\n '#535353',\n 20,\n 180,\n 25\n );\n\n Draw.singleLineText(\n this.drawContext,\n 'Tap to jump and double jump!',\n 'bold 16px Monospace',\n '#535353',\n 80,\n 370);\n\n const hero = new Hero(\n this.drawContext,\n 30,\n (this.currentHeight - 126),\n this.worldConfig\n );\n\n const terrain = new Terrain(\n this.drawContext,\n 0,\n (this.currentHeight - 40),\n this.currentWidth,\n this.currentHeight\n );\n\n terrain.render();\n hero.render();\n }", "title": "" }, { "docid": "0945ce0ef8aaca0150da95ea008c604d", "score": "0.63794196", "text": "startGame(){\r\n\r\n\r\n //resets gameboard display before start\r\n this.resetGameboard();\r\n\r\n //hide overlay display\r\n const overlayDiv=document.querySelector('#overlay');\r\n overlayDiv.style.visibility=\"hidden\";\r\n\r\n\r\n //choose random phrase from collection and add it to display\r\n const phrase=this.getRandomPhrase();\r\n phrase.addPhraseToDisplay();\r\n this.activePhrase=phrase;\r\n }", "title": "" }, { "docid": "09eb4c80a5905356603542299eef1fec", "score": "0.63791007", "text": "startGame() {\n $('#overlay').hide();\n this.activePhrase = this.createRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "31f3cfcef2f3928b694600e7eb9651cb", "score": "0.6378488", "text": "function add_screen() {\n try {\n $(\"body\").prepend($(\"<div id='mash_screen'>\"));\n var pos = $(\"#\"+mash_cfg.id).offset();\n $(\"#mash_screen\").css({\n 'width': ''+mash_cfg.width+'px',\n 'height': ''+mash_cfg.height+'px',\n 'z-index': '99',\n 'background': 'white',\n 'position': 'absolute',\n 'left': pos.left,\n 'top': pos.top\n });\n\n $(window).resize(function() {\n var pos = $(\"#\"+mash_cfg.id).offset();\n $(\"#mash_screen\").css({\n 'left': pos.left,\n 'top': pos.top\n });\n });\n }\n catch(err) {\n setTimeout(add_screen, 50);\n }\n}", "title": "" }, { "docid": "c8fa3bbe6d45c6dd52da5e6747241ab9", "score": "0.63763016", "text": "function startGame() {\n gameInPlay = true\n generateUpNextTetrimono()\n addUpNextTetrimono()\n addActiveTetrimono()\n startTimer()\n handlePlayMusic()\n startGameButton.style.display = 'none'\n }", "title": "" }, { "docid": "d64943f11b6f8ad43288e0de54c55a41", "score": "0.6373071", "text": "startGame () {\n overlay.style.display = \"none\";\n audioSettings.forEach(label => label.style.position = \"static\");\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n this.activePhrase.addCategoryToDisplay();\n this.activePhrase.addHintToDisplay();\n this.addInstructionsToDisplay();\n this.onScreenResize();\n this.ready = true;\n }", "title": "" }, { "docid": "a5ca0d1fc248b2f5182f47520f663e60", "score": "0.63702273", "text": "function start() {\n createScreen();\n createPipe();\n createBall();\n play();\n}", "title": "" }, { "docid": "f0ed4e6ba3844090d2ab2af768417cbe", "score": "0.6365578", "text": "function startNewGame() {\n if (!document.fullscreenElement) { p.wrapper.requestFullscreen(); }\n p.loadingWidth = 0;\n p.ready = false;\n p.timeOfStart = 0;\n clearInterval(p.timeOut1);\n\n createBall();\n if (p.startGame) { startTimer(); }\n }", "title": "" }, { "docid": "d18fe0dd4deccae06b0b7e6c73a9a2dd", "score": "0.63642925", "text": "startGame() {\n overlay.style.display = \"none\";\n overlay.className = \"start\";\n this.createPhrases();\n this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "aa892b2b6056d36d1856266bd2c6ad74", "score": "0.63569635", "text": "function startUp() {\n introScreen()\n handleStartClick()\n handleCocktailSearch()\n handleMealSearch()\n}", "title": "" }, { "docid": "8b8efb1b8e4e21fdbdea996c9eb1d736", "score": "0.63552344", "text": "function startWin() {\n\tremoveAllEventListeners();\n\tdocument.getElementById('playing-menu').style.display = 'none';\n\tdocument.getElementById('online-menu').style.display = 'none';\n\tdocument.getElementById('main-menu').style.display = 'none';\n\tdocument.getElementById('levels-menu').style.display = 'block';\n\tvar board = document.getElementById('board');\n\tboard.innerHTML = '<div id=\"thanks\">Thank you for playing Flip-a-Blox!</div>';\n\tboard.innerHTML += '<img id=\"logo-small\" src=\"images/logo.png\"/>';\n\tboard.innerHTML += '<img id=\"congratulations\" src=\"images/congratulations.png\"/>';\n\tboard.style.backgroundColor = '';\n\tvar backButton = document.getElementById('back-button');\n\tbackButton.onclick = function() {playEffect(1); startLevels();};\n}", "title": "" }, { "docid": "af38237cb821d8b149cc9570082e6be9", "score": "0.63498086", "text": "function startGame(doRun)\n{\n screen.paused = true;\n\n var info, object;\n var totalWidth = 0;\n\n reset();\n\n // read level description\n for (var i = 0; i < levelModel.count; i++) {\n info = levelModel.get(i);\n\n if (info.type == BACKGROUND_IMAGE_TYPE) {\n //create backround image (streched to fill)\n object = background.createBackgroundImage(info.image);\n backgroundItems.push(object);\n } else if (info.type == BACKGROUND_ITEM_TYPE ||\n info.type == BACKGROUND_TILE_TYPE) {\n // create background element\n object = background.createItem(info.image, info.x, info.y);\n object.speed = info.speed;\n object.vspeed = info.vspeed;\n object.tile = (info.type == BACKGROUND_TILE_TYPE);\n backgroundItems.push(object);\n } else {\n // create sprite element (bonus or enemy)\n object = createObject(\"sprites/\" + info.name + \".qml\", foreground);\n\n if (object !== null) {\n object.x = info.x;\n object.y = canvas.height - info.y;\n sprites.push(object);\n totalWidth = Math.max(totalWidth, object.x + object.width);\n }\n }\n }\n\n screen.paused = false;\n canvas.sceneWidth = totalWidth;\n\n if (doRun)\n screen.state = \"running\";\n}", "title": "" }, { "docid": "36c2222b361876490843ff4826e0fbb0", "score": "0.6346903", "text": "function startGame() {\r\n saveForm();\r\n renderTextPhrase();\r\n renderSketchpad();\r\n renderNextFormBtn();\r\n}", "title": "" }, { "docid": "c6f7a247e4fe9b49eb9585ca2877fcdf", "score": "0.63404846", "text": "function startGame() {\n render(deckSlctr, deckTemplate(pairs));\n timeStart = getTimestamp();\n }", "title": "" }, { "docid": "6cda9cec1f46d0f0afadf1f179383be4", "score": "0.6334547", "text": "initGame() {\n this.loadBackgrounds();\n this.introScreen();\n this.gameLoop();\n }", "title": "" }, { "docid": "0a0c4da418b047bebd1d4bea0199cfcc", "score": "0.6331942", "text": "function startupCanvas(top, left, w, h){\n// function that creates the canvas\n// according to the values specified \n// by setCanvasSize() \n $('body').prepend(\"<div class='tab-game-canvas'></div>\");\n $('.tab-game-canvas').css({\"position\":\"absolute\", \"top\" : top + \"px\", \"left\" : left + \"px\",\"width\" : w + \"px\", \"height\" : h + \"px\", \"z-index\" : \"1000\", \"animation\" : \"wakeup 1s\"});\n}", "title": "" }, { "docid": "46a507fb801a7751491b7a69b572a299", "score": "0.63174784", "text": "function gamescreen(buttontext, splashtext) {\n var $button = $(\"<div>\");\n $button.attr(\"id\", \"startbutton\");\n $button.attr(\"class\", \"startbutton\");\n $button.html(buttontext);\n kd.ENTER.down = function (){\n window.setTimeout(function () {\n document.getElementById(\"startbutton\").click();\n }, 300);\n }\n $button.on(\"click\", function () {\n $button.css(\"border\",\"5px solid #3847ce\");\n gameReset();\n $button.parent().css(\"display\", \"none\");\n gameRun();\n $button.parent().remove();\n });\n /*var $img = $(\"<div>\");*/ //for splashscreen pictures, implement if time \n var $startscreen = $(\"<div>\");\n $startscreen.attr(\"id\", \"splashscreen\");\n $startscreen.attr(\"class\", \"splashscreen\");\n $startscreen.html(splashtext);\n $startscreen.append($button);\n $startscreen.appendTo($(\"#gameBox\"));\n}", "title": "" }, { "docid": "4ffcdc63ef7d707f19d7b082b53812db", "score": "0.6314803", "text": "startGame() {\n if (this.isArcadeMode()) {\n this.setArcadeMode();\n }\n this.toggleSpeed();\n this.runningTime = 0;\n this.playingIntro = false;\n this.tRex.playingIntro = false;\n this.containerEl.style.webkitAnimation = '';\n this.playCount++;\n this.generatedSoundFx.background();\n announcePhrase(getA11yString(A11Y_STRINGS.started));\n\n if (Runner.audioCues) {\n this.containerEl.setAttribute('title', getA11yString(A11Y_STRINGS.jump));\n }\n\n // Handle tabbing off the page. Pause the current game.\n document.addEventListener(Runner.events.VISIBILITY,\n this.onVisibilityChange.bind(this));\n\n window.addEventListener(Runner.events.BLUR,\n this.onVisibilityChange.bind(this));\n\n window.addEventListener(Runner.events.FOCUS,\n this.onVisibilityChange.bind(this));\n }", "title": "" } ]
c40fd7f40e8b3a720a2eeb0158c74691
create function to randomise mines each cell.isMine has a 25% chance of being a mine
[ { "docid": "b959aba3b8d4d388eaf3a244d4484e19", "score": "0.6999251", "text": "function randomMine() {\n if (Math.random() < 0.25) {\n return true\n } else {\n return false\n }\n}", "title": "" } ]
[ { "docid": "9e5fb76847315cb1ed79a696ebc58600", "score": "0.754482", "text": "function mineCheck(numOfMines, numOfCells) {\n\tlet mineCheck = Math.floor(Math.random(numOfMines) * numOfCells);\n\tlet rtnValue = 1;\n\tif (mineCheck == 0){\n\t\trtnValue = 1;\n\t}\n\telse {\n\t\trtnValue = 0;\n\t}\n\treturn rtnValue\n}", "title": "" }, { "docid": "a9b2351e05030e51e8a67b44f4aa168b", "score": "0.74119705", "text": "function addRandomMines() {\n let mineCount = 10\n minesLeft.innerHTML = 10 \n \n while (mineCount > 0) {\n const randomIndex = Math.floor(Math.random() * cells.length)\n const minePosition = cells[randomIndex] // keep const for minePosition\n if (minePosition.classList.contains('mine')) {\n continue\n } else {\n minePosition.classList.add('mine')\n mineCount -= 1\n } \n }\n\n cells.forEach(cell => {\n if (!cell.classList.contains('mine')) {\n cell.classList.add('valid')\n }\n })\n\n countMinesAround()\n}", "title": "" }, { "docid": "cec1645f3e4f1c11cf163e1e9053ddfc", "score": "0.74093956", "text": "function setMinesAndNegs(rowIdx, colIdx) {\n for (var i = 0; i < gLevelMinesCount; i++) {\n var row = getRandomIntInclusive(0, gBoardSize - 1)\n var col = getRandomIntInclusive(0, gBoardSize - 1)\n //if this is a mine OR also the user first click\n while (gBoard[row][col].isMine || (rowIdx === row && colIdx === col)) {\n\n row = getRandomIntInclusive(0, gBoardSize - 1)\n col = getRandomIntInclusive(0, gBoardSize - 1)\n }\n gBoard[row][col].isMine = true;\n }\n\n setMinesNegsCount();\n}", "title": "" }, { "docid": "5244d14398454b692da16d7ac9ddd910", "score": "0.7300169", "text": "setMines(initialCell) {\n const adjacentCells = this.getAdjacentCells(initialCell);\n let i = 0;\n let randomCell;\n while (i < this.mineCount) {\n if (i < Math.floor(this.mineCount / 2)) {\n randomCell = this.getRandomCell(\"top\");\n }\n if (i >= Math.floor(this.mineCount / 2)) {\n randomCell = this.getRandomCell(\"bottom\")\n }\n if (randomCell.row !== initialCell.row && randomCell.column !== initialCell.column) {\n if (!adjacentCells.some(cell => cell.row === randomCell.row && cell.column === randomCell.column)) {\n if (!randomCell.value) {\n randomCell.value = \"*\";\n i++;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "3ef0eb5347929612e6181c6c88e936eb", "score": "0.72780615", "text": "function randomMine (number) {\n var boardCells = document.getElementsByClassName('board')[0].children;\n for (var i = 0; i < number.length; i++) {\n var random = Math.floor(Math.random()*number.length);\n if (i === mine) {\n boardCells[i].classList.add('mine');\n }\n }\n }", "title": "" }, { "docid": "c790241000f35b226ca43079927b5d61", "score": "0.72681993", "text": "function randMines(board, num) {\n var minesLocation = []\n for (var x = 0; x < num; x++) {\n var randi = getRandomInt(0, board.length)\n var randj = getRandomInt(0, board.length)\n if (!board[randi][randj].isMine) {\n board[randi][randj].isMine = true\n board[randi][randj].icon = MINE\n minesLocation.push({\n i: randi,\n j: randj\n })\n } else {\n randMines(board, 1) // if the mine location not empty, find enother\n }\n }\n return minesLocation\n}", "title": "" }, { "docid": "862eee68b4e479cfad440ddd7eec916d", "score": "0.72524273", "text": "function placeManyRandomMines() {\n for(var i = 0; i < mines; i++) {\n placeRandomMine();\n }\n}", "title": "" }, { "docid": "e2dbe265c4dde70b81e7a1147c3c1744", "score": "0.7189162", "text": "function setupmines()\n{\n\tvar cells = document.getElementsByClassName('cell');\n\tvar mineindex = [];\n\n\n\tif(this.level.value === \"Easy\")\n\t{\n\t\tvar numberofcells = 10;\n\t\tvar totalcells = 100;\n\t}\n\telse\n\t{\n\t\tvar numberofcells = 15;\n\t\tvar totalcells = 225;\n\t}\n\tif(this.level.value === \"Easy\")\n\t{\n\t\tvar firstcloumn = [0,10,20,30,40,50,60,70,80,90];\n\t\tvar lastcolumn = [9,19,29,39,49,59,69,79,89,99];\n\n\t}\n\telse\n\t{\n\t\t\tvar firstcloumn = [0,15,30,45,60,75,90,105,120,135,150,165,180,195,210];\n\t\t\tvar lastcolumn = [14,29,44,59,74,89,104,119,134,149,164,179,194,209,224];\n\t\n\t}\n\t\n\n\n\twhile(true)\n\t{\n\t\tvar mine = Math.floor(Math.random() * totalcells);\n\t\tif(!mineindex.includes(mine))\n\t\t{\n\t\t\tmineindex.push(mine);\n\t\t}\n\n\t\tif(mineindex.length >= 20 && this.level.value === \"Easy\")\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\tif(mineindex.length >= 30 && (this.level.value === \"Medium\" || this.level.value === \"Hard\"))\n\t\t{\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\tmineindex.forEach((position)=>\n\t{\n\t\tcells[position].setAttribute(\"class\",\"cell mine\");\n\t\ttry\n\t\t{\n\t\t\tif(!firstcloumn.includes(position) )\n\t\t\t{\n\t\t\tvar minenumber = Number(cells[position - numberofcells - 1].getAttribute(\"value\"));\n\t\t\tcells[position - numberofcells - 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tvar minenumber = Number(cells[position - numberofcells].getAttribute(\"value\"));\n\t\t\tcells[position - numberofcells].setAttribute(\"value\",minenumber + 1);\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif(!lastcolumn.includes(position) )\n\t\t\t{\n\t\t\t\tvar minenumber = Number(cells[position - numberofcells + 1].getAttribute(\"value\"));\n\t\t\t\tcells[position - numberofcells + 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif(!firstcloumn.includes(position) )\n\t\t\t{\n\t\t\tvar minenumber = Number(cells[position - 1].getAttribute(\"value\"));\n\t\t\tcells[position - 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif(!lastcolumn.includes(position) )\n\t\t\t{\n\t\t\tvar minenumber = Number(cells[position + 1].getAttribute(\"value\"));\n\t\t\tcells[position + 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif(!firstcloumn.includes(position) )\n\t\t\t{\n\t\t\tvar minenumber = Number(cells[position + numberofcells - 1].getAttribute(\"value\"));\n\t\t\tcells[position + numberofcells - 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tvar minenumber = Number(cells[position + numberofcells].getAttribute(\"value\"));\n\t\t\tcells[position + numberofcells].setAttribute(\"value\",minenumber + 1);\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif(!lastcolumn.includes(position) )\n\t\t\t{\n\t\t\tvar minenumber = Number(cells[position + numberofcells + 1].getAttribute(\"value\"));\n\t\t\tcells[position + numberofcells + 1].setAttribute(\"value\",minenumber + 1);\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\t\n\t\t}\n\t}\n\t\t)\n\n\t \n\n}", "title": "" }, { "docid": "55ca98e0c6418eb8fbcb3d206ebc7c71", "score": "0.71061933", "text": "updateMines(board) {\n let height = this.props.height, width = this.props.width, mines = this.props.mines;\n let randomX, randomY, minesPlanted = 0;\n while (minesPlanted < mines) {\n randomX = this.getRandomNumber(width);\n randomY = this.getRandomNumber(height);\n if (!(board[randomY][randomX].isMine)) {\n board[randomY][randomX].isMine = true;\n minesPlanted++;\n }\n }\n }", "title": "" }, { "docid": "14179df9a20f2eff7aca08173bf3d981", "score": "0.70627147", "text": "function insertMines(locations, gMines) {\r\n for (var i = 0; i < gMines; i++) {\r\n var rndmIdx = getRandomInt(0, locations.length);\r\n var rndmLocation = locations.splice(rndmIdx, 1);\r\n gBoard[rndmLocation[0].i][rndmLocation[0].j].isMine = true;\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "a56a2b95278c0eb8368c2f76493e73cf", "score": "0.70136064", "text": "SetMine(){\n\t for (var i = 0; i < size; i++) {\n\t\tfor (var j = 0; j < size; j++) {\n\t\t\t//console.log(board[i][j] == -5);\n\t\t\tvar x = Math.floor(Math.random()*size);\n\t\t\tvar y = Math.floor(Math.random()*size);\n\t\t\n\t\t\tconsole.log(board[x][y]);\n\t\t}\n\t }\n\t var i = 0;\n\t while(i<mine){\n\t\tvar x = Math.floor(Math.random()*size);\n\t\tvar y = Math.floor(Math.random()*size);\n\t\tif(board[x][y] == -5){\n\t\t board[x][y] = -1;\n\t\t i++;\n\t\t}\n\t }\n\t}", "title": "" }, { "docid": "9d268bb7f303774c818d6b7903b70633", "score": "0.6968484", "text": "function setRandomMines(board, gLevel, position) {\r\n var countMines = 0;\r\n for (var i = 0; i < gLevel.SIZE * 4; i++) {\r\n var randomI = getRandomIntInclusive(0, gLevel.SIZE - 1);\r\n var randomJ = getRandomIntInclusive(0, gLevel.SIZE - 1);\r\n if ((randomI === position.i) && (randomJ === position.j)) continue\r\n // if(board[randomI][randomJ].isMarked===true) continue\r\n if (board[randomI][randomJ].isMine === false) {\r\n board[randomI][randomJ].isMine = true;\r\n countMines++;\r\n }\r\n else if (board[randomI][randomJ].isMine === true) {\r\n continue;\r\n }\r\n if (countMines === gLevel.MINES) {\r\n return;\r\n }\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "09b362b08cacfb0b220abb112e42e2b1", "score": "0.6865113", "text": "function randcell() {\n\t\treturn Math.floor(Math.random()*xCellCount);\n\t}", "title": "" }, { "docid": "5090858af97c410235f33d6e4c8ce60d", "score": "0.6850351", "text": "function initCell() {\n return Math.random() < genWeighting ? 1 : 0;\n}", "title": "" }, { "docid": "5b4deff91decf484677e3e8c81464305", "score": "0.6831246", "text": "function setMine() {\n if ((isMine = Math.floor(Math.random() *2)) === 0) {\n isMine = false;\n } else {\n isMine = true;\n } return isMine;\n}", "title": "" }, { "docid": "e0c793048b0511de5deff4c97a183768", "score": "0.67661655", "text": "function placeMines(elCell) {\n gMinePoses = [];\n console.log('Place mines!')\n var emptyCells = getEmptyCells(gBoard, elCell);\n for (var i = 0; i < gLevel.mines; i++) {\n var randIdx = getRandomInteger(0, emptyCells.length - 1);\n var mineCoord = emptyCells.splice(randIdx, 1)[0];\n gBoard[mineCoord.i][mineCoord.j].isMine = true;\n gMinePoses.push(mineCoord);\n }\n\n}", "title": "" }, { "docid": "089e6a5ab89199f2c5e0d5e06a111a9e", "score": "0.6735186", "text": "populateMines() {\n while (this.minesArray.length < this.totMines) {\n let temp = Misc.getRandomNum(1, this.dat.totNumbers); // Math.floor(Math.random() * this.totNumbers) + 1; \n if (this.minesArray.indexOf(temp) < 0) this.minesArray.push(temp); \n }\t\n this.sortMines(); \n }", "title": "" }, { "docid": "201df98c5a9b29bd27c73d00ed1f3bcf", "score": "0.6490702", "text": "function placeRandomCells(){\n\tfor(var y = 0; y <dimension; y++){\n\t\tfor(var x=0; x<dimension; x++){\n\t\t\tvar cell = getCell(x,y);\n\t\t\tif(Math.random() > chanceOfLiveCell) {cell.addClass('alive');}\n\t\t\telse { cell.removeClass('alive');}\n\t\t};\n\t};\n}", "title": "" }, { "docid": "25e2783293cd3cb24cabca7e7308cec2", "score": "0.6479639", "text": "mul() {\n // setTimeout(mul(), 6000);\n this.multiply++;\n\n let emptyCells = this.chooseCell(0)\n var newCell = random(emptyCells); \n // console.log(newCell, this.multiply); return;\n if (this.multiply >= 1 && newCell ) {\n var newGrass = new Grass(newCell[0], newCell[1], this.index);\n grassArr.push(newGrass);\n matrix[newCell[1]][newCell[0]] = 1;\n this.multiply = 0;\n \n }\n }", "title": "" }, { "docid": "d37c057a979fc035b1cd94870fb65685", "score": "0.6470419", "text": "setMines(height, width, boardData)\n {\n let x = 0;\n let y = 0;\n let mines = 0;\n\n while (mines < 10)\n {\n x = this.getRandomInt(8);\n y = this.getRandomInt(8);\n if (!boardData[x][y].isMine)\n {\n boardData[x][y].isMine = true;\n mines++;\n }\n }\n\n return (boardData);\n }", "title": "" }, { "docid": "7c000ddc70003e56015800de0e783555", "score": "0.64642036", "text": "randomFloorToUniq(){\n for (let rowNumber = 1; rowNumber < this.map.length - 1; rowNumber++){\n for (let columnNumber = 1; columnNumber < this.map[rowNumber].length -1; columnNumber++) {\n let cell = this.map[rowNumber][columnNumber]\n if (cell.type === \"floor\") {\n cell.texture = (Math.random() < 0.001) ? \"chest\" : null\n }\n if (cell.type === \"floor\" && cell.texture === null) {\n cell.texture = (Math.random() < 0.001) ? \"blood\" : null\n }\n if (cell.type === \"floor\" && cell.texture === null) {\n if (Math.random() < 0.01) {\n new Monster(rowNumber, columnNumber)\n }\n }\n }\n }\n }", "title": "" }, { "docid": "a80cfe132ae405c9731cc86b84a61841", "score": "0.64558023", "text": "function randomizeCells(){\n\tvar val;\n\tfor(var i = 0; i < cell.length; i++){\n\t\tfor(var j = 0; j < cell[0].length; j++){\n\t\t\tval = Math.floor(random() * (frequency - 0 + 1));\n\t\t\tif(val == 1){\n\t\t\t\tcell[i][j] = 1;\n\t\t\t\ttempCell[i][j] = 0;\n\t\t\t}else{\n\t\t\t\tcell[i][j] = 0;\n\t\t\t\ttempCell[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "28c6604b0c30b4b1805c6220db525bef", "score": "0.6447771", "text": "function placeMines() {\n while (minesPlaced.length < minesNeeded) {\n const mineIndex = Math.floor(Math.random() * totalTiles);\n if (!minesPlaced.includes(mineIndex)) {\n minesPlaced.push(mineIndex);\n }\n }\n }", "title": "" }, { "docid": "8255cc759f84769033e3a8e7feabdeb6", "score": "0.6445667", "text": "function placeMinesRandomly(numberOfMines)\n {\n console.log(\"placing mines randomly\");\n var gridWithMines = [];\n\n // generate a clean grid\n for(var i=0; i<$scope.numRows; i++){\n var row = [];\n for(var j=0; j<$scope.numCols; j++){\n row.push(0);\n }\n gridWithMines.push(row);\n }\n\n // randomly place mines in the grid\n var numPlaced = 0;\n while(numPlaced < numberOfMines){\n var randRow = Math.floor(Math.random() * ($scope.numRows-1));\n var randCol = Math.floor(Math.random() * ($scope.numCols-1));\n if(gridWithMines[randRow][randCol] != MINE){\n gridWithMines[randRow][randCol] = MINE;\n gridWithMines = adjustAroundPosition(gridWithMines, randRow, randCol);\n numPlaced++;\n }\n }\n return gridWithMines;\n }", "title": "" }, { "docid": "aa2a372deb18569965b33070be0bc53b", "score": "0.64222574", "text": "populateBoardArr() {\n for (let i = 0; i < DATA.cells(); i++) {\n let random = Math.random() * 2;\n if (random > DATA.mineRate) {\n DATA.boardArr.push(1);\n DATA.mineCell.push(i);\n } else {\n DATA.boardArr.push(0);\n DATA.emptyCell.push(i);\n }\n }\n }", "title": "" }, { "docid": "1fa07176019727885080a882fa493e1e", "score": "0.63387746", "text": "function generateMines(range) {\n mines = [];\n for (var i = 0; i < 16; i++) {\n var mine = Math.floor(Math.random() * (range - 1) + 1);\n console.log(mine);\n\n //determino se i numeri esistono già, e se sì, ne genero uno nuovo\n if (mines.includes(mine) === false) {\n mines.push(mine);\n console.log(mines);\n } else {\n console.log(\"numero doppione! Genero nuovo...\");\n i--;\n }\n }\n }", "title": "" }, { "docid": "768f1117201c45638675d9a9c9fa29db", "score": "0.6333389", "text": "function placeRandomMine() {\n do{\n var row = Math.round(Math.random() * (rows-1));\n var column = Math.round(Math.random() * (cols-1));\n var spot = getSpot( row, column);\n }\nwhile(spot.content==\"mine\")\n spot.content = \"mine\";\n}", "title": "" }, { "docid": "85d3e9724304c25231a4519d7cdba745", "score": "0.63176745", "text": "function _addMines(numMines) {\n _numMines = numMines;\n if(_numMines >= (_width * _height)) {\n throw \"Too many mines\";\n }\n\n var numCells = _width * _height;\n\n var hasMine = new Array(numCells);\n for(var m in hasMine) {\n hasMine[m] = false;\n }\n\n var randomCellIndex = function() {\n return parseInt(Math.random() * numCells);\n };\n\n var mineCell = function(mineme) {\n var row = parseInt(mineme / _width);\n var col = mineme % _width;\n _cells[row][col].setMined(true);\n hasMine[mineme] = true;\n };\n\n var nextMineableCell = function(mineme) {\n while(hasMine[mineme] == true) {\n mineme += 1;\n if(mineme == numCells) {\n mineme = 0;\n }\n }\n return mineme;\n };\n\n for(var i=0;i<numMines;i++) {\n mineCell(nextMineableCell(randomCellIndex()));\n }\n\n _eachCell(function(cell) { cell.calcNeighbouringMines(); });\n\n }", "title": "" }, { "docid": "0a4b19bc266f45fd1d4b7f27b7a0d97a", "score": "0.6282065", "text": "_plantMine(x, y) {\n this.cells[x][y].haveMine = true;\n }", "title": "" }, { "docid": "879b69c5736628b45994262c649b7099", "score": "0.6247191", "text": "function mineDecide() {\n if (Math.random() < 0.4) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "be73eb7243ef0cd6198d008f65b3403b", "score": "0.6187978", "text": "mutate(m) {\n for (let i = 0; i < this.genes.length; i++) {\n if (random(1) < m) {\n // ADD RANDOM MUTATION TO AFFECT GENES\n this.genes[i] = this.createGenes();\n\n }\n }\n }", "title": "" }, { "docid": "f891cc4ea66231426d24bc65f9903054", "score": "0.61655444", "text": "randomFreeCell() {\n let cell = this.randomCell();\n if (!cell.obstacle && cell.player === null && cell.weapon === null) {\n return cell;\n } else {\n return this.randomFreeCell();\n }\n\n }", "title": "" }, { "docid": "8148985075a53f65f5d3966a375312a8", "score": "0.6158465", "text": "function randomLife(){\n\tfor (var i = 0; i < gameLength; i++){\n\t\tfor(var j = 0; j < gameLength; j++){\n\t\t\tvar num = (Math.floor(Math.random() * 1.4)); //how many random cells are generated\n\t\t\tif(num)\n\t\t\t\tmyLifeGame.setAlive(i,j);\n\t\t\telse\n\t\t\t\tmyLifeGame.setDead(i,j);\n\t\t}\n\t\t\n\t}\n\tupdateCells();\n}", "title": "" }, { "docid": "09ea4c227d63aaa56fe6d3d87ab7545b", "score": "0.614753", "text": "function mazeGen(){\n\tif(!clickable){\n\t\treturn;\n\t}\n\tclearBoard();\n\tlet startCell = strtIndex;\n\tlet walls = getNeighbours(startCell);\n\n\twhile(walls.length != 0){\n\t\tlet randomIndex = Math.floor(Math.random()*walls.length);\n\t\tlet randomWall = walls[randomIndex];\n\n\t\tif(randomWall%58 != 0 && (randomWall-57)%58 != 0){\n\t\t\tif(grid[randomWall+1][0] == 0 && grid[randomWall-1][0] != 0){\n\t\t\t\tsurrcells = surroundingCells(randomWall);\n\t\t\t\t//console.log(surrcells);\n\t\t\t\tif(surrcells < 2){\n\t\t\t\t\tupdateGrid(randomWall, 1);\n\t\t\t\t\twalls = walls.concat(getNeighbours(randomWall));\n\t\t\t\t}\n\t\t\t\twalls.splice(randomIndex,1);\n\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t\tif(grid[randomWall-1][0] == 0 && grid[randomWall+1][0] != 0){\n\t\t\t\tsurrcells = surroundingCells(randomWall);\n\t\t\t\t//console.log(surrcells);\n\t\t\t\tif(surrcells < 2){\n\t\t\t\t\tupdateGrid(randomWall, 1);\n\t\t\t\t\twalls = walls.concat(getNeighbours(randomWall));\n\t\t\t\t}\n\t\t\t\twalls.splice(randomIndex,1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif(randomWall < 1160 && randomWall > 58){\n\t\t\tif(grid[randomWall+58][0] == 0 && grid[randomWall-58][0] != 0){\n\t\t\t\tsurrcells = surroundingCells(randomWall);\n\t\t\t\t//console.log(surrcells);\n\t\t\t\tif(surrcells < 2){\n\t\t\t\t\tupdateGrid(randomWall, 1);\n\t\t\t\t\twalls = walls.concat(getNeighbours(randomWall));\n\t\t\t\t}\n\t\t\t\twalls.splice(randomIndex,1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(grid[randomWall-58][0] == 0 && grid[randomWall+58][0] != 0){\n\t\t\t\tsurrcells = surroundingCells(randomWall);\n\t\t\t\t//console.log(surrcells);\n\t\t\t\tif(surrcells < 2){\n\t\t\t\t\tupdateGrid(randomWall, 1);\n\t\t\t\t\twalls = walls.concat(getNeighbours(randomWall));\n\t\t\t\t}\n\t\t\t\twalls.splice(randomIndex,1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t//updateGrid(randomWall,2);\n\t\twalls.splice(randomIndex,1);\n\t}\n\tlet endneighb = getNeighbours(finIndex);\n\t//updateGrid(endneighb[Math.floor(Math.random()*4)], 1);\n\tupdateGrid(endneighb[0], 1);\n\tupdateGrid(endneighb[1], 1);\n\tupdateGrid(endneighb[2], 1);\n\tupdateGrid(endneighb[3], 1);\n\n\tfor(var x=0;x<1218;x++){\n\t\tif(grid[x][0] == 0){\n\t\t\tupdateGrid(x,2);\n\t\t}\n\t\tif(grid[x][0] == 1){\n\t\t\tupdateGrid(x,0);\n\t\t}\n\t}\n\n\t\n}", "title": "" }, { "docid": "1092cfa7e77639260106077003facdf5", "score": "0.61423784", "text": "function useSameMines() {\n for (var i = 0; i < gMinePoses.length; i++) {\n var currMine = gMinePoses[i];\n gBoard[currMine.i][currMine.j].isMine = true;\n }\n}", "title": "" }, { "docid": "5fca063c2053ac2279e503fec68d3441", "score": "0.6115307", "text": "getNewTileRandom() {\n let nums = [2,4];\n let temp = nums[Math.floor(Math.random() * 2)];\n return temp;\n }", "title": "" }, { "docid": "b4aefd57f1c9060ca825c2cf7c3e1024", "score": "0.60832876", "text": "randomWallToFloor(){\n for (let rowNumber = 1; rowNumber < this.map.length - 1; rowNumber++){\n for (let columnNumber = 1; columnNumber < this.map[rowNumber].length -1; columnNumber++) {\n let cell = this.map[rowNumber][columnNumber]\n if (cell.type === \"wall\") {\n cell.type = (Math.random() < 0.08) ? \"floor\" : \"wall\"\n if (cell.type === 'floor') {\n cell.texture = null\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d6041831e9a6bc6cdd507f12fef3480f", "score": "0.60761046", "text": "function getRandomCell(){\n var randomCellID=\"\", randomAI=\"\", isBlocked=\"\";\n do {\n randomAI = Math.floor(Math.random()*9);\n randomAI++;\n randomCellID = \"ttt\" + randomAI;\n //console.log(\"getRandomCell: \" +randomCellID);\n isBlocked = isCellBlocked(randomCellID);\n if (isBlocked===true){\n //console.log(\"Blocked: \" +randomCellID);\n }\n } while (isBlocked===true);\n \n if (isBlocked===false){\n //console.log(\"Not blocked: \" +randomCellID);\n return randomCellID;\n }\n}", "title": "" }, { "docid": "18037511ca56dcded4741cc337c164ab", "score": "0.6069928", "text": "function randomInitial(){\n var gametable = document.getElementById(\"game-table-id\");\n\n for(iRandomInit = 0; iRandomInit < gametable.rows.length; iRandomInit++){\n var numcols = gametable.rows[iRandomInit].cells.length;\n for(jRandomInit = 0; jRandomInit < numcols; jRandomInit++){\n var curcell = gametable.rows[iRandomInit].cells[jRandomInit];\n if(Math.random() >= 0.75){\n setAlive(curcell);\n }else{\n setDead(curcell);\n }\n }\n }\n}", "title": "" }, { "docid": "b110febb4f5bd34a172d1b8a79c0255d", "score": "0.6068105", "text": "addNewMines(cnt, min, max) {\n console.log('ADD New Mines'); \n let minVal = (min) ? min : this.dat.firstNumber; \n let maxVal = (max) ? max : this.dat.totNumbers; \n let j = 0; let tmpArray = []; \n while (j < cnt) {\n let temp = Misc.getRandomNum(minVal, maxVal); \n // exclude existing mine #s & the current guess \n if (this.minesArray.indexOf(temp) < 0 && temp != this.dat.guessValue) {\n this.minesArray.push(temp); \n j++; \n tmpArray.push(temp); \n }\n }\t\n console.log('NEW mines = ' + tmpArray.toString());\n this.sortMines(); \n this.totMines += cnt; \n }", "title": "" }, { "docid": "3dd70d99f3de4f5930db78cecf4d7fcc", "score": "0.6064328", "text": "generateWalls() {\n const tdElts = $(\"td\");\n // the number of the walls will be in this interval\n const min = 10;\n const max = 15;\n const randomNumber = random(min, max); // number of walls\n\n for (let i = 0; i < randomNumber; i++) {\n // selecting a random <td> element\n let index = random(0, tdElts.length);\n let randomTdElt = tdElts[index];\n\n //while the <td> element is not free\n while (this.getCellContent(randomTdElt.id) !== 0) {\n //reassign a new <td>\n index = random(0, tdElts.length);\n randomTdElt = tdElts[index];\n }\n\n // managing the cell for the wall\n $(randomTdElt)\n .removeClass(\"free\")\n .addClass(\"greyed\");\n }\n }", "title": "" }, { "docid": "77f5dab5ed1fc9a6e2ae2b576f63b29f", "score": "0.60489357", "text": "function stoneRand() {\r\n for (var i = 0; i < qtyStone; i++) {\r\n var x = Math.floor(Math.random() * 400);\r\n $('.box[data-block-id=' + x + ']').addClass('stone');\r\n }\r\n }", "title": "" }, { "docid": "0fa8dc224df5a1ca47577b219100b7b7", "score": "0.6048735", "text": "function generate(){\n\t\t\tfunction checkSurroundingCells(){\n\t\t\t\t//TO DO - Use this function below for the white squares also, increase its scope so it's accessible to other functions\n\t\t\t\tfunction checkImmediateSurroundingCells(u,v){\n\t\t\t\t\tvar minesNextTo = 0;\n\t\t\t\t\tvar uLowLimit = -1;\n\t\t\t\t\tvar uUpLimit = 1;\n\t\t\t\t\tvar vLowLimit = -1;\n\t\t\t\t\tvar vUpLimit = 1;\n\t\t\t\t\n\t\t\t\t\tif (u == 0){\n\t\t\t\t\t\tuLowLimit = 0;\n\t\t\t\t\t} else if (u == gameOptions.squaresHigh -1){\n\t\t\t\t\t\tuUpLimit = 0;\n\t\t\t\t\t} \n\n\t\t\t\t\tif (v == 0){\t\t\t\n\t\t\t\t\t\tvLowLimit = 0;\n\t\t\t\t\t} else if (v == gameOptions.squaresWide -1){\n\t\t\t\t\t\tvUpLimit = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (b = uLowLimit; b <= uUpLimit; b++){\n\t\t\t\t\t\tfor (c = vLowLimit; c <= vUpLimit; c++){\n\t\t\t\t\t\t\tif(gameBoard[u+b][v+c] == 'mine'){\n\t\t\t\t\t\t\t\tminesNextTo ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(gameBoard[u][v] !== 'mine'){\n\t\t\t\t\t\tgameBoard[u][v] = minesNextTo;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//For every element in the gameboard array, check its immediate surrounding cells\n\t\t\t\tfor (u = 0; u < gameBoard.length; u++){\n\t\t\t\t\t//u is rows, v is columns\n\t\t\t\t\tfor (v = 0; v < gameBoard[u].length; v++){\n\t\t\t\t\t\tcheckImmediateSurroundingCells(u,v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//This function populates the board with mines and safe places. Change safe to numbers! \n\t\t\tfunction populateArray(){\n\t\t\t\tfunction compareSquareToMines(n,p){\n\t\t\t\t\tfor (s = 0; s < minePositions.length; s++){\n\t\t\t\t\t\tif (n == minePositions[s][0] && p == minePositions[s][1]){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (n = 0; n < gameOptions.squaresHigh; n++){\n\t\t\t\t\tgameBoard.push([]);\n\t\t\t\t\tfor (p = 0; p < gameOptions.squaresWide; p++){\n\t\t\t\t\t\tif (compareSquareToMines(n,p) == true){\n\t\t\t\t\t\t\tgameBoard[n].push('mine');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgameBoard[n].push('safe');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//console.log(gameBoard)\n\t\t\t}\n\n\t\t\t//Check if a mine exists in this square before updating the array.\n\t\t\tfunction checkInstance(xPos, yPos){\n\t\t\t\tfor (l = 0; l < minePositions.length; l++){\n\t\t\t\t\tif (xPos == minePositions[l][0] && yPos == minePositions[l][1]){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Generate coordinates for each mine\n\t\t\tfor (k = 0; k < gameOptions.numberMines; k++){\n\t\t\t\t//Give each mine a x and y pos based on the number of squaresHigh and squaresWide\n\t\t\t\tfunction getPos(){\n\t\t\t\t\tvar xPos = Math.floor(Math.random() * gameOptions.squaresWide);\n\t\t\t\t\tvar yPos = Math.floor(Math.random() * gameOptions.squaresHigh);\n\t\t\t\t\tif (checkInstance(xPos, yPos) == false){\n\t\t\t\t\t\tvar thisMinePos = [xPos, yPos];\n\t\t\t\t\t\tminePositions.push(thisMinePos);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Call it again, since a mine exists in these coords\n\t\t\t\t\t\tgetPos();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tgetPos();\n\t\t\t}\n\t\t\tpopulateArray();\n\t\t\tcheckSurroundingCells();\n\t\t}", "title": "" }, { "docid": "9071f7a2bc4e1d2a089fd305b5458121", "score": "0.6044972", "text": "function placeMines(matrix) {\n\n\t\t// fill the spaces that are free (== undefined) with freeSpot objects\n\t\tfor (var x = 0; x < matrix.length; x++) {\n\t\t\tfor (var y = 0; y < matrix.length; y++) {\n\t\t\t\tif (matrix[x][y] === undefined){\n\t\t\t\t\t// I've found I need to explicitly create the object here else the property clicked becomes TRUE for all squares\n\t\t\t\t\tmatrix[x][y] = freeSpot = {\n\t\t\t\t\t\t\t\t\t\t\t\tmined: false,\n\t\t\t\t\t\t\t\t\t\t\t\tclue: false,\n\t\t\t\t\t\t\t\t\t\t\t\tclicked: false,\n\t\t\t\t\t\t\t\t\t\t\t\trevealed: false,\n\t\t\t\t\t\t\t\t\t\t\t\tnextToMines: 0,\n\t\t\t\t\t\t\t\t\t\t\t\tflagged: false\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Generate Mines\n\t\tfor (var i = 0; i < numMines; i++) {\n\t\t\t// Generate a random X and Y co-ord\n\t\t\tvar randomX = Math.round(Math.random() * (matrix.length - 1)),\n\t\t\t\trandomY = Math.round(Math.random() * (matrix.length - 1));\n\t\t\t\n\t\t\t\t\t// check we dont place a mine in our start point or a previous mine\n\t\t\t\t\twhile (matrix[randomX][randomY][\"clicked\"] === true || matrix[randomX][randomY][\"mined\"] === true){\n\t\t\t\t\t\trandomX = Math.round(Math.random() * (matrix.length - 1));\n\t\t\t\t\t\trandomY = Math.round(Math.random() * (matrix.length - 1));\n\t\t\t\t\t\tconsole.log(\"stopped starting sq mine placement\")\n\t\t\t\t\t\t\n\t\t\t\t\t} \t\t\n\t\t\t\t\t// assign the new mine object to the matrix\n\t\t\t\t\tmatrix[randomX][randomY] = new Object(minedSpot)\n\t\t\t\t\t\t\n\t\t};\n\t\t\t\n\t\t\treturn matrix\n\n\t} // END placemines\t", "title": "" }, { "docid": "1de96281a86958e1b21ce71bb65ef5f3", "score": "0.60375607", "text": "function randomNumber() {\n\t\trandom = Math.floor(Math.random() * (1 + 15 - 0) + 0);\n\t\t$('.smallBlock').css('background-color', blockArray[random]);\n\t\treturn random;\n\t}", "title": "" }, { "docid": "9d4c4e61d567c69c5203562f58d5edf7", "score": "0.60236835", "text": "randomTiles() {\n\t\tconst randomValue = Math.random()\n\t\tthis.randomTile = randomValue > 0.5 ? 2 : 4\n\t\t// console.log(this.randomTile);\n\t}", "title": "" }, { "docid": "f286637aaf4d61c26156db365263f5c8", "score": "0.6016918", "text": "function spontaneousNeutrons() {\n for (let row = 0; row < tiles.rows; row++) {\n for (let col = 0; col < tiles.cols; col++) {\n const tileType = tiles.get(col, row);\n if (tileType === 2 && Math.random() < SPONT_RATE) {\n // Generate neutron at random coordinate inside the tile.\n const { x, y } = randomInsideTile(col, row);\n neutrons.push(new Neutron(x, y));\n\n // Increase heat at tile.\n heat.increase(col, row, SPONT_HEAT);\n }\n }\n }\n}", "title": "" }, { "docid": "611a93209859f54c2c0dccc703051e16", "score": "0.6014999", "text": "randomize() {\n // !!!! IMPLEMENT ME !!!!\n for (let height = 0; height < this.height; height++) {\n for (let width = 0; width < this.width; width++) {\n this.cells[this.currentBufferIndex][height][width] =\n (Math.random() * MODULO) | 0;\n }\n }\n }", "title": "" }, { "docid": "2d5e5dbc3bc5f114c590cdef201424eb", "score": "0.60100895", "text": "function buildBoard() {\r\n var board = [];\r\n const SIZE = 4;\r\n for (var i = 0; i < SIZE; i++) {\r\n board[i] = [];\r\n for (var j = 0; j < SIZE; j++) {\r\n board[i][j] = {\r\n minesAroundCount: 0,\r\n isShown: false,\r\n isMine: false,\r\n isMarked: true,\r\n i: i,\r\n j: j,\r\n neighbors: []\r\n };\r\n }\r\n }\r\n var firstBoom = board[getRandomInt(0, 3)][getRandomInt(0, 3)];\r\n firstBoom.isShown = true;\r\n firstBoom.isMine = true;\r\n var seconedBoom = board[getRandomInt(0, 3)][getRandomInt(0, 3)];\r\n seconedBoom.isMine = true;\r\n seconedBoom.isShown = true;\r\n console.log('boom1: ', firstBoom.i, ',', firstBoom.j, 'boom2: ', seconedBoom.i, ',', seconedBoom.j)\r\n\r\n setMinesNegsCount(board);\r\n return board;\r\n\r\n}", "title": "" }, { "docid": "3d77aa5cc0f6beac239517fbbef4023e", "score": "0.6007211", "text": "function randomizer(mn,mx){\n\n //Create the variable to hold the random number\n //Math.random() * (max-min) + min;\n var randomNumber = Math.round(Math.random() * (mx-mn) + Number(mn));\n\n\n //Return the random number back tot he code\n return randomNumber;\n }", "title": "" }, { "docid": "55eb398ee729065a5145819ed6d09426", "score": "0.6000282", "text": "randomize() {\n // !!!! IMPLEMENT ME !!!!\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n this.cells[this.currentBufferIndex][h][w] = (Math.random() * 2) | 0;\n }\n }\n }", "title": "" }, { "docid": "b297810f9aad0a06b7bb204e74e57a57", "score": "0.59840465", "text": "function randomCellGenerator() {\n let rndRow, rndCol, val;\n val = 2;\n do {\n rndRow = Math.floor(Math.random() * 4 );\n rndCol = Math.floor(Math.random() * 4 );\n }\n while ( !!board[rndRow][rndCol] );\n\n board[rndRow][rndCol] = val;\n render();\n}", "title": "" }, { "docid": "e2a0fb08417512f6b0806b8e557dd414", "score": "0.59830064", "text": "function place_mines(field, x, y) {\n\tplaced_mines = 0;\n\n\twhile(placed_mines < MINE_COUNT) {\n\t\trx = Math.floor(Math.random() * FIELD_WIDTH);\n\t\try = Math.floor(Math.random() * FIELD_HEIGHT);\n\n\t\tif(rx === x && ry === y) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif(field[ry][rx] !== DEFAULT_MINE_TILE_VALUE) {\n\t\t\tplaced_mines++;\n\t\t\tfield[ry][rx] = DEFAULT_MINE_TILE_VALUE;\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "e4bea0303bf0d0ca992a29b1cf1591d1", "score": "0.59762347", "text": "static primRandomMaze(graph)\n {\n this._graph = graph;\n var numOfVerticies = this._graph.adjacent.length;\n //create an array of bool \n //describes which vertex is part of the maze\n this._ofTheMaze = this.fillArrayWith(numOfVerticies,false);\n //2. Pick a cell, mark it as part of the maze. \n // Add the walls of the cell to the wall list.\n var listOfNeighbors = this._graph.adjacent[0];\n var s = listOfNeighbors[0];\n //marks the source vertex as part of the maze\n this._ofTheMaze[s.name] = true;\n var q = [];\n //Adds any neighbors of the source vertix to the queue\n for(var i=0; i!=listOfNeighbors.length;++i)\n {\n if(listOfNeighbors[i].name != s.name)\n {\n q.push(listOfNeighbors[i]);\n }\n }\n //3. While there are walls in the list:\n while(q.length!=0)\n {\n var numOfWalls = q.length;\n // i) Pick a random wall from the list.\n var randomPick = Math.floor(Math.random()* numOfWalls);\n var u = q[randomPick];\n //If only one of the two cells that the wall divides is visited\n if(this.oneOfTheTwoIsVisited(u)){\n //a) Make the wall a passage\n this._ofTheMaze[u.name] = true;\n var neighborIndex = this.getNeighbor(u);\n //get the neighbor vertex\n //var neighbor = this._graph.adjacent[neighborIndex][0];\n //mark the unvisited cell as part of the maze.\n this._ofTheMaze[neighborIndex] = true;\n this._ofTheMaze[u.pre.name] = true;\n //b) Add the unvisited neighboring walls of the cell to the wall list\n var adjacentNeighbors = this._graph.adjacent[neighborIndex];\n for(var i=0; i!= adjacentNeighbors.length ;++i){\n var v = adjacentNeighbors[i];\n if(v.name != s.name\n &&\n !(this._ofTheMaze[v.name]))\n q.push(v);\n }\n }\n //ii) Remove the wall from the list.\n q.splice(randomPick,1);\n }\n\n }", "title": "" }, { "docid": "3cb61af8acd7985be7c541d69f6b138d", "score": "0.5976148", "text": "function createArray(){\n\n // randomizing the mines\n\n for (var i = 0; i < 10; i++) {\n var x = Math.floor(Math.random()*9);\n var y = Math.floor(Math.random()*9);\n if (value[x][y].textContent === \"0\") {\n i--;\n }else{\n value[x][y].textContent = \"0\";\n }\n\n }\n\n // giving values to non-mine boxes\n for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10; j++) {\n // count of mine aound it\n var c = 0;\n // selecting non- mine boxes\n if(value[i][j].textContent !== \"0\"){\n // check for cornor boxes\n if(i!==0 && j!==0)\n if(value[i-1][j-1].textContent===\"0\")\n c++;\n if(i!==0)\n if(value[i-1][j].textContent===\"0\")\n c++;\n if(i!==0 && j!==9)\n if(value[i-1][j+1].textContent===\"0\")\n c++;\n if(j!==0)\n if(value[i][j-1].textContent===\"0\")\n c++;\n if(j!==9)\n if(value[i][j+1].textContent===\"0\")\n c++;\n if(i!==9 && j!==0)\n if(value[i+1][j-1].textContent===\"0\")\n c++;\n if(i!==9)\n if(value[i+1][j].textContent===\"0\")\n c++;\n if(i!==9 && j!==9)\n if(value[i+1][j+1].textContent===\"0\")\n c++;\n if(c===0){\n value[i][j].textContent = \"\"\n }else{\n value[i][j].textContent = c;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5c5ba5a3ff82ee9644eb6183532ec9a3", "score": "0.5973541", "text": "function seedGrid() {\n currentGrid.forEach(column => {\n column.forEach(cell => {\n if ( inBounds(cell.x, cell.y) ) {\n if (Math.floor((Math.random() * 10) + 1) < startDensity) {\n cell.status = \"alive\"\n }\n }\n })\n })\n}", "title": "" }, { "docid": "9f76a2ff09a701aaca95d06db1d8f0fb", "score": "0.59608364", "text": "randomWeight() {\n for (let i = 0; i < this.rows; i++){\n for (let j = 0; j < this.cols; j++){\n this.data[i][j] = Math.random() * 2 - 1;\n }\n }\n }", "title": "" }, { "docid": "fc9842ee8e23961e3fe280b8f6a96aae", "score": "0.59601116", "text": "function initializeMines(targetX, targetY){\r\n\t\tvar tempCells = [];\r\n\t\t\r\n\t\tfor(var x = 0; x < width; x++){\r\n\t\t\tfor(var y = 0; y < height; y++){\r\n\t\t\t\tif(x >= targetX-1 && x <= targetX+1 && y >= targetY-1 && y <= targetY+1){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\ttempCells.push(cells[x][y]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tshuffle(tempCells);\r\n\t\t\r\n\t\tfor(var i = 0; i < mineCount; i++){\r\n\t\t\ttempCells[i].IsMine = true;\r\n\t\t\t\r\n\t\t\tfor(var x = tempCells[i].X-1; x <= tempCells[i].X+1; x++){\r\n\t\t\t\tfor(var y = tempCells[i].Y-1; y <= tempCells[i].Y+1; y++){\r\n\t\t\t\t\tif(x >= 0 && x < width && y >= 0 && y < height){\r\n\t\t\t\t\t\tcells[x][y].AdjacentMineCount += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tminesInitialized = true;\r\n\t}", "title": "" }, { "docid": "d1e278a2741314b7c9d2b1c73b055d57", "score": "0.5958727", "text": "seedGrid() {\n let newGrid = this.grid.map((arr) => [...arr]); // Duplicate grid array\n\n // Randomise cell states and return updated grid\n for (let row = 0; row < this.gridRows; row++) {\n for (let col = 0; col < this.gridCols; col++) {\n newGrid[row][col] = Math.random() > 0.5 ? 1 : 0; // 50% chance for cell to be 1 (alvie) or 0 (dead)\n }\n }\n\n this.grid = newGrid; // Overwrites the current grid with the new seeded grid\n this.render(); // Render grid canvas changes\n }", "title": "" }, { "docid": "a9c4c67f26bbfebbb3c1d146c00e20a0", "score": "0.59410805", "text": "function spawnTiles() {\n\tfor (var i = 0; i < 5; i++) {\n\t\tfor (var j = 0; j < 5; j++) {\n\t\t\tif (tileArray[i][j] == null) {\n\t\t\t\t\n\t\t\t\tvar spawnChancePercentage;\n\t\t\t\tif(highestCount > 1500){\n\t\t\t\t\tspawnChancePercentage = 30;\n\t\t\t\t}\n\t\t\t\telse if(highestCount > 300){\n\t\t\t\t\tspawnChancePercentage = 23;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tspawnChancePercentage = 15;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar randoSpawn = randomInt(0, 100);\n\t\t\t\tif (randoSpawn < spawnChancePercentage) {\n\t\t\t\t\t//generate tile\n\t\t\t\t\tvar tempTile;\n\t\t\t\t\tvar randoColor = randomInt(1, 5);\n\t\t\t\t\tswitch (randoColor) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\ttempTile = TilePrefab(\"blue\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\ttempTile = TilePrefab(\"green\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\ttempTile = TilePrefab(\"red\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\ttempTile = TilePrefab(\"yellow\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(highestCount > 2000){\n\t\t\t\t\t\ttempTile.count = randomInt(1, 33);\n\t\t\t\t\t}\n\t\t\t\t\telse if(highestCount > 500){\n\t\t\t\t\t\ttempTile.count = randomInt(1, 17);\n\t\t\t\t\t}\n\t\t\t\t\telse if(highestCount > 100){\n\t\t\t\t\t\ttempTile.count = randomInt(1, 9);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttempTile.count = randomInt(1, 5);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tstage.addChild(tempTile.container); //adds tile graphics container to stage so it can be rendered\n\t\t\t\t\ttileArray[i][j] = tempTile;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ccc1ba3bde2fe3ce518f0486efd2327e", "score": "0.5927908", "text": "function random(mn, mx) {\n return Math.random() * (mx - mn) + mn;\n}", "title": "" }, { "docid": "2c189fdbdc4f8c5c8de2211bde9c75d3", "score": "0.59231967", "text": "function setMinesManually(board, elCell) {\n gElManualMines.push(elCell);\n var elCellCoord = getCellCoord(elCell.className);\n board[elCellCoord.i][elCellCoord.j].isMine = true;\n elCell.innerHTML = MINE;\n //add the mine to gLevel;\n gLevel.mines += 1;\n}", "title": "" }, { "docid": "648edb4b59548802576efb4dd3eab9e2", "score": "0.591116", "text": "randomiseGrid() {\r\n for(var n = 0; n < this.stepCount; n++) {\r\n for(var x = 0; x < this.gridSizeX; x++) {\r\n for(var y = 0; y < this.gridSizeX; y++) {\r\n this.step[n].cell[x][y] = 2*Math.random() - 1;\r\n }\r\n }\r\n }\r\n this.iterationCount = 0;\r\n }", "title": "" }, { "docid": "898e0525cf9e0ee6e0299ff65735c580", "score": "0.5906463", "text": "generateRandomCellValue() {\n let value = Math.floor(Math.random()*2) + 1;\n return value * 2;\n }", "title": "" }, { "docid": "ff44a68f6795b999984f55d78d3b9ed7", "score": "0.5899214", "text": "function init_items(){\n\t\n\tlet coin1x = Math.floor(Math.random()*4),\n\tcoin1y = Math.floor(Math.random()*4);\n\twhile(map[coin1x][coin1y]!=COIN_ONE){\n\t\tcoin1x = Math.floor(Math.random()*4);\n\t\tcoin1y = Math.floor(Math.random()*4);\n\t\tif(map[coin1x][coin1y]==FLOOR)\n\t\t\tmap[coin1x][coin1y]=COIN_ONE;\n\t}\n\t\n\tlet coin2x = Math.floor(Math.random()*4),\n\tcoin2y = Math.floor(Math.random()*4)+4;\n\twhile(map[coin2x][coin2y]!=COIN_ONE){\n\t\tcoin2x = Math.floor(Math.random()*4);\n\t\tcoin2y = Math.floor(Math.random()*4)+4;\n\t\tif(map[coin2x][coin2y]==FLOOR)\n\t\t\tmap[coin2x][coin2y]=COIN_ONE;\n\t}\n\t\n\tlet coin3x = Math.floor(Math.random()*4)+4,\n\tcoin3y = Math.floor(Math.random()*4);\n\twhile(map[coin3x][coin3y]!=COIN_ONE){\n\t\tcoin3x = Math.floor(Math.random()*4)+4;\n\t\tcoin3y = Math.floor(Math.random()*4);\n\t\tif(map[coin3x][coin3y]==FLOOR)\n\t\t\tmap[coin3x][coin3y]=COIN_ONE;\n\t}\n\tlet coin4x = Math.floor(Math.random()*4)+4,\n\tcoin4y = Math.floor(Math.random()*4)+4;\n\twhile(map[coin4x][coin4y]!=COIN_ONE){\n\t\tcoin4x = Math.floor(Math.random()*4)+4;\n\t\tcoin4y = Math.floor(Math.random()*4)+4;\n\t\tif(map[coin4x][coin4y]==FLOOR)\n\t\t\tmap[coin4x][coin4y]=COIN_ONE;\n\t}\n\t\n\tlet coin_stack1x = Math.floor(Math.random()*7),\n\tcoin_stack1y = Math.floor(Math.random()*4);\n\twhile(map[coin_stack1x][coin_stack1y]!=COIN_STACK){\n\t\tcoin_stack1x = Math.floor(Math.random()*7);\n\t\tcoin_stack1y = Math.floor(Math.random()*4);\n\t\tif(map[coin_stack1x][coin_stack1y]==FLOOR)\n\t\t\tmap[coin_stack1x][coin_stack1y]=COIN_STACK;\n\t}\n\t\n\tlet coin_stack2x = Math.floor(Math.random()*7),\n\tcoin_stack2y = Math.floor(Math.random()*4)+4;\n\twhile(map[coin_stack2x][coin_stack2y]!=COIN_STACK){\n\t\tcoin_stack2x = Math.floor(Math.random()*7);\n\t\tcoin_stack2y = Math.floor(Math.random()*4)+4;\n\t\tif(map[coin_stack2x][coin_stack2y]==FLOOR)\n\t\t\tmap[coin_stack2x][coin_stack2y]=COIN_STACK;\n\t}\t\n\tlet chest1x = Math.floor(Math.random()*7),\n\tchest1y = Math.floor(Math.random()*4);\n\twhile(map[chest1x][chest1y]!=CLOSED_CHEST){\n\t\tchest1x = Math.floor(Math.random()*7);\n\t\tchest1y = Math.floor(Math.random()*4);\n\t\tif(map[chest1x][chest1y]==FLOOR)\n\t\t\tmap[chest1x][chest1y]=CLOSED_CHEST;\n\t}\n\tlet chest2x = Math.floor(Math.random()*7),\n\tchest2y = Math.floor(Math.random()*4)+4;\n\twhile(map[chest2x][chest2y]!=CLOSED_CHEST){\n\t\tchest2x = Math.floor(Math.random()*7);\n\t\tchest2y = Math.floor(Math.random()*4)+4;\n\t\tif(map[chest2x][chest2y]==FLOOR)\n\t\t\tmap[chest2x][chest2y]=CLOSED_CHEST;\n\t}\n\t\n\t\n\tlet battery1x = Math.floor(Math.random()*7),\n\tbattery1y = Math.floor(Math.random()*4);\n\twhile(map[battery1x][battery1y]!=BATTERY){\n\t\tbattery1x = Math.floor(Math.random()*7);\n\t\tbattery1y = Math.floor(Math.random()*4)+4;\n\t\tif(map[battery1x][battery1y]==FLOOR)\n\t\t\tmap[battery1x][battery1y]=BATTERY;\n\t}\t\n\tlet battery2x = Math.floor(Math.random()*7),\n\tbattery2y = Math.floor(Math.random()*4);\n\twhile(map[battery2x][battery2y]!=BATTERY){\n\t\tbattery2x = Math.floor(Math.random()*7);\n\t\tbattery2y = Math.floor(Math.random()*4);\n\t\tif(map[battery2x][battery2y]==FLOOR)\n\t\t\tmap[battery2x][battery2y]=BATTERY;\n\t}\n\t\n}", "title": "" }, { "docid": "4fa6f54e5331b21f3bfab4d885528cd5", "score": "0.5896905", "text": "spawnNew() {\n const ran = Math.floor(Math.random() * 16);\n if (this.info[ran].val == 0) {\n this.info[ran].val = Math.random() > 0.5 ? 4 : 2;\n } else {\n this.spawnNew();\n }\n }", "title": "" }, { "docid": "99ae718c7bbfad2d1ad377a04f7ecd73", "score": "0.58934593", "text": "makeMineField(height, width, mineCount) {\n // Could have just done the whole {mine: false, adjMineCount: 0} bity, but wanted to try something newer\n // Yeah, I haven't used objects much in JS which is kinda sad considering I do mostly frontend work...\n let Square = function (mine, adjMineCount, x, y) {\n this.mine = mine;\n this.adjMineCount = adjMineCount;\n this.x = x;\n this.y = y;\n this.flagged = false;\n this.hidden = true;\n }\n // Interesting way of creating an array... originally used .fill, but then all indices would reference the same square :/\n // Creates an array from the array-like object that has the desired length\n // Fill first array of length height with arrays of length width filled with new squares\n let x = 0, y = 0;\n let field = Array.from({length: height}, () => {\n x = 0;\n let arr = Array.from({length: width}, () => (new Square(false, 0, x++, y)));\n y++;\n return arr;\n });\n\n // Randomly figure out where to place the mines\n let mineSet = new Set();\n // Helper function for calculating random coords\n function randInt(max) {\n return Math.floor(Math.random() * max);\n }\n // Uses set to avoid duplicates, continues until set is large enough\n // So... unfortunately doesn't compare the values within objects, rather just the references\n // Using JSON.stringify to create primitive strings for each object, will use JSON.parse on removal\n while (mineSet.size < mineCount) {\n mineSet.add(JSON.stringify({x: randInt(width), y: randInt(height)}));\n }\n\n // Place the mines in field, incrementing adjMineCount in surrounding squares (include self for simplicity)\n mineSet.forEach(e => {\n // Necessary since I stored the objects as strings for the unfortunate reasons mentioned previously\n let coord = JSON.parse(e);\n // Set mine to true\n field[coord.y][coord.x].mine = true;\n // Increment adjMineCount in 3 x 3 square centered at coord\n for (let h = coord.y - 1; h <= coord.y + 1; h++) {\n for (let w = coord.x - 1; w <= coord.x + 1; w++) {\n // Bounds check, just did continue since it tickled my fancy and avoids extra negation\n if (h < 0 || h >= height || w < 0 || w >= width)\n continue;\n field[h][w].adjMineCount++;\n }\n }\n });\n\n return field;\n }", "title": "" }, { "docid": "be3732b263c35cea0a94f8f17f7c29ae", "score": "0.589187", "text": "function xSpawnLimit() {\n return Math.floor(Math.random()* 10+5)*box;\n}", "title": "" }, { "docid": "9ab8fc0fa53ec99fdeab98e0bc9257a8", "score": "0.58891326", "text": "function friendGen () {\n const ranfriend = friendList[Math.floor(Math.random() * friendList.length)];\n //removes gravity from clouds and has them float along at random speeds\n gameState.friends.create(-55, 460, ranfriend).setGravityY(-200).setVelocityX(85);\n }", "title": "" }, { "docid": "890edbfce5445b8db07fad8d713d792d", "score": "0.5877658", "text": "function SetRandomStates() {\n let tmpRow;\n let tmpCol;\n let tmpState;\n for (let i = 0; i < 81 ; i++) {\n [tmpRow, tmpCol] = indexToRowCol(i);\n tmpState = states[Math.floor(Math.random() *3)];\n SetCellState(tmpRow, tmpCol, tmpState);\n }\n}", "title": "" }, { "docid": "1c896e667a2cadee3ae73e7255c4b1a4", "score": "0.58661157", "text": "function createrandomNum() {\n\tmyMouse.randomNum = Math.floor(Math.random()*60);\n\twhile (myMouse.sameRandom == myMouse.randomNum || myMouse.randomNum == 0) {\n\t\tmyMouse.randomNum = Math.floor(Math.random()*60);\n\t}\n\tmyMouse.sameRandom = myMouse.randomNum;\n\t$(\"#mole div\").eq(myMouse.randomNum).removeClass(\"disappear\").addClass(\"appear\");\n}", "title": "" }, { "docid": "3498bc4f5ecd2c912c0584206abdde67", "score": "0.58612114", "text": "function floodFillMinesweeper(row, col){\r\n \r\n if(grid[row][col].v == 1){\r\n console.log('you died');\r\n showMines();\r\n deadAudio.play();\r\n \r\n return;\r\n }\r\n\r\n // if(grid[row][col].v == 1){\r\n // if(row < orCellX){\r\n // if(row > topBorder){\r\n // topBorder = row;\r\n // }\r\n // }\r\n\r\n // if(row > orCellX){\r\n // if(row < bottomBorder){\r\n // bottomBorder = row;\r\n // }\r\n // }\r\n\r\n // if(col < orCellY){\r\n // if(col > leftBorder){\r\n // leftBorder = col;\r\n // }\r\n // }\r\n\r\n \r\n // if(col > orCellY){\r\n // if(col < rightBorder){\r\n // rightBorder = col;\r\n // }\r\n // }\r\n // }\r\n \r\n\r\n if(grid[row][col].col == newColor)\r\n return;\r\n\r\n if(grid[row][col].v == 0){\r\n grid[row][col].v == 2;\r\n grid[row][col].col = newColor;\r\n cellCount++;\r\n\r\n console.log(cellCount);\r\n\r\n if(cellCount == (64 - difficulty.medium)){\r\n console.log('you win');\r\n winText.setVisible(true);\r\n winAudio.play();\r\n }\r\n\r\n if(mineCount[row][col] != 0){\r\n \r\n if(mineCount[row][col] == '1')\r\n displayText[row][col].tint = 0x0000ff; \r\n else if(mineCount[row][col] == '2')\r\n displayText[row][col].tint = 0xff0000; \r\n else if(mineCount[row][col] == '3')\r\n displayText[row][col].tint = 0x7a005d; \r\n else \r\n displayText[row][col].tint = 0x000000; \r\n \r\n \r\n displayText[row][col].text = mineCount[row][col];\r\n\r\n return;\r\n }\r\n \r\n if(row < bottomBorder){\r\n floodFillMinesweeper(row + 1, col);\r\n }\r\n \r\n if(col < rightBorder)\r\n floodFillMinesweeper(row, col + 1);\r\n \r\n if(col > leftBorder)\r\n floodFillMinesweeper(row, col - 1);\r\n \r\n if(row > topBorder)\r\n floodFillMinesweeper(row - 1, col);\r\n\r\n\r\n \r\n }\r\n}", "title": "" }, { "docid": "f50eeaeee679d5ee0f2e09093f7ba4dd", "score": "0.58596563", "text": "function randomTile() {\n\t\treturn Math.floor(Math.random() * numTileTypes);\n\t}", "title": "" }, { "docid": "e451f8526fc4f3ccbfcd8899319600d2", "score": "0.58560914", "text": "obstacles() {\n let averageObstacles = Math.floor((this.width * this.height) / ((this.width + this.height) / 2));\n for (let obstacles = 0; obstacles < averageObstacles; obstacles++) {\n let cell = this.randomFreeCell();\n cell.obstacle = true;\n cell.element.addClass(\"wall\");\n }\n }", "title": "" }, { "docid": "95dcd1a6be73749dd65b8da72764befb", "score": "0.58364135", "text": "spawn_powerup(pos){\n // get a list of currently not active powerups from pool\n var items = this.powerups.filter(x=>!x.is_moving);\n // get random item from that list\n var p = items[Math.floor(Math.random() * items.length)];\n // spawn it at given position\n p.startPosition(pos.x, pos.y);\n p.is_moving = true;\n }", "title": "" }, { "docid": "f65192d3ea6ceef0d07dd9968d357b20", "score": "0.58357185", "text": "function randomCells(numberOfCells, mapType, cellType, player2control) {\n // pick random function using row || column length\n var random = function(number) {\n return Math.floor(Math.random() * number);\n };\n\n // loops until number of cells requested is zero\n while (numberOfCells--) {\n var randomRow = random(ROWS);\n var randomColumn = random(COLUMNS);\n\n // if map tile is clear, assigned it to its type\n if (!map[randomRow][randomColumn] && !player2control) {\n mapType[randomRow][randomColumn] = cellType;\n\n // is random tile clear && not player 1\n } else if (\n !map[randomRow][randomColumn] &&\n gameObjects[randomRow][randomColumn] !== PLAYER1 &&\n player2control\n ) {\n // is random tile away at least +1/-1 from player 1\n if (\n randomRow > player1Row + 1 ||\n randomRow < player1Row - 1 ||\n randomColumn > player1Column + 1 ||\n randomColumn < player1Column - 1\n ) {\n // assign location to player 2\n gameObjects[randomRow][randomColumn] = PLAYER2;\n\n // if random tile is close to player 1 reloop\n } else {\n numberOfCells++;\n }\n\n // if map tile is not clear, try again\n } else {\n numberOfCells++;\n }\n }\n}", "title": "" }, { "docid": "bd37f44673392283670625940466b7ea", "score": "0.58314043", "text": "function buildBoard() {\n var size = gLevel1.SIZE;\n var field = [];\n for (var i = 0; i < size; i++) {\n field[i] = [];\n for (var j = 0; j < size; j++) {\n field[i][j] = createCell();\n }\n }\n var mineCount = gLevel1.mineCount;\n for (var i = 0; i < mineCount;) {\n var x = getRandomInt(0, 10);\n var y = getRandomInt(0, 10);\n if (!field[x][y].isMine) {\n field[x][y].isMine = true;\n i++;\n }\n }\n console.table(field);\n return (field);\n}", "title": "" }, { "docid": "5cc7d76364e5b116d16b753344e12672", "score": "0.5822241", "text": "function randomBlock() {\n return Math.floor(Math.random() * 4);\n}", "title": "" }, { "docid": "df613440857c05d7dd889258ec4f360c", "score": "0.58215594", "text": "function checkWin() {\r\n\r\n // Cleared is the amount of cells minus the amount of mines\r\n let cleared = size * size - mines;\r\n\r\n // For recording flagged cells\r\n let flagged = 0;\r\n let falseFlag = 0;\r\n\r\n // Iterate through every cell\r\n for(let y = 0; y < size; y++) {\r\n for(let x = 0; x < size; x++) {\r\n // If the cell is flagged\r\n if (grid[x][y][2]) {\r\n // If the cell is a mine, increment flagged\r\n if (grid[x][y][0] == 0)\r\n flagged++\r\n else\r\n // If it is flagged but not a mine increment falseFlag\r\n falseFlag++;\r\n }\r\n // If the cell is cleared and not a mine, decrement cleared\r\n if (grid[x][y][1] && grid[x][y][0] > 0) cleared--;\r\n }\r\n }\r\n\r\n // If cleared is 0, the only cells left are mines\r\n // If all flags have been placed on mines, we have located all mines\r\n if (cleared == 0 || flagged - falseFlag == mines) {\r\n // Set game over to true\r\n gameOver = true;\r\n \r\n // Stop the timer\r\n clearInterval(timer);\r\n\r\n // Set the face to cool guy cos you won\r\n let face = document.getElementById(\"new-game\");\r\n face.style.backgroundImage = \"url('images/smiley_win.png')\";\r\n }\r\n}", "title": "" }, { "docid": "6313423d1aad8e47ecd86325413a0231", "score": "0.58097786", "text": "function randomGrass (num) {\n return (num % 2 == 0) ? 0 : 5;\n}", "title": "" }, { "docid": "598677ca07f776908a33850a1d9b59b8", "score": "0.58068967", "text": "function randomSquare() {\n square.forEach(className => {\n className.classList.remove('mole')\n })\n let randomPosition = square[Math.floor(Math.random() * 9)]\n randomPosition.classList.add('mole')\n\n hitPosition = randomPosition.id\n}", "title": "" }, { "docid": "2d852aa685df5e7ec3b6107c37cdb7e8", "score": "0.5806271", "text": "function getRandomIndexFromFreeCells() {\n getFreeTileIndeces()\n randomIndex = Math.floor(Math.random() * arrayOfFreePos.length)\n return arrayOfFreePos[randomIndex]\n}", "title": "" }, { "docid": "215946d1c458c96194879a0d0088ebfe", "score": "0.5806052", "text": "addRandomTiles(count) {\n\n for (let i = 0; i < count; i++) {\n\n if (!this.slotsLeft()) {\n return false\n }\n let x, y\n do {\n x = _random(0, this.TILES_PER_ROW - 1)\n y = _random(0, this.TILES_PER_ROW - 1)\n } while (!this.slotIsFree(x, y))\n\n //get a random value between 2 and 4 but that has 4 times\n // more chances to be a 2 than 4\n const value = _sample([2, 2, 2, 2, 4])\n\n this.createTile(x, y, value)\n }\n return true\n }", "title": "" }, { "docid": "975cfc377b4b1776b12b2acfa3146d09", "score": "0.5805159", "text": "function revealMines() {\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard.length; j++) {\n var elCell = document.querySelector(`#td-${i}-${j}`);\n if (gBoard[i][j].isMine) {\n elCell.classList.add('mine-step');\n elCell.innerText = MINE;\n }\n if (gBoard[i][j].isMarked && !gBoard[i][j].isMine) {\n elCell.innerText = WRONG;\n }\n }\n }\n}", "title": "" }, { "docid": "3e91d9f55a1475de84dd4272f9c472e2", "score": "0.5797722", "text": "function randomTerrain(){\n\t//grass - 70%, wter - 10%, earth - 20%\n\tvar chance = Math.floor(Math.random() * 100);\n\tif(chance > 30)\n\t\treturn 0;\n\telse if(chance > 20)\n\t\treturn 1;\n\telse\n\t\treturn 2;\n}", "title": "" }, { "docid": "2b6d07a9025bb03ea721525737625e8a", "score": "0.57966673", "text": "function cellMarked(elCell)\r\n\r\n\r\n\r\n\r\nfunction random_location() {\r\n return {\r\n lon: Math.floor(Math.random() * 360) - 179,\r\n lat: Math.floor(Math.random() * 181) - 90\r\n }\r\n}", "title": "" }, { "docid": "8622dc90c7d50a4c5b9671f67fb3e2f9", "score": "0.57919705", "text": "function implantMine()\n{\n\tvar qnt=7;\n\tvar mine=\"\";\n\n\twhile (qnt > 0)\n\t{\n\t\tvar x = getRandomInt();\n\t\tvar y = getRandomInt();\n\t\tqnt--;\n\t\tconsole.log(x,y);\n\t\tmine=document.getElementById(x+\",\"+y);\n\t\tmine.setAttribute('value', '*');\n\t}\n}", "title": "" }, { "docid": "1e53b6f638b4cef238246fc836bee5b4", "score": "0.5789379", "text": "function shuffledCells()\n{\n\t//create an array with all 81 cell positions\n\tvar positions = [];\n\tfor(var i = 0; i < 9; i++)\n\t{\n\t\tfor(var j = 0; j < 9; j++)\n\t\t{\n\t\t\tpositions.push([i, j]);\n\t\t}\n\t}\n\t//shuffle the array\n\tvar shuff = [];\n\tfor(var i = 0; i < 81; i++)\n\t{\n\t\tvar index = randomInt(positions.length - 1);\n\t\tshuff.push(positions[index]);\n\t\tremove(positions, index);\n\t}\n\treturn shuff;\n}", "title": "" }, { "docid": "2982f9bc588da591fc5a8b77c8719b4e", "score": "0.57871586", "text": "generateRandomPos() {\n if (this.generateRandomSite() == 1) {\n //Powerup spawns at top border\n this.posX = Math.floor(Math.random() * this.canvasWidth);\n this.posY = 0;\n } else if (this.generateRandomSite() == 2) {\n //Powerup spawns at right border\n this.posX = this.canvasWidth;\n this.posY = Math.floor(Math.random() * this.canvasHeight);\n } else if (this.generateRandomSite() == 3) {\n //Powerup spawns at bottom border\n this.posX = Math.floor(Math.random() * this.canvasWidth);\n this.posY = this.canvasHeight;\n } else {\n //Powerup spawns at left border\n this.posX = 10;\n this.posY = Math.floor(Math.random() * this.canvasHeight);\n }\n }", "title": "" }, { "docid": "3ad6b2749d480bd5e4a5489ed348dbef", "score": "0.57866573", "text": "_spawnFood() {\n var r = -1, c;\n while (r == -1 || this.board[r][c] !== 0) {\n r = Math.floor((Math.random() * this.boardSize));\n c = Math.floor((Math.random() * this.boardSize));\n }\n this.board[r][c] = -1;\n return true;\n }", "title": "" }, { "docid": "e0bab63fddf09a4f3a8fd459d7105042", "score": "0.57863265", "text": "function getSafeCell() {\n var safeCells = [];\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard[0].length; j++) {\n var cell = gBoard[i][j];\n if (!cell.isShowen && !cell.isMine && !cell.isMarked) {\n safeCells.push({ i, j });\n }\n }\n }\n if (safeCells.length === 0) {\n alert('No empty cells left')\n return;\n }\n console.log(safeCells, 'length is:', safeCells.length);\n var randIdx = getRandomInteger(0, safeCells.length - 1);\n return safeCells[randIdx];\n}", "title": "" }, { "docid": "06ba2f633df8deb29b696ccb182d9d79", "score": "0.5783784", "text": "function randomRow() {\n return 1 + Math.floor(Math.random() * (gridlength - 2) );\n}", "title": "" }, { "docid": "bb2d0f8c958b4958528b78afa880d321", "score": "0.57810754", "text": "function setMines() {\n let buttons = document.querySelectorAll('button');\n let bombPositions = new Array(10);\n let gridIds = new Array(81);\n for (let i = 0; i < gridIds.length; ++i) {\n gridIds[i] = Number(buttons[i].id);\n }\n const max = 88, min = 0;\n for (let i = 0; i < bombPositions.length; ++i) {\n let possible = true;\n while (possible) {\n let bombPos = Math.floor(Math.random() * (max - min + 1) + min);\n if (gridIds.includes(bombPos) && !bombPositions.includes(bombPos)) {\n bombPositions[i] = bombPos;\n possible = false;\n } else {\n possible = true;\n }\n }\n }\n buttons.forEach(function (btn) {\n let btnId = btn.getAttribute('id');\n bombPositions.forEach(function (value) {\n if (btnId === value.toString()) {\n btn.style.color = 'darkred';\n }\n })\n });\n}", "title": "" }, { "docid": "158847d7e405c738a4f87d4409dabc18", "score": "0.5779869", "text": "function randomDanger(){\n\n\t//acquire a random number within the grid\n\tvar rand = Math.floor((Math.random() * 140) + 1);\n\twhile(rand == 0 ||\n\t\t inArray(rand, dangerous) ||\n\t\t inArray(rand, portals) ||\n\t\t inArray(rand, walls)) {\n\n\t\trand = Math.floor((Math.random() * 140 + 1));\n\t}\n\n\tvar elem = document.getElementById(rand);\n\telem.className = \"danger square\";\n\telem.type = \"Danger\";\n\tdangerous.push(rand);\n}", "title": "" }, { "docid": "d42eba1ca47cbe02b2fac54b84afb0c7", "score": "0.5768633", "text": "function MineSweep() {\n\n //Player attached to the game.\n var player = new Player();\n\n // private field holding the current level; \n var level;\n\n this.Level = function () { return level; };\n\n // Method responsible for initalizing a new game session.\n this.InitGame = function (length, width, mines) {\n\n CreateLevel(length, width,mines);\n\n FillBoard();\n\n };\n\n // Method responsible for running the game.\n this.RunGame = function (curNode,e) {\n \n UpdateLevel(curNode,e);\n };\n\n // Method resposible for ending a game session.\n this.EndGame = function () {\n\n\n };\n\n // Get current player\n this.Player = function () {\n return player;\n };\n\n // Set current player. \n this.SetPlayer = function (newPlayer) {\n player = newPlayer;\n };\n\n function CreateLevel(length, width, mines) {\n level = new Array();\n\n for (i = 0; i < parseInt(length) ; i++) {\n\n tmpRow = new Array();\n\n for (j = 0; j < (parseInt(width)) ; j++) {\n\n tmpNode = new Node(j, i);\n tmpRow.push(tmpNode);\n\n }\n\n level.push(tmpRow);\n }\n\n\n //Add mines; \n for (i = 0; i < mines; i++) {\n rndX = Math.floor((Math.random() * length));\n rndY = Math.floor((Math.random() * width));\n level[rndY][rndX].IsMine = true;\n }\n\n AddNumOfMinesToLevel();\n\n\n\n\n }\n // Update level during game.\n function UpdateLevel(curNode,e) {\n // Check mines. \n \n curPosX = curNode.index();\n curPosY = curNode.parent().index();\n node = level[curPosY][curPosX];\n \n\n if (node.IsMine) {\n alert(\"Du förlorade\");\n }\n else if (node.Value > 0) {\n \n curNode.val(node.Value);\n }\n else {\n Reveal(curPosX, curPosY);\n }\n\n \n\n \n\n }\n\n\n function Reveal(x, y) {\n\n if ((x >= 0 && y >= 0 && x < level.length && y < level.length)) {\n\n var node = level[y][x];\n\n $(\"#game-level\").children().eq(y).children().eq(x).css(\"background-color\", \"yellow\")\n\n if (!node.IsRevealed && node.Value == 0) {\n level[y][x].IsRevealed = true;\n\n Reveal(x - 1, y);\n Reveal(x + 1, y);\n Reveal(x, y + 1);\n Reveal(x, y - 1);\n\n }\n else {\n\n \n $(\"#game-level\").children().eq(y).children().eq(x).val(level[y][x].Value > 0 ? level[y][x].Value : \"\");\n level[y][x].IsRevealed = true;\n return;\n\n }\n }\n else { return; }\n\n }\n\n function AddNumOfMinesToLevel() {\n\n\n for (i = 0; i < level.length ; i++) {\n\n for (j = 0; j < level[0].length ; j++) {\n\n level[i][j].Value = GetNumberOfMines(j, i);\n }\n\n }\n\n }\n\n function GetNumberOfMines(x, y) {\n sum = 0;\n\n for (k = y - 1; k <= y + 1; k++) {\n for (m = x - 1; m <= x + 1; m++) {\n\n if (k >= 0 && m >= 0 && m < level.length && k < level.length) {\n\n if (level[k][m].IsMine) {\n\n sum++;\n }\n }\n }\n }\n\n return sum;\n }\n\n function FillBoard() {\n\n var tmpArr = document.getElementById(\"game-level\");\n\n for (var i = 0; i < level.length; i++) {\n var row = \"<div>\";\n\n for (j = 0; j < level.length; j++) {\n\n row += \"<input class='node' value=''/>\";\n }\n\n row += \"</div>\";\n $(tmpArr).append(row);\n }\n\n };\n }", "title": "" }, { "docid": "673806a00ed62e287622e88fb44fe2db", "score": "0.5766891", "text": "function snakesToGen() {\n\tif (level === 0) { return 1; }\n\t\n\tvar numPicker = Math.random();\n\t\n\tif (entities.length-1 < maxSnakes) {\n\t\tif (level < 5) {\n\t\t\tif (numPicker < 0.3) { return 0; }\n\t\t\telse { return 1; }\n\t\t} else {\n\t\t\tif (numPicker < 0.1) { return 0; }\n\t\t\telse if (numPicker > 0.8 && entities.length-1 < maxSnakes-1) { return 2; }\t//return 2 only if we have space for 2\n\t\t\telse { return 1; }\n\t\t}\n\t}\n}", "title": "" }, { "docid": "95fe10a332196104c9261ff536dba51c", "score": "0.576454", "text": "generateWeapons() {\n //to treat the object like an array\n const arrayWeapons = [];\n for (const element in this.weapons) {\n arrayWeapons.push(this.weapons[element]);\n }\n\n //remove the last (=default weapon) bcs it dont't need to be displayed on the map\n arrayWeapons.pop();\n\n // loop 'till the nb of weapons is not achieved\n for (let i = 0; i < this.nbOfWeapons; i++) {\n // selecting a random weapon\n const randomIndexWeapon = random(0, arrayWeapons.length);\n const randomWeapon = arrayWeapons[randomIndexWeapon];\n\n let elPos = `${randomWeapon.x}-${randomWeapon.y}`;\n // adding attribute \"pos\"\n randomWeapon.pos = elPos;\n // selecting the cell id by the attribute \"pos\"\n let tdEltId = $(`#${randomWeapon.pos}`);\n\n //\"if\" statement won't work bcs it watch only 1 time and then pass though the verification\n while (this.getCellContent(elPos) !== 0) {\n //picking a new pos\n let newXpos = random(0, this.nbOfLines); //10 = the maximum x(width) grid\n let newYpos = random(0, this.nbOfColumns); //10 = the maximum y(height) grid\n\n //assignatate the new pos to the weapon\n randomWeapon.x = newXpos;\n randomWeapon.y = newYpos;\n elPos = newXpos + \"-\" + newYpos;\n randomWeapon.pos = elPos;\n\n //selecting a new cell to the weapon\n tdEltId = $(`#${elPos}`);\n }\n //giving class & attribute to the weapon's cell\n tdEltId\n .addClass(`weapon ${randomWeapon.name}`)\n .attr(\"data-weapon\", randomWeapon.name);\n }\n }", "title": "" }, { "docid": "373e5868c2bc450ea7588c51964cbcf1", "score": "0.5751892", "text": "function createRandomPopulation() {\r\n for(var h = 5; h < theGrid.length - 5; h++) {\r\n for(var i = 5; i < theGrid[h].length - 5; i++) \r\n theGrid[h][i] = Math.round(Math.random());\r\n }\r\n gameLoop()\r\n}", "title": "" }, { "docid": "75f1b37b1cd6c1312781c00a1bc9010a", "score": "0.5745766", "text": "function revealMines(x1,y1){\n\n mineSquares.forEach(function(item, index, array) {\n\n var square = item; //holder for current square\n var x = square.getX(); //x val of square\n var y = square.getY(); //y val of square\n\n\n var found = false; //used to manage while loop\n\n var tile = grid.firstElementChild;\n\n while(found == false){\n\n //get coords of current tile\n var tileX = tile.x;\n var tileY = tile.y;\n\n //if coords match x,y of current mine square\n //update the square\n //break out of while loop\n if(x==tileX && y == tileY){\n\n //don't update the square where the mine was hit\n if(x == x1 && y == y1){\n found = true;\n }\n else {\n tile.classList.remove(\"hidden\");\n\n var flagBool = flagCheck(tileX, tileY); //check if flagged\n\n if(flagBool === true){ //if so, show marked mine\n tile.classList.add(\"mine_marked\")\n }\n else { //otherwise show regular mine\n tile.classList.add(\"mine\");\n }\n found = true;\n }\n }\n else{\n tile = tile.nextElementSibling;\n }\n\n }\n });\n}", "title": "" }, { "docid": "d47b1e371a4cecd9d9eb42e4a0d36641", "score": "0.5732871", "text": "randomize() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n // this.matrix[i][j] = randomGaussian();\n // this.matrix[i][j] = random(-1, 1);\n this.matrix[i][j] = getRandom(-1, 1)\n }\n }\n }", "title": "" } ]
cebb260a6c3028c8379e27516448e438
picking a simple representative of that type.
[ { "docid": "1e3e2653a8a0012c8965102efd1244c5", "score": "0.0", "text": "function Format() {\r\n\t\r\n}", "title": "" } ]
[ { "docid": "85cc9afd6e00f7fc85137ca744c374c7", "score": "0.60236275", "text": "get type() {}", "title": "" }, { "docid": "969725b9c0c399ddefae5d18720e3ea4", "score": "0.57500386", "text": "function Typeon () {}", "title": "" }, { "docid": "204cb7e4a3c040f63c1d17c343d563f4", "score": "0.57036215", "text": "_getType(type) {\n switch (type) {\n case 'single':\n case 'multiple':\n return 'Workshop'\n default:\n return type\n }\n }", "title": "" }, { "docid": "ff0a4dd8c65e0dcc284978b5f2f81115", "score": "0.5658484", "text": "function getSingularType(type: GraphQLType): GraphQLSingularType {\n let unmodifiedType = type;\n while (unmodifiedType instanceof GraphQLList) {\n unmodifiedType = unmodifiedType.ofType;\n }\n return (unmodifiedType: any);\n}", "title": "" }, { "docid": "47b25b1f203e407ba53b8b340e994fb8", "score": "0.5632977", "text": "function getTypeIdentifier(Repr){\n return Repr[$$type] || Repr.name || 'Anonymous';\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5628792", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5628792", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5628792", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.5598138", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.5598138", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.5598138", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.5598138", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.5598138", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "193a8a588d0d48d58386b43ceff04cdc", "score": "0.55309105", "text": "function isSimpleType(type) {\n return type.name === 'nat' ||\n type.name === 'int' ||\n type.name === 'char' ||\n type.name === 'string' ;\n}", "title": "" }, { "docid": "ea9eb525b64fc3fb20a156a4abfc4ea9", "score": "0.55242425", "text": "get type () { return this._type }", "title": "" }, { "docid": "505341079082e45e304090968bee24ed", "score": "0.55198383", "text": "function miniKindOf(val) {\n\t if (val === void 0) return 'undefined';\n\t if (val === null) return 'null';\n\t var type = typeof val;\n\t\n\t switch (type) {\n\t case 'boolean':\n\t case 'string':\n\t case 'number':\n\t case 'symbol':\n\t case 'function':\n\t {\n\t return type;\n\t }\n\t }\n\t\n\t if (Array.isArray(val)) return 'array';\n\t if (isDate(val)) return 'date';\n\t if (isError(val)) return 'error';\n\t var constructorName = ctorName(val);\n\t\n\t switch (constructorName) {\n\t case 'Symbol':\n\t case 'Promise':\n\t case 'WeakMap':\n\t case 'WeakSet':\n\t case 'Map':\n\t case 'Set':\n\t return constructorName;\n\t } // other\n\t\n\t\n\t return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n\t}", "title": "" }, { "docid": "824e02a7f3d0f1f3de3186f907f65699", "score": "0.55119264", "text": "get type() {\n return this._type.id;\n }", "title": "" }, { "docid": "6e46973f9dba488534621a799b7c3abe", "score": "0.5479743", "text": "function getObject(kind)\r\n{\r\n switch(kind)\r\n {\r\n case 0:\r\n return \"Wormhole\";\r\n case 1:\r\n return \"Asteroid\";\r\n case 2:\r\n return \"Station\";\r\n case 4:\r\n return \"Freighter\";\r\n case 5:\r\n return \"Meteor Shower\";\r\n case 111:\r\n return \"Planet\"\r\n default:\r\n return \"Unknown\";\r\n }\r\n}", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.543015", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.543015", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.543015", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.543015", "text": "get type() { return this._type; }", "title": "" }, { "docid": "07abd31d781188a3c03dd39774386397", "score": "0.53971255", "text": "id() {\n return this._types[0].name() + '<:' + this.name();\n }", "title": "" }, { "docid": "ef7baa9f59eb8d985ddfa7ae08d2cfbb", "score": "0.53948814", "text": "function getSingularSetter(type) {\n\n switch (type) {\n\n case 0x1406:\n return setValue1f; // FLOAT\n case 0x8b50:\n return setValue2fv; // _VEC2\n case 0x8b51:\n return setValue3fv; // _VEC3\n case 0x8b52:\n return setValue4fv; // _VEC4\n\n case 0x8b5a:\n return setValue2fm; // _MAT2\n case 0x8b5b:\n return setValue3fm; // _MAT3\n case 0x8b5c:\n return setValue4fm; // _MAT4\n\n case 0x8b5e:\n return setValueT1; // SAMPLER_2D\n case 0x8b60:\n return setValueT6; // SAMPLER_CUBE\n\n case 0x1404:\n case 0x8b56:\n return setValue1i; // INT, BOOL\n case 0x8b53:\n case 0x8b57:\n return setValue2iv; // _VEC2\n case 0x8b54:\n case 0x8b58:\n return setValue3iv; // _VEC3\n case 0x8b55:\n case 0x8b59:\n return setValue4iv; // _VEC4\n\n }\n\n }", "title": "" }, { "docid": "572a35bb3e49a9803331126a90a39b4e", "score": "0.5389509", "text": "function SupType() {\n}", "title": "" }, { "docid": "3edccf844b56dcff230440196a0fe949", "score": "0.5370975", "text": "function getType() {\n var selection = randomNum()\n if (selection === 1) {\n return dragon;\n } else if (selection === 2) {\n return prowler;\n } else {\n return grunt;\n }\n}", "title": "" }, { "docid": "5b3846d35093b7ba0a32dbe3dfc2c7aa", "score": "0.53707296", "text": "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "title": "" }, { "docid": "fe30aa5965d86cea9e52c1c9f7997b83", "score": "0.53617996", "text": "function ATNType() {}", "title": "" }, { "docid": "09ddc31954b12c12eb6141d7dce2619c", "score": "0.5361476", "text": "get type() {\n return this.getStringAttribute('type');\n }", "title": "" }, { "docid": "8aa42f0f516900b8bffcdeeaf39a9010", "score": "0.53598684", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}", "title": "" }, { "docid": "dc1920aa541a654f32b1e14e0b287132", "score": "0.535532", "text": "function getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "dc1920aa541a654f32b1e14e0b287132", "score": "0.535532", "text": "function getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "dc1920aa541a654f32b1e14e0b287132", "score": "0.535532", "text": "function getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "f5822540ec4d016e1313fcc95681b1da", "score": "0.5353855", "text": "function getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case QUANTITATIVE:\n return 'quantitative';\n case 't':\n case TEMPORAL:\n return 'temporal';\n case 'o':\n case ORDINAL:\n return 'ordinal';\n case 'n':\n case NOMINAL:\n return 'nominal';\n case GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}", "title": "" }, { "docid": "ca2feabe39e92a2599d88d14c09e313c", "score": "0.53496724", "text": "function getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8B5F: return setValueT3D1; // SAMPLER_3D\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "cf995de4355f8ace4a8f5af3808bccd0", "score": "0.53294057", "text": "function TypeExplorerSingleType(type, offsetFromAggregate, aggregateType) {\n this.aggregateType = aggregateType;\n this.isExpanded = false;\n this.type = type;\n this.offsetFromAggregate = offsetFromAggregate;\n this.perInstanceFields = [];\n this.fields = [];\n this.extendedFields = [];\n this.descriptions = [];\n this.arrayFields = [];\n this.arrayItemFields = [];\n this.allFieldArrayNames = [\"perInstanceFields\", \"fields\", \"extendedFields\", \"arrayFields\", \"descriptions\", \"arrayItemFields\"];\n this.preparedForRenderingPromise = null;\n }", "title": "" }, { "docid": "2d6f1e57dcf57c5e96465062a455777b", "score": "0.532765", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\t\tcase 0x8dc6: return setValueV2ui; // _VEC2\n\t\tcase 0x8dc7: return setValueV3ui; // _VEC3\n\t\tcase 0x8dc8: return setValueV4ui; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}", "title": "" }, { "docid": "e82849e5976c8836515410add12896af", "score": "0.5323418", "text": "function getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "5070dc4790120f4ae955219598eb3d63", "score": "0.531256", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b5f: return setValueT3D1; // SAMPLER_3D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\tcase 0x8DC1: return setValueT2DArray1; // SAMPLER_2D_ARRAY\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "5070dc4790120f4ae955219598eb3d63", "score": "0.531256", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b5f: return setValueT3D1; // SAMPLER_3D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\tcase 0x8DC1: return setValueT2DArray1; // SAMPLER_2D_ARRAY\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "5070dc4790120f4ae955219598eb3d63", "score": "0.531256", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b5f: return setValueT3D1; // SAMPLER_3D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\tcase 0x8DC1: return setValueT2DArray1; // SAMPLER_2D_ARRAY\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "f8294886ad603127b7b4a12e2e7962a3", "score": "0.52932125", "text": "function setName(theType : int): String\n\t{\n\t\t//do stuff here.\n\t}", "title": "" }, { "docid": "712c4ca51a6f8c267495f70d2becbeb6", "score": "0.5284118", "text": "toString () {\n return `Type[${this.major}].${this.name}`\n }", "title": "" }, { "docid": "735539cf6d229579c76058be463d5240", "score": "0.52789545", "text": "function type(x){\n\treturn x.type == 'whot'? x.whotValue : x.type;\n}", "title": "" }, { "docid": "b6f1aeff9060b5a62a2a0ceb6dff64cc", "score": "0.52788025", "text": "function getSingularSetter(type) {\n switch (type) {\n case 0x1406: return setValue1f; // FLOAT\n case 0x8b50: return setValue2fv; // _VEC2\n case 0x8b51: return setValue3fv; // _VEC3\n case 0x8b52: return setValue4fv; // _VEC4\n case 0x8b5a: return setValue2fm; // _MAT2\n case 0x8b5b: return setValue3fm; // _MAT3\n case 0x8b5c: return setValue4fm; // _MAT4\n case 0x8b5e:\n case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n case 0x8b60: return setValueT6; // SAMPLER_CUBE\n case 0x1404:\n case 0x8b56: return setValue1i; // INT, BOOL\n case 0x8b53:\n case 0x8b57: return setValue2iv; // _VEC2\n case 0x8b54:\n case 0x8b58: return setValue3iv; // _VEC3\n case 0x8b55:\n case 0x8b59: return setValue4iv; // _VEC4\n }\n}", "title": "" }, { "docid": "6b040b1ec70845db1caabc2deed0d255", "score": "0.5275076", "text": "get type() {\n return this.__type.get();\n }", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6bc751a7e1c6c5b35351e32a08f49bde", "score": "0.52713376", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3611afd0d76c7c7653ba187646bf2779", "score": "0.52704877", "text": "__resolveType(obj, context, info) {\n if (obj.developed_by) return 'Software'\n else if (obj.new_or_used) return 'Equipment'\n else return null\n }", "title": "" }, { "docid": "b7d0e06d0fa114c4919ee0973f07ef21", "score": "0.5266661", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8b5f: return setValueT3D1; // SAMPLER_3D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\tcase 0x8DC1: return setValueT2DArray1; // SAMPLER_2D_ARRAY\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "a945f10d4ea628eafcb1432679286e6e", "score": "0.5266201", "text": "function getSingularSetter(type) {\n switch (type) {\n case 0x1406:\n return setValueV1f; // FLOAT\n case 0x8b50:\n return setValueV2f; // _VEC2\n case 0x8b51:\n return setValueV3f; // _VEC3\n case 0x8b52:\n return setValueV4f; // _VEC4\n\n case 0x8b5a:\n return setValueM2; // _MAT2\n case 0x8b5b:\n return setValueM3; // _MAT3\n case 0x8b5c:\n return setValueM4; // _MAT4\n\n case 0x1404:\n case 0x8b56:\n return setValueV1i; // INT, BOOL\n case 0x8b53:\n case 0x8b57:\n return setValueV2i; // _VEC2\n case 0x8b54:\n case 0x8b58:\n return setValueV3i; // _VEC3\n case 0x8b55:\n case 0x8b59:\n return setValueV4i; // _VEC4\n\n case 0x1405:\n return setValueV1ui; // UINT\n case 0x8dc6:\n return setValueV2ui; // _VEC2\n case 0x8dc7:\n return setValueV3ui; // _VEC3\n case 0x8dc8:\n return setValueV4ui; // _VEC4\n\n case 0x8b5e: // SAMPLER_2D\n case 0x8d66: // SAMPLER_EXTERNAL_OES\n case 0x8dca: // INT_SAMPLER_2D\n case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n case 0x8b62: // SAMPLER_2D_SHADOW\n return setValueT1;\n\n case 0x8b5f: // SAMPLER_3D\n case 0x8dcb: // INT_SAMPLER_3D\n case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n return setValueT3D1;\n\n case 0x8b60: // SAMPLER_CUBE\n case 0x8dcc: // INT_SAMPLER_CUBE\n case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n case 0x8dc5: // SAMPLER_CUBE_SHADOW\n return setValueT6;\n\n case 0x8dc1: // SAMPLER_2D_ARRAY\n case 0x8dcf: // INT_SAMPLER_2D_ARRAY\n case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n return setValueT2DArray1;\n }\n}", "title": "" }, { "docid": "5d289db142ce46f8501da651e7f2d7db", "score": "0.526305", "text": "function typeOf(id, simple){\n\n\t\tvar gettingTypeOf = $q.defer();\n if (angular.isObject(id)) id = id.id;\n\t\tthis.get({id:id}).then(function(cards){\n\t\t\tcacheCards(cards[0]);\n\t\t\tif (simple) {\n\t var pokemeon = [\"Grass\", \"Lightning\", \"Darkness\", \"Fairy\", \"Fire\", \"Psychic\", \"Metal\", \"Dragon\", \"Water\", \"Fighting\", \"Colorless\"];\n\t var trainer = [\"Trainer-Item\", \"Trainer-Stadium\", \"Trainer-Supporter\", \"Pokemon Tool\"];\n\t var engergy = [\"Energy\"];\n\t if (pokemeon.indexOf(cards[0].type) != -1) gettingTypeOf.resolve('pokemon');\n\t if (trainer.indexOf(cards[0].type) != -1) gettingTypeOf.resolve('trainer');\n\t if (engergy.indexOf(cards[0].type) != -1) gettingTypeOf.resolve('energy');\n\t }\n\t\t});\n return gettingTypeOf.promise;\n }", "title": "" }, { "docid": "57298b0d3a977fb9817eda0ed727802d", "score": "0.5261564", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES\n\t\tcase 0x8B5F: return setValueT3D1; // SAMPLER_3D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "c330770da61fd9e9197468c3eb2408e2", "score": "0.52585775", "text": "function getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "6a503e9b2abaa9dd4bc0a299c6092166", "score": "0.5257444", "text": "function getSingularSetter( type ) {\n\n switch ( type ) {\n\n case 0x1406: return setValue1f; // FLOAT\n case 0x8b50: return setValue2fv; // _VEC2\n case 0x8b51: return setValue3fv; // _VEC3\n case 0x8b52: return setValue4fv; // _VEC4\n\n case 0x8b5a: return setValue2fm; // _MAT2\n case 0x8b5b: return setValue3fm; // _MAT3\n case 0x8b5c: return setValue4fm; // _MAT4\n\n case 0x8b5e: return setValueT1; // SAMPLER_2D\n case 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n }\n\n }", "title": "" }, { "docid": "6a503e9b2abaa9dd4bc0a299c6092166", "score": "0.5257444", "text": "function getSingularSetter( type ) {\n\n switch ( type ) {\n\n case 0x1406: return setValue1f; // FLOAT\n case 0x8b50: return setValue2fv; // _VEC2\n case 0x8b51: return setValue3fv; // _VEC3\n case 0x8b52: return setValue4fv; // _VEC4\n\n case 0x8b5a: return setValue2fm; // _MAT2\n case 0x8b5b: return setValue3fm; // _MAT3\n case 0x8b5c: return setValue4fm; // _MAT4\n\n case 0x8b5e: return setValueT1; // SAMPLER_2D\n case 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n }\n\n }", "title": "" }, { "docid": "6a503e9b2abaa9dd4bc0a299c6092166", "score": "0.5257444", "text": "function getSingularSetter( type ) {\n\n switch ( type ) {\n\n case 0x1406: return setValue1f; // FLOAT\n case 0x8b50: return setValue2fv; // _VEC2\n case 0x8b51: return setValue3fv; // _VEC3\n case 0x8b52: return setValue4fv; // _VEC4\n\n case 0x8b5a: return setValue2fm; // _MAT2\n case 0x8b5b: return setValue3fm; // _MAT3\n case 0x8b5c: return setValue4fm; // _MAT4\n\n case 0x8b5e: return setValueT1; // SAMPLER_2D\n case 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n }\n\n }", "title": "" }, { "docid": "c42199ed7b352ab4ef33b227a0345d07", "score": "0.52559566", "text": "function getSingularSetter( type ) {\n\t\n\t\t\tswitch ( type ) {\n\t\n\t\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\t\n\t\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\t\n\t\t\t\tcase 0x8b5e: return setValueT1; // SAMPLER_2D\n\t\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\n\t\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\t\n\t\t\t}\n\t\n\t\t}", "title": "" }, { "docid": "c42199ed7b352ab4ef33b227a0345d07", "score": "0.52559566", "text": "function getSingularSetter( type ) {\n\t\n\t\t\tswitch ( type ) {\n\t\n\t\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\t\n\t\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\t\n\t\t\t\tcase 0x8b5e: return setValueT1; // SAMPLER_2D\n\t\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\t\n\t\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\t\n\t\t\t}\n\t\n\t\t}", "title": "" }, { "docid": "063878a3f557e3b4352f9ebfc8d06812", "score": "0.5248246", "text": "get typeDefault()\n {\n return \"\";\n }", "title": "" }, { "docid": "3f580e344c2c8ba72c0dc123af1d8fc9", "score": "0.52474505", "text": "get Single() {}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.5234206", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "a8076dec36ff131bb9d01e6905a87943", "score": "0.5225565", "text": "function defaultForType(type) {\n const def = {\n boolean: true,\n string: '',\n number: undefined,\n array: []\n };\n return def[type];\n }", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.52124", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "7f29c2532782c49c6f0287883169d8c5", "score": "0.519924", "text": "get type() {\r\n return this._type;\r\n }", "title": "" }, { "docid": "360b9b92f27964614db36a2d51d56951", "score": "0.5195266", "text": "function type( value ){\n\treturn (exists( value ) ? value.constructor : value);\n}", "title": "" }, { "docid": "8f648d5495ae76dc32f009a52bba991d", "score": "0.5189503", "text": "findType(random) {\n return this.types[this.indexToType[this.getClosest(random)]]\n }", "title": "" }, { "docid": "d52ce48c7552b8fc48758c7d45fb5722", "score": "0.51752543", "text": "get type() {\n return _type.get(this);\n }", "title": "" }, { "docid": "05036f1b0c26c000ac43518ba7c40de7", "score": "0.51699007", "text": "function convertType(type) {\n if (type === \"UMLActor\")\n return \"ACTOR\";\n else if (type === \"UMLUseCase\")\n return \"USE_CASE\";\n else if (type === \"UMLCommunication\")\n return \"COMMUNICATION\";\n else if (type === \"UMLInclude\")\n return \"INCLUSION\";\n else if (type === \"UMLExtend\")\n return \"EXTENSION\";\n else if (type === \"UMLGeneralization\")\n return \"GENERALIZATION\";\n}", "title": "" }, { "docid": "85966b8477335c37de689f5793cbb367", "score": "0.51633936", "text": "function defaultForType (type) {\n var def = {\n boolean: true,\n string: '',\n array: []\n }\n\n return def[type]\n }", "title": "" }, { "docid": "b21e34f7667f34382e121da7e79982ed", "score": "0.5159489", "text": "enterSimpleTypeId(ctx) {\n\t}", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.51561415", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.51561415", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.51561415", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.51561415", "text": "get type() {\n return this._type;\n }", "title": "" } ]
7199bdff2e574879089bb949c2e38594
window.rpcprovider = new ethers.providers.JsonRpcProvider( " " " ); window.rpcprovider1 = new ethers.providers.JsonRpcProvider( " " " ); const selectedAddress = provider.provider.selectedAddress; /////Get function
[ { "docid": "da62ca99053240c44da858c17556f93b", "score": "0.0", "text": "async function syncCollections(collectionAddess) {\n var latest = await axios.get(\"/transfers?collection=\" + collectionAddess);\n var startBlock = latest.data.length == 0 ? 7090600 : latest.data.block + 1;\n var endBlock = await rpcprovider.getBlockNumber();\n var evts = [];\n var contract = new ethers.Contract(\n toAddress(collectionAddess),\n bhc1155,\n rpcprovider\n );\n\n for (var i = startBlock; i <= endBlock; i = i + 4000) {\n var transfers = [];\n startBlock = i;\n try {\n var evtsCr = await contract.queryFilter(\n \"TransferSingle\",\n i,\n i + 4000 <= endBlock ? i + 4000 : endBlock\n );\n\n for (var x = 0; x < evtsCr.length; x++) {\n var event = evtsCr[x];\n transfers.push([\n event.blockNumber,\n collectionAddess,\n event.args.to,\n Number(event.args.id)\n ]);\n }\n if (transfers.length > 0) {\n await axios.post(\"/transfers\", { transfers: transfers });\n }\n startBlock = i + 4000 <= endBlock ? i + 4000 : endBlock;\n } catch (e) {\n //removed//console.log(e);\n }\n }\n\n if (startBlock != 7090600) {\n await axios.patch(\"/transfers/\" + collectionAddess, {\n block: startBlock - 1\n });\n }\n}", "title": "" } ]
[ { "docid": "f7e6dc81fb61ea816ac5033cd5271a8e", "score": "0.65132153", "text": "initializeProvider() {\n const providerOptions = {\n static: {\n eth_syncing: false,\n web3_clientVersion: `Torus/v${version}`,\n },\n version,\n // account mgmt\n getAccounts: async () => {\n // Expose no accounts if this origin has not been approved, preventing\n // account-requiring RPC methods from completing successfully\n // only show address if account is unlocked\n log.info(this.prefsController.state.selectedAddress, 'accounts')\n return this.prefsController.state.selectedAddress ? [this.prefsController.state.selectedAddress] : []\n },\n // tx signing\n processTransaction: this.newUnapprovedTransaction.bind(this),\n // msg signing\n processEthSignMessage: this.newUnsignedMessage.bind(this),\n processTypedMessage: this.newUnsignedTypedMessage.bind(this),\n processTypedMessageV3: this.newUnsignedTypedMessage.bind(this),\n processTypedMessageV4: this.newUnsignedTypedMessage.bind(this),\n processPersonalMessage: this.newUnsignedPersonalMessage.bind(this),\n getPendingNonce: this.getPendingNonce.bind(this),\n getPendingTransactionByHash: (hash) => this.txController.getFilteredTxList({ hash, status: 'submitted' })[0],\n }\n const providerProxy = this.networkController.initializeProvider(providerOptions)\n return providerProxy\n }", "title": "" }, { "docid": "b13a96c2f55400a949e7d0c9dfaa330d", "score": "0.6467452", "text": "async function getEthers() {\n new Promise((resolve, reject) => {\n try {\n const provider = new ethers.providers.JsonRpcProvider(\n 'https://ropsten.infura.io/v3/ac007c67256342a2930b2560d4987e42',\n );\n\n console.log('Ethers Lib connection');\n resolve(provider);\n } catch (error) {\n console.log(error);\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "1e0d78484e82d6fe5e837c3cda3197d4", "score": "0.6444227", "text": "getAccountDetails() {\n //const rpc = new JsonRpc(this.props.endpoint, {fetch});\n console.log('*not implemented*')\n }", "title": "" }, { "docid": "3c4f60d8bac23ccb083f5de1045b9889", "score": "0.6303672", "text": "async function init () {\n // get info for ganache or hardhat testnet\n const provider = await new ethers.providers.JsonRpcProvider();\n //console.log(\"\\n\\nprovider\\n\\n\", provider);\n\n // the following 2 lines are used if contract is on rinkeby instead of ganache or hardhat testnet\n //let provider;\n //window.ethereum.enable().then(provider = new ethers.providers.Web3Provider(window.ethereum));\n\n const signer = await provider.getSigner()\n //console.log(\"\\n\\nsigner\\n\\n\", signer);\n const userAddress = await signer.getAddress();\n //console.log(\"\\n\\nuser address\\n\\n\", userAddress);\n\n // initialize shadow contract\n\n let AppInstance = null;\n // get the contract address from deployment to test network. Make sure it is the applicaton contract, not the oracle.\n const abi = AppContractJSON.abi;\n\n // Make sure you set this correctly after deployment or nothing wil work!!!\n AppInstance = new ethers.Contract('0x5FbDB2315678afecb367f032d93F642f64180aa3', abi, signer);\n\n // listen for events\n filterEvents(AppInstance);\n\n return { AppInstance, signer }\n}", "title": "" }, { "docid": "e53d4df521f4982f6c373a5f96bca8cf", "score": "0.6301108", "text": "async function fetchAddress() {\n requestAccount()\n\n if (typeof window.ethereum !== \"undefined\") {\n\n\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = await provider.getSigner();\n try {\n const signerAddress = await signer.getAddress();\n \n setCurrentAddress(\"Account:\".concat(signerAddress));\n } catch (err) {\n\n }\n }\n }", "title": "" }, { "docid": "5974167713111216c92731feec0772c7", "score": "0.62525177", "text": "async function main () {\n const [, userInWhitelist] = await ethers.getSigners()\n\n const web3provider = new Web3HttpProvider(bscTestnetRpc)\n const gsnProvider = await RelayProvider.newProvider({\n provider: web3provider,\n config: {\n loggerConfiguration: { logLevel: 'error' },\n paymasterAddress: paymasterAddr,\n },\n }).init()\n\n const walletInWitelist = getWallet(1)\n const privateKey = walletInWitelist.privateKey\n\n gsnProvider.addAccount(privateKey)\n const clientProvider = new ethers.providers.Web3Provider(gsnProvider)\n\n const contract = new ethers.Contract(contractAddr, contractAbi, clientProvider)\n const contractInstance = contract.connect(clientProvider.getSigner(userInWhitelist.address))\n\n await contractInstance.METHOD_NAME()\n}", "title": "" }, { "docid": "2f8c8c4aac268908083d52991151ecdf", "score": "0.6165554", "text": "_initContract(){\n console.log('init contract');\n const eth = new Eth(window.web3.currentProvider);\n const contract = new EthContract(eth);\n const t = contract(this.abi).at(this.contractAddress);\n return t; //return to store in scope\n }", "title": "" }, { "docid": "0ab14a8748888b3a17e7feba6f0baac5", "score": "0.5864496", "text": "constructor() {\n this.web3 = new window.Web3(window.web3.currentProvider);\n this.web3.defaultAccount = window.web3.eth.accounts[0];\n this.namespace = this.web3.sha3(\"demo\")\n\n let carbonVoteXContract = this.web3.eth.contract(voteABI);\n let tokenContract = this.web3.eth.contract(tokenABI);\n let coreContract = this.web3.eth.contract(coreABI);\n\n this.carbonVoteXInstance = carbonVoteXContract.at(voteAddress);\n this.tokenInstance = tokenContract.at(tokenAddress);\n this.coreInstance = coreContract.at(coreAddress);\n\n this.initStringFormat();\n }", "title": "" }, { "docid": "6c960c3fa63255874032add17e563a55", "score": "0.5808637", "text": "function getAddress(remote, port, onSuccess, onFailure) {\n var method = \"getaddress\";\n walletJSONrpc(remote, port, method, undefined,\n function(resp) {\n onSuccess(resp);\n },\n function(e){\n onFailure(e);\n }\n );\n}", "title": "" }, { "docid": "6804cc3bf81966b286529ce5186eeb01", "score": "0.58016956", "text": "async getFundingAddress (stub, args, thisClass){\n if (secret === args[0]){\n logger.info('address: %s', address.toString())\n let res = {\n address: address.toString()\n }\n return Buffer.from(JSON.stringify(res))\n }\n else{\n return Buffer.from('Invalid secret.') \n }\n }", "title": "" }, { "docid": "3c3d6924adf1ea851102e5e880a61f3a", "score": "0.57903916", "text": "function retrievePortisAddress() {\n web3.eth.getAccounts().then(accounts => {\n document.getElementById(\"portis\").innerHTML = `<p>Wallet Address: ${\n accounts[0]\n }</p>`;\n });\n}", "title": "" }, { "docid": "3159c754fef3dd66755939dba4c0ecba", "score": "0.5784709", "text": "static getWalletRpc() {\n if (this.walletRpc === undefined) this.walletRpc = new MoneroWalletRpc(TestUtils.WALLET_RPC_CONFIG);\n return this.walletRpc;\n }", "title": "" }, { "docid": "a1c0392341993c094d9f82f3ef9c0d5c", "score": "0.568989", "text": "getSecret({ myAddress, participantAddress }) {\n return new Promise(async (resolve, reject) => {\n console.log('\\n\\nStart getting secret from ETH Token Swap')\n\n let secret\n\n try {\n secret = await this.contract.methods.getSecret(participantAddress).call({\n from: myAddress,\n })\n }\n catch (err) {\n reject(err)\n }\n\n console.log('ETH Token Swap secret:', secret)\n resolve(secret)\n })\n }", "title": "" }, { "docid": "106aa9cc5ef1783485e83063a622c8b2", "score": "0.56705475", "text": "loadTokenPrice(dexName, tokenPair, callback) {\n dexName=dexName||'Pancake';\n log.debug(`load LP price from ${dexName} ...`);\n\n let contractConfig = OptionTradingConfig.LP[dexName][\"router\"];\n let contractAddress = contractConfig.address();\n let contractAbi = contractConfig.abi;\n\n let contract = new window.web3.eth.Contract(contractAbi, contractAddress);\n\n let amountOut=new BigNumber(10).pow(18).toFixed();\n\n let address1=OptionTradingConfig.contractConfig[tokenPair[0]].hotPotToken.address();\n let address2=OptionTradingConfig.contractConfig[tokenPair[1]].hotPotToken.address();\n\n let addressArr=[address1,address2];\n\n if(tokenPair[1] != 'USDT'){\n let usdtAddress=OptionTradingConfig.contractConfig['USDT'].hotPotToken.address();\n addressArr.push(usdtAddress);\n }\n\n contract.methods\n .getAmountsOut(amountOut,addressArr)\n .call()\n .then((amounts) => {\n log.debug(`loadLPPrice result => ${amounts}`);\n callback(amounts[amounts.length-1]);\n });\n }", "title": "" }, { "docid": "2468c298682ec728df967565e322fe42", "score": "0.56594", "text": "createContractInstance(addr) {\n let abiDefinitionString = this.state.abiDefinitionString;\n let abiDefinition = JSON.parse(abiDefinitionString);\n\n // 1. Create the contract object\n var contract = web3.eth.contract(abiDefinition);\n var address = addr;\n if (!addr) {\n address = this.state.savedContract.savedAddress;\n }\n\n console.log('address', address);\n // if (!addr) {\n // address = '0xc4fAa1Ed4A7519E9420A5a2E8A7A49AdE9b06467';\n // }\n \n var instance = contract.at(address);\n console.log('instance', instance);\n return instance\n\n }", "title": "" }, { "docid": "1340eba336541539ba8b65be03b64533", "score": "0.56563914", "text": "function askOneEther() {\n if (!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n \n try { \t\n var config = require(path.join(__dirname, \"../config/config.json\"));\n var ip = config.minerIp;\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", \"http://\" + ip + \":3000?account=\" + web3.eth.accounts[accounts_index] , false ); // false for synchronous request\n xmlHttp.send( null );\n console.log(xmlHttp);\n alert(xmlHttp.responseText);\n } catch(e) {\n \tconsole.log(e);\n \talert(e);\n }\n}", "title": "" }, { "docid": "32fb6a2621ce4821acf49c0d59c52fd0", "score": "0.5647779", "text": "getContractCode(address) {\n return new Promise((resolve, reject) => {\n if (address === constants.NEW_CONTRACT) {\n return reject(new Error('Contract Creation is not supporte.'))\n } else if (this.contractCodes[address]) {\n return resolve(this.contractCodes[address])\n }\n this.nextProvider[this.nextProvider.sendAsync ? 'sendAsync' : 'send'](\n {\n id: new Date().getTime(),\n method: 'eth_getCode',\n params: [address]\n },\n (err, result) => {\n if (err) {\n reject(err)\n } else {\n this.contractCodes[address] = result.result\n resolve(this.contractCodes[address])\n }\n }\n )\n })\n }", "title": "" }, { "docid": "004ec2351095385294bcc0cda9268f99", "score": "0.5629301", "text": "function get_node_address() {\n\tvar url = 'http://' + config.api + \":\" + config.port + '/contract_address';\n\tvar out = '';\n\treturn new Promise(function (resolve, reject) {\n\t\trequest.get({url: url,\n\t\t\tjson: true,\n\t\t\theaders: {\"X-Hardware-Name\": config.name, \"X-Hardware-Token\": config.token}},\n\t\t\t(error, response, body) => {\n\t\t\t\tif (!error && response.statusCode === 200) {\n initialise_reader()\n\t\t\t\t\tresolve([body.data.contract_address, body.data.token_address]);\n\t\t\t\t} else {\n\n stop_polling()\n\t\t\t\t\tconsole.log('Cannot get node address - is API online? Is kiosk online?');\n\n\t\t\t\t\tmainWindow.loadURL('file://' + __dirname + '/app/themes/' + config.theme + '/kiosk_offline.html');\n\n mainWindow.webContents.once('did-finish-load', () => {\n\n });\n return true;\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t});\n\t});\n\n\n}", "title": "" }, { "docid": "9fbaf348c6347f95c8adeb5031844f54", "score": "0.56159323", "text": "function walletConfig() {\n let pair;\n $(\"#g-search\").click(()=>{\n pair = getGethAccount(currentUser);\n gethInquiry(pair[0],pair[1]);\n });\n $(\"#g-withdraw\").click(walletPanel(0));\n $(\"#g-charge\").click(walletPanel(1));\n}", "title": "" }, { "docid": "dd0f6ea71a25f7e4975aa2cf8bf0cfeb", "score": "0.5615654", "text": "function getAddress() {\n $.get(\"http://137.108.93.222/openstack/api/clients/\" + clientId + \"?OUCU=\" + salesId + \"&password=\" + password,\n function (data) {\n if (data.status == \"success\") {\n clientLatLong(data.data[0].address);\n } else {\n alert(\"Error: \" + data.status);\n }\n }, \"json\");\n\n }", "title": "" }, { "docid": "b05fdadd627cb11d8ecb5a61252bd8dc", "score": "0.55922246", "text": "constructor() {\n super();\n this.type = exports.types.GETADDR;\n }", "title": "" }, { "docid": "6f2edafaa5b728a6d788a6a582839f54", "score": "0.5585612", "text": "function splitIntegratedAddress(remote, port, integrated_address, onSuccess, onFailure) {\n // Set up JSON_RPC call:\n var method = \"split_integrated_address\";\n var params = { integrated_address: integrated_address }\n\n // Do JSON_RPC call:\n walletJSONrpc(remote, port, method, params,\n function(resp) {\n onSuccess(resp);\n },\n function(e){\n onFailure(e);\n }\n );\n /*\n // Display payment ID and standard address:\n var payment_id = resp.result.payment_id;\n var standard_address = resp.result.standard_address;\n */\n}", "title": "" }, { "docid": "4618d5c9aad45414b31f07181a7a45f1", "score": "0.55814064", "text": "function initContract(address){\n Contract = new ethers.Contract(address, abi, signer);\n document.getElementById(\"contractDeploy\").style.display = \"none\";\n\n GetBuyerAndSeller();\n\n Contract.onpaid = function(){\n AppState1();\n };\n Contract.onshipped = function(){\n AppState2();\n };\n Contract.ondelivered = function(){\n AppState3();\n };\n\n GetAppStateOnPageLoad();\n}", "title": "" }, { "docid": "01cbadc5d938f7b82871dc9468f2a2bf", "score": "0.55808896", "text": "function makeIntegratedAddress(remote, port, payment_id, onSuccess, onFailure) {\n // Set up JSON_RPC call:\n var method = \"make_integrated_address\";\n if (payment_id != undefined) {\n var params = { payment_id: payment_id }\n } else {\n var params = { payment_id: \"\" }\n }\n\n // Do JSON_RPC call:\n walletJSONrpc(remote, port, method, params,\n function(resp) {\n onSuccess(resp);\n },\n function(e){\n onFailure(e);\n }\n );\n /*\n // Display integrated address:\n var integrated_address = resp.result.integrated_address;\n */\n}", "title": "" }, { "docid": "c7f67ac25a3b272bbc5a0fd5e3b47d34", "score": "0.55634975", "text": "async getEther() {\n let web3 = window.web3;\n if (!web3) {\n alert(\"You need to install & unlock metamask to do that\");\n return;\n }\n const metamaskProvider = new eth.providers.Web3Provider(web3.currentProvider);\n const metamask = metamaskProvider.getSigner();\n const address = (await metamask.provider.listAccounts())[0];\n if (!address) {\n alert(\"You need to install & unlock metamask to do that\");\n return;\n }\n const sentTx = await metamask.sendTransaction({\n to: this.state.localWallet.address,\n value: eth.utils.bigNumberify(\"1000000000000000000\"),\n gasLimit: eth.utils.bigNumberify(\"21000\")\n });\n console.log(sentTx);\n }", "title": "" }, { "docid": "246fd54d37e8cfe07efb98d48c37dbf6", "score": "0.5535939", "text": "async function web3HelperFactory(provider, minter_addr, minter_abi, erc1155_addr) {\n const w3 = provider;\n const minter = new ethers_1.Contract(minter_addr, minter_abi, w3);\n const erc1155_abi = new utils_1.Interface(fakeERC1155_json_1.abi);\n const erc1155 = new ethers_1.Contract(erc1155_addr, erc1155_abi, w3);\n function signedMinter(signer) {\n return minter.connect(signer);\n }\n async function extractTxn(txr, _evName) {\n const receipt = await txr.wait();\n const log = receipt.logs.find((log) => log.address === minter.address);\n if (log === undefined) {\n throw Error(\"Couldn't extract action_id\");\n }\n const evdat = minter_abi.parseLog(log);\n const action_id = evdat.args[0].toString();\n return [receipt, action_id];\n }\n return {\n async balance(address) {\n const bal = await w3.getBalance(address);\n // ethers BigNumber is not compatible with our bignumber\n return new bignumber_js_1.default(bal.toString());\n },\n async balanceWrapped(address, chain_nonce) {\n const bal = await erc1155.balanceOf(address, chain_nonce);\n return new bignumber_js_1.default(bal.toString());\n },\n async balanceWrappedBatch(address, chain_nonces) {\n const bals = await erc1155.balanceOfBatch(Array(chain_nonces.length).fill(address), chain_nonces);\n return new Map(bals.map((v, i) => [chain_nonces[i], new bignumber_js_1.default(v.toString())]));\n },\n async transferNativeToForeign(sender, chain_nonce, to, value) {\n const res = await signedMinter(sender)\n .freeze(chain_nonce, to, { value });\n return await extractTxn(res, 'Transfer');\n },\n async transferNftToForeign(sender, chain_nonce, to, id) {\n let txr;\n let ev;\n const calldata = Buffer.concat([\n Buffer.from((new Int32Array([0])).buffer),\n Buffer.from((new Int32Array([chain_nonce])).buffer).reverse(),\n Buffer.from(to, \"utf-8\")\n ]);\n if (id.contract_type == \"ERC721\") {\n ev = \"TransferErc721\";\n const erc = new ethers_1.Contract(id.contract, fakeERC721_json_1.abi, w3);\n txr = await erc.connect(sender)['safeTransferFrom(address,address,uint256,bytes)'](await sender.getAddress(), minter_addr, id.token, calldata);\n }\n else {\n ev = \"TransferErc1155\";\n const erc = new ethers_1.Contract(id.contract, erc1155_abi, w3);\n txr = await erc.connect(sender).safeTransferFrom(await sender.getAddress(), minter_addr, id.token, ethers_1.BigNumber.from(1), calldata);\n }\n return await extractTxn(txr, ev);\n },\n async unfreezeWrapped(sender, chain_nonce, to, value) {\n const res = await signedMinter(sender)\n .withdraw(chain_nonce, to, value);\n return await extractTxn(res, 'Unfreeze');\n },\n async unfreezeWrappedNft(sender, to, id) {\n const res = await signedMinter(sender)\n .withdraw_nft(to, id);\n return await extractTxn(res, 'UnfreezeNft');\n }\n };\n}", "title": "" }, { "docid": "401f50a7aed9f3ca9f2fd8fe05165ad1", "score": "0.5532886", "text": "constructor(connector) {\n this.rpc = connector.rpc;\n this.api = connector.api;\n this.contractName = \"eosdtgovernc\";\n }", "title": "" }, { "docid": "65e8ed74699796a0a6de92a2b4bb7aff", "score": "0.5530365", "text": "constructor(web3Instance, rideCore, marketCore) {\n this.web3Instance = web3Instance\n this.rideCore = rideCore\n this.marketCore = marketCore\n let price = EthereumClient.fetchEtherPrice()\n if (price != null) {\n ethPrice = price\n }\n }", "title": "" }, { "docid": "b0e22ed6e4322771576cd7a688043eca", "score": "0.5505627", "text": "function initializeProcess(){\n var access_key = '6bc92aeeaec00461592fd1e701f03a19';\n var ip= $('#returnip').text();\n doAjaxGet( 'http://api.ipstack.com/' + ip + '?access_key=' + access_key)\n .then(json => {\n AddVendor(json);\n\n })\n}", "title": "" }, { "docid": "7e0a04730f12e59eca77cc59835fe2a2", "score": "0.55032724", "text": "_callContract(to_contract, func, address) {\n return new Promise((resolve, reject) => {\n this.neb.api.call({\n from: address,\n to: to_contract,\n value: 0,\n nonce: 0,\n gasPrice: 1000000,\n gasLimit: 200000,\n contract: {\n \"source\": \"\",\n \"sourceType\": \"js\",\n \"function\": func,\n \"args\": \"[\\\"\" + address + \"\\\"]\",\n \"binary\": \"\",\n \"type\": \"call\"\n }\n }).then(r => {\n resolve(JSON.parse(r.result))\n }).catch(e => {\n reject(e);\n });\n })\n }", "title": "" }, { "docid": "9ca006a8e49626c547615dfda676fc9c", "score": "0.5501773", "text": "function getAddress (currencyName, cryptoprice) {\n\n\t\tvar data = JSON.stringify({ currency: currencyName, price: cryptoprice, product: scope.lastId })\n\t\tconsole.log('sending ', data)\n\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', scope.serverUrl + \"/getAddress\", true);\n\t\txhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n\t\txhr.send(data);\n\t\txhr.onload = function () {\n\t\t\tvar respData = JSON.parse(this.responseText);\n\n\t\t scope.address = respData.address;\n\t\t console.log('getAddress (' + currencyName + ') returned', scope.address);\n\t\t pollForTx(respData.txId);\n\t\t\tvar txuri = generateUri( scope.currencyChoice.name, scope.productList[scope.lastId].price, scope.address);\n\t\t\tinitCanvas(txuri);\n\t\t};\n\n\t}", "title": "" }, { "docid": "eb4c16ac790c7ab3f203c10807107d4b", "score": "0.5500912", "text": "function webRetrieveAddress(){\n\tif (KDF.getVal('address_search_result') !== ''){\n\t\tKDF.hideWidget('address_search_result');\n\t\tKDF.showWidget('ahtm_cusfulladdress');\n\t\tKDF.showWidget('txt_cusaddressnumber');\n\t\tKDF.showWidget('txt_cusaddressline1');\n\t\tKDF.showWidget('txt_custown');\n\t\tKDF.showWidget('txt_cuspostcode');\n\t}\n}", "title": "" }, { "docid": "ba203d62393a2da3cb213570bb5b2030", "score": "0.5479559", "text": "getAddress(account) {\n const batch = [{ method: 'getaddressesbyaccount', parameters: [account] },];\n client.command(batch).then((block) => console.log(account));\n }", "title": "" }, { "docid": "8fea611fcb6de27eab8ae28be7080d1c", "score": "0.54768544", "text": "getContractAddress(name) {\n let addrs = window.addresses[this.network.name],\n addr = addrs[name];\n if (!addr) {\n console.error('Contract address not found by name: ' + name);\n throw new Error('Contract address not found by name: ' + name);\n }\n return addr;\n }", "title": "" }, { "docid": "26276696dffcf97078fe8acf2defb55b", "score": "0.54687", "text": "async function connectToEthereum(contract_address) {\n //ether params (we could do this outside later)\n const url = \"http://localhost:8545\";//7545 if running ganache-cli as an application, running ganache-cli on command line is 8545\n const custom_provider = new ethers.providers.JsonRpcProvider(url);\n const private_key = process.env.PRIVATE_KEY_OWNER; //-> Metamask for client integration\n const wallet = new ethers.Wallet(private_key, custom_provider); //connects wallet with private_key and custome_provider\n let contract = new ethers.Contract(contract_address, abi, wallet);\n\n return contract;\n}", "title": "" }, { "docid": "a9687c74126a920ae163b64ffde9153a", "score": "0.54677373", "text": "async function getComptrollerCompAddress(reqParams, context, ee, next){\n\n const addr = await comptroller.contract.getCompAddress();\n console.log(`COMP Token Address: ${addr}`);\n\n return next();\n}", "title": "" }, { "docid": "283411c942e93ced507fb6d02134f0db", "score": "0.5467339", "text": "fetchData(address, x) {\n const contract = require(\"truffle-contract\");\n const ERC721 = contract(ERC721token);\n\n var data = {};\n ERC721.setProvider(this.state.web3.currentProvider);\n\n //this call works fine\n //smart contract returns a string\n var erc = ERC721.at(address);\n erc.name().then((res, error) => {\n if (!error) {\n {\n (data.address = address), (data.name = res);\n }\n } else {\n console.log(error);\n }\n });\n\n erc.tokenURI(1).then((res, error) => {\n if (!error) {\n {\n data.url = res;\n }\n } else {\n console.log(error);\n }\n });\n erc.fetchData(1).then((res, error) => {\n if (!error) {\n {\n (data.input1 = res[0]),\n (data.input2 = res[1]),\n (data.input3 = res[2]),\n (data.number = res[3].c);\n }\n } else {\n console.log(error);\n }\n });\n erc.symbol().then((res, error) => {\n if (!error) {\n data.sym = res;\n\n this.setState({\n addressofTokens: [...this.state.addressofTokens, data]\n });\n } else {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "73464a33605cdfed5c8c9c9d18d745db", "score": "0.5465785", "text": "async function prepContractsForPriceRetrieval() {\r\n\tpancake.router = {address: '0x10ED43C718714eb63d5aA57B78B54704E256024E'};\r\n\t//prettier-ignore\r\n\tpancake.router.abi = [{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountADesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"addLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"addLiquidityETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveOut\",\"type\":\"uint256\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveOut\",\"type\":\"uint256\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"}],\"name\":\"getAmountsIn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"}],\"name\":\"getAmountsOut\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveB\",\"type\":\"uint256\"}],\"name\":\"quote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidityETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidityETHSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityETHWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapETHForExactTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactETHForTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactETHForTokensSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForETH\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForETHSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForTokensSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapTokensForExactETH\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapTokensForExactTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\r\n pancake.router.instance = new web3.eth.Contract(pancake.router.abi,pancake.router.address);\r\n\tNotToolsLivePriceV3.instance = new web3.eth.Contract(NotToolsLivePriceV3.abi, NotToolsLivePriceV3.address);\r\n\tNSM.pair.instance = new web3.eth.Contract(NSM.pair.abi, NSM.pair.address);\r\n\tbuildBatchRequest();\r\n}", "title": "" }, { "docid": "cdb87cbd2387a16a797c40f8b101669f", "score": "0.5464932", "text": "async function _ub2() { \n const ctx = web3Ctx.getCurrentContext();\n let questions = [\n { type: 'input', name: 'address', message: 'Specify the address:' },\n ]; \n let answer = await inquirer.prompt(questions);\n try{\n let response = await ctx.erc223.methods.balanceOf(answer.address).call(ctx.transactionObject); \n console.log('Balance for '+ answer.address + ' :' + response);\n } catch(e){\n console.log('Error:',e);\n }\n \n}", "title": "" }, { "docid": "6cf3a48092d1f0b3425749b6a056b6b3", "score": "0.5459474", "text": "function doGetProviderKeys()\n{\n //console.log(\"doGetProviderKeys called\");\n getProviderKeys(function()\n\t\t {\n\t\t var i;\n\t\t for (i = 0; i < gReturnInfo.length; i++)\n\t\t\t{\n\t\t\tif (gReturnInfo[i].providername == 'Bing Europe')\n\t\t\t {\n\t\t\t keyBing = gReturnInfo[i].pointkey;\n\t\t\t }\n\t\t\tif (gReturnInfo[i].providername == 'Google')\n\t\t\t {\n\t\t\t keyGoogle = gReturnInfo[i].pointkey;\t\n\t\t\t keyGoogleStat = gReturnInfo[i].imagekey;\t\n\t\t\t }\n\t\t\tif (gReturnInfo[i].providername == 'Here')\n\t\t\t {\n\t\t\t keyHere.app_id = gReturnInfo[i].pointkey;\n\t\t\t keyHere.app_code = gReturnInfo[i].imagekey;\n\t\t\t }\n\t\t\tif (gReturnInfo[i].providername == 'MapQuest North America')\n\t\t\t {\n\t\t\t keyMQ = gReturnInfo[i].pointkey;\n\t\t\t }\n\t\t\t}\n\t }, errorfunction);\t\t\n}", "title": "" }, { "docid": "5b7f305f48b98baa9c8cdd89e965d802", "score": "0.5455347", "text": "function BaseProvider(selector,service) {\r\n\r\n if (typeof selector != 'number')\r\n throw \"incorrect provider\";\r\n\r\n\r\n var self = this;\r\n var _provider;\r\n\r\n switch (selector) {\r\n case 1:\r\n //Initialize the ibex provider here\r\n _provider = new IbexProvider(service);\r\n break;\r\n case 2:\r\n //Initialize the twilio provider here\r\n _provider = new TwilioProvider(service);\r\n break;\r\n default:\r\n //Default initializing ibex library provider\r\n _provider = new IbexProvider();\r\n break;\r\n };\r\n\r\n\r\n //----- Hold Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio Hold call is taking callback function\r\n //----- Ibex Hold call is not taking any parameter\r\n self.holdCall = function (requestObject) {\r\n return _provider.hold(requestObject);\r\n }\r\n\r\n //----- Resume Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio Resume call is taking callback function\r\n //----- Ibex resume call is not taking any parameter\r\n self.resumeCall = function (requestObject) {\r\n return _provider.resume(requestObject);\r\n }\r\n\r\n //----- Consultancy Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio Resume call is taking callback function\r\n //----- Ibex resume call is not taking any parameter\r\n self.consultancyCall = function (requestObject) {\r\n return _provider.consultancy(requestObject);\r\n };\r\n\r\n //----- conference Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio Resume call is taking callback function\r\n //----- Ibex resume call is not taking any parameter\r\n self.conferenceCall = function (requestObject) {\r\n return _provider.conference(requestObject);\r\n };\r\n\r\n //----- Tansfer Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio transfer call is taking phoneNumber and callback function\r\n //----- Ibex iss providing 6 type of transfer call\r\n //----- 1. TransferCallToAgent | parameter: type, target Campaign, target Agent, json lead data\r\n //----- 2. TransferCallToCampaign | parameter: type, target Campaign, json lead data\r\n //----- 3. TransferCallToIP | parameter: type, extAtIP, displayName, json lead data\r\n //----- 4. TransferCallToQueue | parameter: type, targetCampaign, queueId, json lead data\r\n //----- 5. TransferCallToTelco | parameter: type, countryCode, number, json lead data\r\n //----- default. CompleteTransfer | parameter: json lead data\r\n self.transferCall = function (requestObject) {\r\n\r\n _provider.transfer(requestObject);\r\n\r\n //switch (selector) {\r\n // case 2:\r\n // return _provider.transfer(obj.phoneNumber, obj.callback);\r\n // case 1:\r\n // default:\r\n // switch (obj.TransferType) {\r\n // case 1:\r\n // return _provider.TransferCallToAgent(obj.type, obj.targetCampaign, obj.targetAgent, obj.jsonLead);\r\n // case 2:\r\n // return _provider.TransferCallToCampaign(obj.type, obj.targetCampaign, obj.jsonLead);\r\n // case 3:\r\n // return _provider.TransferCallToIP(obj.type, obj.extAtIP, obj.displayName, obj.jsonLead);\r\n // case 4:\r\n // return _provider.TransferCallToQueue(obj.type, obj.targetCampaign, obj.queueId, obj.jsonLead);\r\n // case 5:\r\n // return _provider.TransferCallToTelco(obj.type, obj.countryCode, obj.number, obj.jsonLead);\r\n // default:\r\n // return _provider.CompleteTransfer(obj.leadData);\r\n // break;\r\n // }\r\n\r\n //};\r\n };\r\n\r\n //----- Hangup Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio hangup call is taking callback function\r\n //----- Ibex hangup call is not taking any parameter\r\n self.hangupCall = function (requestObject) {\r\n _provider.hangup(requestObject);\r\n };\r\n\r\n //----- toggle Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio hangup call is taking callback function\r\n //----- Ibex hangup call is not taking any parameter\r\n self.toggleCall = function (requestObject) {\r\n _provider.toggle(requestObject);\r\n };\r\n\r\n //----- third Party Hangup Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio hangup call is taking callback function\r\n //----- Ibex hangup call is not taking any parameter\r\n self.thirdPartyHangupCall = function (requestObject) {\r\n _provider.thirdPartyHangup(requestObject);\r\n };\r\n\r\n //----- third Party Hangup Call Method \r\n //----- Parameters obj accordingly, can be nullable\r\n //----- Twilio hangup call is taking callback function\r\n //----- Ibex hangup call is not taking any parameter\r\n self.deviceMute = function (requestObject) {\r\n if (requestObject.toMute)\r\n _provider.mute(requestObject);\r\n else\r\n _provider.unmute(requestObject);\r\n };\r\n\r\n //----- Manual Call Method\r\n //----- Taking obj which will resolve the complexity accordingly\r\n self.manualCall = function (requestObject) {\r\n return _provider.manualCall(requestObject);\r\n };\r\n\r\n //----- Send DTMF Method\r\n //----- Taking obj which will resolve the complexity accordingly\r\n self.sendDTMF = function (requestObject) {\r\n return _provider.sendDTMF(requestObject);\r\n };\r\n\r\n return self;\r\n}", "title": "" }, { "docid": "9ad4126cb6642185afd4354daafb4c97", "score": "0.54459614", "text": "async function _ub3() { \n const ctx = web3Ctx.getCurrentContext();\n let address = common.getAddress();\n if (address.length == 0 ){\n console.log('No address registered');\n return;\n }\n\n const choices = [];\n address.forEach(item => { \n choices.push({name: item.name +' '+ item.address,value: item});\n });\n let questions = [\n { type: 'list', name: 'address', message: 'Address:',choices:choices },\n { type: 'input', name: 'amount', message: 'Specify the amount:' }\n ]; \n let answer = await inquirer.prompt(questions);\n \n return new Promise((resolve, reject) => {\n ctx.erc223.methods.mint(answer.address.address,parseInt(answer.amount)).send(ctx.transactionObject)\n .on('transactionHash', (hash) => {\n web3Ctx.checkTransaction(hash).then( () => resolve(), (err) => reject(err));\n });\n });\n \n}", "title": "" }, { "docid": "406362730b85949bfa576b245e6f96a1", "score": "0.5437338", "text": "getPublicKeyData() {\n IPC_RENDERER.send(\"ledger:getPublicKeyData\");\n }", "title": "" }, { "docid": "ba369d1b4458e5f22c0722fdf1d337b6", "score": "0.5432933", "text": "function getLendingPoolAddressProviderContract() {\n const lpAddressProviderAddress = \"0x506B0B2CF20FAA8f38a4E2B524EE43e1f4458Cc5\" // kovan address\n const lpAddressProviderContract = new web3.eth.Contract(LendingPoolAddressProviderABI, lpAddressProviderAddress)\n return lpAddressProviderContract\n }", "title": "" }, { "docid": "7a9f8210421b1cb0a01275bbb6c505ed", "score": "0.5421029", "text": "getService(){\n\n }", "title": "" }, { "docid": "b8f879c3a61a93aca94f9a99a8d74981", "score": "0.54056144", "text": "addressMenu(env, address) {\n let overview = function() { this.accountOverview(env, address); }.bind(this);\n let balances = function() { this.accountBalances(env, address); }.bind(this);\n let latestTx = function() { this.latestTransactions(env, address); }.bind(this);\n let watchAddr = function() { this.watchAddress(env, address); }.bind(this);\n let createTx = function() { this.createTransaction(env, address); }.bind(this);\n let createSig = function() { this.createSignature(env, address); }.bind(this);\n let createWlt = function() { this.createWallet(env); }.bind(this);\n\n this.displayMenu(\"Wallet Utilities\", {\n \"0\": {title: \"Account Overview\", callback: overview},\n \"1\": {title: \"Account Balances\", callback: balances},\n \"2\": {title: \"Recent Transactions\", callback: latestTx},\n \"3\": {title: \"Watch Address\", callback: watchAddr},\n \"4\": {title: \"Create Transaction\", callback: createTx},\n \"5\": {title: \"Create Multisig Signature\", callback: createSig},\n \"6\": {title: \"Create Wallet\", callback: createWlt},\n }, function() { this.end(); }.bind(this), true);\n }", "title": "" }, { "docid": "1b76c8fa84ab12f5573b56ebe42327b6", "score": "0.53985345", "text": "async ApproveAndCallDepositToken(tokenAddress,amountFormatted,tokenDecimals,callback)\n {\n console.log('deposit token',tokenAddress,amountRaw);\n\n var amountRaw = this.getRawFromDecimalFormat(amountFormatted,tokenDecimals)\n\n\n var remoteCallData = '0x01';\n\n var contract = this.ethHelper.getWeb3ContractInstance(\n this.web3,\n tokenAddress,\n _0xBitcoinABI.abi\n );\n\n console.log(contract)\n\n var approvedContractAddress = this.lavaWalletContract.blockchain_address;\n\n contract.approveAndCall.sendTransaction( approvedContractAddress, amountRaw, remoteCallData , callback);\n\n }", "title": "" }, { "docid": "436d3c80bc0a390011ba7f8452f5a9b0", "score": "0.53897727", "text": "function EnumCB_ProxyAddress_POST() {\n\tvar cpWorkPage = pega.ui.ClientCache.find(\"pyWorkPage\");\n\tvar cpProxyAddress = pega.ui.ClientCache.find(\"pyWorkPage.HouseholdRoster.ProxyAddress\");\n\tvar cpResponse = pega.ui.ClientCache.find(\"pyWorkPage.HouseholdMemberTemp.Response\");\n\t\n\tif(cpWorkPage && cpProxyAddress && cpResponse){\n\t\tvar addressType = cpProxyAddress.get(\"AddrType\").getValue();\n\t\tENUMCB.ProxyAddress_VLDN(addressType);\n\t\tif (!cpWorkPage.hasMessages()) {\n\t\t\t/*Stateside Address*/\n\t\t\tif(addressType == 'USSA' || addressType == 'USPO' || addressType == 'USRR'){\n\t\t\t\tcpResponse.put(\"RESP_PRX_CITY_TEXT\", cpProxyAddress.get(\"CITY\").getValue());\n\t\t\t\tcpResponse.put(\"RESP_PRX_STATE_TEXT\", cpProxyAddress.get(\"STATE\").getValue());\n\t\t\t\tcpResponse.put(\"RESP_PRX_ZIP_TEXT\", cpProxyAddress.get(\"LOCZIP\").getValue());\n\t\t\t\t\n\t\t\t\tif(addressType == 'USSA'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNUM_PRI_TEXT\", cpProxyAddress.get(\"LOCHN1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNAME_1_PRI_TEXT\", cpProxyAddress.get(\"StreetName\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_UNIT_TEXT\", cpProxyAddress.get(\"LOCWSID1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'USPO'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_POBOX_TEXT\", cpProxyAddress.get(\"POBOX\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'USRR'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_RR_DESC_TEXT\", cpProxyAddress.get(\"RRDescriptor\").getValue());\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_RR_NUM_TEXT\", cpProxyAddress.get(\"RRNumber\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_RR_BOXID_TEXT\", cpProxyAddress.get(\"RRBoxIDNumber\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t}else{ /*Puerto Rico*/\n\t\t\t\tcpResponse.put(\"RESP_PRX_PR_MUNI_NAME\", cpProxyAddress.get(\"Municipio\").getValue());\n\t\t\t\tcpResponse.put(\"RESP_PRX_STATE_TEXT\", cpProxyAddress.get(\"STATE\").getValue());\n\t\t\t\tcpResponse.put(\"RESP_PRX_ZIP_TEXT\", cpProxyAddress.get(\"LOCZIP\").getValue());\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRGA'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNUM_PRI_TEXT\", cpProxyAddress.get(\"LOCHN1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNAME_1_PRI_TEXT\", cpProxyAddress.get(\"StreetName\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_UNIT_TEXT\", cpProxyAddress.get(\"LOCWSID1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRUA'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PR_URB_NAME\", cpProxyAddress.get(\"LOCURB\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNUM_PRI_TEXT\", cpProxyAddress.get(\"LOCHN1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNAME_1_PRI_TEXT\", cpProxyAddress.get(\"StreetName\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_UNIT_TEXT\", cpProxyAddress.get(\"LOCWSID1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRAC'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_BUILDING_NAME\", cpProxyAddress.get(\"LOCAPTCOMPLEX\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNUM_PRI_TEXT\", cpProxyAddress.get(\"LOCHN1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNAME_1_PRI_TEXT\", cpProxyAddress.get(\"StreetName\").getValue());\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_BUILDING_DESC\", cpProxyAddress.get(\"LOCBLDGDESC\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_BUILDING_NUM_TEXT\", cpProxyAddress.get(\"LOCBLDGID\").getValue()); Confirm RESPONSE property with BAs **/\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_UNIT_TEXT\", cpProxyAddress.get(\"LOCWSID1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRAA'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PR_AREA_NAME\", cpProxyAddress.get(\"LOCAREANM1\").getValue());\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_PR_AREA_2_NAME\", cpProxyAddress.get(\"LOCAREANM2\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNUM_PRI_TEXT\", cpProxyAddress.get(\"LOCHN1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_STRNAME_1_PRI_TEXT\", cpProxyAddress.get(\"StreetName\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_UNIT_TEXT\", cpProxyAddress.get(\"LOCWSID1\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PR_KMHM_TEXT\", cpProxyAddress.get(\"KMHM\").getValue());\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRPO'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_POBOX_TEXT\", cpProxyAddress.get(\"POBOX\").getValue());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(addressType == 'PRRR'){\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_RR_DESC_TEXT\", cpProxyAddress.get(\"RRDescriptor\").getValue());\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_RR_NUM_TEXT\", cpProxyAddress.get(\"RRNumber\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\t/** cpResponse.put(\"RESP_PRX_RR_BOXID_TEXT\", cpProxyAddress.get(\"RRBoxIDNumber\").getValue()); Need RESPONSE property from BAs **/\n\t\t\t\t\tcpResponse.put(\"RESP_PRX_PHYS_DESC_TEXT\", cpProxyAddress.get(\"LOCDESC\").getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e4f63bf5b9b7db6f05ec2c054877b7df", "score": "0.53847003", "text": "async getAddress () {\n await this.init()\n return this._contractAddress\n }", "title": "" }, { "docid": "91c633d12b04a4a9c53eab2f57866748", "score": "0.53772736", "text": "function doProvidersQuery(region)\n{\n //add new providers dependent on region chosen\n getProviders(region, successProvidersQuery, errorfunction);\n}", "title": "" }, { "docid": "f6026803e0e19ecb05bceb45e6643053", "score": "0.53738683", "text": "function getTotalTokens() {\n var testcontract;\n var callJSONs = {\n from: ownerAddress, // get address string\n to: contractAddress, // get the contract string\n value: \"0\",\n nonce: 0,\n gasPrice: \"200000\",\n gasLimit: \"1000000\",\n contract: testcontract\n }\n\n // get the token Id owned by the address\n testcontract = { \"function\": \"getTotalTokens\", \"args\": \"\" };\n callJSONs.contract = testcontract;\n neb.api.call(callJSONs)\n .then(function (resp) {\n var data = resp.result;\n if (data!== numberOfAvatars){\n numberOfAvatars = data;\n // $(\"#prize\").show().text(\"Total prize pool: \" + String(parseInt(JSON.parse(resp.result)) / 1e18) + \" NAS\");\n $(\"#amountAvatars\").show().text(numberOfAvatars);\n }\n \n })\n}", "title": "" }, { "docid": "88b3038b5bcf63dbec58a244101f4432", "score": "0.53654945", "text": "setupProviderEngine({ origin }) {\n // setup json rpc engine stack\n const engine = new RpcEngine()\n const { provider } = this\n const { blockTracker } = this\n\n // create filter polyfill middleware\n const filterMiddleware = createFilterMiddleware({ provider, blockTracker })\n // create subscription polyfill middleware\n const subscriptionManager = createSubscriptionManager({ provider, blockTracker })\n subscriptionManager.events.on('notification', (message) => engine.emit('notification', message))\n\n // metadata\n engine.push(createOriginMiddleware({ origin }))\n engine.push(createLoggerMiddleware({ origin }))\n // filter and subscription polyfills\n engine.push(filterMiddleware)\n engine.push(subscriptionManager.middleware)\n // permissions\n engine.push(this.permissionsController.createMiddleware({ origin }))\n // watch asset\n // engine.push(this.preferencesController.requestWatchAsset.bind(this.preferencesController))\n // forward to metamask primary provider\n engine.push(providerAsMiddleware(provider))\n return engine\n }", "title": "" }, { "docid": "3cc373f1eefda2d3ff41edd36e4c87da", "score": "0.53570575", "text": "loadContract(name, address) {\n if (!address) {\n address = this.getContractAddress(name);\n }\n let abis = window.abis,\n key = '_cached_' + name + '_' + address,\n contract = abis[key];\n if (!contract) {\n console.log('first time to load contract ' + name + ': ' + address);\n let abi = abis[name];\n if (!abi) {\n console.error('Contract name found: ' + name);\n throw new Error('Contract not found: ' + name);\n }\n contract = new ethers.Contract(\n address,\n abi,\n this.provider.getSigner()\n );\n abis[key] = contract;\n console.log('Contract ' + name + ' loaded ok: ' + address);\n }\n return contract;\n }", "title": "" }, { "docid": "6110d90a19fccf564adfaff6a3f0e14d", "score": "0.5352406", "text": "getSubCustmer(selectedSPValue, selectedCustValue){\n this.getSubCustomerApi(selectedSPValue,selectedCustValue)\n}", "title": "" }, { "docid": "e01aad8ed8dbe8ea270e0738b80c2d9e", "score": "0.5346933", "text": "function Address(){\n var addressFormData={\n id: sabio.page.UserId,\n AddressLine1: vm.profile.addressLine1,\n address2: vm.profile.addressLine2,\n city: vm.profile.city,\n StateProvinceCode: vm.profile.stateProvinceCode,\n zip: vm.profile.zip\n }\n profileFactory.profileAddress(addressFormData).then(GetCall).then(AddressMap);\n }", "title": "" }, { "docid": "34219d0e2c0b3da65766fcce26a17127", "score": "0.5344192", "text": "handlePeerAddSubmit(address) {\n this.state.lc.send('LitRPC.Connect', {\n 'LNAddr': address,\n })\n .then(reply => {\n this.updateListConnections();\n })\n .catch(err => {\n this.displayError(err);\n });\n }", "title": "" }, { "docid": "3ef51f21172908c9cf003a335ac9f21d", "score": "0.5343043", "text": "function callFunction() {\n\n var types = [];\n var args = [];\n var addr = getContractAddress();\n var fromAddr = $('#sender').val();\n var name = $('#functionName').text();\n $(\"#error\").text('');\n\n var fn = getFunctionAbi(global_abi.abi, name);\n \n if( !fn.constant && (!fromAddr || fromAddr.length == 0) )\n {\n $('#error').text('Sender Address is required. Click the wallet button to import a wallet.');\n return;\n }\n\n var argValue;\n for(i=0; i<fn.inputs.length; i++)\n {\n types.push(fn.inputs[i].type);\n argValue = $('#input' + i).val();\n args.push(argValue);\n }\n try {\n var functionData = encodeFunctionData(name, types, args);\n console.log(functionData);\n } catch (err) {\n errorHandler('Invalid input: ', err);\n return;\n }\n \n if( fn.constant)\n {\n httpClient.ethCall(\n addr, \n functionData, \n fromAddr, \n function(response) {\n parseResponse(fn, response); \n }, \n function(message, error) {\n errorHandler(message, error);\n });\n }\n else \n {\n getNonce(function(nonceValue){\n\n var nonce = nonceValue;\n var gasPrice = getInputValueInHex(\"#gasPrice\");\n var gasLimit = getInputValueInHex(\"#gasLimit\");\n var amountToSend = getInputValueInHex('#amountToSend');\n \n var txObject = {\n nonce: nonce,\n gasPrice: gasPrice,\n gasLimit: gasLimit,\n to: addr,\n value: amountToSend,\n data: functionData\n }\n \n console.log(\"txObject: \" + JSON.stringify(txObject));\n var signedTx = wallet.sign(txObject);\n \n httpClient.sendRawTransaction( \n signedTx, \n function(response) {\n parseResponse(fn, response);\n }, \n function(msg, error) {\n errorHandler( msg, error); \n });\n });\n }\n return false;\n}", "title": "" }, { "docid": "efb39df35295f0a69ed365b4df3468dd", "score": "0.5342604", "text": "function initialiseRequestStructure(ssid){\r\n //options get set once, then call multiple operations\r\n var options = {\r\n hostname: 'api.betfair.com',\r\n port: 443,\r\n path: '/exchange/betting/json-rpc/v1',\r\n method: 'POST',\r\n headers: {\r\n 'X-Application' : settings.appKey,\r\n 'Accept': 'application/json',\r\n 'Content-type' : 'application/json',\r\n 'X-Authentication' : ssid\r\n }\r\n }\r\n function next () {\r\n console.log(\"this is the next function\");\r\n }\r\n // Start from finding the horse race event type id\r\n // function start() {\r\n // operations.findHorseRaceId(options, operations.secondFunction);\r\n // }\r\n function start() {\r\n operations.findHorseRaceId(options, function(str){\r\n console.log(\"I have hit the second function this way\");\r\n console.log(str);\r\n })\r\n }\r\n // function start() {\r\n // var firstFunction = operations.findHorseRaceId();\r\n // firstFunction.then(\r\n // function(){\r\n // console.log(\"second function\");\r\n // }\r\n // ).then(function(){\r\n // console.log(\"third function\");\r\n // });\r\n // }\r\n start();\r\n}", "title": "" }, { "docid": "9c2375fe3d92b44a772ceba879c1b41e", "score": "0.5342017", "text": "async getApi() {\n const wsProvider = new WsProvider(RPC_PROVIDER);\n const api = ApiPromise.create({\n provider: wsProvider,\n types: { \"Address\": \"MultiAddress\", \"LookupSource\": \"MultiAddress\" },\n //types: { \"Address\": \"AccountId\", \"LookupSource\": \"AccountId\" },\n });\n await api.isReady;\n return api;\n }", "title": "" }, { "docid": "41e8c7fd1624bb4876ee7f5f0c99a4c3", "score": "0.53358585", "text": "function getLocationByAddress(address) { \n var result = addresses.get({address: address}); \n //console.log(\"locateByAddress=\", result);\n return result;\n }", "title": "" }, { "docid": "d3aa416afce68a25a0e9a6a078c03741", "score": "0.5325859", "text": "address(numToMake, coinType) {\n return new Promise((resolve, reject) => {\n this.state.lc.send('LitRPC.Address', {\n 'NumToMake': numToMake,\n 'CoinType': coinType,\n }).then(reply => {\n resolve(reply);\n }\n )\n .catch(err => {\n this.displayError(err);\n });\n });\n }", "title": "" }, { "docid": "96af5097d2be17afe87428b0491b1907", "score": "0.5324122", "text": "function connect() {\n var provider = document.getElementById('providerUrl').value;\n window.web3 = new Web3(new Web3.providers.HttpProvider(provider));\n getAllAccounts();\n}", "title": "" }, { "docid": "cd05a94deab4456e07dea607a3e32596", "score": "0.5323371", "text": "function fetchAccountData() {\n // Get a Web3 instance for the wallet\n web3 = new Web3(provider);\n\n Promise.all([\n // Get connected chain id from Ethereum node\n netId ? Promise.resolve(0) : web3.eth.getChainId(),\n\n // Get list of accounts of the connected wallet\n web3.eth.getAccounts(),\n ])\n .then(([chainId, accounts]) => {\n // Load chain information over an HTTP API\n const chainData = netId ? Promise.resolve(0) : EvmChains.getChain(chainId);\n // document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // MetaMask does not give you all accounts, only the selected account\n triggerEvent(\"selectAccount\", accounts[0], !netId ? chainData : { networkId: netId });\n\n setup();\n load();\n })\n .catch(console.log);\n}", "title": "" }, { "docid": "38bdc624782e0250c4e0b0dcc09f5ab4", "score": "0.5322218", "text": "constructor() {\n this.eth\n }", "title": "" }, { "docid": "b3039643197988fb8dc5bfb87d5b8d4b", "score": "0.5321076", "text": "getCustomer(selectedSPValue){\n this.getCustomerApi(selectedSPValue)\n }", "title": "" }, { "docid": "165ad21cfcbcbec0ecf11e5649c379f7", "score": "0.5318818", "text": "async function getLocalProviderAddress() {\n if (signerLocalProvider) {\n setLocalProviderAddress(await signerLocalProvider.getAddress());\n }\n }", "title": "" }, { "docid": "85756ff131f7abd0ce4ffa9ecebe1a21", "score": "0.53168905", "text": "__jsonp() {\n\n let queryString = this.__getQueryString(this.data);\n let randomInt = this.__getRandomInt(1000000, 9999999);\n let functionName = `jsonp${randomInt}`;\n\n window[functionName] = (data) => {\n this.resolve(data);\n window[functionName] = undefined;\n };\n\n let script = document.createElement(\"script\");\n let head = document.getElementsByTagName(\"head\");\n script.src = `${this.url}?callback=${functionName}&${queryString}`;\n script.type = \"text/javascript\";\n script.id = `yellow-lab-${randomInt}`;\n head[0].appendChild(script);\n }", "title": "" }, { "docid": "6c967f228f6e1606fc1d24f3ef7f7072", "score": "0.5316876", "text": "deployedContractInstance(address) {\n this.contractInstance.at(address).then((deployedContract) => {\n this.deployedContract = deployedContract\n this.initializeAppState()\n this.listenForEvents()\n }).catch((e) => {\n console.log(e);\n })\n }", "title": "" }, { "docid": "df5c3ac648bcf521834641225eaf1189", "score": "0.5305467", "text": "function OfferService() {\n\n}", "title": "" }, { "docid": "0bb00347ba65be82cb271122626f3a81", "score": "0.53015417", "text": "_handleProposal(e){\n this.regObj = e.detail.response.Data\n this._checkKomiteTerpilih()\n }", "title": "" }, { "docid": "204832b3c6b0623c7a8cabaa32067575", "score": "0.5294972", "text": "getTokenBalance(req, res){\n if(isNullOrUndefined.isNullOrUndefined(req.body.wallet))\n {\n let msg = { msg: \"Error read Wallet Json\"};\n res.status(400).json(msg);\n }\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.password))\n {\n let msg = { msg: \"Error read parameter <password>\"};\n res.status(400).json(msg);\n }\t\t\t\t\t\t\t\n let walletJson = JSON.stringify(req.body.wallet);\t\n let ks = Lightwallet.keystore.deserialize(walletJson);\n let password = req.body.password.toString();\n ks.keyFromPassword(password, function(err, pwDerivedKey) {\n if(!err)\n {\n let web3Provider = new HookedWeb3Provider({\n host: \"https://mainnet.infura.io/7xNw0DpR7VrQxYmSs303 \",\n transaction_signer: ks\n });\t\t \n web3.setProvider(web3Provider); \t\n let addr = ks.getAddresses()[0];\n let contractData = contractInstance.balanceOf.getData(addr);\t\t\t\t\t\n web3.eth.call({\n to: contractAddr, // Contract address, used call the token balance of the address in question\n data: contractData // Combination of contractData and tknAddress, required to call the balance of an address \n }, function(err, result) {\n if (result) { \n let tokens = web3.toBigNumber(result).toString(); // Convert the result to a usable number string\n let balance = {\n address: addr,\n balance: web3.fromWei(tokens, 'ether')\n };\n res.status(200).json(balance);\n }\n else {\n res.status(400).json(err); // Dump errors here\n }\n }); \n } else {\n res.status(400).json(err);\n } \n });\t\t\t\n }", "title": "" }, { "docid": "fbb8f178d031ca96cd11ed6534951482", "score": "0.5293631", "text": "function JsonRpcProvider() {\n var defaults = this.defaults = {};\n defaults.rpcPath_ = '/rpc';\n\n function generateId() {\n /**! http://stackoverflow.com/a/2117523/377392 */\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }\n\n this.$get = ['$http', function($http) {\n /**\n * Makes a JSON-RPC request to |method| with |data|.\n *\n * @param {{path:string=, method: string, data:*)}} options Call options.\n * @param {angular.HttpConfig} config HTTP config.\n * @return {angular.HttpPromise}\n */\n function jsonrpc(options, config) {\n var id = generateId();\n var payload = {\n 'jsonrpc': '2.0',\n 'method': options.method,\n 'id': id\n };\n angular.isDefined(options.data) && (payload['params'] = options.data);\n\n var transformResponse = $http.defaults.transformResponse;\n transformResponse.push(function(data) {\n return data['id'] == id ? data['result'] || data['error'] : null;\n });\n\n config = config || {};\n if (angular.isArray(config['transformResponse'])) {\n [].push.apply(transformResponse, config['transformResponse']);\n }\n config['transformResponse'] = transformResponse;\n\n return $http.post(options.path || defaults.rpcPath_, payload, config);\n }\n\n /**\n * Shorthand for making a request with the default path.\n *\n * @param {string} method The method to call.\n * @param {?*} data The data for the call.\n * @param {angular.HttpConfig} config HTTP config.\n * @return {angular.HttpPromise}\n */\n jsonrpc.request = function(method, data, config) {\n return jsonrpc({method: method, data: data}, config);\n };\n\n /**\n * Shorthand for making a request with a path.\n *\n * @param {string} path The call path.\n * @param {string} method The method to call.\n * @param {?*} data The data for the call.\n * @param {angular.HttpConfig} config HTTP config.\n * @return {angular.HttpPromise}\n */\n jsonrpc.requestPath = function(path, method, data, config) {\n return jsonrpc({path: path, method: method, data: data}, config);\n };\n\n return jsonrpc;\n }];\n}", "title": "" }, { "docid": "69733d180cb839c0a345d9a920778273", "score": "0.5291947", "text": "function getTotalPrize() {\n var testcontract;\n var callJSONs = {\n from: ownerAddress, // get address string\n to: contractAddress, // get the contract string\n value: \"0\",\n nonce: 0,\n gasPrice: \"200000\",\n gasLimit: \"1000000\",\n contract: testcontract\n }\n\n // get the token Id owned by the address\n testcontract = { \"function\": \"getPrizePool\", \"args\": \"\" };\n callJSONs.contract = testcontract;\n neb.api.call(callJSONs)\n .then(function (resp) {\n var data = String(parseInt(JSON.parse(resp.result)) / 1e18);\n if (data !== prizePool){\n prizePool = data;\n $(\"#pool\").show().text(prizePool + \" NAS\");\n }\n // $(\"#prize\").show().text(\"Total prize pool: \" + String(parseInt(JSON.parse(resp.result)) / 1e18) + \" NAS\");\n \n }\n )\n}", "title": "" }, { "docid": "a90a8e95021e9b3865cada18253863e2", "score": "0.5284474", "text": "showUserBalance(callback) {\n let self = this;\n this.web3.eth.getBalance(self.owner).then(function(value){\n console.log(value)\n });\n }", "title": "" }, { "docid": "daf6fb2623ed80f06fb41fc0bd4a16b7", "score": "0.52798337", "text": "function showLatestProvider(){\n myContract.methods.getProviderCount().call().then(function(totalCount){\n console.log(\"-----------------------------------------------------------------\");\n console.log(\"Total provider count = \",totalCount);\n return totalCount;\n })\n .then(function(totalCount){\n //get Provider pool \n myContract.methods.getProviderPool().call().then(function(pool){\n console.log(\"Active Provider count = \",pool.length);\n console.log(\"Provider Pool: \");\n console.log(pool); \n return totalCount; \n }).then(function(totalCount){\n //print provider detals (object)\n if(argv['debug']){\n myContract.methods.getProvider(totalCount-1).call().then(function(ret){\n console.log(\"-----------------------------------------------------------------\");\n console.log(\"Last provider: \", ret);\n //return ret;\n }).then(function(ret){\n if(argv['nl']) process.exit();\n });\n }\n else if(argv['nl']) process.exit();\n })\n })\n}", "title": "" }, { "docid": "321cfea4d54b8f24f29c136f868ee2e3", "score": "0.527855", "text": "function depositText(){\r\n var address = document.getElementById(\"address\").value;\r\n console.log(address);\r\n contract.methods.depositText(address).send({from: accounts[0]}).then(x => console.log(x));\r\n}", "title": "" }, { "docid": "6b9a97d6a735ecb12afdd59f164a0178", "score": "0.52779514", "text": "function Get_PAOffer_Startup_Data(i_OWNER_ID) {\n try {\n ////////debugger;\n //alert('test');\n _Params_Get_PAOffer_Startup_Data.OWNER_ID = i_OWNER_ID;\n _Params_Get_PAOffer_Startup_Data.USER_ID = _UserInfo.UserID;\n _Params_Get_PAOffer_Startup_Data.PCODE = \"PA\";\n\n _Params = JSON.stringify(_Params_Get_PAOffer_Startup_Data);\n\n _Service_Method = \"Get_PAOffer_Startup_Data\";\n\n CallService('Service_Call_Completed_PAOffer');\n }\n catch (e) {\n alert(\"Get_PAOffer_Startup_Data: \" + e.Message);\n }\n}", "title": "" }, { "docid": "bb9bb570c4921dd6bc6d2cddc1e4cf52", "score": "0.5276028", "text": "function respondContractQuery(responseString){\n\n //call contract callback method\n EventEmitter.callback(responseString).then((success) =>{\n console.log(null, success);\n\n }).catch((err) => {\n console.log(err);\n });\n\n}", "title": "" }, { "docid": "6e142a1fe5b12f60b7116f8a28c19218", "score": "0.5269141", "text": "function fetchAllAcceptedAddresses(){\n\n var isOrg = myContractInstance.returnAcceptedArray(function(err,result){\n\t\tif(!err){\n var msg =\"\";\n for (var i = 0; i< result.length; i++){\n msg += result[i]+\", \";\n }\n\n document.getElementById('acceptedCallback').innerHTML = msg;\n console.log(msg);\n\n\t\t }\n\t\t else {\n\t\t\t console.err(error);\n\t\t }\n });\n\n// var allEvents = myContractInstance.RequestSubmittedForApproval({},{fromBlock: 0, toBlock: 'latest'},function(error, result) {\n// if (!error) {\n// if(result.args.state == 1) { // this IF condition shall filter the Accepted requests\n// var msg = \"IPFS HASH \"+(result.args.ProviderDetailsIPFShash) + \" block no: \"+ result.blockNumber;\n// document.getElementById('acceptedReqCallback').innerHTML += \"<hr/>\"+msg;\n// console.log(msg);\n// AcceptedListMap[result.args._requsterAdd] = result.args.ProviderDetailsIPFShash ;\n// }\n// }\n// else {\n// console.error(error);\n// } \n// });\n\n// allEvents.stopWatching();\n// console.log (\"these are the entry for Already accepted list which got modified\");\n// for(var key in AcceptedListMap) {\n// var value = AcceptedListMap[key];\n// console.log(\"key:=\" + key + \", value:=\"+value)\n// }\n// }\n\n// function printAcceptedList(){\n// console.log (\"these are the entry for Already accepted list which got modified\");\n// for(var key in AcceptedListMap) {\n// var value = AcceptedListMap[key];\n// console.log(\"key:=\" + key + \", value:=\"+value)\n// }\n}", "title": "" }, { "docid": "6094b48372fad08b07dd93e067a5fc59", "score": "0.5268057", "text": "function fetchAllPendingAddresses(){\n var isOrg = myContractInstance.returnPendingArray(function(err,result){\n\t\tif(!err){\n var msg =\"\";\n for (var i = 0; i< result.length; i++){\n msg += result[i]+\", \";\n }\n\n document.getElementById('callback22').innerHTML = msg;\n console.log(msg);\n\n\t\t }\n\t\t else {\n\t\t\t console.err(error);\n\t\t }\n });\n\n\n// var allEvents = myContractInstance.RequestSubmittedForApproval({},{fromBlock: 0, toBlock: 'latest'},function(error, result) {\n// \t if (!error) {\n// if(result.args.state == 0) { // this IF condition shall filter the PENDING requests\n// \t\t var msg = \"IPFS HASH \"+(result.args.ProviderDetailsIPFShash) + \" block no: \"+ result.blockNumber;\n// document.getElementById('callback22').innerHTML += \"<hr/>\"+msg;\n// console.log(msg);\n// PendingListMap[result.args._requsterAdd] = result.args.ProviderDetailsIPFShash ;\n// }\n// \t }\n// \t else {\n// \t\t console.error(error);\n// \t } \n// });\n// allEvents.stopWatching();\n// console.log (\"these are the entry for pending list\");\n// for(var key in PendingListMap) {\n// var value = PendingListMap[key];\n// console.log(\"key:=\" + key + \", value:=\"+value);\n \n// }\n}", "title": "" }, { "docid": "1bb487d074730ee3ec9af56736190f86", "score": "0.52676916", "text": "function testContract(address,callback) {\n console.log(\"in testContract@\" + address);\n var _contract = new web3.eth.Contract(abi, address);\n _contract.methods.getOwner().call({\n from: web3.eth.accounts[0]\n }, function(error, owner) {\n console.log(\"@testContract:Owner is: \" + owner);\n testPOSTapi(address, owner[0], owner[1],function(data){\n return callback(data);\n });\n });\n }", "title": "" }, { "docid": "fdfb9b12c39a1762895dcc57e0d187bb", "score": "0.5262211", "text": "getBlocksByWalletAdressValue(walletAddress){\n return this.bd.getBlocksByWalletAddress(walletAddress).then(res => res).catch(err => err);\n }", "title": "" }, { "docid": "620e22d3deaafa7cd29a92c49f803560", "score": "0.52542454", "text": "function GetAmountToPay(){\n Contract.amount().then(function(result){\n amount = result;\n document.getElementById(\"paymentAmount\").innerText = ethers.utils.formatEther(amount);\n });\n}", "title": "" }, { "docid": "7f0561478ddff68cc5328121c180facd", "score": "0.52531743", "text": "sendEth(req, res){\n if(isNullOrUndefined.isNullOrUndefined(req.body.wallet))\n {\n let error = { \n isError: true,\n msg: \"Error read Wallet Json\"\n };\n res.status(400).json(error);\n }\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.password))\n {\n let error = { \n isError: true,\n msg: \"Error read parameter <password>\"\n };\n res.status(400).json(error);\n }\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.to))\n {\n let error = { \n isError: true,\n msg: \"Error read parameter <to>\"\n };\n res.status(400).json(error);\n }\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.gasLimit))\n {\n let error = { \n isError: true,\n msg: \"Error read parameter <gasLimit>\"\n };\n res.status(400).json(error);\n }\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.gasPrice))\n {\n let error = { \n isError: true,\t\t\t\t\t\n msg: \"Error read parameter <gasPrice>\"};\n res.status(400).json(error);\n }\t\t\t\n if(isNullOrUndefined.isNullOrUndefined(req.body.value))\n {\n let error = { \n isError: true,\n msg: \"Error read parameter <value>\"\n };\n res.status(400).json(error);\n }\t\n \n let walletJson = JSON.stringify(req.body.wallet);\t\t\t\t\n let ks = Lightwallet.keystore.deserialize(walletJson);\t\t\t\n let password = req.body.password.toString();\n ks.keyFromPassword(password, function(err, pwDerivedKey) {\t\n if(ks.isDerivedKeyCorrect(pwDerivedKey))\n {\t\t\t\t\t\n if(ks.getAddresses()[0] == req.body.to) \n {\n let error = { \n isError: true,\n msg: \"Invalid Recipient\"\n };\n res.status(400).json(error);\n } \n\n let web3Provider = new HookedWeb3Provider({\n host: \"https://mainnet.infura.io/7xNw0DpR7VrQxYmSs303 \",\n transaction_signer: ks\n });\t\t \n web3.setProvider(web3Provider); \n \n let sendingAddr = ks.getAddresses()[0];\n let nonceNumber = parseInt(web3.eth.getTransactionCount(sendingAddr.toString(), \"pending\"));\n \n txOptions = {};\n txOptions.to = req.body.to;\n txOptions.gasLimit = req.body.gasLimit; \n txOptions.gasPrice = parseInt(req.body.gasPrice) * 1000000000; \n txOptions.value = parseFloat(req.body.value) * 1.0e18; \n txOptions.nonce = nonceNumber;\n\n \n let valueTx = txutils.valueTx(txOptions);\n let signedValueTx = signing.signTx(ks, pwDerivedKey, valueTx, sendingAddr);\t\t\t\t\t \n web3.eth.sendRawTransaction('0x' + signedValueTx, function(err, hash) { \n if(!isNullOrUndefined.isNullOrUndefined(err)){\n let error = { \n isError: true,\n msg: err\n };\n res.status(400).json(error);\n } \n if(!isNullOrUndefined.isNullOrUndefined(hash)){\n let data = { \n isError: false,\n hash: hash \n };\n res.status(200).json(data);\n }\n else\n {\t\t\t\t\t\t\t\n let error = { \n isError: true,\n msg: 'return hash is null'\n };\n res.status(400).json(error);\n }\n \n });\n }else{\t\n let error = {\n isError: true,\n msg: 'Password incorret'\t\t\t\t\t\t\n };\t\t\t\t\n res.status(400).json(error);\n }\n });\t\n }", "title": "" }, { "docid": "445b4d29590865b0dce3646c21095b37", "score": "0.52528405", "text": "getProvider(options) {\n // Check cache for existing provider\n const existingProvider = this.engines.get(JSON.stringify(options));\n\n if (existingProvider) {\n existingProvider.start();\n return existingProvider;\n } // Create a new provider if one does not exist\n\n\n let normalizedOptions = {};\n\n if (options && typeof options !== 'string') {\n normalizedOptions = options;\n }\n\n const network = this.networkFromProviderOptions(options);\n\n if (network === _bitskiProvider.Kovan && normalizedOptions.minGasPrice == null) {\n normalizedOptions.minGasPrice = 1;\n }\n\n const newProvider = this.createProvider(network, normalizedOptions);\n newProvider.start();\n this.engines.set(JSON.stringify(options), newProvider);\n return newProvider;\n }", "title": "" }, { "docid": "09b4983c1c06e5bfcac6d670f7d8741a", "score": "0.52459216", "text": "function listAllProviders (){\n myContract.methods.getProviderPoolSize().call().then(function(actCount){\n console.log(\"-----------------------------------------------------\");\n console.log(\"Total active provider = \", actCount);\n })\n .then(function(){\t \n myContract.methods.getProviderPool().call().then(function(pool){ \n console.log(\"Active provider pool: \");\n console.log(pool);\n }).then(function(){ \n myContract.methods.getProviderCount().call().then(function(totalCount){\n console.log(\"-----------------------------------------------------\");\n console.log(\"Total provider since start = \", totalCount);\n return totalCount;\n }).then(function(totalCount){\t\n myContract.methods.listProviders().call().then(function(proList){ \n if(totalCount > 0) console.log(\"List all the Providers: \")\n for (var i = 0;i < totalCount ;i++){\n if(argv['debug']){ //in a detail pattern\n console.log(proList[i]);\n } else{ //or simple print: 3 key values \n if(proList[i]['addr'] != 0){\n console.log(\"provD = \", proList[i]['provID']);\n console.log(\"addr = \", proList[i]['addr']);\n console.log(\"available = \", proList[i]['available']);\n }\n }\n }\t\t\n })\n .catch(function(){ //catch any error at end of .then() chain!\n console.log(\"List All Provider Info Failed! \")\n process.exit();\n }) \n })\n })\n })\n}", "title": "" }, { "docid": "04af22cdc2e81be0320cbba0ee47d189", "score": "0.52446544", "text": "function oyXMLRPCProvider () {\t\n\n\tvar status = null;\n\tvar url = null;\t\n\tvar req = null;\n\tvar msgCount = 0;\t\n\tvar inProgress = false;\n\tvar isComplete = false;\n\t\t\n\tvar oThis = this;\n\t\n\t// checks to see if we have too many messages in log\n\tvar internalCanMsg = function(){\n\t\tmsgCount++;\n\t\treturn msgCount < 100;\n\t}\n\t\n\t// adds message to internal log\n\tvar internalOnLog = function(msg){\n\t\tif(oThis.onLog && internalCanMsg()) {\n\t\t\toThis.onLog(msg);\n\t\t}\n\t}\n\t\n\t// adds message to internal error handler\n\tvar internalOnError = function(msg){\n\t\tif(oThis.onError && internalCanMsg()) {\n\t\t\toThis.onError(msg);\n\t\t}\n\t}\t\n\t\n\t// tells us whether we are busy waiting for the response to another requst\n\tvar internalIsBusy = function(){\n\t\treturn inProgress && !isComplete;\n\t}\t\n\t\n\t// internal callback function for the browser; it is called when a state of a request object changes\n\tvar internalRequestComplete = function() {\n\t\t\t\t\n\t\tvar STATE_COMPLETED = 4;\n\t\tvar STATUS_200 = 200;\n\t\t\t\t\n\t\tif (!internalIsBusy()) {\n\t\t\tinternalOnError(\"internalRequestComplete: error - no request submitted\");\n\t\t}\n\t\t\n\t\tinternalOnLog(\"internalRequestComplete: readyState \" + req.readyState);\n\t\t\n\t\tif (req.readyState == STATE_COMPLETED) {\n\t\t\tstatus = req.status;\n\t\t\tinProgress = false;\n\t\t\tisComplete = true;\n\n\t\t\tinternalOnLog(\"internalRequestComplete: status \" + status);\n\t\t\t\n\t\t\tif (status == STATUS_200) {\n\t\t\t\tinternalOnLog(\"internalRequestComplete: calling callback on content with length \" + req.responseText.length + \" chars\");\t\t\t\n\t\t\t\tif(oThis.onComplete) {\n\t\t\t\t\toThis.onComplete(req.responseText, req.responseXML);\n\t\t\t\t}\t\t\t\t \n\t\t\t\tinternalOnLog(\"internalRequestComplete: complete on \" + new Date());\n\t\t\t} else {\n\t\t\t\tinternalOnError(\"internalRequestComplete: error - bad status while fetching \" + url);\n\t\t\t}\n\t\t} else {\n\t\t\t// we need to review other state codes for XMLRPC provider\n\t\t}\n\t}\t\n\t\n\t// call this function to figure out version of this class\n\tthis.getVersion = function(){\n\t\treturn \"1.0.0\";\n\t}\n\t\n\t// call this function to figure out if current browser supports XML HTTP Requests\n\tthis.isSupported = function(){\n\t\tvar nonEI = window.XMLHttpRequest;\n\t\tvar onIE = window.ActiveXObject;\n\t\t\n\t\tif (onIE) {\t \t\t\n\t\t\tonIE = new ActiveXObject(\"Microsoft.XMLHTTP\") != null;\n\t\t}\n\t\t\n\t\treturn window.XMLHttpRequest || onIE;\n\t}\n\t\n\t// call this function to find out if more calls are possible and if request has been completely received \n\tthis.isBusy = function(){\n\t\treturn internalIsBusy();\n\t}\t\t\n\n\t// call this function to submit new request\n\tthis.submit = function(_url){\t\n\t\tif (internalIsBusy()) {\n\t\t\tinternalOnError(\"submit: error - busy processing another request \" + _url);\t\t\t\n\t\t}\t\n\t\t\n\t\tmsgCount = 0;\n\t\tinternalOnLog(\"submit: started on \" + new Date() + \" for \" + _url);\n\t\t\t\t\n\t\turl = _url;\t\n\t\tstatus = null;\n\t\tinProgress = true;\n\t\tisComplete = false;\n\t\t\n\t if (window.XMLHttpRequest) {\n\t \n\t \t// branch for native XMLHttpRequest object\n\t\t\tinternalOnLog(\"submit: using XMLHttpRequest()\");\n\t \n\t req = new XMLHttpRequest();\n\t req.onreadystatechange = internalRequestComplete;\n\t req.open(\"GET\", url, true);\n\t \n \treq.send(null);\t\n\t \t \n\t } else { \n\t \t \t\n\t \t// branch for IE/Windows ActiveX version\n\t \tif (window.ActiveXObject) {\t \t\t\n\t\t req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t if (req) {\n\t\t \n\t\t\t\t\tinternalOnLog(\"submit: using Microsoft.XMLHTTP\");\n\t\t \n\t\t req.onreadystatechange = internalRequestComplete;\n\t\t req.open(\"GET\", url, true);\n\t\t\t \treq.setrequestheader(\"Pragma\",\"no-cache\");\n\t\t \t \treq.setrequestheader(\"Cache-control\",\"no-cache\");\n\t\t \n\t\t \treq.send();\t\n\t\t } else {\n\t\t\t\t\tinternalOnError(\"submit: error - unable to create Microsoft.XMLHTTP\");\n\t\t }\n\t\t } else {\n\t\t\t\tinternalOnError(\"submit: error - browser does not support XML HTTP Request\");\n\t\t }\n\t }\n\t\t\n\t\tinternalOnLog(\"submit: complete\");\n\t}\n\t\n\t// call this function to abort current request\n\tthis.abort = function(){\n\t\tinternalOnLog(\"abort: \" + url);\n\t\t\n\t\tif (!internalIsBusy()) {\n\t\t\tinternalOnError(\"abort: error - no request submitted\");\t\t\t\n\t\t}\n\t\n\t\tonComplete = null;\t\t\n\t\treq.abort();\n\t}\t\n\n\t// call this function to find out current url\n\tthis.getUrl = function(){\n\t\treturn url;\n\t}\n\t\n\t// call this function to find out HTTP status code after response completes\n\tthis.getStatus = function(){\n\t\treturn status;\n\t}\t\n\t\n\t// please can override this; this is function called when fatal error occurs\n\tthis.onError = function(msg){\n\t\t\n\t} \n\t\n\t// user can override this; this function is called when log message is created\t\n\tthis.onLog = function(msg) {\n\t\n\t}\t\n\t\n\t// user can override this; this function is called when response is received without errors\n\tthis.onComplete = function(responseText, responseXML){\n\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "253acda2d28db17a2ba7e6c32466a47e", "score": "0.5243041", "text": "function GetETCballance(callback) {\n\n\n var result;\n var balance;\n\n $.ajax({\n dataType: 'jsonp',\n url: \"https://api.gastracker.io/v1/addr/\" + localStorage.EtcWallet,\n type: \"GET\",\n success: function (data) {\n var balance = data.ether;\n document.getElementById(\"etc1ballance\").innerHTML = data.balance.ether;\n callback();\n },\n error: function () {\n console.log(\"error on getting ETC Ballance API\")\n }\n\n //});\n\n });\n\n}", "title": "" }, { "docid": "3075911ced8f8355d0e6cc5144285a42", "score": "0.52410877", "text": "getCurrentWeb3Provider (): Object {\n return this.web3.currentProvider;\n }", "title": "" }, { "docid": "4f3982e2ad4c4b91666df130e51b396e", "score": "0.52333295", "text": "getCallerAddress() {\n if (giantConfig.debug) {\n logger.warn(`Called method GiantContract.getCallerAddress, return ${giantConfig.caller.publicKey}`)\n }\n return giantConfig.caller.publicKey\n }", "title": "" }, { "docid": "c1701894f83a39c088de163eb29fa9c7", "score": "0.52323055", "text": "async instantiate(ctx){\n console.log('************ Pharnet Manufacturer Smart Contract Instantiated *************');\n\t}", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5230848", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "3ef1ce07a487ab61bf112af9989bdf50", "score": "0.52266467", "text": "function waitProviderFromEnv(env) {\n var _this = this;\n if ('ETH_NODE_URI' in env && env.ETH_NODE_URI) {\n var ETH_NODE_URI_1 = env.ETH_NODE_URI, REACH_DO_WAIT_PORT_1 = env.REACH_DO_WAIT_PORT;\n return (function () { return __awaiter(_this, void 0, void 0, function () {\n var provider;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!shared_impl_1.truthyEnv(REACH_DO_WAIT_PORT_1)) return [3 /*break*/, 2];\n return [4 /*yield*/, waitPort_1[\"default\"](ETH_NODE_URI_1)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [4 /*yield*/, doHealthcheck(ETH_NODE_URI_1)];\n case 3:\n _a.sent();\n provider = new ethers_1.ethers.providers.JsonRpcProvider(ETH_NODE_URI_1);\n // TODO: make polling interval configurable?\n provider.pollingInterval = 500; // ms\n return [2 /*return*/, provider];\n }\n });\n }); })();\n }\n else if ('ETH_NET' in env && env.ETH_NET) {\n var ETH_NET = env.ETH_NET;\n // TODO: support more\n if (ETH_NET === 'homestead' || ETH_NET === 'ropsten') {\n // No waitPort for these, just go\n return Promise.resolve(ethers_1.ethers.getDefaultProvider(ETH_NET));\n }\n else if (ETH_NET === 'window') {\n var ethereum_1 = shim_1.window.ethereum;\n if (ethereum_1) {\n return (function () { return __awaiter(_this, void 0, void 0, function () {\n var provider;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n provider = new ethers_1.ethers.providers.Web3Provider(ethereum_1);\n // The proper way to ask MetaMask to enable itself is eth_requestAccounts\n // https://eips.ethereum.org/EIPS/eip-1102\n return [4 /*yield*/, provider.send('eth_requestAccounts', [])];\n case 1:\n // The proper way to ask MetaMask to enable itself is eth_requestAccounts\n // https://eips.ethereum.org/EIPS/eip-1102\n _a.sent();\n return [2 /*return*/, provider];\n }\n });\n }); })();\n }\n else {\n throw Error(\"window.ethereum is not defined\");\n }\n }\n else {\n throw Error(\"ETH_NET not recognized: '\" + ETH_NET + \"'\");\n }\n }\n else {\n // This branch should be impossible, but just in case...\n throw Error(\"non-empty ETH_NET or ETH_NODE_URI is required, got: \" + Object.keys(env));\n }\n}", "title": "" }, { "docid": "20dd54bd81f18b7664a59cd5805af5c4", "score": "0.52229774", "text": "function callLegacyRegistry (address, callback) {\n const rpcUrl = `https://ropsten.infura.io/${infuraKey}`\n if (!address) return callback(null)\n return http({\n uri: rpcUrl,\n accept: 'application/json',\n data: {\n method: 'eth_call',\n params: [\n {to: '0xb9C1598e24650437a3055F7f66AC1820c419a679', data: (getAttributesData + address.slice(2))},\n 'latest'\n ],\n id: 1,\n jsonrpc: '2.0'\n }\n }, (error, response) => {\n if (error) return callback(error)\n if (response.error) return callback(response.error)\n const hexHash = response.result.slice(130).slice(0, 68)\n return callback(null, toBase58(hexHash))\n })\n }", "title": "" }, { "docid": "1690d92e497dc16e9e48ae8f821750ad", "score": "0.5221103", "text": "get rpc (): RpcServer {\n return this._rpc\n }", "title": "" }, { "docid": "5c518b92f66d0a43d071f22f61d64f40", "score": "0.52194035", "text": "constructor(core, baseurl = '/ext/bc/P') {\n super(core, baseurl);\n /**\n * @ignore\n */\n this.keychain = new keychain_1.KeyChain('', '');\n this.blockchainID = constants_1.PlatformChainID;\n this.blockchainAlias = undefined;\n this.AVAXAssetID = undefined;\n this.txFee = undefined;\n this.creationTxFee = undefined;\n this.minValidatorStake = undefined;\n this.minDelegatorStake = undefined;\n /**\n * Gets the alias for the blockchainID if it exists, otherwise returns `undefined`.\n *\n * @returns The alias for the blockchainID\n */\n this.getBlockchainAlias = () => {\n if (typeof this.blockchainAlias === \"undefined\") {\n const netid = this.core.getNetworkID();\n if (netid in constants_1.Defaults.network && this.blockchainID in constants_1.Defaults.network[netid]) {\n this.blockchainAlias = constants_1.Defaults.network[netid][this.blockchainID].alias;\n return this.blockchainAlias;\n }\n else {\n /* istanbul ignore next */\n return undefined;\n }\n }\n return this.blockchainAlias;\n };\n /**\n * Sets the alias for the blockchainID.\n *\n * @param alias The alias for the blockchainID.\n *\n */\n this.setBlockchainAlias = (alias) => {\n this.blockchainAlias = alias;\n /* istanbul ignore next */\n return undefined;\n };\n /**\n * Gets the blockchainID and returns it.\n *\n * @returns The blockchainID\n */\n this.getBlockchainID = () => this.blockchainID;\n /**\n * Refresh blockchainID, and if a blockchainID is passed in, use that.\n *\n * @param Optional. BlockchainID to assign, if none, uses the default based on networkID.\n *\n * @returns The blockchainID\n */\n this.refreshBlockchainID = (blockchainID = undefined) => {\n const netid = this.core.getNetworkID();\n if (typeof blockchainID === 'undefined' && typeof constants_1.Defaults.network[netid] !== \"undefined\") {\n this.blockchainID = constants_1.PlatformChainID; //default to P-Chain\n return true;\n }\n if (typeof blockchainID === 'string') {\n this.blockchainID = blockchainID;\n return true;\n }\n return false;\n };\n /**\n * Takes an address string and returns its {@link https://github.com/feross/buffer|Buffer} representation if valid.\n *\n * @returns A {@link https://github.com/feross/buffer|Buffer} for the address if valid, undefined if not valid.\n */\n this.parseAddress = (addr) => {\n const alias = this.getBlockchainAlias();\n const blockchainID = this.getBlockchainID();\n return bintools.parseAddress(addr, blockchainID, alias, constants_2.PlatformVMConstants.ADDRESSLENGTH);\n };\n this.addressFromBuffer = (address) => {\n const chainid = this.getBlockchainAlias() ? this.getBlockchainAlias() : this.getBlockchainID();\n return bintools.addressToString(this.core.getHRP(), chainid, address);\n };\n /**\n * Fetches the AVAX AssetID and returns it in a Promise.\n *\n * @param refresh This function caches the response. Refresh = true will bust the cache.\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.getAVAXAssetID = (refresh = false) => __awaiter(this, void 0, void 0, function* () {\n if (typeof this.AVAXAssetID === 'undefined' || refresh) {\n const assetID = yield this.getStakingAssetID();\n this.AVAXAssetID = bintools.cb58Decode(assetID);\n }\n return this.AVAXAssetID;\n });\n /**\n * Overrides the defaults and sets the cache to a specific AVAX AssetID\n *\n * @param avaxAssetID A cb58 string or Buffer representing the AVAX AssetID\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.setAVAXAssetID = (avaxAssetID) => {\n if (typeof avaxAssetID === \"string\") {\n avaxAssetID = bintools.cb58Decode(avaxAssetID);\n }\n this.AVAXAssetID = avaxAssetID;\n };\n /**\n * Gets the default tx fee for this chain.\n *\n * @returns The default tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getDefaultTxFee = () => {\n return this.core.getNetworkID() in constants_1.Defaults.network ? new bn_js_1.default(constants_1.Defaults.network[this.core.getNetworkID()][\"P\"][\"txFee\"]) : new bn_js_1.default(0);\n };\n /**\n * Gets the tx fee for this chain.\n *\n * @returns The tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getTxFee = () => {\n if (typeof this.txFee === \"undefined\") {\n this.txFee = this.getDefaultTxFee();\n }\n return this.txFee;\n };\n /**\n * Sets the tx fee for this chain.\n *\n * @param fee The tx fee amount to set as {@link https://github.com/indutny/bn.js/|BN}\n */\n this.setTxFee = (fee) => {\n this.txFee = fee;\n };\n /**\n * Gets the default creation fee for this chain.\n *\n * @returns The default creation fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getDefaultCreationTxFee = () => {\n return this.core.getNetworkID() in constants_1.Defaults.network ? new bn_js_1.default(constants_1.Defaults.network[this.core.getNetworkID()][\"P\"][\"creationTxFee\"]) : new bn_js_1.default(0);\n };\n /**\n * Gets the creation fee for this chain.\n *\n * @returns The creation fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getCreationTxFee = () => {\n if (typeof this.creationTxFee === \"undefined\") {\n this.creationTxFee = this.getDefaultCreationTxFee();\n }\n return this.creationTxFee;\n };\n /**\n * Sets the creation fee for this chain.\n *\n * @param fee The creation fee amount to set as {@link https://github.com/indutny/bn.js/|BN}\n */\n this.setCreationTxFee = (fee) => {\n this.creationTxFee = fee;\n };\n /**\n * Gets a reference to the keychain for this class.\n *\n * @returns The instance of [[]] for this class\n */\n this.keyChain = () => this.keychain;\n /**\n * @ignore\n */\n this.newKeyChain = () => {\n // warning, overwrites the old keychain\n const alias = this.getBlockchainAlias();\n if (alias) {\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), alias);\n }\n else {\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), this.blockchainID);\n }\n return this.keychain;\n };\n /**\n * Helper function which determines if a tx is a goose egg transaction.\n *\n * @param utx An UnsignedTx\n *\n * @returns boolean true if passes goose egg test and false if fails.\n *\n * @remarks\n * A \"Goose Egg Transaction\" is when the fee far exceeds a reasonable amount\n */\n this.checkGooseEgg = (utx, outTotal = new bn_js_1.default(0)) => __awaiter(this, void 0, void 0, function* () {\n const avaxAssetID = yield this.getAVAXAssetID();\n let outputTotal = outTotal.gt(new bn_js_1.default(0)) ? outTotal : utx.getOutputTotal(avaxAssetID);\n const fee = utx.getBurn(avaxAssetID);\n if (fee.lte(constants_1.ONEAVAX.mul(new bn_js_1.default(10))) || fee.lte(outputTotal)) {\n return true;\n }\n else {\n return false;\n }\n });\n /**\n * Retrieves an assetID for a subnet's staking assset.\n *\n * @returns Returns a Promise<string> with cb58 encoded value of the assetID.\n */\n this.getStakingAssetID = () => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n return this.callMethod('platform.getStakingAssetID', params).then((response) => (response.data.result.assetID));\n });\n /**\n * Creates a new blockchain.\n *\n * @param username The username of the Keystore user that controls the new account\n * @param password The password of the Keystore user that controls the new account\n * @param subnetID Optional. Either a {@link https://github.com/feross/buffer|Buffer} or an cb58 serialized string for the SubnetID or its alias.\n * @param vmID The ID of the Virtual Machine the blockchain runs. Can also be an alias of the Virtual Machine.\n * @param FXIDs The ids of the FXs the VM is running.\n * @param name A human-readable name for the new blockchain\n * @param genesis The base 58 (with checksum) representation of the genesis state of the new blockchain. Virtual Machines should have a static API method named buildGenesis that can be used to generate genesisData.\n *\n * @returns Promise for the unsigned transaction to create this blockchain. Must be signed by a sufficient number of the Subnet’s control keys and by the account paying the transaction fee.\n */\n this.createBlockchain = (username, password, subnetID = undefined, vmID, fxIDs, name, genesis) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n fxIDs,\n vmID,\n name,\n genesisData: genesis,\n };\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.createBlockchain', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Gets the status of a blockchain.\n *\n * @param blockchainID The blockchainID requesting a status update\n *\n * @returns Promise for a string of one of: \"Validating\", \"Created\", \"Preferred\", \"Unknown\".\n */\n this.getBlockchainStatus = (blockchainID) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n blockchainID,\n };\n return this.callMethod('platform.getBlockchainStatus', params)\n .then((response) => response.data.result.status);\n });\n /**\n * Create an address in the node's keystore.\n *\n * @param username The username of the Keystore user that controls the new account\n * @param password The password of the Keystore user that controls the new account\n *\n * @returns Promise for a string of the newly created account address.\n */\n this.createAddress = (username, password) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n };\n return this.callMethod('platform.createAddress', params)\n .then((response) => response.data.result.address);\n });\n /**\n * Gets the balance of a particular asset.\n *\n * @param address The address to pull the asset balance from\n *\n * @returns Promise with the balance as a {@link https://github.com/indutny/bn.js/|BN} on the provided address.\n */\n this.getBalance = (address) => __awaiter(this, void 0, void 0, function* () {\n if (typeof this.parseAddress(address) === 'undefined') {\n /* istanbul ignore next */\n throw new Error(\"Error - PlatformVMAPI.getBalance: Invalid address format\");\n }\n const params = {\n address\n };\n return this.callMethod('platform.getBalance', params).then((response) => response.data.result);\n });\n /**\n * List the addresses controlled by the user.\n *\n * @param username The username of the Keystore user\n * @param password The password of the Keystore user\n *\n * @returns Promise for an array of addresses.\n */\n this.listAddresses = (username, password) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n };\n return this.callMethod('platform.listAddresses', params)\n .then((response) => response.data.result.addresses);\n });\n /**\n * Lists the set of current validators.\n *\n * @param subnetID Optional. Either a {@link https://github.com/feross/buffer|Buffer} or an\n * cb58 serialized string for the SubnetID or its alias.\n *\n * @returns Promise for an array of validators that are currently staking, see: {@link https://docs.avax.network/v1.0/en/api/platform/#platformgetcurrentvalidators|platform.getCurrentValidators documentation}.\n *\n */\n this.getCurrentValidators = (subnetID = undefined) => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.getCurrentValidators', params)\n .then((response) => response.data.result);\n });\n /**\n * Lists the set of pending validators.\n *\n * @param subnetID Optional. Either a {@link https://github.com/feross/buffer|Buffer}\n * or a cb58 serialized string for the SubnetID or its alias.\n *\n * @returns Promise for an array of validators that are pending staking, see: {@link https://docs.avax.network/v1.0/en/api/platform/#platformgetpendingvalidators|platform.getPendingValidators documentation}.\n *\n */\n this.getPendingValidators = (subnetID = undefined) => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.getPendingValidators', params)\n .then((response) => response.data.result);\n });\n /**\n * Samples `Size` validators from the current validator set.\n *\n * @param sampleSize Of the total universe of validators, select this many at random\n * @param subnetID Optional. Either a {@link https://github.com/feross/buffer|Buffer} or an\n * cb58 serialized string for the SubnetID or its alias.\n *\n * @returns Promise for an array of validator's stakingIDs.\n */\n this.sampleValidators = (sampleSize, subnetID = undefined) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n size: sampleSize.toString(),\n };\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.sampleValidators', params)\n .then((response) => response.data.result.validators);\n });\n /**\n * Add a validator to the Primary Network.\n *\n * @param username The username of the Keystore user\n * @param password The password of the Keystore user\n * @param nodeID The node ID of the validator\n * @param startTime Javascript Date object for the start time to validate\n * @param endTime Javascript Date object for the end time to validate\n * @param stakeAmount The amount of nAVAX the validator is staking as\n * a {@link https://github.com/indutny/bn.js/|BN}\n * @param rewardAddress The address the validator reward will go to, if there is one.\n * @param delegationFeeRate Optional. A {@link https://github.com/indutny/bn.js/|BN} for the percent fee this validator\n * charges when others delegate stake to them. Up to 4 decimal places allowed; additional decimal places are ignored.\n * Must be between 0 and 100, inclusive. For example, if delegationFeeRate is 1.2345 and someone delegates to this\n * validator, then when the delegation period is over, 1.2345% of the reward goes to the validator and the rest goes\n * to the delegator.\n *\n * @returns Promise for a base58 string of the unsigned transaction.\n */\n this.addValidator = (username, password, nodeID, startTime, endTime, stakeAmount, rewardAddress, delegationFeeRate = undefined) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n nodeID,\n startTime: startTime.getTime() / 1000,\n endTime: endTime.getTime() / 1000,\n stakeAmount: stakeAmount.toString(10),\n rewardAddress,\n };\n if (typeof delegationFeeRate !== 'undefined') {\n params.delegationFeeRate = delegationFeeRate.toString(10);\n }\n return this.callMethod('platform.addValidator', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Add a validator to a Subnet other than the Primary Network. The validator must validate the Primary Network for the entire duration they validate this Subnet.\n *\n * @param username The username of the Keystore user\n * @param password The password of the Keystore user\n * @param nodeID The node ID of the validator\n * @param subnetID Either a {@link https://github.com/feross/buffer|Buffer} or a cb58 serialized string for the SubnetID or its alias.\n * @param startTime Javascript Date object for the start time to validate\n * @param endTime Javascript Date object for the end time to validate\n * @param weight The validator’s weight used for sampling\n *\n * @returns Promise for the unsigned transaction. It must be signed (using sign) by the proper number of the Subnet’s control keys and by the key of the account paying the transaction fee before it can be issued.\n */\n this.addSubnetValidator = (username, password, nodeID, subnetID, startTime, endTime, weight) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n nodeID,\n startTime: startTime.getTime() / 1000,\n endTime: endTime.getTime() / 1000,\n weight\n };\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.addSubnetValidator', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Add a delegator to the Primary Network.\n *\n * @param username The username of the Keystore user\n * @param password The password of the Keystore user\n * @param nodeID The node ID of the delegatee\n * @param startTime Javascript Date object for when the delegator starts delegating\n * @param endTime Javascript Date object for when the delegator starts delegating\n * @param stakeAmount The amount of nAVAX the delegator is staking as\n * a {@link https://github.com/indutny/bn.js/|BN}\n * @param rewardAddress The address of the account the staked AVAX and validation reward\n * (if applicable) are sent to at endTime\n *\n * @returns Promise for an array of validator's stakingIDs.\n */\n this.addDelegator = (username, password, nodeID, startTime, endTime, stakeAmount, rewardAddress) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n nodeID,\n startTime: startTime.getTime() / 1000,\n endTime: endTime.getTime() / 1000,\n stakeAmount: stakeAmount.toString(10),\n rewardAddress,\n };\n return this.callMethod('platform.addDelegator', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Create an unsigned transaction to create a new Subnet. The unsigned transaction must be\n * signed with the key of the account paying the transaction fee. The Subnet’s ID is the ID of the transaction that creates it (ie the response from issueTx when issuing the signed transaction).\n *\n * @param username The username of the Keystore user\n * @param password The password of the Keystore user\n * @param controlKeys Array of platform addresses as strings\n * @param threshold To add a validator to this Subnet, a transaction must have threshold\n * signatures, where each signature is from a key whose address is an element of `controlKeys`\n *\n * @returns Promise for a string with the unsigned transaction encoded as base58.\n */\n this.createSubnet = (username, password, controlKeys, threshold) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n controlKeys,\n threshold\n };\n return this.callMethod('platform.createSubnet', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Get the Subnet that validates a given blockchain.\n *\n * @param blockchainID Either a {@link https://github.com/feross/buffer|Buffer} or a cb58\n * encoded string for the blockchainID or its alias.\n *\n * @returns Promise for a string of the subnetID that validates the blockchain.\n */\n this.validatedBy = (blockchainID) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n blockchainID,\n };\n return this.callMethod('platform.validatedBy', params)\n .then((response) => response.data.result.subnetID);\n });\n /**\n * Get the IDs of the blockchains a Subnet validates.\n *\n * @param subnetID Either a {@link https://github.com/feross/buffer|Buffer} or an AVAX\n * serialized string for the SubnetID or its alias.\n *\n * @returns Promise for an array of blockchainIDs the subnet validates.\n */\n this.validates = (subnetID) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n subnetID,\n };\n if (typeof subnetID === 'string') {\n params.subnetID = subnetID;\n }\n else if (typeof subnetID !== 'undefined') {\n params.subnetID = bintools.cb58Encode(subnetID);\n }\n return this.callMethod('platform.validates', params)\n .then((response) => response.data.result.blockchainIDs);\n });\n /**\n * Get all the blockchains that exist (excluding the P-Chain).\n *\n * @returns Promise for an array of objects containing fields \"id\", \"subnetID\", and \"vmID\".\n */\n this.getBlockchains = () => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n return this.callMethod('platform.getBlockchains', params)\n .then((response) => response.data.result.blockchains);\n });\n /**\n * Send AVAX from an account on the P-Chain to an address on the X-Chain. This transaction\n * must be signed with the key of the account that the AVAX is sent from and which pays the\n * transaction fee. After issuing this transaction, you must call the X-Chain’s importAVAX\n * method to complete the transfer.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The address on the X-Chain to send the AVAX to. Do not include X- in the address\n * @param amount Amount of AVAX to export as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns Promise for an unsigned transaction to be signed by the account the the AVAX is\n * sent from and pays the transaction fee.\n */\n this.exportAVAX = (username, password, amount, to) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n to,\n amount: amount.toString(10)\n };\n return this.callMethod('platform.exportAVAX', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Send AVAX from an account on the P-Chain to an address on the X-Chain. This transaction\n * must be signed with the key of the account that the AVAX is sent from and which pays\n * the transaction fee. After issuing this transaction, you must call the X-Chain’s\n * importAVAX method to complete the transfer.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The ID of the account the AVAX is sent to. This must be the same as the to\n * argument in the corresponding call to the X-Chain’s exportAVAX\n * @param sourceChain The chainID where the funds are coming from.\n *\n * @returns Promise for a string for the transaction, which should be sent to the network\n * by calling issueTx.\n */\n this.importAVAX = (username, password, to, sourceChain) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n sourceChain,\n username,\n password,\n };\n return this.callMethod('platform.importAVAX', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Calls the node's issueTx method from the API and returns the resulting transaction ID as a string.\n *\n * @param tx A string, {@link https://github.com/feross/buffer|Buffer}, or [[Tx]] representing a transaction\n *\n * @returns A Promise<string> representing the transaction ID of the posted transaction.\n */\n this.issueTx = (tx) => __awaiter(this, void 0, void 0, function* () {\n let Transaction = '';\n if (typeof tx === 'string') {\n Transaction = tx;\n }\n else if (tx instanceof buffer_1.Buffer) {\n const txobj = new tx_1.Tx();\n txobj.fromBuffer(tx);\n Transaction = txobj.toString();\n }\n else if (tx instanceof tx_1.Tx) {\n Transaction = tx.toString();\n }\n else {\n /* istanbul ignore next */\n throw new Error('Error - platform.issueTx: provided tx is not expected type of string, Buffer, or Tx');\n }\n const params = {\n tx: Transaction.toString(),\n };\n return this.callMethod('platform.issueTx', params).then((response) => response.data.result.txID);\n });\n /**\n * Returns an upper bound on the amount of tokens that exist. Not monotonically increasing because this number can go down if a staker's reward is denied.\n */\n this.getCurrentSupply = () => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n return this.callMethod('platform.getCurrentSupply', params)\n .then((response) => new bn_js_1.default(response.data.result.supply, 10));\n });\n /**\n * Returns the height of the platform chain.\n */\n this.getHeight = () => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n return this.callMethod('platform.getHeight', params)\n .then((response) => new bn_js_1.default(response.data.result.height, 10));\n });\n /**\n * Gets the minimum staking amount.\n *\n * @param refresh A boolean to bypass the local cached value of Minimum Stake Amount, polling the node instead.\n */\n this.getMinStake = (refresh = false) => __awaiter(this, void 0, void 0, function* () {\n if (refresh !== true && typeof this.minValidatorStake !== \"undefined\" && typeof this.minDelegatorStake !== \"undefined\") {\n return {\n minValidatorStake: this.minValidatorStake,\n minDelegatorStake: this.minDelegatorStake\n };\n }\n const params = {};\n return this.callMethod('platform.getMinStake', params)\n .then((response) => {\n this.minValidatorStake = new bn_js_1.default(response.data.result.minValidatorStake, 10);\n this.minDelegatorStake = new bn_js_1.default(response.data.result.minDelegatorStake, 10);\n return {\n minValidatorStake: this.minValidatorStake,\n minDelegatorStake: this.minDelegatorStake\n };\n });\n });\n /**\n * Sets the minimum stake cached in this class.\n * @param minValidatorStake A {@link https://github.com/indutny/bn.js/|BN} to set the minimum stake amount cached in this class.\n * @param minDelegatorStake A {@link https://github.com/indutny/bn.js/|BN} to set the minimum delegation amount cached in this class.\n */\n this.setMinStake = (minValidatorStake = undefined, minDelegatorStake = undefined) => {\n if (typeof minValidatorStake !== \"undefined\") {\n this.minValidatorStake = minValidatorStake;\n }\n if (typeof minDelegatorStake !== \"undefined\") {\n this.minDelegatorStake = minDelegatorStake;\n }\n };\n /**\n * Gets the total amount staked for an array of addresses.\n */\n this.getStake = (addresses) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n addresses\n };\n return this.callMethod('platform.getStake', params)\n .then((response) => new bn_js_1.default(response.data.result.staked, 10));\n });\n /**\n * Get all the subnets that exist.\n *\n * @param ids IDs of the subnets to retrieve information about. If omitted, gets all subnets\n *\n * @returns Promise for an array of objects containing fields \"id\",\n * \"controlKeys\", and \"threshold\".\n */\n this.getSubnets = (ids = undefined) => __awaiter(this, void 0, void 0, function* () {\n const params = {};\n if (typeof ids !== undefined) {\n params.ids = ids;\n }\n return this.callMethod('platform.getSubnets', params)\n .then((response) => response.data.result.subnets);\n });\n /**\n * Exports the private key for an address.\n *\n * @param username The name of the user with the private key\n * @param password The password used to decrypt the private key\n * @param address The address whose private key should be exported\n *\n * @returns Promise with the decrypted private key as store in the database\n */\n this.exportKey = (username, password, address) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n address,\n };\n return this.callMethod('platform.exportKey', params)\n .then((response) => response.data.result.privateKey);\n });\n /**\n * Give a user control over an address by providing the private key that controls the address.\n *\n * @param username The name of the user to store the private key\n * @param password The password that unlocks the user\n * @param privateKey A string representing the private key in the vm's format\n *\n * @returns The address for the imported private key.\n */\n this.importKey = (username, password, privateKey) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n privateKey,\n };\n return this.callMethod('platform.importKey', params)\n .then((response) => response.data.result.address);\n });\n /**\n * Returns the treansaction data of a provided transaction ID by calling the node's `getTx` method.\n *\n * @param txid The string representation of the transaction ID\n *\n * @returns Returns a Promise<string> containing the bytes retrieved from the node\n */\n this.getTx = (txid) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n txID: txid,\n };\n return this.callMethod('platform.getTx', params).then((response) => response.data.result.tx);\n });\n /**\n * Returns the status of a provided transaction ID by calling the node's `getTxStatus` method.\n *\n * @param txid The string representation of the transaction ID\n * @param includeReason Return the reason tx was dropped, if applicable. Defaults to true\n *\n * @returns Returns a Promise<string> containing the status retrieved from the node and the reason a tx was dropped, if applicable.\n */\n this.getTxStatus = (txid, includeReason = true) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n txID: txid,\n includeReason: includeReason\n };\n return this.callMethod('platform.getTxStatus', params).then((response) => response.data.result);\n });\n /**\n * Retrieves the UTXOs related to the addresses provided from the node's `getUTXOs` method.\n *\n * @param addresses An array of addresses as cb58 strings or addresses as {@link https://github.com/feross/buffer|Buffer}s\n * @param sourceChain A string for the chain to look for the UTXO's. Default is to use this chain, but if exported UTXOs exist from other chains, this can used to pull them instead.\n * @param limit Optional. Returns at most [limit] addresses. If [limit] == 0 or > [maxUTXOsToFetch], fetches up to [maxUTXOsToFetch].\n * @param startIndex Optional. [StartIndex] defines where to start fetching UTXOs (for pagination.)\n * UTXOs fetched are from addresses equal to or greater than [StartIndex.Address]\n * For address [StartIndex.Address], only UTXOs with IDs greater than [StartIndex.Utxo] will be returned.\n * @param persistOpts Options available to persist these UTXOs in local storage\n *\n * @remarks\n * persistOpts is optional and must be of type [[PersistanceOptions]]\n *\n */\n this.getUTXOs = (addresses, sourceChain = undefined, limit = 0, startIndex = undefined, persistOpts = undefined) => __awaiter(this, void 0, void 0, function* () {\n if (typeof addresses === \"string\") {\n addresses = [addresses];\n }\n const params = {\n addresses: addresses,\n limit\n };\n if (typeof startIndex !== \"undefined\" && startIndex) {\n params.startIndex = startIndex;\n }\n if (typeof sourceChain !== \"undefined\") {\n params.sourceChain = sourceChain;\n }\n return this.callMethod('platform.getUTXOs', params).then((response) => {\n const utxos = new utxos_1.UTXOSet();\n let data = response.data.result.utxos;\n if (persistOpts && typeof persistOpts === 'object') {\n if (this.db.has(persistOpts.getName())) {\n const selfArray = this.db.get(persistOpts.getName());\n if (Array.isArray(selfArray)) {\n utxos.addArray(data);\n const self = new utxos_1.UTXOSet();\n self.addArray(selfArray);\n self.mergeByRule(utxos, persistOpts.getMergeRule());\n data = self.getAllUTXOStrings();\n }\n }\n this.db.set(persistOpts.getName(), data, persistOpts.getOverwrite());\n }\n utxos.addArray(data, false);\n response.data.result.utxos = utxos;\n response.data.result.numFetched = parseInt(response.data.result.numFetched);\n return response.data.result;\n });\n });\n /**\n * Helper function which creates an unsigned Import Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s, and [[TransferOperation]]s).\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param ownerAddresses The addresses being used to import\n * @param sourceChain The chainid for where the import is coming from.\n * @param toAddresses The addresses to send the funds\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n * @param changeAddresses The addresses that can spend the change remaining from the spent UTXOs\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n * @param locktime Optional. The locktime field created in the resulting outputs\n * @param threshold Optional. The number of signatures required to spend the funds in the resultant UTXO\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains a [[ImportTx]].\n *\n * @remarks\n * This helper exists because the endpoint API should be the primary point of entry for most functionality.\n */\n this.buildImportTx = (utxoset, ownerAddresses, sourceChain, toAddresses, fromAddresses, changeAddresses = undefined, memo = undefined, asOf = helperfunctions_1.UnixNow(), locktime = new bn_js_1.default(0), threshold = 1) => __awaiter(this, void 0, void 0, function* () {\n const to = this._cleanAddressArray(toAddresses, 'buildBaseTx').map((a) => bintools.stringToAddress(a));\n const from = this._cleanAddressArray(fromAddresses, 'buildBaseTx').map((a) => bintools.stringToAddress(a));\n const change = this._cleanAddressArray(changeAddresses, 'buildBaseTx').map((a) => bintools.stringToAddress(a));\n let srcChain = undefined;\n if (typeof sourceChain === \"undefined\") {\n throw new Error(\"Error - PlatformVMAPI.buildImportTx: Source ChainID is undefined.\");\n }\n else if (typeof sourceChain === \"string\") {\n srcChain = sourceChain;\n sourceChain = bintools.cb58Decode(sourceChain);\n }\n else if (!(sourceChain instanceof buffer_1.Buffer)) {\n srcChain = bintools.cb58Encode(sourceChain);\n throw new Error(\"Error - PlatformVMAPI.buildImportTx: Invalid destinationChain type: \" + (typeof sourceChain));\n }\n const atomicUTXOs = yield (yield this.getUTXOs(ownerAddresses, srcChain, 0, undefined)).utxos;\n const avaxAssetID = yield this.getAVAXAssetID();\n if (memo instanceof payload_1.PayloadBase) {\n memo = memo.getPayload();\n }\n const atomics = atomicUTXOs.getAllUTXOs();\n const builtUnsignedTx = utxoset.buildImportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), to, from, change, atomics, sourceChain, this.getTxFee(), avaxAssetID, memo, asOf, locktime, threshold);\n if (!(yield this.checkGooseEgg(builtUnsignedTx))) {\n /* istanbul ignore next */\n throw new Error(\"Failed Goose Egg Check\");\n }\n return builtUnsignedTx;\n });\n /**\n * Helper function which creates an unsigned Export Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s, and [[TransferOperation]]s).\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param amount The amount being exported as a {@link https://github.com/indutny/bn.js/|BN}\n * @param destinationChain The chainid for where the assets will be sent.\n * @param toAddresses The addresses to send the funds\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n * @param changeAddresses The addresses that can spend the change remaining from the spent UTXOs\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n * @param locktime Optional. The locktime field created in the resulting outputs\n * @param threshold Optional. The number of signatures required to spend the funds in the resultant UTXO\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains an [[ExportTx]].\n */\n this.buildExportTx = (utxoset, amount, destinationChain, toAddresses, fromAddresses, changeAddresses = undefined, memo = undefined, asOf = helperfunctions_1.UnixNow(), locktime = new bn_js_1.default(0), threshold = 1) => __awaiter(this, void 0, void 0, function* () {\n let prefixes = {};\n toAddresses.map((a) => {\n prefixes[a.split(\"-\")[0]] = true;\n });\n if (Object.keys(prefixes).length !== 1) {\n throw new Error(\"Error - PlatformVMAPI.buildExportTx: To addresses must have the same chainID prefix.\");\n }\n if (typeof destinationChain === \"undefined\") {\n throw new Error(\"Error - PlatformVMAPI.buildExportTx: Destination ChainID is undefined.\");\n }\n else if (typeof destinationChain === \"string\") {\n destinationChain = bintools.cb58Decode(destinationChain); //\n }\n else if (!(destinationChain instanceof buffer_1.Buffer)) {\n throw new Error(\"Error - PlatformVMAPI.buildExportTx: Invalid destinationChain type: \" + (typeof destinationChain));\n }\n if (destinationChain.length !== 32) {\n throw new Error(\"Error - PlatformVMAPI.buildExportTx: Destination ChainID must be 32 bytes in length.\");\n }\n /*\n if(bintools.cb58Encode(destinationChain) !== Defaults.network[this.core.getNetworkID()].X[\"blockchainID\"]) {\n throw new Error(\"Error - PlatformVMAPI.buildExportTx: Destination ChainID must The X-Chain ID in the current version of AvalancheJS.\");\n }*/\n let to = [];\n toAddresses.map((a) => {\n to.push(bintools.stringToAddress(a));\n });\n const from = this._cleanAddressArray(fromAddresses, 'buildExportTx').map((a) => bintools.stringToAddress(a));\n const change = this._cleanAddressArray(changeAddresses, 'buildExportTx').map((a) => bintools.stringToAddress(a));\n if (memo instanceof payload_1.PayloadBase) {\n memo = memo.getPayload();\n }\n const avaxAssetID = yield this.getAVAXAssetID();\n const builtUnsignedTx = utxoset.buildExportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), amount, avaxAssetID, to, from, change, destinationChain, this.getTxFee(), avaxAssetID, memo, asOf, locktime, threshold);\n if (!(yield this.checkGooseEgg(builtUnsignedTx))) {\n /* istanbul ignore next */\n throw new Error(\"Failed Goose Egg Check\");\n }\n return builtUnsignedTx;\n });\n /**\n * Helper function which creates an unsigned [[AddSubnetValidatorTx]]. For more granular control, you may create your own\n * [[UnsignedTx]] manually and import the [[AddSubnetValidatorTx]] class directly.\n *\n * @param utxoset A set of UTXOs that the transaction is built on.\n * @param fromAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who pays the fees in AVAX\n * @param changeAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who gets the change leftover from the fee payment\n * @param nodeID The node ID of the validator being added.\n * @param startTime The Unix time when the validator starts validating the Primary Network.\n * @param endTime The Unix time when the validator stops validating the Primary Network (and staked AVAX is returned).\n * @param weight The amount of weight for this subnet validator.\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns An unsigned transaction created from the passed in parameters.\n */\n /* Re-implement when subnetValidator signing process is clearer\n buildAddSubnetValidatorTx = async (\n utxoset:UTXOSet,\n fromAddresses:Array<string>,\n changeAddresses:Array<string>,\n nodeID:string,\n startTime:BN,\n endTime:BN,\n weight:BN,\n memo:PayloadBase|Buffer = undefined,\n asOf:BN = UnixNow()\n ):Promise<UnsignedTx> => {\n const from:Array<Buffer> = this._cleanAddressArray(fromAddresses, 'buildAddSubnetValidatorTx').map((a) => bintools.stringToAddress(a));\n const change:Array<Buffer> = this._cleanAddressArray(changeAddresses, 'buildAddSubnetValidatorTx').map((a) => bintools.stringToAddress(a));\n \n if( memo instanceof PayloadBase) {\n memo = memo.getPayload();\n }\n \n const avaxAssetID:Buffer = await this.getAVAXAssetID();\n \n const now:BN = UnixNow();\n if (startTime.lt(now) || endTime.lte(startTime)) {\n throw new Error(\"PlatformVMAPI.buildAddSubnetValidatorTx -- startTime must be in the future and endTime must come after startTime\");\n }\n \n const builtUnsignedTx:UnsignedTx = utxoset.buildAddSubnetValidatorTx(\n this.core.getNetworkID(),\n bintools.cb58Decode(this.blockchainID),\n from,\n change,\n NodeIDStringToBuffer(nodeID),\n startTime, endTime,\n weight,\n this.getFee(),\n avaxAssetID,\n memo, asOf\n );\n \n if(! await this.checkGooseEgg(builtUnsignedTx)) {\n /* istanbul ignore next */ /*\n throw new Error(\"Failed Goose Egg Check\");\n }\n \n return builtUnsignedTx;\n }\n \n */\n /**\n * Helper function which creates an unsigned [[AddDelegatorTx]]. For more granular control, you may create your own\n * [[UnsignedTx]] manually and import the [[AddDelegatorTx]] class directly.\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param toAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who recieved the staked tokens at the end of the staking period\n * @param fromAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who own the staking UTXOs the fees in AVAX\n * @param changeAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who gets the change leftover from the fee payment\n * @param nodeID The node ID of the validator being added.\n * @param startTime The Unix time when the validator starts validating the Primary Network.\n * @param endTime The Unix time when the validator stops validating the Primary Network (and staked AVAX is returned).\n * @param stakeAmount The amount being delegated as a {@link https://github.com/indutny/bn.js/|BN}\n * @param rewardAddresses The addresses which will recieve the rewards from the delegated stake.\n * @param rewardLocktime Optional. The locktime field created in the resulting reward outputs\n * @param rewardThreshold Opional. The number of signatures required to spend the funds in the resultant reward UTXO. Default 1.\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns An unsigned transaction created from the passed in parameters.\n */\n this.buildAddDelegatorTx = (utxoset, toAddresses, fromAddresses, changeAddresses, nodeID, startTime, endTime, stakeAmount, rewardAddresses, rewardLocktime = new bn_js_1.default(0), rewardThreshold = 1, memo = undefined, asOf = helperfunctions_1.UnixNow()) => __awaiter(this, void 0, void 0, function* () {\n const to = this._cleanAddressArray(toAddresses, 'buildAddDelegatorTx').map((a) => bintools.stringToAddress(a));\n const from = this._cleanAddressArray(fromAddresses, 'buildAddDelegatorTx').map((a) => bintools.stringToAddress(a));\n const change = this._cleanAddressArray(changeAddresses, 'buildAddDelegatorTx').map((a) => bintools.stringToAddress(a));\n const rewards = this._cleanAddressArray(rewardAddresses, 'buildAddValidatorTx').map((a) => bintools.stringToAddress(a));\n if (memo instanceof payload_1.PayloadBase) {\n memo = memo.getPayload();\n }\n const minStake = (yield this.getMinStake())[\"minDelegatorStake\"];\n if (stakeAmount.lt(minStake)) {\n throw new Error(\"PlatformVMAPI.buildAddDelegatorTx -- stake amount must be at least \" + minStake.toString(10));\n }\n const avaxAssetID = yield this.getAVAXAssetID();\n const now = helperfunctions_1.UnixNow();\n if (startTime.lt(now) || endTime.lte(startTime)) {\n throw new Error(\"PlatformVMAPI.buildAddDelegatorTx -- startTime must be in the future and endTime must come after startTime\");\n }\n const builtUnsignedTx = utxoset.buildAddDelegatorTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), avaxAssetID, to, from, change, helperfunctions_1.NodeIDStringToBuffer(nodeID), startTime, endTime, stakeAmount, rewardLocktime, rewardThreshold, rewards, new bn_js_1.default(0), avaxAssetID, memo, asOf);\n if (!(yield this.checkGooseEgg(builtUnsignedTx))) {\n /* istanbul ignore next */\n throw new Error(\"Failed Goose Egg Check\");\n }\n return builtUnsignedTx;\n });\n /**\n * Helper function which creates an unsigned [[AddValidatorTx]]. For more granular control, you may create your own\n * [[UnsignedTx]] manually and import the [[AddValidatorTx]] class directly.\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param toAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who recieved the staked tokens at the end of the staking period\n * @param fromAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who own the staking UTXOs the fees in AVAX\n * @param changeAddresses An array of addresses as {@link https://github.com/feross/buffer|Buffer} who gets the change leftover from the fee payment\n * @param nodeID The node ID of the validator being added.\n * @param startTime The Unix time when the validator starts validating the Primary Network.\n * @param endTime The Unix time when the validator stops validating the Primary Network (and staked AVAX is returned).\n * @param stakeAmount The amount being delegated as a {@link https://github.com/indutny/bn.js/|BN}\n * @param rewardAddresses The addresses which will recieve the rewards from the delegated stake.\n * @param delegationFee A number for the percentage of reward to be given to the validator when someone delegates to them. Must be between 0 and 100.\n * @param rewardLocktime Optional. The locktime field created in the resulting reward outputs\n * @param rewardThreshold Opional. The number of signatures required to spend the funds in the resultant reward UTXO. Default 1.\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns An unsigned transaction created from the passed in parameters.\n */\n this.buildAddValidatorTx = (utxoset, toAddresses, fromAddresses, changeAddresses, nodeID, startTime, endTime, stakeAmount, rewardAddresses, delegationFee, rewardLocktime = new bn_js_1.default(0), rewardThreshold = 1, memo = undefined, asOf = helperfunctions_1.UnixNow()) => __awaiter(this, void 0, void 0, function* () {\n const to = this._cleanAddressArray(toAddresses, 'buildAddValidatorTx').map((a) => bintools.stringToAddress(a));\n const from = this._cleanAddressArray(fromAddresses, 'buildAddValidatorTx').map((a) => bintools.stringToAddress(a));\n const change = this._cleanAddressArray(changeAddresses, 'buildAddValidatorTx').map((a) => bintools.stringToAddress(a));\n const rewards = this._cleanAddressArray(rewardAddresses, 'buildAddValidatorTx').map((a) => bintools.stringToAddress(a));\n if (memo instanceof payload_1.PayloadBase) {\n memo = memo.getPayload();\n }\n const minStake = (yield this.getMinStake())[\"minValidatorStake\"];\n if (stakeAmount.lt(minStake)) {\n throw new Error(\"PlatformVMAPI.buildAddValidatorTx -- stake amount must be at least \" + minStake.toString(10));\n }\n if (typeof delegationFee !== \"number\" || delegationFee > 100 || delegationFee < 0) {\n throw new Error(\"PlatformVMAPI.buildAddValidatorTx -- delegationFee must be a number between 0 and 100\");\n }\n const avaxAssetID = yield this.getAVAXAssetID();\n const now = helperfunctions_1.UnixNow();\n if (startTime.lt(now) || endTime.lte(startTime)) {\n throw new Error(\"PlatformVMAPI.buildAddValidatorTx -- startTime must be in the future and endTime must come after startTime\");\n }\n const builtUnsignedTx = utxoset.buildAddValidatorTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), avaxAssetID, to, from, change, helperfunctions_1.NodeIDStringToBuffer(nodeID), startTime, endTime, stakeAmount, rewardLocktime, rewardThreshold, rewards, delegationFee, new bn_js_1.default(0), avaxAssetID, memo, asOf);\n if (!(yield this.checkGooseEgg(builtUnsignedTx))) {\n /* istanbul ignore next */\n throw new Error(\"Failed Goose Egg Check\");\n }\n return builtUnsignedTx;\n });\n /**\n * Class representing an unsigned [[CreateSubnetTx]] transaction.\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param fromAddresses The addresses being used to send the funds from the UTXOs {@link https://github.com/feross/buffer|Buffer}\n * @param changeAddresses The addresses that can spend the change remaining from the spent UTXOs\n * @param subnetOwnerAddresses An array of addresses for owners of the new subnet\n * @param subnetOwnerThreshold A number indicating the amount of signatures required to add validators to a subnet\n * @param memo Optional contains arbitrary bytes, up to 256 bytes\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns An unsigned transaction created from the passed in parameters.\n */\n this.buildCreateSubnetTx = (utxoset, fromAddresses, changeAddresses, subnetOwnerAddresses, subnetOwnerThreshold, memo = undefined, asOf = helperfunctions_1.UnixNow()) => __awaiter(this, void 0, void 0, function* () {\n const from = this._cleanAddressArray(fromAddresses, 'buildCreateSubnetTx').map((a) => bintools.stringToAddress(a));\n const change = this._cleanAddressArray(changeAddresses, 'buildCreateSubnetTx').map((a) => bintools.stringToAddress(a));\n const owners = this._cleanAddressArray(subnetOwnerAddresses, 'buildCreateSubnetTx').map((a) => bintools.stringToAddress(a));\n if (memo instanceof payload_1.PayloadBase) {\n memo = memo.getPayload();\n }\n const avaxAssetID = yield this.getAVAXAssetID();\n const builtUnsignedTx = utxoset.buildCreateSubnetTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), from, change, owners, subnetOwnerThreshold, this.getCreationTxFee(), avaxAssetID, memo, asOf);\n if (!(yield this.checkGooseEgg(builtUnsignedTx, this.getCreationTxFee()))) {\n /* istanbul ignore next */\n throw new Error(\"Failed Goose Egg Check\");\n }\n return builtUnsignedTx;\n });\n this.blockchainID = constants_1.PlatformChainID;\n const netid = core.getNetworkID();\n if (netid in constants_1.Defaults.network && this.blockchainID in constants_1.Defaults.network[netid]) {\n const { alias } = constants_1.Defaults.network[netid][this.blockchainID];\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), alias);\n }\n else {\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), this.blockchainID);\n }\n }", "title": "" }, { "docid": "51fc5d361abec11c8863c89f15ce0128", "score": "0.5217551", "text": "currentWalletDisplay(addr){\n return Wallets.find({public:addr});\n //return \"BTC: 0.01\";\n }", "title": "" }, { "docid": "dc086535ded55f42b411e1623336817f", "score": "0.52160054", "text": "function getCurrentAdressSPA() {\n kony.application.showLoadingScreen(\"loadingscreen\", \"Loading...\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, false, null);\n var url = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\" + latitude + \",\" + longitude + \"&sensor=false\"\n var inputParam = {};\n inputParam[\"serviceID\"] = \"GeoAddressJSON\";\n inputParam[\"httpheaders\"] = {};\n inputParam[\"httpconfigs\"] = {};\n inputParam.appID = \"ksa\";\n inputParam.appver = \"1.0.0\";\n inputParam[\"channel\"] = \"rc\";\n inputParam[\"platform\"] = kony.os.deviceInfo().name;\n var connHandle = kony.net.invokeServiceAsync(url, inputParam, callBckFunGeoAddLoc)\n}", "title": "" }, { "docid": "8aebedc700758121893ee1d9d1e57d51", "score": "0.5213979", "text": "static async getRpcByType(type)\n\t{\n\t\ttry {\n\t\t\tassert(typeof type === 'string');\n\n\t\t\t// TODO: Cache this.\n\t\t\tconst rpcs = await InternalAPI.get('ffrpc/list', {\n\t\t\t\tqueryString: { type }\n\t\t\t});\n\n\t\t\t// Random RPCs index\n\t\t\tconst rpcIndex = getRandomInteger(0, rpcs.length - 1);\n\n\t\t\t// Creating FFRPCClient object and returning it.\n\t\t\treturn new FFRPCClient(rpcs[rpcIndex]);\n\t\t}\n\t\tcatch(err) {\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "d19edcbd10c462c27bd99ac9306fbb1c", "score": "0.5209877", "text": "getNpcData() {\n console.log('[c2s Button] getNpcData');\n let arg = {'npc': 'Amy'}; //for test\n\n this.helper.callC2sAPI(null, 'getSpecificNpcData', 5000, arg);\n }", "title": "" }, { "docid": "f3f7745ffb290427061df04e444dd6cb", "score": "0.52094865", "text": "function fetcher(key, reference, address, chain, decimals) {\n return Promise.all([\n jsonrpc('getPendingOperationInfo', {\n url: 'node',\n params: [reference],\n }),\n getCustodianContract().token_cooldown(reference).call(),\n getCustodianContract().minimal_sponsor_amount().call(),\n getCustodianContract().default_cooldown().call(),\n getSponsorContract().sponsorOf(reference).call(),\n getBalanceContract()\n .tokenBalance(address, CHAIN_CONFIG[chain].cAddress)\n .call()\n .then((x) => {\n return x + ''\n }),\n\n getSponsorContract().sponsorValueOf(reference).call(),\n getCustodianContract().safe_sponsor_amount().call(),\n\n getCustodianContract().burn_fee(reference).call(),\n getCustodianContract().mint_fee(reference).call(),\n getCustodianContract().wallet_fee(reference).call(),\n getCustodianContract().minimal_mint_value(reference).call(),\n getCustodianContract().minimal_burn_value(reference).call(),\n ]).then(\n ([\n { cnt = 0 } = {},\n cooldown,\n minMortgage,\n defaultCooldown,\n sponsor,\n cethBalance,\n currentMortgage,\n safeSponsorAmount,\n burn_fee,\n mint_fee,\n wallet_fee,\n minimal_mint_value,\n minimal_burn_value,\n ]) => {\n console.log('currentMortgage', currentMortgage + '')\n console.log('safeSponsorAmount', safeSponsorAmount + '')\n\n const cooldownMinutes = parseInt(defaultCooldown) / 60\n const diff = parseInt(Date.now() / 1000 - parseInt(cooldown))\n return {\n cooldownMinutes,\n pendingCount: cnt,\n minMortgage: minMortgage + '',\n countdown: Math.max(0, parseInt(defaultCooldown + '') - diff),\n cethBalance,\n sponsor,\n currentMortgage: Big(currentMortgage + '').div('1e18'),\n safeSponsorAmount: Big(safeSponsorAmount + '').div('1e18'),\n out_fee: Big(burn_fee + '').div(`1e${decimals}`),\n in_fee: Big(mint_fee + '').div(`1e${decimals}`),\n wallet_fee: Big(wallet_fee + '').div(`1e${decimals}`),\n minimal_in_value: Big(minimal_mint_value + '').div(`1e${decimals}`),\n minimal_out_value: Big(minimal_burn_value + '').div(`1e${decimals}`),\n }\n }\n )\n}", "title": "" } ]
12074b3d3d27a54baae4838d29759990
Load the icon by URL using HTTP.
[ { "docid": "1fa65a0599e131d1b1aed24616ec977d", "score": "0.6618617", "text": "function loadByHttpUrl(url) {\n return $q(function(resolve, reject) {\n // Catch HTTP or generic errors not related to incorrect icon IDs.\n var announceAndReject = function(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n reject(err);\n },\n extractSvg = function(response) {\n if (!svgCache[url]) {\n svgCache[url] = angular.element('<div>').append(response)[0].querySelector('svg');\n }\n resolve(svgCache[url]);\n };\n\n $templateRequest(url, true).then(extractSvg, announceAndReject);\n });\n }", "title": "" } ]
[ { "docid": "1030e0da003f533009dd36b6f9f0899c", "score": "0.7592534", "text": "function loadByURL(url){/* Load the icon from embedded data URL. */function loadByDataUrl(url){var results=dataUrlRegex.exec(url);var isBase64=/base64/i.test(url);var data=isBase64?window.atob(results[2]):results[2];return $q.when(angular.element(data)[0]);}/* Load the icon by URL using HTTP. */function loadByHttpUrl(url){return $q(function(resolve,reject){// Catch HTTP or generic errors not related to incorrect icon IDs.\n\tvar announceAndReject=function announceAndReject(err){var msg=angular.isString(err)?err:err.message||err.data||err.statusText;$log.warn(msg);reject(err);},extractSvg=function extractSvg(response){if(!svgCache[url]){svgCache[url]=angular.element('<div>').append(response)[0].querySelector('svg');}resolve(svgCache[url]);};$templateRequest(url,true).then(extractSvg,announceAndReject);});}return dataUrlRegex.test(url)?loadByDataUrl(url):loadByHttpUrl(url);}", "title": "" }, { "docid": "4ce110a148f42d13175186ef5c72d0d8", "score": "0.7557646", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "4ce110a148f42d13175186ef5c72d0d8", "score": "0.7557646", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "4ce110a148f42d13175186ef5c72d0d8", "score": "0.7557646", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "a228228d2552deafc32398fc67586550", "score": "0.715263", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $q(function(resolve, reject) {\n // Catch HTTP or generic errors not related to incorrect icon IDs.\n var announceAndReject = function(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n reject(err);\n },\n extractSvg = function(response) {\n if (!svgCache[url]) {\n svgCache[url] = angular.element('<div>').append(response)[0].querySelector('svg');\n }\n resolve(svgCache[url]);\n };\n\n $templateRequest(url, true).then(extractSvg, announceAndReject);\n });\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "a228228d2552deafc32398fc67586550", "score": "0.715263", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $q(function(resolve, reject) {\n // Catch HTTP or generic errors not related to incorrect icon IDs.\n var announceAndReject = function(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n reject(err);\n },\n extractSvg = function(response) {\n if (!svgCache[url]) {\n svgCache[url] = angular.element('<div>').append(response)[0].querySelector('svg');\n }\n resolve(svgCache[url]);\n };\n\n $templateRequest(url, true).then(extractSvg, announceAndReject);\n });\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "a228228d2552deafc32398fc67586550", "score": "0.715263", "text": "function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $q(function(resolve, reject) {\n // Catch HTTP or generic errors not related to incorrect icon IDs.\n var announceAndReject = function(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n reject(err);\n },\n extractSvg = function(response) {\n if (!svgCache[url]) {\n svgCache[url] = angular.element('<div>').append(response)[0].querySelector('svg');\n }\n resolve(svgCache[url]);\n };\n\n $templateRequest(url, true).then(extractSvg, announceAndReject);\n });\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }", "title": "" }, { "docid": "5d58113a2927616cf84cb51bcd9ca106", "score": "0.68325573", "text": "function loadByHttpUrl(url){return $q(function(resolve,reject){// Catch HTTP or generic errors not related to incorrect icon IDs.\n\tvar announceAndReject=function announceAndReject(err){var msg=angular.isString(err)?err:err.message||err.data||err.statusText;$log.warn(msg);reject(err);},extractSvg=function extractSvg(response){if(!svgCache[url]){svgCache[url]=angular.element('<div>').append(response)[0].querySelector('svg');}resolve(svgCache[url]);};$templateRequest(url,true).then(extractSvg,announceAndReject);});}", "title": "" }, { "docid": "decc96bc319bd38fc64c08c367d48a39", "score": "0.6430763", "text": "function loadByID(id){var iconConfig=config[id];return loadByURL(iconConfig.url).then(function(icon){return new Icon(icon,iconConfig);});}", "title": "" }, { "docid": "92892b089753c2e75ea2d79699d595d2", "score": "0.6320318", "text": "function updateIcon()\n {\n switch (contentDoc().location.protocol)\n {\n case \"file:\":\n urlIsPortable = false;\n icon.src = getIconPath(\"special/localfile\");\n specialLocation = [\"localfile\"];\n return true; // Done\n\n case \"data:\":\n icon.src = getIconPath(\"special/script\");\n specialLocation = [\"datauri\", url.truncateBeforeFirstChar(\",\")];\n return true; // Done\n\n case \"about:\":\n urlIsPortable = false;\n if (url == \"about:blank\") // Blank page gets no icon (some pages load by going to about:blank first, thus getting it briefly)\n {\n icon.src = \"\";\n specialLocation = [\"blankpage\"]; // FIXME: remove this string from localizations\n }\n else // Note: about:addons gets the normal about icon, not the puzzle piece, because it already has that as its own icon\n {\n icon.src = getIconPath(\"special/about\");\n specialLocation = [\"internalfile\", url.truncateBeforeFirstChar(\"?\")];\n }\n return true; // Done\n\n case \"chrome:\": case \"resource:\":\n urlIsPortable = false;\n icon.src = getIconPath(\"special/resource\");\n specialLocation = [\"internalfile\", contentDoc().location.protocol + \"//\"];\n return true; // Done\n\n case \"view-source:\": // TODO: handle better\n urlIsPortable = false;\n default:\n if (host == \"\")\n return false; // Unknown host -> still need to look up\n if (!countryCode)\n {\n icon.src = getIconPath(\"special/unknown\"); // Have a host (and ip) but no country -> unknown site\n specialLocation = [\"unknownsite\"];\n return true; // Done\n }\n switch (countryCode) // IP has been looked up\n {\n case \"-A\": case \"-B\": case \"-C\":\n urlIsPortable = false;\n icon.src = getIconPath(\"special/privateip\");\n break;\n case \"-L\":\n urlIsPortable = false;\n icon.src = getIconPath(\"special/localhost\");\n break;\n case \"A1\": case \"A2\":\n icon.src = getIconPath(\"special/anonymous\");\n break;\n default:\n icon.src = getIconPath((safeGetBoolPref(\"flagfox.usealticons\") ? \"flagset2/\" : \"flagset1/\") + countryCode.toLowerCase());\n break;\n }\n specialLocation = null;\n return true; // Done\n }\n }", "title": "" }, { "docid": "086cd89758691ebd92fe79d4cd5eb819", "score": "0.62989", "text": "function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }", "title": "" }, { "docid": "086cd89758691ebd92fe79d4cd5eb819", "score": "0.62989", "text": "function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }", "title": "" }, { "docid": "086cd89758691ebd92fe79d4cd5eb819", "score": "0.62989", "text": "function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }", "title": "" }, { "docid": "e81bfd01e3e69be644f9fd9ab824a8a0", "score": "0.6266723", "text": "function loadIcons() {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', 'assets/icons/icons.svg');\n xhr.onload = function() {\n if (xhr.status === 200) {\n iconsEl = document.createElement('div');\n iconsEl.innerHTML = xhr.responseText;\n }\n else {\n console.log('Error: ' + xhr.status);\n }\n };\n xhr.send();\n }", "title": "" }, { "docid": "131a0ece8333e93d1f86ca957de04459", "score": "0.6263069", "text": "function getIcon(id){id=id||'';// If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n\t// over a URL string. If the value is not trusted, this will intentionally throw an error\n\t// because the user is attempted to use an unsafe URL, potentially opening themselves up\n\t// to an XSS attack.\n\tif(!angular.isString(id)){id=$sce.getTrustedUrl(id);}// If already loaded and cached, use a clone of the cached icon.\n\t// Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\tif(iconCache[id]){return $q.when(transformClone(iconCache[id]));}if(urlRegex.test(id)||dataUrlRegex.test(id)){return loadByURL(id).then(cacheIcon(id));}if(id.indexOf(':')==-1){id='$default:'+id;}var load=config[id]?loadByID:loadFromIconSet;return load(id).then(cacheIcon(id));}", "title": "" }, { "docid": "8004102c6f9d3f852caad32f19643f8c", "score": "0.6242855", "text": "function getIconForURL(url) {\n var iconSrc = '';\n if (url) {\n $.each(LINK_IMGSRC, function(key, src) {\n // console.log(key);\n if (url.indexOf(key) >= 0) {\n iconSrc = src;\n }\n });\n if (iconSrc === '') {\n iconSrc = URL_FAVICON_FETCH + url;\n }\n }\n return iconSrc;\n }", "title": "" }, { "docid": "a693540f6d7015b81018427b4be2487a", "score": "0.6236236", "text": "function loadFromIconSet(id){var setName=id.substring(0,id.lastIndexOf(':'))||'$default';var iconSetConfig=config[setName];return!iconSetConfig?announceIdNotFound(id):loadByURL(iconSetConfig.url).then(extractFromSet);function extractFromSet(set){var iconName=id.slice(id.lastIndexOf(':')+1);var icon=set.querySelector('#'+iconName);return icon?new Icon(icon,iconSetConfig):announceIdNotFound(id);}function announceIdNotFound(id){var msg='icon '+id+' not found';$log.warn(msg);return $q.reject(msg||id);}}", "title": "" }, { "docid": "3f77340e995ee08cf887707c1a705ef1", "score": "0.6203334", "text": "function iconURLby(iconID){\n let iconLinkString = \"http://openweathermap.org/img/wn/\" + iconID + \"@2x.png\"; \n return iconLinkString;\n }", "title": "" }, { "docid": "a5e0d1fab0b4f4bd931547f7d92bdba2", "score": "0.6169233", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "a5e0d1fab0b4f4bd931547f7d92bdba2", "score": "0.6169233", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "a5e0d1fab0b4f4bd931547f7d92bdba2", "score": "0.6169233", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "2ec2cf24b776dc2279bb3bf42359c7e6", "score": "0.61316746", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "2ec2cf24b776dc2279bb3bf42359c7e6", "score": "0.61316746", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "2ec2cf24b776dc2279bb3bf42359c7e6", "score": "0.61316746", "text": "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "title": "" }, { "docid": "cb8b23fde4f3455dcd872b1a1b08cdea", "score": "0.6109208", "text": "function loadByID(id) {\r\n var iconConfig = config[id];\r\n return loadByURL(iconConfig.url).then(function(icon) {\r\n return new Icon(icon, iconConfig);\r\n });\r\n }", "title": "" }, { "docid": "642e1846416871ddff7e5737da114a74", "score": "0.607553", "text": "function getIcon(id) {\r\n id = id || '';\r\n\r\n // If already loaded and cached, use a clone of the cached icon.\r\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\r\n\r\n if ( iconCache[id] ) return $q.when( iconCache[id].clone() );\r\n if ( urlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\r\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\r\n\r\n var load = config[id] ? loadByID : loadFromIconSet;\r\n return load(id)\r\n .then( cacheIcon(id) );\r\n }", "title": "" }, { "docid": "4fb44382313de7911532f652f5d26555", "score": "0.6039156", "text": "function loadByURL(url) {\r\n return $http\r\n .get(url, { cache: $templateCache })\r\n .then(function(response) {\r\n return angular.element('<div>').append(response.data).find('svg')[0];\r\n }).catch(announceNotFound);\r\n }", "title": "" }, { "docid": "3ae7cefb01e2a054f18d0e3c56a51f49", "score": "0.60309047", "text": "function loadImg (url, varName) {\n map.loadImage(\n url,\n (error, image) => {\n if (error) { throw error }\n map.addImage(varName, image)\n }\n )\n }", "title": "" }, { "docid": "9044c85bda414b3befea1b34ef5d10db", "score": "0.6010005", "text": "function remoteWeatherIcon(iconId) {\n var inconUrl;\n inconUrl = \"https://openweathermap.org/img/w/\" + iconId + \".png\";\n $weatherIcon.attr(\"src\", inconUrl);\n $weatherIcon.css(\"height\", \"200px\");\n }", "title": "" }, { "docid": "8bcbf316d9888a84af694332269dc2f6", "score": "0.6008087", "text": "function getIcon(id) {\n id = id || '';\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if ( iconCache[id] ) return $q.when( transformClone(iconCache[id]) );\n if ( urlRegex.test(id) || dataUrlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then( cacheIcon(id) );\n }", "title": "" }, { "docid": "8bcbf316d9888a84af694332269dc2f6", "score": "0.6008087", "text": "function getIcon(id) {\n id = id || '';\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if ( iconCache[id] ) return $q.when( transformClone(iconCache[id]) );\n if ( urlRegex.test(id) || dataUrlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then( cacheIcon(id) );\n }", "title": "" }, { "docid": "8bcbf316d9888a84af694332269dc2f6", "score": "0.6008087", "text": "function getIcon(id) {\n id = id || '';\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if ( iconCache[id] ) return $q.when( transformClone(iconCache[id]) );\n if ( urlRegex.test(id) || dataUrlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then( cacheIcon(id) );\n }", "title": "" }, { "docid": "7653b3be7b6462cc795cde207728d424", "score": "0.5983259", "text": "function getIcon(id) {\n id = id || '';\n\n // If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n // over a URL string. If the value is not trusted, this will intentionally throw an error\n // because the user is attempted to use an unsafe URL, potentially opening themselves up\n // to an XSS attack.\n if (!angular.isString(id)) {\n id = $sce.getTrustedUrl(id);\n }\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if (iconCache[id]) {\n return $q.when(transformClone(iconCache[id]));\n }\n\n if (urlRegex.test(id) || dataUrlRegex.test(id)) {\n return loadByURL(id).then(cacheIcon(id));\n }\n\n if (id.indexOf(':') == -1) {\n id = '$default:' + id;\n }\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then(cacheIcon(id));\n }", "title": "" }, { "docid": "7653b3be7b6462cc795cde207728d424", "score": "0.5983259", "text": "function getIcon(id) {\n id = id || '';\n\n // If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n // over a URL string. If the value is not trusted, this will intentionally throw an error\n // because the user is attempted to use an unsafe URL, potentially opening themselves up\n // to an XSS attack.\n if (!angular.isString(id)) {\n id = $sce.getTrustedUrl(id);\n }\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if (iconCache[id]) {\n return $q.when(transformClone(iconCache[id]));\n }\n\n if (urlRegex.test(id) || dataUrlRegex.test(id)) {\n return loadByURL(id).then(cacheIcon(id));\n }\n\n if (id.indexOf(':') == -1) {\n id = '$default:' + id;\n }\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then(cacheIcon(id));\n }", "title": "" }, { "docid": "7653b3be7b6462cc795cde207728d424", "score": "0.5983259", "text": "function getIcon(id) {\n id = id || '';\n\n // If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n // over a URL string. If the value is not trusted, this will intentionally throw an error\n // because the user is attempted to use an unsafe URL, potentially opening themselves up\n // to an XSS attack.\n if (!angular.isString(id)) {\n id = $sce.getTrustedUrl(id);\n }\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if (iconCache[id]) {\n return $q.when(transformClone(iconCache[id]));\n }\n\n if (urlRegex.test(id) || dataUrlRegex.test(id)) {\n return loadByURL(id).then(cacheIcon(id));\n }\n\n if (id.indexOf(':') == -1) {\n id = '$default:' + id;\n }\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then(cacheIcon(id));\n }", "title": "" }, { "docid": "7856d9224dadc1bb02b10f11d2522d12", "score": "0.5975139", "text": "function load_gif_from_url (url) {\n\tvar request = new XMLHttpRequest();\n\trequest.open(\"GET\", url, false); // False indicates this is a synchronous request. This means this method will block at request.send() until a response is received.\n\t\n\t// Some compatibility code, taking from libgif.js.\n\tif ('overrideMimeType' in request) {\n\t\trequest.overrideMimeType('text/plain; charset=x-user-defined');\n\t} else if ('responseType' in request) {\n\t\trequest.responseType = 'arraybuffer';\n\t} else { // Internet Explorer 9\n\t\trequest.setRequestHeader('Accept-Charset', 'x-user-defined');\n\t}\n\t\n\trequest.send();\n\t\t\n\t// Handling response.\n\tif (request.status != 200) \n\t\tconsole.log(\"XMLHttpRequest error. Status code: \" + this.statusText);\n\t\n\t// More compatibility code.\n\tif (!('response' in request)) { // For Internet Explorer 9\n\t\trequest.response = new VBArray(request.responseText).toArray().map(String.fromCharCode).join('');\n\t}\n\t\n\tvar data = request.response;\n\tif (data.toString().indexOf(\"ArrayBuffer\") > 0) {\n\t\tdata = new Uint8Array(data);\n\t}\n\n\treturn parseGIF(new Stream(data));\n}", "title": "" }, { "docid": "1182095f79ed992f9b1d33b188d2106d", "score": "0.5940424", "text": "_fetchIcon(iconConfig) {\n var _a;\n const { url: safeUrl, options } = iconConfig;\n const withCredentials = (_a = options === null || options === void 0 ? void 0 : options.withCredentials) !== null && _a !== void 0 ? _a : false;\n if (!this._httpClient) {\n throw getMatIconNoHttpProviderError();\n }\n // TODO: add an ngDevMode check\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n const url = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].RESOURCE_URL, safeUrl);\n // TODO: add an ngDevMode check\n if (!url) {\n throw getMatIconFailedToSanitizeUrlError(safeUrl);\n }\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this._inProgressUrlFetches.get(url);\n if (inProgressFetch) {\n return inProgressFetch;\n }\n const req = this._httpClient.get(url, { responseType: 'text', withCredentials }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"finalize\"])(() => this._inProgressUrlFetches.delete(url)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"share\"])());\n this._inProgressUrlFetches.set(url, req);\n return req;\n }", "title": "" }, { "docid": "1182095f79ed992f9b1d33b188d2106d", "score": "0.5940424", "text": "_fetchIcon(iconConfig) {\n var _a;\n const { url: safeUrl, options } = iconConfig;\n const withCredentials = (_a = options === null || options === void 0 ? void 0 : options.withCredentials) !== null && _a !== void 0 ? _a : false;\n if (!this._httpClient) {\n throw getMatIconNoHttpProviderError();\n }\n // TODO: add an ngDevMode check\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n const url = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].RESOURCE_URL, safeUrl);\n // TODO: add an ngDevMode check\n if (!url) {\n throw getMatIconFailedToSanitizeUrlError(safeUrl);\n }\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this._inProgressUrlFetches.get(url);\n if (inProgressFetch) {\n return inProgressFetch;\n }\n const req = this._httpClient.get(url, { responseType: 'text', withCredentials }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"finalize\"])(() => this._inProgressUrlFetches.delete(url)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"share\"])());\n this._inProgressUrlFetches.set(url, req);\n return req;\n }", "title": "" }, { "docid": "3a5e5c2f5043e572f0eca306ed6de235", "score": "0.59002095", "text": "function updateIconUrl(iconUrl) {\n var downloadIcon = document.querySelector(\"#icon\");\n downloadIcon.setAttribute(\"src\", iconUrl);\n}", "title": "" }, { "docid": "f73c71f2397bc1deda3583191e74dc95", "score": "0.5897022", "text": "get image() {\n if (!this.download.target.path) {\n // Old history downloads may not have a target path.\n return \"moz-icon://.unknown?size=32\";\n }\n\n // When a download that was previously in progress finishes successfully, it\n // means that the target file now exists and we can extract its specific\n // icon, for example from a Windows executable. To ensure that the icon is\n // reloaded, however, we must change the URI used by the XUL image element,\n // for example by adding a query parameter. This only works if we add one of\n // the parameters explicitly supported by the nsIMozIconURI interface.\n return \"moz-icon://\" + this.download.target.path + \"?size=32\" +\n (this.download.succeeded ? \"&state=normal\" : \"\");\n }", "title": "" }, { "docid": "cf3efdfb895fe299f510a59feddffd3f", "score": "0.58784324", "text": "_fetchIcon(iconConfig) {\n var _a;\n const { url: safeUrl, options } = iconConfig;\n const withCredentials = (_a = options === null || options === void 0 ? void 0 : options.withCredentials) !== null && _a !== void 0 ? _a : false;\n if (!this._httpClient) {\n throw getMatIconNoHttpProviderError();\n }\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n const url = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].RESOURCE_URL, safeUrl);\n if (!url) {\n throw getMatIconFailedToSanitizeUrlError(safeUrl);\n }\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this._inProgressUrlFetches.get(url);\n if (inProgressFetch) {\n return inProgressFetch;\n }\n // TODO(jelbourn): for some reason, the `finalize` operator \"loses\" the generic type on the\n // Observable. Figure out why and fix it.\n const req = this._httpClient.get(url, { responseType: 'text', withCredentials }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"finalize\"])(() => this._inProgressUrlFetches.delete(url)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"share\"])());\n this._inProgressUrlFetches.set(url, req);\n return req;\n }", "title": "" }, { "docid": "9abeb72c306815b8c53b1bd0db2181fb", "score": "0.58609074", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "9abeb72c306815b8c53b1bd0db2181fb", "score": "0.58609074", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "9abeb72c306815b8c53b1bd0db2181fb", "score": "0.58609074", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "d2a31c8c5098e2428dc5bc622e7bedef", "score": "0.5851753", "text": "function loadFromIconSet(id) {\r\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\r\n var iconSetConfig = config[setName];\r\n\r\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\r\n\r\n function extractFromSet(set) {\r\n var iconName = id.slice(id.lastIndexOf(':') + 1);\r\n var icon = set.querySelector('#' + iconName);\r\n return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);\r\n }\r\n\r\n function announceIdNotFound(id) {\r\n var msg = 'icon ' + id + ' not found';\r\n $log.warn(msg);\r\n\r\n return $q.reject(msg || id);\r\n }\r\n }", "title": "" }, { "docid": "9d1c805a6e674d0e0f71470e3ec0f28a", "score": "0.5794976", "text": "function loadTile(which, url, tile) {\n const cache = _cache.requests;\n const tileId = `${tile.id}-${which}`;\n if (cache.loaded[tileId] || cache.inflight[tileId]) return;\n const controller = new AbortController();\n cache.inflight[tileId] = controller;\n const requestUrl = url.replace('{x}', tile.xyz[0])\n .replace('{y}', tile.xyz[1])\n .replace('{z}', tile.xyz[2]);\n\n fetch(requestUrl, { signal: controller.signal })\n .then(function(response) {\n if (!response.ok) {\n throw new Error(response.status + ' ' + response.statusText);\n }\n cache.loaded[tileId] = true;\n delete cache.inflight[tileId];\n return response.arrayBuffer();\n })\n .then(function(data) {\n if (data.byteLength === 0) {\n throw new Error('No Data');\n }\n\n loadTileDataToCache(data, tile, which);\n\n if (which === 'images') {\n dispatch.call('loadedImages');\n } else {\n dispatch.call('loadedLines');\n }\n })\n .catch(function (e) {\n if (e.message === 'No Data') {\n cache.loaded[tileId] = true;\n } else {\n console.error(e); // eslint-disable-line no-console\n }\n });\n}", "title": "" }, { "docid": "4ca64c623a5839b01a05265d3d83b8df", "score": "0.57660484", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return icon ? new Icon(icon, iconSetConfig) : announceIdNotFound(id);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "4ca64c623a5839b01a05265d3d83b8df", "score": "0.57660484", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return icon ? new Icon(icon, iconSetConfig) : announceIdNotFound(id);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "4ca64c623a5839b01a05265d3d83b8df", "score": "0.57660484", "text": "function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return icon ? new Icon(icon, iconSetConfig) : announceIdNotFound(id);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }", "title": "" }, { "docid": "5b3da441f585044fe66a557ffd6b1e23", "score": "0.5731945", "text": "icon (url) {\n // Obtain resolvable URL for opengraph favicon image.\n // We'll use the origin of this url to keep caches working.\n if (!urlIsSane(url)) {\n return fallbackUrl\n }\n const { origin } = urlParse(url)\n return resolvedUrl('logo', origin)\n }", "title": "" }, { "docid": "3b9f25217f7c98ce19efc06e2219e72c", "score": "0.56992525", "text": "function displayIcon() {\n chrome.extension.sendRequest({\n msg: \"bitletIcon\"\n });\n debugMsg(logLevels.info, 'Icon request sent');\n}", "title": "" }, { "docid": "9071ca192d4a420090a8680370ba56cd", "score": "0.565109", "text": "function getIcon(i) {\n icon.src = `http://openweathermap.org/img/wn/${i}@4x.png`;\n}", "title": "" }, { "docid": "33c206575a1124ff537b16767aadbd6d", "score": "0.56116474", "text": "function imgLoad(url) {\n return new Promise(function(resolve, reject) {\n var request = new XMLHttpRequest();\n request.open('GET', url);\n // if (url.includes('placeholder')){\n // request.open('GET', url + '.svg');\n // } else {\n // request.open('GET', url + '.jpg');\n // }\n request.responseType = 'blob';\n\n request.onload = function() {\n if (request.status == 200) {\n resolve(request.response);\n } else {\n reject(Error('Image didn\\'t load successfully; error code:' + request.statusText));\n }\n };\n\n request.onerror = function() {\n reject(Error('There was a network error.'));\n };\n\n request.send();\n });\n}", "title": "" }, { "docid": "e045d424a2eba714fd7b8ed5c1a4a0dd", "score": "0.5602357", "text": "loadSprite(url, id) {\n if (!utils.is.string(url)) {\n return;\n }\n\n const prefix = 'cache-';\n const hasId = utils.is.string(id);\n let isCached = false;\n\n function updateSprite(data) {\n // Inject content\n this.innerHTML = data;\n\n // Inject the SVG to the body\n document.body.insertBefore(this, document.body.childNodes[0]);\n }\n\n // Only load once\n if (!hasId || !document.querySelectorAll(`#${id}`).length) {\n // Create container\n const container = document.createElement('div');\n utils.toggleHidden(container, true);\n\n if (hasId) {\n container.setAttribute('id', id);\n }\n\n // Check in cache\n if (support.storage) {\n const cached = window.localStorage.getItem(prefix + id);\n isCached = cached !== null;\n\n if (isCached) {\n const data = JSON.parse(cached);\n updateSprite.call(container, data.content);\n return;\n }\n }\n\n // Get the sprite\n utils\n .fetch(url)\n .then(result => {\n if (utils.is.empty(result)) {\n return;\n }\n\n if (support.storage) {\n window.localStorage.setItem(\n prefix + id,\n JSON.stringify({\n content: result,\n }),\n );\n }\n\n updateSprite.call(container, result);\n })\n .catch(() => {});\n }\n }", "title": "" }, { "docid": "ae61bc13324c09c2ddbe2a709cc7c3a1", "score": "0.54953444", "text": "function loadIcons() {\n var icon_list = ['rail-11.png', 'metro-11.png', 'solar-11.png', 'trash-11.png', 'camera-15.png'];\n icon_list.forEach(function(listItem){\n map.loadImage(\"/static/icons/\" + listItem, function(error, image){\n if (error) throw error;\n var tag = listItem.replace('.png', '');\n map.addImage(tag, image);\n }\n );\n });\n}", "title": "" }, { "docid": "f5d5d1257436a625a2b57a835fec1aae", "score": "0.5464159", "text": "function load_open(id, url) {\n $(\"#\" + id).html('<div style=\"width:100%; padding:20px 10px 10px 10px;\" align=\"center\"><img src=\"assets/img/content/ajax-loader.gif\"/></div>');\n $(\"#\" + id).load(url);\n}", "title": "" }, { "docid": "f7666b3d31db23620c4378974077c1de", "score": "0.5423536", "text": "function chemIconUrl(type) {\n\tif (type) {\n\t\tconst icons = type.split(' ');\n\n\t\treturn 'https://chemineur.fr/ext/Dominique92/GeoBB/icones/' +\n\t\t\ticons[0] + (icons.length > 1 ? '_' + icons[1] : '') + // Limit to 2 type names & ' ' -> '_'\n\t\t\t'.svg';\n\t}\n}", "title": "" }, { "docid": "fbbaf39db02bc0e1b0a54390541dd40f", "score": "0.54043627", "text": "function loadPonyIcon() {\n\tvar element = document.getElementById(\"c1\");\n var c = element.getContext(\"2d\");\n\t\n\t//Get the image\n\tvar imgData = document.getElementById(\"ponyIcon\");\n\timgData.crossOrigin = \"Anonymous\";\n\t\n\t//Draw the image on the canvas (img, x, y)\n\tc.drawImage(imgData, 0, 0);\n}", "title": "" }, { "docid": "889fe4e4ea64b87fb36a8f8e54bb42b3", "score": "0.5375353", "text": "function loadResource(url, cb) {\n const xhr = new XMLHttpRequest()\n xhr.open('GET', url, false)\n xhr.onreadystatechange = () => {\n if (xhr.readyState !== 4) return\n if (xhr.status === 200) {\n cb(xhr.responseText)\n } else {\n throw new Error(`[${this.status}] ${this.statusText}`)\n }\n }\n xhr.send()\n}", "title": "" }, { "docid": "b4f446369cc17d3dd6aca64674cb8bb0", "score": "0.53531694", "text": "function _load(url) {\n if(resourceCache[url]) {\n /* If the current URL has been loaded, we can use it from cache array resourceCache[]\n */\n return resourceCache[url];\n } else {\n /* Otherwise, we need to load this new URL\n */\n var img = new Image();\n img.onload = function() {\n /* After loaded, put it in resourceCache[]\n */\n resourceCache[url] = img;\n /* When all the imgs have been loaded, call the added callback function(s)\n */\n if(isReady()) {\n readyCallbacks.forEach(function(func) { func(); });\n }\n };\n\n /* Set the init resourcCache[url] as false, it will be changed at onload's callback funtion\n * Set img's src as parameter URl 。\n */\n resourceCache[url] = false;\n img.src = url;\n }\n }", "title": "" }, { "docid": "a22eb769bafb99a141800c0103ee8e39", "score": "0.53435254", "text": "function loadGif() {\n const portal = document.createElement(\"img\");\n portal.classList = \"portal\";\n portal.src = \"https://media.giphy.com/media/3o7aD2d7hy9ktXNDP2/giphy.gif\";\n gifDiv.append(portal);\n}", "title": "" }, { "docid": "c9ab570d77717db2be172c508fe026b8", "score": "0.5342304", "text": "function loadResource(url, done) {\n request(\n {\n url: url,\n timeout: config.maxDelay * 1000,\n encoding: null\n },\n function (e, response, body) {\n if (!e && response.statusCode === 200) {\n done(body);\n } else {\n done(null, e);\n }\n }\n );\n }", "title": "" }, { "docid": "93e5eb7b65b4db8678ba64ae538bc72c", "score": "0.53302985", "text": "function normalIcon() {\n return {\n url: 'static/media/marker.png'\n };\n}", "title": "" }, { "docid": "e2d9810defe61ee24438d248a8ecba07", "score": "0.53098494", "text": "function load_sorce(url, done){\n return load({\n url: url\n }, done);\n }", "title": "" }, { "docid": "93fa31e59549f001de13707e769d35f1", "score": "0.5307677", "text": "function _load(url) {\n\t\t if (resourceCache[url]) {\n\t\t\t /* Returns cached image.\n\t\t\t */\n\t\t\t return resourceCache[url];\n\t\t } else {\n\t\t\t /* Loads new image.\n\t\t\t */\n\t\t\t var img = new Image();\n\t\t\t img.onload = function () {\n\t\t\t\t /* Caches loaded image.\n\t\t\t\t */\n\t\t\t\t resourceCache[url] = img;\n\n\t\t\t\t /* Calls the onReady() callbacks.\n\t\t\t\t */\n\t\t\t\t if (isReady()) {\n\t\t\t\t\t readyCallbacks.forEach(function (func) {\n\t\t\t\t\t\t func();\n\t\t\t\t\t });\n\t\t\t\t }\n\t\t\t };\n\n\t\t\t /* Sets the initial cache value to false. This will change when\n\t\t\t * the image's onload event handler is called. Points\n\t\t\t * the image's src attribute to the one passed in URL.\n\t\t\t */\n\t\t\t resourceCache[url] = false;\n\t\t\t img.src = url;\n\t\t }\n\t }", "title": "" }, { "docid": "52d7361e58efb25c9e01abd0c66447f9", "score": "0.5300943", "text": "function Font(original,href,requestRemote)\n{\n\t//Nothing yet\n\tthis.url = null;\n\tthis.original = original;\n\tthis.pending = [];\n\t//Check if we can reach it\n\tthis.xhr = new XMLHttpRequest();\n\t//Ping\n\tthis.xhr.open('HEAD', href);\n\tthis.xhr.onerror = function(e) {\n\t\t//If we couln't not access to it\n\t\tif (this.status===0)\n\t\t\t//Request it remotelly\n\t\t\trequestRemote();\n\t};\n\t//Send\n\tthis.xhr.send();\n}", "title": "" }, { "docid": "3fc6cf7f5a90b943d653411736b13ce2", "score": "0.52835804", "text": "function ResourceLoadButtons()\r\n{\r\n try {\r\n // The following \"if\" is not really necessary but with it this script will\r\n // work for Opera too\r\n if (document.location.href.indexOf (\"fleet3\") == -1)\r\n return;\r\n\r\n if (! show_Load_Buttons) return;\r\n\r\n if (DEBUG_MODE > 0) GM_log('ResourceLoadButtons: ' + strPaginaActual);\r\n\r\n const ICON_REVERSE_OFF = \"data:image/gif;base64,\" +\r\n \"R0lGODlhIAAgAPcAAJdsIeGSQ+icb/LKruGOQuGIQ9poFy0mHNtyMeSOWqF1F7iAMeGdP9WAOdty\" +\r\n \"GuGIUd2ESuGFROGVQctvGiIdFN5wL+GVReupg+GZQjgvF9t2G9ZxKplaAPTUuqhiAN10Mqp0Ifnm\" +\r\n \"2uGGQ+GAQ7J+MrF7Ld91ONuBHqJpGOmkevjh0t6ITJ1wGOOKWO69ltuIIeWSYdBwIItoGaN0Mpx0\" +\r\n \"GNt9He+6m9JwJNpgFNyMIoxSAOGCQzYxLOGDRTk1MOOOW/np3QkEAOGLQ990NdeBPeCaPOSQXdqF\" +\r\n \"ReKKVtpfE+GYRcGGMdyKIZpvKbJoAJ9iAPbczP77+dyRJOCZP9uFINiAPuqsfeCXPdVxJvPMtYdT\" +\r\n \"AJVlAOGKVLx+JdJ/NOGPQ59zGKJfAPXXxDw4M9psGOGMRNVdEuWQXvvv5i0oI9uDIN19QeGcQ5Vp\" +\r\n \"APbZx5JgAKNqGKBoF6ZxJYVaAO6zktplFeCZO9peE9pnFq98MtyOI9mDQtpkGOKNV55eAN+GTdyE\" +\r\n \"R9hcEsCCLOOLWe2xjat3LN+JUNlyLthyLjIuKuGaP+KJVdhyLOKMWeCSP9+BQ+CHURQUFQEBARAL\" +\r\n \"ABoWE990N91yNeF+QuWPXeSPXOSPXeF/QtxyM95zNNpjFd10NJdZAN1yNNleE+F/Q+WPXuKKVf/+\" +\r\n \"/hwYE5tcAOF9Qtt/HhgYGdt5G9hxLeWRW9diFOOOWZNmAJNiAOF+Qx8TAM5+LslvFuOLWPjk1f32\" +\r\n \"8oJNAM5vHemgddyDRv78+uWbV/HCqOKDS/jj1uibafz07993O+idcOWOXOWPXOaUZd+ITvrr4Nhg\" +\r\n \"E9yGIN+GM9lxLvC/ouqxfCQaANqDRNpwGZVxF9N/OHpSAI9fGA0HANeDPuGBQ/HIqMduEdOCOOCe\" +\r\n \"PNp6HL18H6B0L9+IQzEsJ9lgFNliFIpjANpjFuKLVp53GOB9QeF+QeSOXNlxK91zNadvH9yGSd+Z\" +\r\n \"OuB/QtuMItyNIq56J59yLaBzMvfe0NhsFuCXOdhnFdlmFt10Nf///yH5BAAAAAAALAAAAAAgACAA\" +\r\n \"Bwj/ACVJCkKwoMGDCBMKlDRJFwdQEEFxmEixosWJEidqoTVQVzdbtiZM2EWyZIyTJ2/EuMGypcoY\" +\r\n \"uzgEyYZqZMobWHLq3MCTJyNGz1oFbdUTi5NsQUCtzLmBkTtGh6JGRUC1qtWqUY8mxdJ06lVOYMOK\" +\r\n \"HcsJgVZUGxAdoio2lNtQluLKnSvXrVYOhz6EhSv3n99//gL7e2fp77+5Wv18WPxJcOAsf6E49gfZ\" +\r\n \"r2TBiRk3HlLJxIW/yxwP+ew3tOPMHxp3NnHLcDHBlVr/fX0aqeJPnzp3NvU32ZDfQ0zw9pusUqXa\" +\r\n \"QVClHlKs0pB8f+kYBw7dr/Tp/ob4O/uBuYkh0P66/zE+PbxfN8Cn/77bvdgQY3+J/SYP36/89M6z\" +\r\n \"H82mo4L/BH9FEUwnBHbSToADFkigW5yEkQ1/d0Sowl/G3JFEhHdM6JcxonTo4R2BmGEGBw/qkMSF\" +\r\n \"vIh34ol3pHheEh6KEqEozJiBSokWnmjDX1ng4KOPO/qVxYon4sAMM684yN+KPmr4zwU/NvkXlFGa\" +\r\n \"88orHjyoRRJR8hHFXz14IqYnXoIpJjqe1NEPP1kGoYOYdcRZxw6G9SPnnHX2g4cBBpChT5s6qInH\" +\r\n \"oHta8RcufCZqqF+IkuEoNdQAyqejlJIxwF/cVGopptQ44IAGGgBKBqSkeurAMn9ZYaqnqPoVDSus\" +\r\n \"1JxQg4NBaKHBp6DmqoEzhunKCq9/qXLCCWrQqgU4siar7LI1qNKssMOqQUUzL7zwBFJaDEsssWqo\" +\r\n \"wS233UpLxbjUvsBEDjnUc2MQc5Rb7bvwxmvuuejWo8e9UlwbxDU50FNvPQAHLHDA9+IrxcEHyxKE\" +\r\n \"JLTM0YYsb0C8hSwUT7zFFrFcjHEssbTh8cfnSLNQEJOUbPLJKKeM8sKSBAQAOw==\";\r\n\r\n const ICON_REVERSE_ON = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAAB\" +\r\n \"zenr0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAACx0lEQVR4nL2XMWvbQBTHT06MFRdDp36CuiGBgpc\" +\r\n \"MxaQQMnbp4CWhZPGnyNrRY8GLwQQ8BDq4thNPhiwOLZhAMKF4NYSCAx2Nq1qS9Tqc7nT37iSdTaj\" +\r\n \"hxx3S/977693TGREAIBnLAnuLaMlnKXH302Br8ZixLAAAQjKWBa9fERh+JjCp/x9GNQKHe9QEsbd\" +\r\n \"o8vm3N5xltwR/Ou9ScTrH0twEpp/UaSVIIUddsaS6oH+7H/ioY9n7yEeG26uA26tI15je6RzD0yW\" +\r\n \"Bgk2A5LPUAE4oLsRBI06E0RRq6umSQCFH6BZM6kR6GjVJDFdnFHFuQu8kMsAqECXWJFk3gQGKAbd\" +\r\n \"XAff6NDUZ/m2qUw1cn0bEBA0WMzmq52yskwxMmyQ2udevgtevwurxRg4a+FqtiY4bsHUVQIm9fhX\" +\r\n \"8uy9KSdk9UW+i0xrgFdAk9/pV5YmccVsJmqRLNcArgAy4V2cAniPFXf76qQ2YpIs1oDQhSu79nqK\" +\r\n \"HmivVidPp+sioB5jYGbeV/dRtUZLO2MCoRqSTT9dM/u25EthUJ56AbJw2wy0o5EIDjSIH76czbkv\" +\r\n \"319XpmNQTDOB3OfDn2iCmumQDtmrAbRRpYwV+FHwxo/cuds10GHHdxW7yFjAxLvHq8UYJlKoTR4F\" +\r\n \"pM2xCpQJM1CiC29rXNxkKlqpr7UdjCD8HeAVEsYB/e64Exxoj3de3ErwC/DXUBGULlT8Yz6GBWOA\" +\r\n \"0XciyW+KoBpBDDP6LDRazdF3gQ7CYSYmX3RK4gwO9ASzEiN3Oms1U5w4OIobl6C1gBrBDNopz78c\" +\r\n \"n1GkrRaPVAYA7LEuoFRAdbsKwLM91jN5zeAXsnW1qIG5RUrCk6+KIuT+KTsJ8lsD3OtELn4v7IwV\" +\r\n \"pCwY1oi4QF647N+ChRT9UScay4HCPVuGhJTPRXHsu+McphJ/n+SwtycsXKvh6nM4Ue2ebf57/A7g\" +\r\n \"WUZUpB3X7AAAAAElFTkSuQmCC\";\r\n\r\n const ICON_NONE_OFF = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAgCAYAAABkW\" +\r\n \"Oo9AAAACXBIWXMAALiMAAC4jAHM9rsvAAAMBUlEQVR4nJ3WWXBc9ZXH8X/f/XbfpbfbV92SWhu2j\" +\r\n \"AV2HK+xMSaGBDJVmaIyWWaepmoqyYQZlsqQIg8ZkjCpwjYYwzAswZa1datbsiVblrVakiUkecEQk\" +\r\n \"mACzkKmUkB4mBoDsWQtre7vPMiTqdS80NyHW/+HW7c+Vef/O+cIIVUiNAlTE4QlCV0WJITADAiiQ\" +\r\n \"qApKpokEwxIWELCERKukHDE6veOELhCJigkrICKIRQMSUMTCppQUDQVTwQwJUFQXf2nJQkUIRBKH\" +\r\n \"PFJH0VI3C4LHtINnpQjPCGbPCuC/ERxORAIcUgK8Iwi87QscVASHFQlntIVntRVHpcEh4IaT+oy+\" +\r\n \"5XV8yFD5RlN4WlZ4nldY78S4UVhcSgQ5KDksi9g8aCm87mAhNDkTw6tEIL9UoB+VWdashkLSIwoM\" +\r\n \"n2GwZAiMSIEZxSZISnAsCozquuMaBpjprl6VmTGTJ3RoM6gJtMvBEOyYEQIhoVgWJaYkiTOKDJjk\" +\r\n \"sGo0OhTQ3xXKNhCfHKoLwsyUpAhSWYwIHFaCE5JggFFYUIITguJEdVgSDMYCgYZNHVO6ypjrs3Zs\" +\r\n \"Mu4ZTHmBDljmwwFNQZ1jWHdZEjWGJZ0TkuCEUlwWpM4JSv0CcG4bPKEsPHKgcqaICNF6JNk+jWNU\" +\r\n \"VliWFYYUHRGA4JBxWLEDHPatBhwwoz6HhPpSqbq0owkPSZSlUxWVjFdVcVYLMZgyGHQcOhXHPrlM\" +\r\n \"MdVlX5JYUgNMSCb9EgSQ7LOk2oYSy0HKgm65QhDUoB+U2NEkRmUVHoUhVOKoD+oM2CFGI6GGUv6j\" +\r\n \"KerGa+vZ6JxLVMbb+Hcxk2cvWktM7UNTKdSTFdUMBaL0Re0OG6Y9Oo6/UJmKBBkQDbpVQT9aoB9W\" +\r\n \"oigXAbUEYITUpgJIRhQJQaEYFRoDAUMzgVkJnXBtC1xMRVjpraS8aZ1TN2xm/Nf/ypv3P8dLt93H\" +\r\n \"1N/dQ9nt2xiZm0drzdU8kqFw6QdYNKVOK8azAqFCcnkjGYypAqG1QAHDBu3nNJrAUFOcZm6AT2hS\" +\r\n \"pw2LY6ZDmcNnUk3yli8kpH6Jk7vuos3HzsAb70DyyUWgCWAuTkKFy9w6f4HOL15C+MNa5isTDHsO\" +\r\n \"gyFVoN4yjQZCIYYUwOMKDL7zDiOUD45NCYk8orOVDTGWCzGWSfMWTvGWCzKWT/Nz2rSjK9t5NzuL\" +\r\n \"3HlxaOU5uahCIulZSgtweISV4HCyurr7Z+2MbluO9O33sxkRZgz8QQTts+EYTPhhBiMhZl0I/y7a\" +\r\n \"RMqt/QZWWUiEmEkHmMiEuHlqM+Y7zFZVcdMXQ2/2LOXSw9+l+WPPmCJIiuLC1C6ztWhUfj1byn+6\" +\r\n \"SMKQIESfPBHfv7w95jZuoXJprrVsMWrmHSjnI06DHgRJtwwh1QLXSoDGlUU8rrJpOcx5ieY9Dxm/\" +\r\n \"Uomq1NM161ldv16XvvM7bw/PsQSBRZXCrA0z1tPHGL6y19j+K//hkvf/xEsLHB9bh4ocP2Xr/Dan\" +\r\n \"ruZ2tTEZF0tU8lapuMJJhMRhpJxpqIxnjYcTKUMaCQgkdMMzsbjnEl4TMXjzPqVvFxTxWzDOi5s3\" +\r\n \"cbP934Flq6xvFigtFKE937P63u/zKWdO7mw7XP8Yu+9LF+6BMUiS0CpNMe7//gvnN+6g9mbG5mtv\" +\r\n \"olZP8nLFR4jSY+ZmMezulNe6V0h6FINphMJJpIVTCcSnKuoYrq2mvNr1jO9bTu/euB7lFhmpQjLr\" +\r\n \"PCfXZ28vfceLmzfyOu7tvDm9jv42WM/obCywDwwzxIfPP8SF267k9mbG5lJr2HWTzLlxxlN+ZyLe\" +\r\n \"jwjhzDKSb0jBDnNYCaZZCpdxWxVJeera5lZW8eFpg1c2rWb9368n/nlOQoApSV+d+gQb+79Aq9u3\" +\r\n \"sDsllu4vH0Xl799P7AIJShR5L8HB7i46y4ufHYD59c0cbG2lnPVKcbTlVzwUzyrOwTLgdqqTEfQZ\" +\r\n \"DzlM5xOMpFOMVtXz+T6Bs5t2sSlPbexcLSVFQqsAKws8s6jj3Fu1y5e3b6VV3Zs5uKOHVz80legN\" +\r\n \"AcrwMIiK798lUu3383M1k1M3tzEdEMtE+kK+qt9Jn2fpwwbQwmUsT3JgudkQZdt0GZrZIIKeTtEN\" +\r\n \"mHRXZkk31THla7DFEuLfFgqUGSOy9/8Z1q23Up2TQ25uio6m9ZyasceClxljhUKLHP1jfP0bNlKr\" +\r\n \"i5Fp+fRFbbJBCUOh2ROBE1+LGlI5YQpKAmahUKrpXI4rNIS1jgScemsiJCpiZLdtIE/vHCYpdIyF\" +\r\n \"IGVOV5+8J/IblxHc1M1R2rryX12Db3bdrC8cpViYQUW4MPLb5DfuIFMQ4JO36M9HOJwVOMlR6fF0\" +\r\n \"dgvFILltKdVqHwDKv8/aFtTPe93NLPIMtcLJShe5/wDD3Fy8yaONdbQt2Y9vRsaGdy5hwIfs0CRY\" +\r\n \"hGu/up18p9ZR0e9R6fv0RENciSicTis0eJoHBBqeVBLEhwNKLTZGs03oM1hl6zv0F4dJn9rPW899\" +\r\n \"TiLxetcv3FHX3n4EU5s2cTxdWlONtxE38b19O3eS6HwMQtAkRJXX5vm5LYmMnVxcolVaHNU5XBYo\" +\r\n \"9XVPz203dI4GlFoCSsccR0yCZu2Kpd8Y5qpb30TWFxNfWGJt194juM7t9CzfQ29mxoZ2rWFmfu+A\" +\r\n \"6VFrhVKAPy+vZn8rfW010Tp9OJkI/8HbQvrHBAyRjl91JIELZJKh63RElVpC6sccR06PIvWpE33m\" +\r\n \"jq6d94BC6tjcn7+Gu+OD9Jz526G7t7C6J1bGd1zGyP/9giwCi0WC7z9gx/Sua6etqow2WiUTNjkS\" +\r\n \"EThSET/M7SsEWrJgraASsbR/wLaHg/RmgqRqUnRs3kH87+5zEJxiQVKzP3xHU793Tc49cXbOf3FP\" +\r\n \"Yze+1V+fX6YxdLc6ja1NE/fns/TdlOKlpRDJhIh65ocvQFtjxjsF8qnh7bGtFVo2KYjFqIlGaQj7\" +\r\n \"ZJb28A7L70AK4tcK65Qosgfxs4w+vDDdH/rH/hNe54Sc5RYhKUiHwwP0ntLI+31EVoqbDojLlnXp\" +\r\n \"CWq0hw16IianxIqyX+Gtke0v4Bmq3Wy6Rj5nbtZuXKFEnCtBIsAH30IH/4XFOEq87B8naU3f8fRu\" +\r\n \"+7hWFWUTJ1JS4VFZ8SlM/y/UJ2OqMmBgFoeNB4QtAqFo57KSxGVblflcNzgeT/EUU+nOREkVxWlt\" +\r\n \"TJB9gt7KL5+HkqLN9a6VfC1EqywDO9eof/vv0Hu5ga6q6JkPJ2XPIOMZ3LEM+l0dNqiCkcSOv+q6\" +\r\n \"sTKGaEhIWgXFpmoTWvY4pRtkQ1btEQjdEcssimXHs9h2PfJJ32O3f15Xn3xCRbffxuKH0PxI/jTe\" +\r\n \"/z2eCv9f3sv2do0vV6UXNQgW2XRFXY54Th0xGxyEZuMF6LDc/iR7JQHtQxBeyBENh7ixZhGNqpy1\" +\r\n \"NM54ofoSui0uhr5mMlx3+ZYyqXVD5FvrOL4LWvINdZxrKGWnsZ68jelaE069NTG6Eo5ZCtCtCdDt\" +\r\n \"CVC5KIGzb5Gi6fSnpDJeCY/MGwcRSpjMmmCZtmgK2Hy07hKe1yiw1PIRBROhgR9fpLOeIQWzyZTE\" +\r\n \"6U1aZNLh+lKx+itTXAi7dGTjnOsOkarHyJTHaE5EaIjHibnRcmHdXpdhc4KjfakTLYiQN7TeCQYL\" +\r\n \"K+PugHBc2qIE36YTCxIxtPJ+xa5hE1PXKfDj9Li2TQnQrRVWOQqHI6lXLqqXI5WmDSnLLpr4hyvj\" +\r\n \"NKdsMglXTKpMG2eQ4fn0BUJ0hs2ySYMWn2dfIVOb8Lm+6ZFvJzSR1XBo5ZCvtKhN+6Q9TVyvkned\" +\r\n \"+hMGuSjgt5qlWNVGq0xwfGUSj4RoMuX6K0xydWYZCpkOv0AJ6s1slHB8YTgVFJhKGmQqbTp9oN0J\" +\r\n \"yy64kH6EkHyyRDftlW8crYnIcnsNQQPJFT2xV0erXR43A9zKBpnX9zmQEzlgKtw0FZ4xtJ5PmLxj\" +\r\n \"KXzlKXxlKVx0DU56Jo8EVI4FJJ5OhjgPxyVg5bMflPwQ9fgMcfkccdmn+WwL2zxUFRmsykQWjlQu\" +\r\n \"RZTqMRlQVoI5JDA1ASekHBkQdDUsTQNK6BiKzqGomKqGpYkEwkoRISBI+sYuoqmyoRUFUtI2AGZs\" +\r\n \"GriSYKIInBlGVfIJAMBEgFBQCgIOfmJof8DrgstGQouqKMAAAAASUVORK5CYII%3D\";\r\n\r\n const ICON_NONE_ON = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAgCAYAAABkWO\" +\r\n \"o9AAAACXBIWXMAALiMAAC4jAHM9rsvAAAMt0lEQVR4nJ3Y13Pc13XAcf8BjiSit13sLhbYAmDbb3\" +\r\n \"vfxaItCkmwiARJkaJAUZEdT2RFnnjGD/bIsT2iNLIMUyRFFSvWKDIBYjsauWgEiA42kTKpLnmiqD\" +\r\n \"ixTYIoW755QMYT5wnInblv9+Ez59xzbvlWfoGabxflISkqQPFQEQXFD1CZ93cU521DnJdPeV4Rom\" +\r\n \"35SLblUZG7MWU5OUhytiHJ30ZZ7gNICvIQ5+Qgzsmj9MFcynOKEeUUUbatkNyiUpQ5eZQWPkBxUS\" +\r\n \"7leTmUFeZSmFNAfqGcb212lObn01qSy49LpZzNVdBdUs7ZIjHdxXJ+XVLJqeIyzpSKOVMq5nSJiD\" +\r\n \"Oics6IJZwql9BdWsZJWTndolJeKi7hlXIpZ8QSzojKOV0i4qxIQnepgrcKZLxSKOJUUQW/LKjghy\" +\r\n \"IJzcXF5JQWbB6qK3mQblEpY9Iq5kuVjMpEjMpEXJTJGJVKGKmQkpTKGCovJ1lRwWilgtEKBWNyJa\" +\r\n \"OSSkYrqpioUjGuUDCqqGJYJuWiTMKwRMwFaTlJmYRZiYhJiZhLYhkTIjkXpCqeLZMgF+VuHirISg\" +\r\n \"hLVIzLqkhK5SQqyxiQlzBeIWNKImZELmNcVcWIqpKxGjWj1SqSKgVTWg0zOi3TWg2TNSomalWM1y\" +\r\n \"gZVW+sTVbKN+CV5YzIyxhWlDMolzEglTElVfOqWI1WIto8VKGSE5UbGK5UMKhQM6JWMq5SMq2sZV\" +\r\n \"KlYEJRy+VaA5c0BiaMAlM2K5c9TubqvEy6Hcy43cy43cy6nEyZTEzoBCa1JiaqjYyrTMRrakgq1Y\" +\r\n \"ypNIyqdQwoFFyqqOZ1uZ5qZcXmoWqVgsEqgQlVNSM6LWPaGiaraxmr1jKiVTFuMDJuMDJpdTDj9T\" +\r\n \"MbaGS6IchMaztzHbtY3LGXmcZWFhuCzHvrWHT7mbY6SRosJA02hvQCYyoNl2oExrUGhrVqJtQq3l\" +\r\n \"Ab0Kq3UEyCSklSZWK+upoJvYZxXTXzNTpmqg0sajUsGmtYsui44XdxrbGehR07WDp6lKvf/z53fv\" +\r\n \"osHz77LPPHjzO/bw/X24PcDga45jYza9awaDdwQ2fihlrPnMbAlM7AuF7FVK2aN3VmTNWqzUM1ul\" +\r\n \"oSWjMLNTWMGzQMC7VMmk1ctFi5ZDcy73Iy66tjpq2DicNd3Dn9Knz8OWQyLAMpMrByl9T1Ja797C\" +\r\n \"eM79/LbHszcw1+JhwWJiw6pgUtIzYjSYuRSZOWab2ON8wujDr95qEOnYZBvYk5Vx3THh9TbjvTTh\" +\r\n \"+zbh9zdY3cbA4y29LO1WP/wMdv98LKfbLAWmqVLOuQTrECrKQhm83y+Tt9XN99hCt7Opj3uTe2i9\" +\r\n \"PPpN3KtNPGtNPDvNPNWxY7Nq1m81CbtpYBg4kZl59pn59pv4tZXz1z/gALjUEW21q5ffRxrj93gr\" +\r\n \"Xlb1gjw/raCrDKnyan4NNP4f4yK2RZIQvffMWt519g8UAnc7tamK9vYM7XxGWvi3mfm2mfn1mXmz\" +\r\n \"ctNqy6LUBdJgNDFhtz/gbmAvXMNfhYqG9mqamZpdZ2rjy8l9udx/hi5hKrpFjLpCF1n09/+zbXvv\" +\r\n \"c0l556hjvdZ2F9lT8v3wNSrL5/kzvHv8fSvt0sBIMsNrQyW+9jod7HbF2ABa+Pt+xOHMIWUu8S9A\" +\r\n \"ybrMx765mtCzAb8LBQ38yV5iDXtu9k6eAB3n/iGVi7R3olBVng3z/nzuNP8d7hR7l68DC3jz9F6t\" +\r\n \"oNANYAsit8+S8vcHXffm7s3Mm14A4WmgJcqfczF6jnitfP2zYnTsMWoG5BT9JsZ6muicX6RuYbfC\" +\r\n \"w1BLnW0sqNnbtYPHKI959/EbIZSG1Avhoe5MPHn+Tmkf3cPHqIjx57gttnXiFFhjVghRRf9/TyXt\" +\r\n \"dx3u3o+BvoQqCB674G3rY6cOp0W4to0upgqSHIUnOQpWA9V4JtXG1v5/ruPdx49Aj/ceo11tfXya\" +\r\n \"QhnVnlD2+9xQfHjnPr4MNcObiHD7qO8dGzz5HOrEAGsmn4z7Exbj32JLf27ef69t1caWvhaksDV5\" +\r\n \"paudEY5B2bB5dg2ELVWwUG7Q5mG5uZaWlmpq2e+e3bWdq9k6ud+7h57FEIJciQ3Uh7Zp1PXj7Fu1\" +\r\n \"2P8d6jh7l1+ADXDj/Cze8+DdllyABrWbj9Hu8e+w7XD3aytGsP8ztbmW9tYKqxiYWGRv7V5sJhFr\" +\r\n \"bQ8M1aeo0Cg04nMaeVqEsg4XHRX+dmsCnA0L7tfNofIkOa+1lYZ4Xf/+wXhA7uJtHRSrK1icTD25\" +\r\n \"k42kWav3CPLKvZLKvvv8fAoUMMtTbSHwiQ8DtIOI1EbFYuOh2cNlswGrcQUZdgJGw00+e2E3aZiX\" +\r\n \"hM9NZ56a/30N9SR6xzL1/2hEmls5CGtfSfWfjlLxjo7CC0J0jf9jaSB3Yw9MghUizDehbW4O7tDx\" +\r\n \"ja30mifQMa9lkJeU2EXXZ6PVZeNZhxG03/P2j0/0ATQT/hvW18HY+wTpp0BtLc5/rzzzF6YD8XOt\" +\r\n \"pJbu9gdO8OLj/2BOuskMlkIAN/+fD3DB/YQ6K9kYH6ABG/jbDPTMTt4LzXxhsGC27jFlLvNpqIGi\" +\r\n \"30eaxEXWZibhM9fg+JgJt4s4/BznY++u1rrKWXSQOwzo0XXmTk4H4u7mlnpKODif17udT1XVZW75\" +\r\n \"IGMmT5080Fhh/ZSaK9kcFAgKjPRthvIupx0uez8xvBujWoRzARNZoIeW3E3BZibiPnfW4SfgfxJj\" +\r\n \"eDu5q58tOfAOsbxZRe55Nz75DseoShozsZOLCDqaOHuP7zE5BaJZWGLBm+6I+QeLiFeGsdA3V1RP\" +\r\n \"2W/4Ha6fPZecNg2lrVuw0GIoKRsMdC3GX6KzTusxNrdDG4s5WLR45BannjjF+9zxez44z//TEmvt\" +\r\n \"PJpSc7mT3exeUz3ZBNsZqB5fX7fHzqNP172jey4vcT81mI+EzEXDb6/FZe1xu31vBdej0xwUDIbS\" +\r\n \"buMhF3GznvdRHz2ogFbMRamhjtPMLdz95nNbvOGhnufvkJEz/4ARPHjzL55KNMP/VPfHb1MsvpZV\" +\r\n \"YB0vcZ6eoi0dFGtN7NgMdL3GMm7DUSc9kIeS28rjdi12m3EFGdlqhB/7+gBs57HSS8FmIBG/FmHw\" +\r\n \"NtbXzedw6yq9zNrpMlwzdzs8w8d4ILP/4RnyWGgVVSpCAF/zU9RXL3DqJBH5GAi363h5jbRMRjJO\" +\r\n \"q0EvJaeE0nbO325NJqiOh1hF1m4m7jX6Fxj5lonZVEo53BpgCDjxwh9fEHpIG7wH2ycG8Z7v0RgL\" +\r\n \"vpNcius/rhHwh3PcGFZg8DjQ7CdU4GXE5ibhNht/A3UKumdgvXPJ2CkMZAr1eg1yEQceno8QlEPX\" +\r\n \"Z6vUZ66430NzmINXlJHD9E9s4ScJ8UkMkA2Q10mlX4+mPGfvQ0QzuCDAXsxOsE+vxWYj4zPT6BIY\" +\r\n \"uJqEPgnFfgVwYjVq1y81CDWklIYSJhsxG32hmymUk4zAzbXAw4bMQCDpIuJ3MePxc9dVzsOsqtf3\" +\r\n \"uT1FefQWqZDPdg9Y98cCFK8ul/JN7QyJjXR8JhJhywc8Hm4KLVTNRl5ILNQr/LRMhp4WStGauyeg\" +\r\n \"vv+toqwgo9cYuecxYd550aep0aog4TMZeeczY9cY+VAbeZhNtMyG1msCXAUFuQoZYgw8FmBoKNJI\" +\r\n \"IBwj47QwEX/R4bcZ+dsM9K1GUk5qjldx4VYYeaqF1F1KbhJY0eoXoLEVUrxPxOriJh1PCOuZoeh4\" +\r\n \"KwVUHCoGZIV8WAxUzMZqTHoSVcb6LPqyfiE4g4DQzW2Uj67Qy5zQx5LUScBqJeEz02LRGLgahJIG\" +\r\n \"HWMmhWEnIqiDoUxKxVxCzVPFdTg1oh2wJUWsZvZFUMGrREDDX0mCsJmxXEjLVELUoGzDpCQjXnBS\" +\r\n \"UhQUW/uZZhu54Bh55es5rzVg0Ju4GEqYaYoCZqrSXs0HPeqiVk1RHTa4kJanqtKnpMCmImFXGTlp\" +\r\n \"8rNRhEW4HKCjlRJSYkKBjUqgjpZYT1MiJ6JecschK1IobMcvotcno0JcRNMiIGKRGjjKilkqhNSd\" +\r\n \"hQQcQgZdBWRZ+2jLBeTFyQMGSsJGTWEBJURAQFsZoqhrVK+oRqnlHKqBEVbR6aX1LArvJt/LCmjG\" +\r\n \"61ghMGOSdr5ZxVKOmuqeRFtZiXqsp4WSHmdKWEs8oKXq4s57RCyqkqCaeqZJxWVHBSJuKMXMRZuZ\" +\r\n \"jXFVJerhDTLSvjRIWEF+QSflUp46RUTnelnH9WleGTbCO/ZAt/T98u0FKWW0BFwUPU5hZQKHoQcc\" +\r\n \"k2qnLyKC/KQVxSiLSoGEleAeX5BYjy8ikvzEeWl0tVTi7ivHxKCnIpKsmnqDgPcXEB5bn5SPKKkB\" +\r\n \"WUoMx9CGnBQ0iKc6nIz0eVX4C04CFycvPZVqjYNPS/AdhNZfbbDntkAAAAAElFTkSuQmCC\";\r\n\r\n const ICON_MOST_OFF = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAgCAYAAABkW\" +\r\n \"Oo9AAAACXBIWXMAALiMAAC4jAHM9rsvAAALrUlEQVR4nMXYWXBU95XHcT/GwQZEg9CK1EIt1FJr6\" +\r\n \"da+sBgm4/FUAgRXzCYJLWhFUnffpVtICAgCSUhiMatT2JWqKechqSRT9tRkJpXKTGEQq1AjtXq9f\" +\r\n \"XtRSyBwPMYDNmAg33mg5j3SS07Vebz1/zyc8/vfe98A3vh79t9c//9A248TOPhBDIPbl3Py/UQub\" +\r\n \"Mvm3NYcTu9Yw/EqLUdqUzlSu5rju7M4sTOLkV06hqq09NdoGajWcrZ2DWerMji5Q8/w9kw+3J3Hh\" +\r\n \"9W5jFTrGN6dzMjOOE7uSGLkpzqEd3UsCLrvR6v43FbC5a5srtr1jFr13BFLuNlu5KY1i2uiji9kH\" +\r\n \"ZdlPaNWI6PWAi6LRi5LuVwVMvmiXcvtDh0OazbXOtdww5rLLbmIUUseo3Iu17uyuS6lM2bTM24v5\" +\r\n \"E9yOfs/SGXe0KEdOi7bTIxZVuMQ0nCY0/BJuUy16wgI6QTEVHxyKl45Hb+QjU/IwyXl4ZJyUORsw\" +\r\n \"lI2wQ4ts7Ieb2caqt2A25KJ26pnwpyOS9LhMifj7UzF3anjtmTkFy26+UNHdum4bDVxVzDg6c7BJ\" +\r\n \"evx2wvwCXmolmxUayZ+8XWrlhxUSx5+ax4+q4nJffmoYgnBzlyC5iwUMQu/ZMBtNhDsKsYrm1BsJ\" +\r\n \"oJiDhEpj4Aln9tWE79sz5o/9PRuHdekUlw2E96uXJyiHrclF79QQEgsIiQWEZBNBOR8wmI+04KJs\" +\r\n \"FCAIlYyaf8nHPb3cMsbmOgwEuwtwy0b8QomvEIhPrkMV2cBAXMhIWsxEaGcSbmST9vz5g89t13LL\" +\r\n \"VspHpsRj5yFYjegWAuYtq9HMa/DZ13HlFSCWzaiCrmELfmEzUU4xU380f4z/q1rF1d7tjF5eDOj5\" +\r\n \"kIm5GL8XRX4bRUE9m/AZSknIFbiby8jZF6PU9zEr1pM84eefz+FMVsZXtmIX17DbI+RQKcRtbOMg\" +\r\n \"HUTPnEjblsZXnsBqpRPSCzCJ63jxv5t8DgA30Xh63F4+GfuHvxHPN1rmbKYCIhleMRSpswlRLs34\" +\r\n \"e0oI2h+B5f0Lp82LgB6aUc6zp5KfFIuYXkN00Im94Qiwh0l+DrLCdnW4pfzUO05TNsLmOgsYKx3G\" +\r\n \"3+9+Rv4/iF8ex+euGHqN9yxr8MtmohIBczKRahSAT6xAEUsRhXKCVrWMiVt5NP63PlDL+7MYqJnA\" +\r\n \"37JRFgyEBUM3BNKCJtLmOvZiM+ShyJm4bHqUewVjB/4McHfnYBns/DiEXz/FURvcLlrC+qR9/Bb8\" +\r\n \"5gV8pjuyCQs56FIeShyAQFbKQGxnEn7Rv6lcQHQk7vzudPzHl6xgqBUSshaSESqICCU4mrPItpTS\" +\r\n \"NhmQLUXcUd+F8cZGV5+BTyD59/A0zn+2FuH4+D73O0oJNhp4PGBUkKtqwlJBvxyDl57Pp6uQty2c\" +\r\n \"sa6N/Jx2wKWaXC3kbHuf8YvrEUVylEtRahSOYpYiCpkEZIMBGQTk9I67vTVwiMVXj3hJc/g2UNun\" +\r\n \"TvA2OEq7lg3EJBKuG8zMdu+hr/Y8glLBvxSFl5bDr6uAtz2Em73rOOjNsMCAr8qiwn7JkKWMiJiK\" +\r\n \"SGriaBcQEjKZa4rF9WSjb9nE1ftPwHXf8F3D+HV1/DiPg8/O8vEwQ9wCutRxRJmbUbuSTnMmvU8E\" +\r\n \"HOICgZCYjZhyUBYzkOVCnB0l/PxPv38ocNV6bjt65m1FjMjFREUjATtJsJyHjOCAZ+lmNu9H/Diy\" +\r\n \"m/hL9Pw7Gv4LgLOzxnr2UzQ9g7TUglR0UhYen1T3beZmLYYmZEKiVpNzApG7omFRIVinPsrFgjdl\" +\r\n \"YpLLmPGaiJiM+GTcgnYjai2QqJCOd6urUx8PARPH8PLV/D0EcxcYezgZjxCOSFzHlEhlwe9RTitm\" +\r\n \"Xi7Cwl0r0URKwnK6whbK7lvLueBpYKouRKn/A6XWhewTMPbk3GJJqYtWaiyAY+YiSJnExTziArlj\" +\r\n \"Etb4MlDePnayZMHTB6vJWSrZFYsZE7MZdaaSdiSQaTHiEfKxyeXoAhlBMW1RMxl3Oso5kFnETMdR\" +\r\n \"TiFCi7tXcCMHv9JPDeaknHVxzC+N5ZbtcuZbFiOc89yfHtT+MMu/etQ/+szvn/+LTd+e5H/bjDhr\" +\r\n \"kpksjYB395VuHcvxlO1GHfNMjx1K/E1JOKsXsnUngScNfG4qzR4qpfiqo1htCGB89tXLWCZNidxq\" +\r\n \"ykRT8NinHs1OGpj8NVp8NXE4KvWcKs5F76ZgucPgMd877/C1fZKxncn4KiORWlaiVrzNqGqt5htT\" +\r\n \"ECp1jC+7QcE98bjro3FVavBU/M23tof4q1fxLXGOC7uSJs/dGDLKm43J+Gvfwt/3TI81UsJ1moIV\" +\r\n \"ccQrlqGoy6db//9FDwLwcs5+MbPy8u/4Iv2AsbrV6LULWK69oeou35ApDGRyZ3L8DclM1kbj7MhE\" +\r\n \"Xd9PN49S/HvWYKvfinXm7Sc350zf2jfVi03m1MJ1C8hWKtBqV5KqG4FoT3LCe2Owd+cwR9aSkH5D\" +\r\n \"3gehBdReKow97s+RpvS8DZoUKoWMdeawNi2Nwm1ribQtprxmlimGpNx7Y3DX7cUtXYxyt6l3GpN4\" +\r\n \"0LNAgK/d2sG15p1BOpXEK6PRanVoDbG42uIR61biacpjav7CvjM+iP433F4GYEXX8LjIK4T1Thas\" +\r\n \"/HUp+CvTiDStJpAwyqmalfgaYrD3RyHtyUWteFtwg1vEmxexHhHEhfrFvDifGhrBtdbMgk3xhFti\" +\r\n \"iXYoEHZF4+nZSWB1ng8zcmMtWbwn815OC42wdMpePEVvPwaHjn4fWMpTqECZ0M6rpok7rWvxte4j\" +\r\n \"EDbcjxtK/DtiyXYEkO4aSnhtqXctabwUX36/KH9m1MYb8lgtiWOuTYN062LCVg1uM3LCFhWMNUUg\" +\r\n \"6stAY89h88btHz52c/heQSezsGre/DlLX7dXIJDKCIiZBFs1hBqW8S0NQa3WYPXkkigIwm1PYlgZ\" +\r\n \"xJ3pWw+aljAjPZvTmR83xqi7Qnctywn3LkIxbYYp/gWTvPbzPSk4Nmnwdm2Eoc5jdH9FTy+cun1r\" +\r\n \"PI/8Oo+z27+kmv2SqYs6QQ6ljMjLEHpfBOXsBy3lIhXWIXfmkpATGW8K4eLTQsI/MNbVnJbyiG6X\" +\r\n \"0e0K4FIt4ZQXyzOniUoh5JQupMI2VNxd8ajyKncNGsZPfwuRP4MfAM8hicTPPnXLjwHigjaUrjXE\" +\r\n \"49fWoKrKw7vIS2e7mSUg1oCvSncPZLD6cYFfIX2/HQFo/tz8R/QEehJINCrQT22EuVYHN7DSa8P2\" +\r\n \"Z+KR0gg0pVEoFvLDVsWjos18MIHL1V4cgUe/Z67PdnM9mfhkZYw05eEejQV389TcB2Iw3c4Cf/Be\" +\r\n \"BxH13CqMXn+0AM747nWV4jSbyA8mE5oIJlgfxyhgURCfamoh1cTPJxJ8IAW1a4hcjAe/6E0Rvfru\" +\r\n \"Dywlj/1lXJnwIgybMB7VItyJIngoRXMHU9huj+FUF8S4b5E5ga1zBxNxjNo4ELj6vlDu36m4YujR\" +\r\n \"qaOZRIcySRyMp3QUDKRoVRmj2cQ7dejHtETOqYj0Ksh0BvD3IiO4KAO7+AalBN6vANJTBzSEDmjJ\" +\r\n \"3wqg+BAKrMjGYQH04kMphEd1nJvOJXwsSSmBnI4tUe7gBndGYfjRBm+oWy8QzrU0xn4h9MIDq8me\" +\r\n \"jyT+0M5uA+lofbriAyvQjkWy/RwGuoxLerRVGaG1xAc1hK9YOBWvxbPWRPekVzcx/T4h7JRhjNRT\" +\r\n \"mjxj6SgnkrDfa6YE3sXEE/C5iRunvgHvOfXcfdsMY6Lpdw+W8zkmVJcw4VEzr/D3aFC7ozk4zqXz\" +\r\n \"8TpLKZOmZgcNKIMF6IMm5g4YeDuhSLGP3mHmxc3MHl+I87T65k8tY7JMxU4zhfiOG/C80k51y9uo\" +\r\n \"mvXAqDAGz1bVvFhXQqDLSn0d6ZzuF3HYEcmx+tTONeq42RrGgONifQ3xtLfGMdIk47TTVmc2qPlk\" +\r\n \"84sBuqXM7gvkSMdqzi4N4H+mngu7cvmbKOeM616hlrTONaSxFBbCsKO5IX9JPt79t9a/wetNVkt5\" +\r\n \"gmfWAAAAABJRU5ErkJggg%3D%3D\";\r\n\r\n const ICON_MOST_ON = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAgCAY\" +\r\n \"AAABkWOo9AAAACXBIWXMAALiMAAC4jAHM9rsvAAALY0lEQVR4nMXY2W/b15XA8fw1A/ShadJJ4kU\" +\r\n \"LxX3RLmvfJa+J4z22E1vWwl1cfj+SoiiJWux0kjZNk0kdYIoB+tAWzUxjW15krRTXH8kfScnyNpb\" +\r\n \"tWrbznQdj5rnSSw9wni7OxQfn4uLg3reAt/6Z+Q/H/xUMNL+Lr/sdxg7vIXRwL2MHywgdLmH0+L8\" +\r\n \"invwF7tO/RDixh9CHKsJHtEx8VMz4sd0Ih9/Bd/hdJo7uYeLDojc1BxVMHzUw9bEO/7EihBMf4D7\" +\r\n \"2c4SP3mbkwG4GG95nR9DBlrf5s62Smw4js04j1yx67tiquNmv4+6QijsWBddsGv5mM3DNWsl1Szk\" +\r\n \"3HGXM2ktZcVWwYDYRsVayaqvm5iUDt/rLmR+oZfaCidkhAzcdRq7ZVcw6dCw46/nB0oJ7fxnbhoZ\" +\r\n \"P7OWGw8C8Vcm8XcWcuYyY3UisT8XagJbCgJaURceq3cSK3cSKQ0fEVUTCWURiUE1moJzkBRV5q5H\" +\r\n \"VS2Vk7OWkBwzI5nJi/UpSVi2RwWJWzSpilnLu2Bv4qq96+9DxM8X8aKsiMlxFRKxhyVVFSmgkY6n\" +\r\n \"lfl8N9/tqyJr3EbftI+KsJTJcQWxYTdKpRbLVsS50Ibv2kXaVk/SYSAwbSAyqWXdUINuM5B0msnY\" +\r\n \"DsrOclKOaWXsdv7HsABo+r+T2cCOS0ErEu4/F4Wqi7mbSjlYemNt5ONROwdFO2tVKUmgiKTSS9tQ\" +\r\n \"ieRpZdR1kyXWIZXcrc/YKEmMNxIQKMq4q8o5KCo4aMuZyspYKZEctGU8Ttz3N/NZZt33ozDk1y65\" +\r\n \"2Ct5Oos46Yt4G4mInaXE/sq2LvL2dzHATkqfhTbqbyTq7WHV9yGygj7/6P+V66ASL0x/x30ItC4E\" +\r\n \"G0v5W5OFm7gvd5GzNrDnbSNtayLq7WBR6+cbZuH3olVNqYu5ONrxdpOy1ZHytRL3tLA+3kXZ3k/V\" +\r\n \"0khX2IYt15IVGZG8Xkvsk80I/bBbgeQ425+H5da6FOlga7yDqbibn7iTraCdta2dDPEDG3oHs6WV\" +\r\n \"FPMB3jvrtQ7/9xEjW282as4F1bz05XxOSv5OErxtJ7ED2NZETTcguDRtiPRn3fu4KF2F+Fp49gq0\" +\r\n \"NeB6F1B+YHeth3tdCPthNwdPBmqebvKebNaGHnLuTgrebRKCH7y2V24d+d6aKjL+XNXcTa0IDOX8\" +\r\n \"zSf+bDeXRXmKuKu6HqlkXjaz72ogFTiB9/xU8ewYvNuFxFh7Mc238JEvhIyRGu5G9HRSG21gTepD\" +\r\n \"FbrL+LtJiB3mxi+RID/9hNW0f+s3ZRmIjh0iLLWQCraQDHST8B0n4D5PydSGPtJH2VpD11ZMMHCH\" +\r\n \"1tQ9ebsLLl/Dif+BZjr+N9zE/dpro6AFirmYeBQ9SGO4g5+1BErtIjnQRD7SRDnQQDXXxe/sOoL8\" +\r\n \"910Rk9BAJfwupYCvJQDsJ8QCSeJi00EXG1052pI2Yr4uF0U/gaQZePQG2YHON9LeTzPnPshr4mJT\" +\r\n \"Yy0bwAFlLM098h5E93UhiN4lAJzFfO6mRLiKhXr6zV20f+tWn9URHe0kHmsgGm8j4W8gJ3awJvRS\" +\r\n \"8nUhCO9nJ49wNnoD0LGzKwEN4vcGTP39LRDhPSjxF1nOINd8BMtZmtoIfs2bp4J57P7Knl4z/TWe\" +\r\n \"zvl6iwSNcte3g1n/5WR2rY71kA83kgs3kfa2sCx1siPvZ8PeSEA9wY+Qkr+f/CI9z8OIhvCrwKv4\" +\r\n \"XIuN9SN6j5IVDPBg5RMJez4NAD+uOTh55D7HhOUDB20Pe34ssdpP3HSQePMrvba3bh05fqGNltId\" +\r\n \"soJXCSDs5sZU1byfrYi8ZsYf41DkWvp+AVw9hawse3oPNBHNTF4gGDiMJ7ayPdpLxN5AO1pMNtpB\" +\r\n \"yNvIoeJA1oYuc0EnB10lWaCMn9hINfsQ3O4Ker2El0IUsvOlmztPEmruJdaENWezmtngUXqzDTy/\" +\r\n \"hFbC1yeIXdhb9B0iJrWyEOsiI1WQCtSRGakj4angU7iFrr2NNaKLgbWRNaCDvaUAWWoiM9PK1pXk\" +\r\n \"H0FMmFm11xPs1xIYMrA5qiPeXkhxQEbuk55a1CzbX4NVr+OklN/7wJT/YWonaq1m1lrPYpyIyqGF\" +\r\n \"5SMP8kJbFAQ2yzUjy0xLS/WUkL5YgXVKQ6lcQG1Rww2Lkiws1Oxihp0ws2apI9CuJmTWsDimID+5\" +\r\n \"FGiwmO6TjzlAzPMvBy7/Di4dsZW9yXdzPnX4dc+dKeBRo4M7p95GseiRnFSuXNETP76EwqEQeUJD\" +\r\n \"uKyU9UEqqv4TEUDG3bQZ+fbF2+9Cp0ybm7VXEBxRErUpWLaWsmveSNJeQsei43V/N1o2r8KIAr+7\" +\r\n \"BC4lnt37HdVcnKVctC6fe4b7LSPSzvSSGNEhWI6l+JdlBFdKQlsSAlqRZT3xQTcyiZM5h4nd9O+j\" +\r\n \"o9JnK/4fGrSpiFgUxi4KkRUVqUE3cUc9fbD0g/QhP4/AyC88kHvzpc+YtNaTNWqT+EjKDClJmDbL\" +\r\n \"NQLKviLxFS9psIDFkIGExETXriNlUzA+b+PbSDkbozMlqluz7SA2qyVh0SBYtKbOGtFVPwVZB9JK\" +\r\n \"JZWcX112H4eEcPE2/GZ0Ps0hXLhC11xDtV7PuqkSyaMkMlZHp20VhqBTZokGy6EjajMSsWpKOMlZ\" +\r\n \"cBq5eKt8JtIoley1pixrZriFr05K26pBtRmSzHtlaScxcxR1zPdkv++DxCmxtvsHem+e2cIglVwu\" +\r\n \"L5gpiFj2yXcN9h4Jc//vI1jLSVg0pp5GEXUdqWMWK18TVfuMOjv6kjgVXJSlnGXm3ipxLSdahRHa\" +\r\n \"qyVjLyLv0JMxKUp4KbtkrePRHEbYK8PwRbN0HeY4/Ccf4cbiDJW8jKbeJgr2I+8695O0KMk4Vksd\" +\r\n \"I3KUj6dWw7K/g3wcrdnKZVMx5K4i7lWQFJVlvKWl3KRm3Esmt4t5oBXFbCav2UlIBE9c9+3i6cBV\" +\r\n \"er8PWY3j1mCcL/8n18GlueJpYHtZT8CgoDO8h6yol7daQ9JUTFQzE/ToWRqr52ryDWT9+WsnNQA2\" +\r\n \"JkIn0qJ7siIbCqJ6kV4k0YiQR0JPw6Yh5VUiimtvDGm5dPgr5H+D1A/jpCfw9xsZ/hbk93s2cx8j\" +\r\n \"6hAlZLCbmLiYbqmAlYGI1VE18vJK7E/Vc3snRjx4r5pqvkkhQTypoQApoKYwZyI2ZSIaMxIIGoiN\" +\r\n \"6En41a0E1MW8Zs14D8e8uwpMFeCXB01l4/ld+9NeQvdJEKqAgFywlHzaQm65hNVROLFxFPFzOwlQ\" +\r\n \"dvxrQ7+S5XMydYBXJcRO5iXLkoJacX4kc0JAZM5IcNxEb1RMTlWz4S7kfUBD3FLEUMLIw08utyV4\" +\r\n \"WJhtJXm4gOVVOZlJHfryYfGgv0qiCREjDakhLctJAalxNJGzi15eKtg8d+3gXd4PlxIJlyOM68hN\" +\r\n \"6MgEl0oiS1Lia5ISGRFhPPKAgL+7mcaiEB+EysiElUriC1GQlsaCCiLib/BUDqVAJicB75KcUSGE\" +\r\n \"VyUkD0rSJzPSbtdUJPf/26Xvbh4ZO7Gb5cgXx8SJioVLSYS2JcTWpsIbI2B5WJ4qIT6uRJtVkgrs\" +\r\n \"pjO4hN1VCMrQbabSE3ISS3EQJj35TznKwiNSMntRkGdKMltTlcpIzVSRnqkhMmpAmtSR/Vcflz/Z\" +\r\n \"uH9q//wNuTtcSvaxnIWxgcaqauYlqFqZqWbpiYGFGw9yklpUZE9Gwgci4juXLFcxNaIhPmYhP6Ii\" +\r\n \"MqVkc17L0eS3LXzQwP1PFrTE9d6drmZvcx/z0Ppan60l+3sjclTZsx4u3DwXeMvf+jPCxnxE69gs\" +\r\n \"mThcROF5M8GQx4bPvMnn2bQJH/4Wx428zdeI9QsfeJ3hege9cCYHjv+Tzz4oYPfEOgZPv4j2zG9+\" +\r\n \"5IjzHfs7MxSImzu4ifGY3U5/sYvrMLqZOf4D9yAc7+yT7Z+Y/Gv8L4sc1nS8YXAMAAAAASUVORK5\" +\r\n \"CYII%3D\";\r\n\r\n function addEvent (el, evt, fxn)\r\n {\r\n if (DEBUG_MODE > 1) GM_log('ResourceLoadButtons >> addEvent: ' + strPaginaActual);\r\n\r\n if (el.addEventListener)\r\n el.addEventListener (evt, fxn, false) // for standards\r\n\r\n else if (el.attachEvent)\r\n el.attachEvent (\"on\" + evt, fxn) // for IE\r\n\r\n else el ['on' + evt] = fxn; // old style, but defeats purpose of using this function\r\n }\r\n\r\n var tempWidth, myA, myImg, theA;\r\n var theDiv = document.getElementById (\"loadAllResources\");\r\n theDiv.setAttribute('style', 'z-order: 98;top:0;');\r\n var theMins = document.getElementsByClassName (\"min\");\r\n var myEvent = document.createEvent (\"MouseEvents\");\r\n\r\n myEvent.initMouseEvent (\"click\", true, true, window, 0, 0, 0, 0, 0,\r\n false, false, false, false, 0, null);\r\n\r\n if (document.getElementById('noneresources') == null) {\r\n /* Add a \"unload all loaded resources\" button */\r\n myA = document.createElement (\"a\");\r\n myImg = document.createElement (\"img\");\r\n myImg.setAttribute (\"src\", ICON_NONE_OFF);\r\n myImg.setAttribute( 'rel', ICON_NONE_ON);\r\n myImg.setAttribute ('class', 'lpunktkit-micon');\r\n myA.appendChild(myImg);\r\n myA.setAttribute (\"href\", \"javascript:void(0);\");\r\n myA.setAttribute ('id', 'noneResources');\r\n myA.setAttribute('title', LANG.MISC.txt_borrarSel);\r\n\r\n addEvent (myA, \"click\", function (e)\r\n {\r\n for (var i = 0; i < theMins.length; i++)\r\n theMins [i].dispatchEvent (myEvent);\r\n });\r\n\r\n theA = theDiv.getElementsByTagName('a');\r\n insertAfter( theA[theA.length-1], myA);\r\n\r\n } else {\r\n /* Add a \"load most resources in reverse order\" button */\r\n myA = document.createElement (\"a\");\r\n myImg = document.createElement (\"img\");\r\n myImg.setAttribute (\"src\", ICON_MOST_OFF);\r\n myImg.setAttribute ('rel', ICON_MOST_ON);\r\n myImg.setAttribute ('class', 'lpunktkit-micon');\r\n myA.appendChild(myImg);\r\n myA.setAttribute (\"href\", \"javascript:void(0);\");\r\n myA.setAttribute ('id', 'mostResources');\r\n myA.setAttribute('title', LANG.MISC.txt_recInversos);\r\n\r\n addEvent (myA, \"click\", function (e)\r\n {\r\n for (var i = 0; i < theMins.length; i++)\r\n theMins [i].dispatchEvent (myEvent);\r\n\r\n var theRevMin = document.getElementsByClassName (\"ago_fleet_mostResource\");\r\n\r\n GM_log(theRevMin.length);\r\n for (var i = theRevMin.length; i >= 1; i--)\r\n theRevMin [i - 1].dispatchEvent (myEvent);\r\n });\r\n\r\n theA = theDiv.getElementsByTagName('a');\r\n insertAfter( theA[theA.length-1], myA);\r\n }\r\n\r\n // Add a \"load resources in reverse order\" button\r\n myA = document.createElement (\"a\");\r\n myA.setAttribute (\"href\", \"javascript:void(0);\");\r\n myA.setAttribute ('id', 'reverseResources');\r\n myA.setAttribute('title', LANG.MISC.txt_recInversos);\r\n\r\n addEvent (myA, \"click\", function (e)\r\n {\r\n for (var i = 0; i < theMins.length; i++)\r\n theMins [i].dispatchEvent (myEvent);\r\n\r\n var theMaxes = document.getElementsByClassName (\"max\");\r\n\r\n for (var i = theMaxes.length; i >= 1 ; i--)\r\n theMaxes [i - 1].dispatchEvent (myEvent);\r\n });\r\n\r\n myImg = document.createElement (\"img\");\r\n myImg.setAttribute (\"src\", ICON_REVERSE_OFF);\r\n myImg.setAttribute ('rel', ICON_REVERSE_ON);\r\n myImg.setAttribute ('class', 'lpunktkit-micon');\r\n myA.appendChild (myImg);\r\n\r\n theA = theDiv.getElementsByTagName('a');\r\n insertAfter( theA[theA.length-1], myA);\r\n\r\n/* theDiv.getElementsByTagName('a');\r\n insertAfter( theA[theA.length-1], document.createElement('br'));*/\r\n insertAfter( myA, document.createElement('br'));\r\n\r\n } catch(e) {\r\n if (DEBUG_MODE != 0) GM_log('ResourceLoadButtons [ERROR]: <' + e + '> ' + strPaginaActual);\r\n }\r\n}", "title": "" }, { "docid": "15352adb602e0d6257ca76a69d65e689", "score": "0.5259648", "text": "function addHttpsToImage(img)\n{\n var src = img.attr(\"src\");\n if (src.indexOf(\"//\") === 0)\n {\n src = \"https:\" + src;\n }\n img.attr(\"src\", src);\n}", "title": "" }, { "docid": "5b34634ab338d5f5b19c9b7ce6d0bf6e", "score": "0.525278", "text": "load(url) {\n\t\tthis.props.loadUrl(url);\n\t}", "title": "" }, { "docid": "cca15382de24880db3802faa9e65577c", "score": "0.5249661", "text": "function loadImg( response, path) {\n\tconsole.log( \"Request received for image content within path: \" + __dirname + \"/../Client\" + path );\n\t\n\tfs.readFile( __dirname + \"/../Client\" + path, function(err, data ) {\n\t\tif( err )\n\t\t\tthrow err;\n\t\telse {\n\t\t\tresponse.writeHead( 200, {\"content-type\" : \"image/gif\"} );\n\t\t\tresponse.end( data, \"binary\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2d2dd7713b8d2f665413eaf98f8f4cfb", "score": "0.52483016", "text": "function addHttpsToImage(img)\n{\n var src = img.attr(\"src\");\n if (src.indexOf(\"//\") == 0)\n {\n src = \"https:\" + src;\n }\n img.attr(\"src\", src);\n}", "title": "" }, { "docid": "bdc451ef55d9d6d254c90ad6bd57ddf2", "score": "0.5244564", "text": "function addIcon(figureURL) {\n return L.icon({\n iconUrl: figureURL,\n iconSize: [30, 30],\n iconAnchor: [15,15],\n popupAnchor: [0, -15]\n });\n}", "title": "" }, { "docid": "c2e8b86b7cea37c50e86f020abe6e672", "score": "0.5242091", "text": "function createImage(url){\n\tvar GiphyAJAXCall = new XMLHttpRequest();\n\tGiphyAJAXCall.open( 'GET', url );\n\tGiphyAJAXCall.send();\n\n\tGiphyAJAXCall.addEventListener('load', function( e ) {\n\t\tvar data = e.target.response; /* From the load function you want to drill down the contentyou want to grab, in this case the GIFS*/\n\t\t\n\t\tpushToDOM(data);\n\n\n});\n}", "title": "" }, { "docid": "3038b2afee22a2cbc0cb25ac6426aceb", "score": "0.52395535", "text": "getIcon(state) {\n let img = \"\";\n\n if(state == \"live\") {\n img = 'src/img/marker-1.svg';\n }\n if(state == \"old\") {\n img = 'src/img/marker-2.svg';\n }\n if(state == \"new\") {\n img = 'src/img/marker-3.svg';\n }\n\n let icon = {\n url: img,\n size: new google.maps.Size(50, 50),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(25, 25)\n };\n\n return icon;\n }", "title": "" }, { "docid": "6fbb4b7055fcb23fe9b5dc108dd6c77c", "score": "0.52288777", "text": "getResource(url) {\n return this.apiGet(this.stripDomain(url));\n }", "title": "" }, { "docid": "6c9ec4e46d91001a06e2049f47444faa", "score": "0.52156085", "text": "function iapiGet(windowname, url) {\n var win = document.getElementById(windowname);\n if (win) {\n win.src = encodeURL(url);\n }\n}", "title": "" }, { "docid": "7b84f208547d5eed1d0a2fd57e4f3b32", "score": "0.52148306", "text": "_load(url) {\n if (this.cache[url]) {\n return this.cache[url];\n } else {\n let img = new Image();\n img.src = url;\n img.onload = () => {\n this.cache[url] = img;\n if (this.allImagesAreLoaded()) {\n this.callbacks.forEach(callback => callback());\n }\n };\n\n // Set the initial cache value to false, this will change when\n // the image's onload event handler is called.\n // This value is used in #allImagesAreLoaded() method.\n this.cache[url] = false;\n }\n }", "title": "" }, { "docid": "aa2c0a7fd77b8f1b03da20c8ceb0bb70", "score": "0.5213431", "text": "get icon() {\n return get(this.data, \"icon\", \"\");\n }", "title": "" }, { "docid": "9acd335df4e07cad527ccae3ee1a4452", "score": "0.51951677", "text": "function loadBlob(url, callback)\n{\n sendRPC(\"GET\", url, \"\", callback);\n}", "title": "" }, { "docid": "ed24c450181023d2a9dd312d8767df78", "score": "0.51912236", "text": "static loadImage( url ) {\n return new Promise( (resolve, reject) => {\n const img = new Image();\n img.src = url;\n img.onload = () => resolve( url );\n img.onerror = (err) => reject(err);\n });\n }", "title": "" }, { "docid": "29c726f06ce44f958f3184f57b65ecf6", "score": "0.51906", "text": "getIcon(num) {\n let icon = this.data.list[num].weather[0].icon;\n return icon;\n }", "title": "" }, { "docid": "80b537afe4b5f810233a95df10bacbd7", "score": "0.5189406", "text": "function images()\r\n{\r\n\timgLookup = createElement('img',{border:0});\r\n\timgLookup.src = 'data:image/gif,GIF89a%12%00%12%00%B3%00%00%FF%FF%FF%F7%F7%EF%CC%CC%CC%BD%BE%BD%99%99%99ZYZRUR%00%00%00%FE%01%02%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%04%14%00%FF%00%2C%00%00%00%00%12%00%12%00%00%04X0%C8I%2B%1D8%EB%3D%E4%00%60(%8A%85%17%0AG*%8C%40%19%7C%00J%08%C4%B1%92%26z%C76%FE%02%07%C2%89v%F0%7Dz%C3b%C8u%14%82V5%23o%A7%13%19L%BCY-%25%7D%A6l%DF%D0%F5%C7%02%85%5B%D82%90%CBT%87%D8i7%88Y%A8%DB%EFx%8B%DE%12%01%00%3B';\r\n}", "title": "" }, { "docid": "ba352235b82a58a634446b1d12090b1f", "score": "0.5165072", "text": "function _load(url) {\n if(resourceCache[url]) {\n\n //return previously loaded image from resourseCache array.\n return resourceCache[url];\n }\n\n else {\n\n //if an image is not in the resourseCache array load image.\n var img = new Image();\n img.onload = function() {\n\n //cache the properly loaded image\n resourceCache[url] = img;\n\n //call all of the onReady() callbacks we have defined.\n if(isReady()) {\n readyCallbacks.forEach(function(func) { func(); });\n }\n };\n\n //Set the initial cache value to false.\n //point the images src attribute to the passed-in URL.\n resourceCache[url] = false;\n img.src = url;\n }\n }", "title": "" }, { "docid": "307334bb5615e5fa7e8659855cd612df", "score": "0.5164076", "text": "static load( path ) {\n\n\t\tlet i = new Image();\n\t\ti.src = 'images/'+path;\n\t\t\n\t\treturn i;\n\t}", "title": "" }, { "docid": "ce4a970b9eef7e592d219961b5fbbe81", "score": "0.51616627", "text": "getHeaderIconSRC() {}", "title": "" }, { "docid": "31590a49577b19a85f3d1422818b4cbb", "score": "0.5160488", "text": "function show5cities(){\r\n var yourApiKey = \"yourApiKey\";\r\n\r\n var cities = ['barcelona', 'new york', 'salerno', 'tokyo', 'sydney'];\r\n\r\n var citiesLength = cities.length;\r\n\r\n for (let index = 0; index < citiesLength; index++) {\r\n \r\n const element = cities[index];\r\n\r\n var apiCall = \"http://api.openweathermap.org/data/2.5/weather?q=\" + element +\"&appid=\" + yourApiKey;\r\n\r\n fetch(apiCall)\r\n\r\n .then(function(resp) { return resp.json() })\r\n\r\n .then( function(data){\r\n\r\n var icon = data.weather[0].icon;\r\n console.log(icon)\r\n\r\n document.getElementById(\"icon\" + index).src= \"http://openweathermap.org/img/wn/\"+ icon + \".png\";\r\n })\r\n }\r\n}", "title": "" }, { "docid": "b567c41946380ec11b867817916d76b6", "score": "0.51583076", "text": "function over_social_icon(id, src){\n document.getElementById(id).src = \"/img/\"+src;\n}", "title": "" }, { "docid": "d490e1a4f65d422bcb5e68496f502c54", "score": "0.515795", "text": "function changeIcon(url) {\n let iconPath = constants.classroomRegex.test(url) ?\n 'images/icon-38.png' :\n 'images/icon-38-off.png';\n\n chrome.browserAction.setIcon({path: iconPath});\n}", "title": "" }, { "docid": "70f7cf5a86c2d0e253eb94141bc5ee5e", "score": "0.51522136", "text": "function _getIcon(opts, type){\n\treturn opts.map[type];\n}", "title": "" }, { "docid": "70f7cf5a86c2d0e253eb94141bc5ee5e", "score": "0.51522136", "text": "function _getIcon(opts, type){\n\treturn opts.map[type];\n}", "title": "" }, { "docid": "05a0ab00fb4b243f1559dd7bc62c7cf7", "score": "0.51521045", "text": "function getArtWeather(weather) {\n if (weather === 'Clear') {\n weather = 'Sun';\n }\n var xhr = new XMLHttpRequest();\n $loader.className = 'loader';\n xhr.open('GET', 'https://www.rijksmuseum.nl/api/en/collection?key=TnIr6Ed8&ps=100&imgonly=true&type=painting&q=' + weather);\n xhr.responseType = 'json';\n xhr.addEventListener('load', function () {\n generateWeatherPicture(xhr.response);\n });\n xhr.addEventListener('error', () => loadError());\n xhr.send();\n}", "title": "" }, { "docid": "5a6e4cdafcbfc22feb9f3afe3e1fc052", "score": "0.515044", "text": "getURL() { \r\n return \"../Images/\" + this.toString() + \".png\";\r\n }", "title": "" }, { "docid": "502f00fb718dcbcce8e50806b1ca4e26", "score": "0.5148314", "text": "function getRequest() {\n // Call API\n fetch(`http://api.openweathermap.org/data/2.5/weather?q=${city.value}&appid=947cf804c478eb1c791115fe97a3238e&units=metric`).then(response => {\n response.json().then(data => {\n console.log(data);\n console.log(data.weather[0].icon);\n getIcon(data.weather[0].icon);\n setData(data);\n });\n }); \n}", "title": "" }, { "docid": "3472d3b1e45886a4ca0bceab84f6ce2a", "score": "0.51460683", "text": "function load( urlOrArr )\n {\n if ( urlOrArr instanceof Array )\n {\n urlOrArr.forEach( function ( res )\n {\n loadResource( res.url, res.resType );\n } );\n }\n else\n {\n loadResource( urlOrArr );\n }\n }", "title": "" }, { "docid": "cf11f333498f48b56613f448a77a3262", "score": "0.5144314", "text": "function loadPage()\r\n{\r\n /**\r\n * Hides the icon and it's placeholder \r\n */\r\n $('.icon').hide();\r\n //load(\"Portland\");\r\n}", "title": "" }, { "docid": "ca67d9e56e35eb97d378126819deb8f8", "score": "0.5143876", "text": "function load(urlOrArr) {\n\t\t if (urlOrArr instanceof Array) {\n\t\t\t urlOrArr.forEach(function (url) {\n\t\t\t\t _load(url);\n\t\t\t });\n\t\t } else {\n\t\t\t /* If no array value passed, assume the value is a string and call the image loader directly.\n\t\t\t */\n\t\t\t _load(urlOrArr);\n\t\t }\n\t }", "title": "" }, { "docid": "cba1b02f71331f0d02d5403b8f7bfd9c", "score": "0.5139429", "text": "function loadResource( url, resType )\n {\n // Return cached resource if we already loaded it\n if ( resources[url] )\n {\n return resources[url];\n }\n // Otherwise do the load from file\n else\n {\n let res;\n\n if ( resType )\n {\n res = new resType();\n }\n else\n {\n res = new Image();\n }\n\n let loadCB = function ()\n {\n resources[url] = res;\n\n // Check all load calls to see if everything is ready\n if ( isLoaded() )\n {\n // Call all callbacks\n readyCallbacks.forEach( function ( func ) { func(); } );\n readyCallbacks = [];\n }\n };\n\n // Set state to not loaded\n resources[url] = false;\n\n if ( res instanceof HTMLAudioElement )\n {\n // Consider audio loaded when the browser thinks it's buffered enough\n res.addEventListener( \"canplaythrough\", loadCB );\n }\n else\n {\n res.onload = loadCB;\n }\n\n res.src = url;\n }\n }", "title": "" }, { "docid": "708f1370504c04fdeb5751c7beb4bc5b", "score": "0.51373017", "text": "function macksThing(){\n var xhr = $.get(\"http://api.giphy.com/v1/gifs/search?q=\" + lastText +\"&api_key=dc6zaTOxFJmzC&limit=5\");\n xhr.done(function(data) {\n var embedURL = data['data'][0].images.original.url;\n var img = new Image(); \n $('#gifAnswer').html(img); \n img.src = embedURL; \n console.log(embedURL);\n });\n}", "title": "" } ]
eca0e139954ce2681a9a51c342b27b4a
Goal of the optimizer: walk the generated template AST tree and detect subtrees that are purely static, i.e. parts of the DOM that never needs to change. Once we detect these subtrees, we can: 1. Hoist them into constants, so that we no longer need to create fresh nodes for them on each rerender; 2. Completely skip them in the patching process.
[ { "docid": "0a13378d2d8f8ca9793d161120f2bb72", "score": "0.0", "text": "function optimize(root, options) {\n if (!root) {\n return;\n }\n\n isStaticKey = genStaticKeysCached(options.staticKeys || '');\n isPlatformReservedTag = options.isReservedTag || no; // first pass: mark all non-static nodes.\n\n markStatic$1(root); // second pass: mark static roots.\n\n markStaticRoots(root, false);\n}", "title": "" } ]
[ { "docid": "5e5ee8b5205bd5b729eb3ed1f3c008d7", "score": "0.5835733", "text": "function renderStatic(index, isInFor) {\n\t var tree = this._staticTrees[index];\n\t // if has already-rendered static tree and not inside v-for,\n\t // we can reuse the same tree by doing a shallow clone.\n\t if (tree && !isInFor) {\n\t return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree);\n\t }\n\t // otherwise, render a fresh tree.\n\t tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n\t markStatic(tree, \"__static__\" + index, false);\n\t return tree;\n\t}", "title": "" }, { "docid": "ce70b591933c59cb13d47c28aa608d5d", "score": "0.58189297", "text": "function renderStatic(index, isInFor) {\n\t var cached = this._staticTrees || (this._staticTrees = []);\n\t var tree = cached[index];\n\t // if has already-rendered static tree and not inside v-for,\n\t // we can reuse the same tree.\n\t if (tree && !isInFor) {\n\t return tree;\n\t }\n\t // otherwise, render a fresh tree.\n\t tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\n\t );\n\t markStatic$1(tree, \"__static__\".concat(index), false);\n\t return tree;\n\t}", "title": "" }, { "docid": "453ae4acdf3e00529754e60a452a5bef", "score": "0.5810936", "text": "function renderStatic(index, isInFor) {\n const cached = this._staticTrees || (this._staticTrees = []);\n let tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\n );\n markStatic$1(tree, `__static__${index}`, false);\n return tree;\n}", "title": "" }, { "docid": "20d6815cf0fad4ec58ad09b703c91202", "score": "0.5801774", "text": "function renderStatic(index, isInFor) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree);\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n }", "title": "" }, { "docid": "f0ff31f251005546bc5ba80a2c4b28e6", "score": "0.57979184", "text": "function renderStatic(index,isInFor){var cached=this._staticTrees||(this._staticTrees=[]);var tree=cached[index];// if has already-rendered static tree and not inside v-for,\n// we can reuse the same tree.\nif(tree&&!isInFor){return tree;}// otherwise, render a fresh tree.\ntree=cached[index]=this.$options.staticRenderFns[index].call(this._renderProxy,null,this// for render fns generated for functional component templates\n);markStatic(tree,\"__static__\"+index,false);return tree;}", "title": "" }, { "docid": "783357a41e925dbbf8f6c2c1f542da58", "score": "0.5790648", "text": "function renderStatic(index, isInFor) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree);\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n }", "title": "" }, { "docid": "783357a41e925dbbf8f6c2c1f542da58", "score": "0.5790648", "text": "function renderStatic(index, isInFor) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree);\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n }", "title": "" }, { "docid": "47056589c7bd10c82f2f06c1838262c5", "score": "0.5780512", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n }", "title": "" }, { "docid": "6e60d15f2002157406767a34e784baa5", "score": "0.5751684", "text": "function processStaticOnly(node, state) {\n var pragmas = utils.getDocblock(state);\n if (pragmas.typechecks === 'static-only') {\n var params = getTypeHintParams(node, state);\n normalizeTypeHintParams(node, state, params);\n }\n}", "title": "" }, { "docid": "33b4a098467c910d059b1deb566c14c1", "score": "0.5735334", "text": "function renderStatic(index, isInFor) {\n var tree = this._staticTrees[index]\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy\n )\n markStatic(tree, \"__static__\" + index, false)\n return tree\n }", "title": "" }, { "docid": "2fb8ff7e3576ced39116b96da85da681", "score": "0.5735275", "text": "function optimize(root,options){if(!root)return;isStaticKey=genStaticKeysCached(options.staticKeys||'');isPlatformReservedTag=options.isReservedTag||function(){return false;};// first pass: mark all non-static nodes.\nmarkStatic(root);// second pass: mark static roots.\nmarkStaticRoots(root,false);}", "title": "" }, { "docid": "9d90172d7e0ec9ef095597f07f4cb1e2", "score": "0.5726932", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, '__static__' + index, false);\n return tree;\n}", "title": "" }, { "docid": "436fca224f5097a9987927fe9d064cce", "score": "0.5725001", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "436fca224f5097a9987927fe9d064cce", "score": "0.5725001", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "436fca224f5097a9987927fe9d064cce", "score": "0.5725001", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "436fca224f5097a9987927fe9d064cce", "score": "0.5725001", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "1474f80fcfc93eceafbe2f6ab84b95c1", "score": "0.5722336", "text": "function renderStatic (\n\t index,\n\t isInFor\n\t) {\n\t var tree = this._staticTrees[index];\n\t // if has already-rendered static tree and not inside v-for,\n\t // we can reuse the same tree by doing a shallow clone.\n\t if (tree && !isInFor) {\n\t return Array.isArray(tree)\n\t ? cloneVNodes(tree)\n\t : cloneVNode(tree)\n\t }\n\t // otherwise, render a fresh tree.\n\t tree = this._staticTrees[index] =\n\t this.$options.staticRenderFns[index].call(this._renderProxy);\n\t markStatic(tree, (\"__static__\" + index), false);\n\t return tree\n\t}", "title": "" }, { "docid": "1474f80fcfc93eceafbe2f6ab84b95c1", "score": "0.5722336", "text": "function renderStatic (\n\t index,\n\t isInFor\n\t) {\n\t var tree = this._staticTrees[index];\n\t // if has already-rendered static tree and not inside v-for,\n\t // we can reuse the same tree by doing a shallow clone.\n\t if (tree && !isInFor) {\n\t return Array.isArray(tree)\n\t ? cloneVNodes(tree)\n\t : cloneVNode(tree)\n\t }\n\t // otherwise, render a fresh tree.\n\t tree = this._staticTrees[index] =\n\t this.$options.staticRenderFns[index].call(this._renderProxy);\n\t markStatic(tree, (\"__static__\" + index), false);\n\t return tree\n\t}", "title": "" }, { "docid": "eb20a5166e5eae83bf618363c7bb5f36", "score": "0.5706975", "text": "function renderStatic(index, isInFor) {\r\n var tree = this._staticTrees[index]\r\n // if has already-rendered static tree and not inside v-for,\r\n // we can reuse the same tree by doing a shallow clone.\r\n if (tree && !isInFor) {\r\n return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree)\r\n }\r\n // otherwise, render a fresh tree.\r\n tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(\r\n this._renderProxy\r\n )\r\n markStatic(tree, \"__static__\" + index, false)\r\n return tree\r\n }", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "6a867fc00ee0080ccd03ec21883027d5", "score": "0.57045346", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "42b9ab6133c05c97243fc39fe4b30d9f", "score": "0.57007647", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\".concat(index), false);\n return tree;\n}", "title": "" }, { "docid": "42b9ab6133c05c97243fc39fe4b30d9f", "score": "0.57007647", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\".concat(index), false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "48582b7af39686c2677fd332e65ee75f", "score": "0.5688687", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index]; // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n\n if (tree && !isInFor) {\n return tree;\n } // otherwise, render a fresh tree.\n\n\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates\n );\n markStatic(tree, \"__static__\" + index, false);\n return tree;\n}", "title": "" }, { "docid": "952faa0065a11d4b280aba10daa42097", "score": "0.5687836", "text": "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree;\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\n );\n markStatic$1(tree, \"__static__\".concat(index), false);\n return tree;\n}", "title": "" }, { "docid": "21e66d2371a3bbcd8432b4a9f852f048", "score": "0.56846464", "text": "function genStatic(el, state) {\n\t el.staticProcessed = true;\n\t // Some elements (templates) need to behave differently inside of a v-pre\n\t // node. All pre nodes are static roots, so we can use this as a location to\n\t // wrap a state change and reset it upon exiting the pre node.\n\t var originalPreState = state.pre;\n\t if (el.pre) {\n\t state.pre = el.pre;\n\t }\n\t state.staticRenderFns.push(\"with(this){return \".concat(genElement(el, state), \"}\"));\n\t state.pre = originalPreState;\n\t return \"_m(\".concat(state.staticRenderFns.length - 1).concat(el.staticInFor ? ',true' : '', \")\");\n\t}", "title": "" }, { "docid": "e000ccec0540c7a0c3d17f892c7b06ed", "score": "0.5679249", "text": "function renderStatic(index, isInFor) {\r\n var cached = this._staticTrees || (this._staticTrees = []);\r\n var tree = cached[index];\r\n // if has already-rendered static tree and not inside v-for,\r\n // we can reuse the same tree.\r\n if (tree && !isInFor) {\r\n return tree;\r\n }\r\n // otherwise, render a fresh tree.\r\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\r\n );\r\n markStatic(tree, \"__static__\".concat(index), false);\r\n return tree;\r\n}", "title": "" }, { "docid": "257b1abd5b1a4685c24029f8f4d651ac", "score": "0.5677493", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "a7d3519588e7716b9b09dd2ec84a187f", "score": "0.5660321", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "26f6c5faca2a6102c2d15832f843c625", "score": "0.5651726", "text": "function genStatic(el, state) {\n el.staticProcessed = true;\n // Some elements (templates) need to behave differently inside of a v-pre\n // node. All pre nodes are static roots, so we can use this as a location to\n // wrap a state change and reset it upon exiting the pre node.\n const originalPreState = state.pre;\n if (el.pre) {\n state.pre = el.pre;\n }\n state.staticRenderFns.push(`with(this){return ${genElement(el, state)}}`);\n state.pre = originalPreState;\n return `_m(${state.staticRenderFns.length - 1}${el.staticInFor ? ',true' : ''})`;\n}", "title": "" }, { "docid": "289a7070ac21b93004ddfaa106a079a1", "score": "0.5637876", "text": "function traverseStaticChildren(n1, n2, shallow = false) {\n const ch1 = n1.children;\n const ch2 = n2.children;\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch1) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch2)) {\n for (let i = 0; i < ch1.length; i++) {\n // this is only called in the optimized path so array children are\n // guaranteed to be vnodes\n const c1 = ch1[i];\n let c2 = ch2[i];\n if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\n if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\n c2.el = c1.el;\n }\n if (!shallow)\n traverseStaticChildren(c1, c2);\n }\n // also inherit for comment nodes, but not placeholders (e.g. v-if which\n // would have received .el during block patch)\n if (( true) && c2.type === Comment && !c2.el) {\n c2.el = c1.el;\n }\n }\n }\n}", "title": "" }, { "docid": "289a7070ac21b93004ddfaa106a079a1", "score": "0.5637876", "text": "function traverseStaticChildren(n1, n2, shallow = false) {\n const ch1 = n1.children;\n const ch2 = n2.children;\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch1) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch2)) {\n for (let i = 0; i < ch1.length; i++) {\n // this is only called in the optimized path so array children are\n // guaranteed to be vnodes\n const c1 = ch1[i];\n let c2 = ch2[i];\n if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\n if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\n c2.el = c1.el;\n }\n if (!shallow)\n traverseStaticChildren(c1, c2);\n }\n // also inherit for comment nodes, but not placeholders (e.g. v-if which\n // would have received .el during block patch)\n if (( true) && c2.type === Comment && !c2.el) {\n c2.el = c1.el;\n }\n }\n }\n}", "title": "" }, { "docid": "56d98c36cfac4b9184faa2ca8772c69c", "score": "0.56330353", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "56d98c36cfac4b9184faa2ca8772c69c", "score": "0.56330353", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "56d98c36cfac4b9184faa2ca8772c69c", "score": "0.56330353", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "56d98c36cfac4b9184faa2ca8772c69c", "score": "0.56330353", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "56d98c36cfac4b9184faa2ca8772c69c", "score": "0.56330353", "text": "function renderStatic (\n index,\n isInFor\n ) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n }", "title": "" }, { "docid": "7517d8bc1433dac61f3870b5d9031b54", "score": "0.5625779", "text": "function updateStatics () {\n var currentStatic = null;\n for (var i = 0, ilength = staticsToRemove.length; i < ilength; i++) {\n currentStatic = staticsToRemove[i][0].property;\n if (config.replaceStaticsInErrors) {\n changed = true;\n staticsToRemove[i][0] = new UglifyJS.AST_String({\n value : currentStatic\n });\n }\n var j, jlength;\n if (isAriaSingleton) {\n for (j = 0, jlength = ariaStatics.length; j < jlength; j++) {\n if (ariaStatics[j].left.property == currentStatic) {\n changed = true;\n ariaStatics[j].right = new UglifyJS.AST_String({\n value : \"\"\n });\n break;\n }\n }\n } else {\n for (j = 0, jlength = statics.length; j < jlength; j++) {\n if (statics[j].key == currentStatic && statics[j].value instanceof UglifyJS.AST_String) {\n changed = true;\n statics[j].value.value = \"\";\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "02678b2db05541b6c6ca8531f0b2d3f3", "score": "0.5585653", "text": "function renderStatic (\n index,\n isInFor\n) {\n var tree = this._staticTrees[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree)\n ? cloneVNodes(tree)\n : cloneVNode(tree)\n }\n // otherwise, render a fresh tree.\n tree = this._staticTrees[index] =\n this.$options.staticRenderFns[index].call(this._renderProxy);\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "d3488178653104bd9d3260944ed07088", "score": "0.5584834", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n=======\nvar email = {\n validate: validate$d\n};\n\nvar validate$e = function (value, options) {\n if (Array.isArray(value)) {\n return value.every(function (val) { return validate$e(val, options); });\n }\n\n return toArray(options).some(function (item) {\n // eslint-disable-next-line\n return item == value;\n });\n};\n\nvar included = {\n validate: validate$e\n};\n\nvar validate$f = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return !validate$e.apply(void 0, args);\n};\n\nvar excluded = {\n validate: validate$f\n};\n\nvar validate$g = function (files, extensions) {\n var regex = new RegExp((\".(\" + (extensions.join('|')) + \")$\"), 'i');\n\n return files.every(function (file) { return regex.test(file.name); });\n};\n\nvar ext = {\n validate: validate$g\n};\n\nvar validate$h = function (files) { return files.every(function (file) { return /\\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(file.name); }); };\n\nvar image = {\n validate: validate$h\n};\n\nvar validate$i = function (value) {\n if (Array.isArray(value)) {\n return value.every(function (val) { return /^-?[0-9]+$/.test(String(val)); });\n>>>>>>> 2606621664cb76ab783da1dddc55bd575ef271ea\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}\n\n<<<<<<< HEAD\n/**\n * Runtime helper for v-once.\n * Effectively it means marking the node as static with a unique key.\n */\nfunction markOnce (\n tree,\n index,\n key\n) {\n markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n return tree\n}\n\nfunction markStatic (\n tree,\n key,\n isOnce\n) {\n if (Array.isArray(tree)) {\n for (var i = 0; i < tree.length; i++) {\n if (tree[i] && typeof tree[i] !== 'string') {\n markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n }\n }\n } else {\n markStaticNode(tree, key, isOnce);\n }\n}\n\nfunction markStaticNode (node, key, isOnce) {\n node.isStatic = true;\n node.key = key;\n node.isOnce = isOnce;\n}\n\n/* */\n\nfunction bindObjectListeners (data, value) {\n if (value) {\n if (!isPlainObject(value)) {\n warn(\n 'v-on without argument expects an Object value',\n this\n );\n } else {\n var on = data.on = data.on ? extend({}, data.on) : {};\n for (var key in value) {\n var existing = on[key];\n var ours = value[key];\n on[key] = existing ? [].concat(existing, ours) : ours;\n }\n }\n }\n return data\n}\n\n/* */\n\nfunction resolveScopedSlots (\n fns, // see flow/vnode\n hasDynamicKeys,\n res\n) {\n res = res || { $stable: !hasDynamicKeys };\n for (var i = 0; i < fns.length; i++) {\n var slot = fns[i];\n if (Array.isArray(slot)) {\n resolveScopedSlots(slot, hasDynamicKeys, res);\n } else if (slot) {\n res[slot.key] = slot.fn;\n }\n }\n return res\n}\n\n/* */\n\nfunction bindDynamicKeys (baseObj, values) {\n for (var i = 0; i < values.length; i += 2) {\n var key = values[i];\n if (typeof key === 'string' && key) {\n baseObj[values[i]] = values[i + 1];\n } else if (key !== '' && key !== null) {\n // null is a speical value for explicitly removing a binding\n warn(\n (\"Invalid value for dynamic directive argument (expected string or null): \" + key),\n this\n );\n }\n }\n return baseObj\n}\n\n// helper to dynamically append modifier runtime markers to event names.\n// ensure only append when value is already string, otherwise it will be cast\n// to string and cause the type check to miss.\nfunction prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}\n\n/* */\n\nfunction installRenderHelpers (target) {\n target._o = markOnce;\n target._n = toNumber;\n target._s = toString;\n target._l = renderList;\n target._t = renderSlot;\n target._q = looseEqual;\n target._i = looseIndexOf;\n target._m = renderStatic;\n target._f = resolveFilter;\n target._k = checkKeyCodes;\n target._b = bindObjectProps;\n target._v = createTextVNode;\n target._e = createEmptyVNode;\n target._u = resolveScopedSlots;\n target._g = bindObjectListeners;\n target._d = bindDynamicKeys;\n target._p = prependModifier;\n}\n\n/* */\n\nfunction FunctionalRenderContext (\n data,\n props,\n children,\n parent,\n Ctor\n) {\n var options = Ctor.options;\n // ensure the createElement function in functional components\n // gets a unique context - this is necessary for correct named slot check\n var contextVm;\n if (hasOwn(parent, '_uid')) {\n contextVm = Object.create(parent);\n // $flow-disable-line\n contextVm._original = parent;\n } else {\n // the context vm passed in is a functional context as well.\n // in this case we want to make sure we are able to get a hold to the\n // real context instance.\n contextVm = parent;\n // $flow-disable-line\n parent = parent._original;\n }\n var isCompiled = isTrue(options._compiled);\n var needNormalization = !isCompiled;\n\n this.data = data;\n this.props = props;\n this.children = children;\n this.parent = parent;\n this.listeners = data.on || emptyObject;\n this.injections = resolveInject(options.inject, parent);\n this.slots = function () { return resolveSlots(children, parent); };\n\n Object.defineProperty(this, 'scopedSlots', ({\n enumerable: true,\n get: function get () {\n return normalizeScopedSlots(data.scopedSlots, this.slots())\n }\n }));\n\n // support for compiled functional template\n if (isCompiled) {\n // exposing $options for renderStatic()\n this.$options = options;\n // pre-resolve slots for renderSlot()\n this.$slots = this.slots();\n this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);\n }\n\n if (options._scopeId) {\n this._c = function (a, b, c, d) {\n var vnode = createElement(contextVm, a, b, c, d, needNormalization);\n if (vnode && !Array.isArray(vnode)) {\n vnode.fnScopeId = options._scopeId;\n vnode.fnContext = parent;\n }\n return vnode\n };\n } else {\n this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };\n }\n}\n\ninstallRenderHelpers(FunctionalRenderContext.prototype);\n\nfunction createFunctionalComponent (\n Ctor,\n propsData,\n data,\n contextVm,\n children\n) {\n var options = Ctor.options;\n var props = {};\n var propOptions = options.props;\n if (isDef(propOptions)) {\n for (var key in propOptions) {\n props[key] = validateProp(key, propOptions, propsData || emptyObject);\n }\n } else {\n if (isDef(data.attrs)) { mergeProps(props, data.attrs); }\n if (isDef(data.props)) { mergeProps(props, data.props); }\n }\n\n var renderContext = new FunctionalRenderContext(\n data,\n props,\n children,\n contextVm,\n Ctor\n );\n\n var vnode = options.render.call(null, renderContext._c, renderContext);\n\n if (vnode instanceof VNode) {\n return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)\n } else if (Array.isArray(vnode)) {\n var vnodes = normalizeChildren(vnode) || [];\n var res = new Array(vnodes.length);\n for (var i = 0; i < vnodes.length; i++) {\n res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);\n }\n return res\n }\n}\n\nfunction cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {\n // #7817 clone node before setting fnContext, otherwise if the node is reused\n // (e.g. it was from a cached normal slot) the fnContext causes named slots\n // that should not be matched to match.\n var clone = cloneVNode(vnode);\n clone.fnContext = contextVm;\n clone.fnOptions = options;\n {\n (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;\n }\n if (data.slot) {\n (clone.data || (clone.data = {})).slot = data.slot;\n }\n return clone\n}\n\nfunction mergeProps (to, from) {\n for (var key in from) {\n to[camelize(key)] = from[key];\n }\n}\n\n/* */\n\n/* */\n\n/* */\n\n/* */\n\n// inline hooks to be invoked on component VNodes during patch\nvar componentVNodeHooks = {\n init: function init (vnode, hydrating) {\n if (\n vnode.componentInstance &&\n !vnode.componentInstance._isDestroyed &&\n vnode.data.keepAlive\n ) {\n // kept-alive components, treat as a patch\n var mountedNode = vnode; // work around flow\n componentVNodeHooks.prepatch(mountedNode, mountedNode);\n } else {\n var child = vnode.componentInstance = createComponentInstanceForVnode(\n vnode,\n activeInstance\n );\n child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n }\n },\n\n prepatch: function prepatch (oldVnode, vnode) {\n var options = vnode.componentOptions;\n var child = vnode.componentInstance = oldVnode.componentInstance;\n updateChildComponent(\n child,\n options.propsData, // updated props\n options.listeners, // updated listeners\n vnode, // new parent vnode\n options.children // new children\n );\n },\n\n insert: function insert (vnode) {\n var context = vnode.context;\n var componentInstance = vnode.componentInstance;\n if (!componentInstance._isMounted) {\n componentInstance._isMounted = true;\n callHook(componentInstance, 'mounted');\n }\n if (vnode.data.keepAlive) {\n if (context._isMounted) {\n // vue-router#1212\n // During updates, a kept-alive component's child components may\n // change, so directly walking the tree here may call activated hooks\n // on incorrect children. Instead we push them into a queue which will\n // be processed after the whole patch process ended.\n queueActivatedComponent(componentInstance);\n } else {\n activateChildComponent(componentInstance, true /* direct */);\n }\n }\n },\n\n destroy: function destroy (vnode) {\n var componentInstance = vnode.componentInstance;\n if (!componentInstance._isDestroyed) {\n if (!vnode.data.keepAlive) {\n componentInstance.$destroy();\n } else {\n deactivateChildComponent(componentInstance, true /* direct */);\n }\n }\n }\n};\n\nvar hooksToMerge = Object.keys(componentVNodeHooks);\n\nfunction createComponent (\n Ctor,\n data,\n context,\n children,\n tag\n) {\n if (isUndef(Ctor)) {\n return\n }\n\n var baseCtor = context.$options._base;\n\n // plain options object: turn it into a constructor\n if (isObject(Ctor)) {\n Ctor = baseCtor.extend(Ctor);\n }\n\n // if at this stage it's not a constructor or an async component factory,\n // reject.\n if (typeof Ctor !== 'function') {\n {\n warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n }\n return\n }\n\n // async component\n var asyncFactory;\n if (isUndef(Ctor.cid)) {\n asyncFactory = Ctor;\n Ctor = resolveAsyncComponent(asyncFactory, baseCtor);\n if (Ctor === undefined) {\n // return a placeholder node for async component, which is rendered\n // as a comment node but preserves all the raw information for the node.\n // the information will be used for async server-rendering and hydration.\n return createAsyncPlaceholder(\n asyncFactory,\n data,\n context,\n children,\n tag\n )\n }\n }\n\n data = data || {};\n\n // resolve constructor options in case global mixins are applied after\n // component constructor creation\n resolveConstructorOptions(Ctor);\n\n // transform component v-model data into props & events\n if (isDef(data.model)) {\n transformModel(Ctor.options, data);\n }\n\n // extract props\n var propsData = extractPropsFromVNodeData(data, Ctor, tag);\n\n // functional component\n if (isTrue(Ctor.options.functional)) {\n return createFunctionalComponent(Ctor, propsData, data, context, children)\n }\n\n // extract listeners, since these needs to be treated as\n // child component listeners instead of DOM listeners\n var listeners = data.on;\n // replace with listeners with .native modifier\n // so it gets processed during parent component patch.\n data.on = data.nativeOn;\n\n if (isTrue(Ctor.options.abstract)) {\n // abstract components do not keep anything\n // other than props & listeners & slot\n\n // work around flow\n var slot = data.slot;\n data = {};\n if (slot) {\n data.slot = slot;\n }\n }\n\n // install component management hooks onto the placeholder node\n installComponentHooks(data);\n\n // return a placeholder vnode\n var name = Ctor.options.name || tag;\n var vnode = new VNode(\n (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n data, undefined, undefined, undefined, context,\n { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },\n asyncFactory\n );\n\n return vnode\n}\n\nfunction createComponentInstanceForVnode (\n vnode, // we know it's MountedComponentVNode but flow doesn't\n parent // activeInstance in lifecycle state\n) {\n var options = {\n _isComponent: true,\n _parentVnode: vnode,\n parent: parent\n };\n // check inline-template render functions\n var inlineTemplate = vnode.data.inlineTemplate;\n if (isDef(inlineTemplate)) {\n options.render = inlineTemplate.render;\n options.staticRenderFns = inlineTemplate.staticRenderFns;\n }\n return new vnode.componentOptions.Ctor(options)\n}\n\nfunction installComponentHooks (data) {\n var hooks = data.hook || (data.hook = {});\n for (var i = 0; i < hooksToMerge.length; i++) {\n var key = hooksToMerge[i];\n var existing = hooks[key];\n var toMerge = componentVNodeHooks[key];\n if (existing !== toMerge && !(existing && existing._merged)) {\n hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;\n }\n }\n}\n\nfunction mergeHook$1 (f1, f2) {\n var merged = function (a, b) {\n // flow complains about extra args which is why we use any\n f1(a, b);\n f2(a, b);\n };\n merged._merged = true;\n return merged\n}\n\n// transform component v-model info (value and callback) into\n// prop and event handler respectively.\nfunction transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input'\n ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n var existing = on[event];\n var callback = data.model.callback;\n if (isDef(existing)) {\n if (\n Array.isArray(existing)\n ? existing.indexOf(callback) === -1\n : existing !== callback\n ) {\n on[event] = [callback].concat(existing);\n }\n } else {\n on[event] = callback;\n }\n}\n\n/* */\n\nvar SIMPLE_NORMALIZE = 1;\nvar ALWAYS_NORMALIZE = 2;\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nfunction createElement (\n context,\n tag,\n data,\n children,\n normalizationType,\n alwaysNormalize\n) {\n if (Array.isArray(data) || isPrimitive(data)) {\n normalizationType = children;\n children = data;\n data = undefined;\n }\n if (isTrue(alwaysNormalize)) {\n normalizationType = ALWAYS_NORMALIZE;\n }\n return _createElement(context, tag, data, children, normalizationType)\n}\n\nfunction _createElement (\n context,\n tag,\n data,\n children,\n normalizationType\n) {\n if (isDef(data) && isDef((data).__ob__)) {\n warn(\n \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n 'Always create fresh vnode data objects in each render!',\n context\n );\n return createEmptyVNode()\n }\n // object syntax in v-bind\n if (isDef(data) && isDef(data.is)) {\n tag = data.is;\n }\n if (!tag) {\n // in case of component :is set to falsy value\n return createEmptyVNode()\n }\n // warn against non-primitive key\n if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)\n ) {\n {\n warn(\n 'Avoid using non-primitive value as key, ' +\n 'use string/number value instead.',\n context\n );\n }\n }\n // support single function children as default scoped slot\n if (Array.isArray(children) &&\n typeof children[0] === 'function'\n ) {\n data = data || {};\n data.scopedSlots = { default: children[0] };\n children.length = 0;\n }\n if (normalizationType === ALWAYS_NORMALIZE) {\n children = normalizeChildren(children);\n } else if (normalizationType === SIMPLE_NORMALIZE) {\n children = simpleNormalizeChildren(children);\n }\n var vnode, ns;\n if (typeof tag === 'string') {\n var Ctor;\n ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);\n if (config.isReservedTag(tag)) {\n // platform built-in elements\n vnode = new VNode(\n config.parsePlatformTagName(tag), data, children,\n undefined, undefined, context\n );\n } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {\n // component\n vnode = createComponent(Ctor, data, context, children, tag);\n } else {\n // unknown or unlisted namespaced elements\n // check at runtime because it may get assigned a namespace when its\n // parent normalizes children\n vnode = new VNode(\n tag, data, children,\n undefined, undefined, context\n );\n }\n } else {\n // direct component options / constructor\n vnode = createComponent(tag, data, context, children);\n }\n if (Array.isArray(vnode)) {\n return vnode\n } else if (isDef(vnode)) {\n if (isDef(ns)) { applyNS(vnode, ns); }\n if (isDef(data)) { registerDeepBindings(data); }\n return vnode\n } else {\n return createEmptyVNode()\n }\n}\n\nfunction applyNS (vnode, ns, force) {\n vnode.ns = ns;\n if (vnode.tag === 'foreignObject') {\n // use default namespace inside foreignObject\n ns = undefined;\n force = true;\n }\n if (isDef(vnode.children)) {\n for (var i = 0, l = vnode.children.length; i < l; i++) {\n var child = vnode.children[i];\n if (isDef(child.tag) && (\n isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {\n applyNS(child, ns, force);\n }\n }\n }\n}\n\n// ref #5318\n// necessary to ensure parent re-render when deep bindings like :style and\n// :class are used on slot nodes\nfunction registerDeepBindings (data) {\n if (isObject(data.style)) {\n traverse(data.style);\n }\n if (isObject(data.class)) {\n traverse(data.class);\n }\n}\n\n/* */\n\nfunction initRender (vm) {\n vm._vnode = null; // the root of the child tree\n vm._staticTrees = null; // v-once cached trees\n var options = vm.$options;\n var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree\n var renderContext = parentVnode && parentVnode.context;\n vm.$slots = resolveSlots(options._renderChildren, renderContext);\n vm.$scopedSlots = emptyObject;\n // bind the createElement fn to this instance\n // so that we get proper render context inside it.\n // args order: tag, data, children, normalizationType, alwaysNormalize\n // internal version is used by render functions compiled from templates\n vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };\n // normalization is always applied for the public version, used in\n // user-written render functions.\n vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };\n\n // $attrs & $listeners are exposed for easier HOC creation.\n // they need to be reactive so that HOCs using them are always updated\n var parentData = parentVnode && parentVnode.data;\n\n /* istanbul ignore else */\n {\n defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {\n !isUpdatingChildComponent && warn(\"$attrs is readonly.\", vm);\n }, true);\n defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {\n !isUpdatingChildComponent && warn(\"$listeners is readonly.\", vm);\n }, true);\n }\n}\n\nvar currentRenderingInstance = null;\n\nfunction renderMixin (Vue) {\n // install runtime convenience helpers\n installRenderHelpers(Vue.prototype);\n=======\n return /^-?[0-9]+$/.test(String(value));\n};\n\nvar integer = {\n validate: validate$i\n};\n\nvar validate$j = function (value, ref) {\n if ( ref === void 0 ) ref = {};\n var version = ref.version; if ( version === void 0 ) version = 4;\n\n if (isNullOrUndefined(value)) {\n value = '';\n }\n\n if (Array.isArray(value)) {\n return value.every(function (val) { return isIP(val, version); });\n }\n\n return isIP(value, version);\n};\n\nvar paramNames$b = ['version'];\n\nvar ip = {\n validate: validate$j,\n paramNames: paramNames$b\n};\n\nvar validate$k = function (value, ref) {\n if ( ref === void 0 ) ref = [];\n var other = ref[0];\n\n return value === other;\n};\n\nvar is = {\n validate: validate$k\n};\n\nvar validate$l = function (value, ref) {\n if ( ref === void 0 ) ref = [];\n var other = ref[0];\n\n return value !== other;\n};\n\nvar is_not = {\n validate: validate$l\n};\n\n/**\n * @param {Array|String} value\n * @param {Number} length\n * @param {Number} max\n */\nvar compare = function (value, length, max) {\n if (max === undefined) {\n return value.length === length;\n }\n\n // cast to number.\n max = Number(max);\n\n return value.length >= length && value.length <= max;\n};\n\nvar validate$m = function (value, ref) {\n var length = ref[0];\n var max = ref[1]; if ( max === void 0 ) max = undefined;\n\n length = Number(length);\n if (value === undefined || value === null) {\n return false;\n }\n\n if (typeof value === 'number') {\n value = String(value);\n }\n\n if (!value.length) {\n value = toArray(value);\n }\n\n return compare(value, length, max);\n};\n\nvar length = {\n validate: validate$m\n};\n\nvar validate$n = function (value, ref) {\n var length = ref[0];\n\n if (value === undefined || value === null) {\n return length >= 0;\n }\n\n if (Array.isArray(value)) {\n return value.every(function (val) { return validate$n(val, [length]); });\n }\n\n return String(value).length <= length;\n};\n\nvar max$1 = {\n validate: validate$n\n};\n\nvar validate$o = function (value, ref) {\n var max = ref[0];\n\n if (value === null || value === undefined || value === '') {\n return false;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0 && value.every(function (val) { return validate$o(val, [max]); });\n }\n\n return Number(value) <= max;\n};\n\nvar max_value = {\n validate: validate$o\n};\n\nvar validate$p = function (files, mimes) {\n var regex = new RegExp(((mimes.join('|').replace('*', '.+')) + \"$\"), 'i');\n\n return files.every(function (file) { return regex.test(file.type); });\n};\n\nvar mimes = {\n validate: validate$p\n};\n\nvar validate$q = function (value, ref) {\n var length = ref[0];\n\n if (value === undefined || value === null) {\n return false;\n }\n\n if (Array.isArray(value)) {\n return value.every(function (val) { return validate$q(val, [length]); });\n }\n\n return String(value).length >= length;\n};\n\nvar min$1 = {\n validate: validate$q\n};\n\nvar validate$r = function (value, ref) {\n var min = ref[0];\n\n if (value === null || value === undefined || value === '') {\n return false;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0 && value.every(function (val) { return validate$r(val, [min]); });\n }\n\n return Number(value) >= min;\n};\n\nvar min_value = {\n validate: validate$r\n};\n\nvar validate$s = function (value) {\n if (Array.isArray(value)) {\n return value.every(function (val) { return /^[0-9]+$/.test(String(val)); });\n }\n\n return /^[0-9]+$/.test(String(value));\n};\n\nvar numeric = {\n validate: validate$s\n};\n\nvar validate$t = function (value, ref) {\n var expression = ref.expression;\n\n if (typeof expression === 'string') {\n expression = new RegExp(expression);\n }\n\n if (Array.isArray(value)) {\n return value.every(function (val) { return validate$t(val, { expression: expression }); });\n }\n\n return expression.test(String(value));\n};\n\nvar paramNames$c = ['expression'];\n\nvar regex = {\n validate: validate$t,\n paramNames: paramNames$c\n};\n\nvar validate$u = function (value, ref) {\n if ( ref === void 0 ) ref = [];\n var invalidateFalse = ref[0]; if ( invalidateFalse === void 0 ) invalidateFalse = false;\n\n if (isEmptyArray(value)) {\n return false;\n }\n\n // incase a field considers `false` as an empty value like checkboxes.\n if (value === false && invalidateFalse) {\n return false;\n }\n\n if (value === undefined || value === null) {\n return false;\n }\n\n return !!String(value).trim().length;\n};\n\nvar required = {\n validate: validate$u\n};\n\nvar validate$v = function (value, ref) {\n if ( ref === void 0 ) ref = [];\n var otherFieldVal = ref[0];\n var possibleVals = ref.slice(1);\n\n var required = possibleVals.includes(String(otherFieldVal).trim());\n\n if (!required) {\n return {\n valid: true,\n data: {\n required: required\n }\n };\n }\n\n var invalid = (isEmptyArray(value) || [false, null, undefined].includes(value));\n\n invalid = invalid || !String(value).trim().length;\n\n return {\n valid: !invalid,\n data: {\n required: required\n }\n };\n};\n\nvar options$5 = {\n hasTarget: true,\n computesRequired: true\n};\n\nvar required_if = {\n validate: validate$v,\n options: options$5\n};\n\nvar validate$w = function (files, ref) {\n var size = ref[0];\n\n if (isNaN(size)) {\n return false;\n }\n\n var nSize = Number(size) * 1024;\n for (var i = 0; i < files.length; i++) {\n if (files[i].size > nSize) {\n return false;\n }\n }\n\n return true;\n};\n\nvar size = {\n validate: validate$w\n};\n\nvar isURL_1 = createCommonjsModule(function (module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isURL;\n\n\n\nvar _assertString2 = _interopRequireDefault(assertString_1);\n\n\n\nvar _isFQDN2 = _interopRequireDefault(isFQDN_1);\n\n\n\nvar _isIP2 = _interopRequireDefault(isIP_1);\n\n\n\nvar _merge2 = _interopRequireDefault(merge_1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar default_url_options = {\n protocols: ['http', 'https', 'ftp'],\n require_tld: true,\n require_protocol: false,\n require_host: true,\n require_valid_protocol: true,\n allow_underscores: false,\n allow_trailing_dot: false,\n allow_protocol_relative_urls: false\n};\n\nvar wrapped_ipv6 = /^\\[([^\\]]+)\\](?::([0-9]+))?$/;\n\nfunction isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\n\nfunction checkHost(host, matches) {\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i];\n if (host === match || isRegExp(match) && match.test(host)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isURL(url, options) {\n (0, _assertString2.default)(url);\n if (!url || url.length >= 2083 || /[\\s<>]/.test(url)) {\n return false;\n }\n if (url.indexOf('mailto:') === 0) {\n return false;\n }\n options = (0, _merge2.default)(options, default_url_options);\n var protocol = void 0,\n auth = void 0,\n host = void 0,\n hostname = void 0,\n port = void 0,\n port_str = void 0,\n split = void 0,\n ipv6 = void 0;\n\n split = url.split('#');\n url = split.shift();\n\n split = url.split('?');\n url = split.shift();\n\n split = url.split('://');\n if (split.length > 1) {\n protocol = split.shift().toLowerCase();\n if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {\n return false;\n }\n } else if (options.require_protocol) {\n return false;\n } else if (url.substr(0, 2) === '//') {\n if (!options.allow_protocol_relative_urls) {\n return false;\n }\n split[0] = url.substr(2);\n }\n url = split.join('://');\n\n if (url === '') {\n return false;\n }\n\n split = url.split('/');\n url = split.shift();\n\n if (url === '' && !options.require_host) {\n return true;\n }\n\n split = url.split('@');\n if (split.length > 1) {\n auth = split.shift();\n if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {\n return false;\n }\n }\n hostname = split.join('@');\n\n port_str = null;\n ipv6 = null;\n var ipv6_match = hostname.match(wrapped_ipv6);\n if (ipv6_match) {\n host = '';\n ipv6 = ipv6_match[1];\n port_str = ipv6_match[2] || null;\n } else {\n split = hostname.split(':');\n host = split.shift();\n if (split.length) {\n port_str = split.join(':');\n }\n }\n\n if (port_str !== null) {\n port = parseInt(port_str, 10);\n if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {\n return false;\n }\n }\n\n if (!(0, _isIP2.default)(host) && !(0, _isFQDN2.default)(host, options) && (!ipv6 || !(0, _isIP2.default)(ipv6, 6))) {\n return false;\n }\n\n host = host || ipv6;\n\n if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {\n return false;\n }\n if (options.host_blacklist && checkHost(host, options.host_blacklist)) {\n return false;\n }\n\n return true;\n}\nmodule.exports = exports['default'];\n});\n\nvar isURL = unwrapExports(isURL_1);\n\nvar validate$x = function (value, options) {\n if ( options === void 0 ) options = {};\n\n if (isNullOrUndefined(value)) {\n value = '';\n }\n\n if (Array.isArray(value)) {\n return value.every(function (val) { return isURL(val, options); });\n }\n\n return isURL(value, options);\n};\n\nvar url = {\n validate: validate$x\n};\n\n/* eslint-disable camelcase */\n\nvar Rules = /*#__PURE__*/Object.freeze({\n after: after,\n alpha_dash: alpha_dash,\n alpha_num: alpha_num,\n alpha_spaces: alpha_spaces,\n alpha: alpha$1,\n before: before,\n between: between,\n confirmed: confirmed,\n credit_card: credit_card,\n date_between: date_between,\n date_format: date_format,\n decimal: decimal,\n digits: digits,\n dimensions: dimensions,\n email: email,\n ext: ext,\n image: image,\n included: included,\n integer: integer,\n length: length,\n ip: ip,\n is_not: is_not,\n is: is,\n max: max$1,\n max_value: max_value,\n mimes: mimes,\n min: min$1,\n min_value: min_value,\n excluded: excluded,\n numeric: numeric,\n regex: regex,\n required: required,\n required_if: required_if,\n size: size,\n url: url\n});\n\nvar version = '2.1.7';\n\nObject.keys(Rules).forEach(function (rule) {\n Validator.extend(rule, Rules[rule].validate, assign({}, Rules[rule].options, { paramNames: Rules[rule].paramNames }));\n});\n\n// Merge the english messages.\nValidator.localize({ en: locale });\n\nvar install = VeeValidate$1.install;\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (VeeValidate$1);\n\n>>>>>>> 2606621664cb76ab783da1dddc55bd575ef271ea\n\n Vue.prototype.$nextTick = function (fn) {\n return nextTick(fn, this)\n };\n\n<<<<<<< HEAD\n Vue.prototype._render = function () {\n var vm = this;\n var ref = vm.$options;\n var render = ref.render;\n var _parentVnode = ref._parentVnode;\n=======\n/***/ }),\n/* 287 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n>>>>>>> 2606621664cb76ab783da1dddc55bd575ef271ea\n\n if (_parentVnode) {\n vm.$scopedSlots = normalizeScopedSlots(\n _parentVnode.data.scopedSlots,\n vm.$slots\n );\n }\n\n // set parent vnode. this allows render functions to have access\n // to the data on the placeholder node.\n vm.$vnode = _parentVnode;\n // render self\n var vnode;\n try {\n // There's no need to maintain a stack becaues all render fns are called\n // separately from one another. Nested component's render fns are called\n // when parent component is patched.\n currentRenderingInstance = vm;\n vnode = render.call(vm._renderProxy, vm.$createElement);\n } catch (e) {\n handleError(e, vm, \"render\");\n // return error render result,\n // or previous vnode to prevent render error causing blank component\n /* istanbul ignore else */\n if (vm.$options.renderError) {\n try {\n vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);\n } catch (e) {\n handleError(e, vm, \"renderError\");\n vnode = vm._vnode;\n }\n } else {\n vnode = vm._vnode;\n }\n } finally {\n currentRenderingInstance = null;\n }\n // if the returned array contains only a single node, allow it\n if (Array.isArray(vnode) && vnode.length === 1) {\n vnode = vnode[0];\n }\n // return empty vnode in case the render function errored out\n if (!(vnode instanceof VNode)) {\n if (Array.isArray(vnode)) {\n warn(\n 'Multiple root nodes returned from render function. Render function ' +\n 'should return a single root node.',\n vm\n );\n }\n vnode = createEmptyVNode();\n }\n // set parent\n vnode.parent = _parentVnode;\n return vnode\n };\n}\n\n/* */\n\nfunction ensureCtor (comp, base) {\n if (\n comp.__esModule ||\n (hasSymbol && comp[Symbol.toStringTag] === 'Module')\n ) {\n comp = comp.default;\n }\n return isObject(comp)\n ? base.extend(comp)\n : comp\n}\n\nfunction createAsyncPlaceholder (\n factory,\n data,\n context,\n children,\n tag\n) {\n var node = createEmptyVNode();\n node.asyncFactory = factory;\n node.asyncMeta = { data: data, context: context, children: children, tag: tag };\n return node\n}\n\nfunction resolveAsyncComponent (\n factory,\n baseCtor\n) {\n if (isTrue(factory.error) && isDef(factory.errorComp)) {\n return factory.errorComp\n }\n\n if (isDef(factory.resolved)) {\n return factory.resolved\n }\n\n if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\n return factory.loadingComp\n }\n\n var owner = currentRenderingInstance;\n if (isDef(factory.owners)) {\n // already pending\n factory.owners.push(owner);\n } else {\n var owners = factory.owners = [owner];\n var sync = true;\n\n var forceRender = function (renderCompleted) {\n for (var i = 0, l = owners.length; i < l; i++) {\n (owners[i]).$forceUpdate();\n }\n\n if (renderCompleted) {\n owners.length = 0;\n }\n };\n\n var resolve = once(function (res) {\n // cache resolved\n factory.resolved = ensureCtor(res, baseCtor);\n // invoke callbacks only if this is not a synchronous resolve\n // (async resolves are shimmed as synchronous during SSR)\n if (!sync) {\n forceRender(true);\n } else {\n owners.length = 0;\n }\n });\n\n var reject = once(function (reason) {\n warn(\n \"Failed to resolve async component: \" + (String(factory)) +\n (reason ? (\"\\nReason: \" + reason) : '')\n );\n if (isDef(factory.errorComp)) {\n factory.error = true;\n forceRender(true);\n }\n });\n\n var res = factory(resolve, reject);\n\n if (isObject(res)) {\n if (isPromise(res)) {\n // () => Promise\n if (isUndef(factory.resolved)) {\n res.then(resolve, reject);\n }\n } else if (isPromise(res.component)) {\n res.component.then(resolve, reject);\n\n if (isDef(res.error)) {\n factory.errorComp = ensureCtor(res.error, baseCtor);\n }\n\n if (isDef(res.loading)) {\n factory.loadingComp = ensureCtor(res.loading, baseCtor);\n if (res.delay === 0) {\n factory.loading = true;\n } else {\n setTimeout(function () {\n if (isUndef(factory.resolved) && isUndef(factory.error)) {\n factory.loading = true;\n forceRender(false);\n }\n }, res.delay || 200);\n }\n }\n\n if (isDef(res.timeout)) {\n setTimeout(function () {\n if (isUndef(factory.resolved)) {\n reject(\n \"timeout (\" + (res.timeout) + \"ms)\"\n );\n }\n }, res.timeout);\n }\n }\n }\n\n sync = false;\n // return in case resolved synchronously\n return factory.loading\n ? factory.loadingComp\n : factory.resolved\n }\n}\n\n/* */\n\nfunction isAsyncPlaceholder (node) {\n return node.isComment && node.asyncFactory\n}\n\n/* */\n\nfunction getFirstComponentChild (children) {\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n var c = children[i];\n if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {\n return c\n }\n }\n }\n}\n\n/* */\n\n/* */\n\nfunction initEvents (vm) {\n vm._events = Object.create(null);\n vm._hasHookEvent = false;\n // init parent attached events\n var listeners = vm.$options._parentListeners;\n if (listeners) {\n updateComponentListeners(vm, listeners);\n }\n}\n\nvar target;\n\nfunction add (event, fn) {\n target.$on(event, fn);\n}\n\nfunction remove$1 (event, fn) {\n target.$off(event, fn);\n}\n\nfunction createOnceHandler (event, fn) {\n var _target = target;\n return function onceHandler () {\n var res = fn.apply(null, arguments);\n if (res !== null) {\n _target.$off(event, onceHandler);\n }\n }\n}\n\nfunction updateComponentListeners (\n vm,\n listeners,\n oldListeners\n) {\n target = vm;\n updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);\n target = undefined;\n}\n\nfunction eventsMixin (Vue) {\n var hookRE = /^hook:/;\n Vue.prototype.$on = function (event, fn) {\n var vm = this;\n if (Array.isArray(event)) {\n for (var i = 0, l = event.length; i < l; i++) {\n vm.$on(event[i], fn);\n }\n } else {\n (vm._events[event] || (vm._events[event] = [])).push(fn);\n // optimize hook:event cost by using a boolean flag marked at registration\n // instead of a hash lookup\n if (hookRE.test(event)) {\n vm._hasHookEvent = true;\n }\n }\n return vm\n };\n\n Vue.prototype.$once = function (event, fn) {\n var vm = this;\n function on () {\n vm.$off(event, on);\n fn.apply(vm, arguments);\n }\n on.fn = fn;\n vm.$on(event, on);\n return vm\n };\n\n Vue.prototype.$off = function (event, fn) {\n var vm = this;\n // all\n if (!arguments.length) {\n vm._events = Object.create(null);\n return vm\n }\n // array of events\n if (Array.isArray(event)) {\n for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {\n vm.$off(event[i$1], fn);\n }\n return vm\n }\n // specific event\n var cbs = vm._events[event];\n if (!cbs) {\n return vm\n }\n if (!fn) {\n vm._events[event] = null;\n return vm\n }\n // specific handler\n var cb;\n var i = cbs.length;\n while (i--) {\n cb = cbs[i];\n if (cb === fn || cb.fn === fn) {\n cbs.splice(i, 1);\n break\n }\n }\n return vm\n };\n\n Vue.prototype.$emit = function (event) {\n var vm = this;\n {\n var lowerCaseEvent = event.toLowerCase();\n if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\n tip(\n \"Event \\\"\" + lowerCaseEvent + \"\\\" is emitted in component \" +\n (formatComponentName(vm)) + \" but the handler is registered for \\\"\" + event + \"\\\". \" +\n \"Note that HTML attributes are case-insensitive and you cannot use \" +\n \"v-on to listen to camelCase events when using in-DOM templates. \" +\n \"You should probably use \\\"\" + (hyphenate(event)) + \"\\\" instead of \\\"\" + event + \"\\\".\"\n );\n }\n }\n var cbs = vm._events[event];\n if (cbs) {\n cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n var args = toArray(arguments, 1);\n var info = \"event handler for \\\"\" + event + \"\\\"\";\n for (var i = 0, l = cbs.length; i < l; i++) {\n invokeWithErrorHandling(cbs[i], vm, args, vm, info);\n }\n }\n return vm\n };\n}\n\n/* */\n\nvar activeInstance = null;\nvar isUpdatingChildComponent = false;\n\nfunction setActiveInstance(vm) {\n var prevActiveInstance = activeInstance;\n activeInstance = vm;\n return function () {\n activeInstance = prevActiveInstance;\n }\n}\n\nfunction initLifecycle (vm) {\n var options = vm.$options;\n\n // locate first non-abstract parent\n var parent = options.parent;\n if (parent && !options.abstract) {\n while (parent.$options.abstract && parent.$parent) {\n parent = parent.$parent;\n }\n parent.$children.push(vm);\n }\n\n vm.$parent = parent;\n vm.$root = parent ? parent.$root : vm;\n\n vm.$children = [];\n vm.$refs = {};\n\n vm._watcher = null;\n vm._inactive = null;\n vm._directInactive = false;\n vm._isMounted = false;\n vm._isDestroyed = false;\n vm._isBeingDestroyed = false;\n}\n\nfunction lifecycleMixin (Vue) {\n Vue.prototype._update = function (vnode, hydrating) {\n var vm = this;\n var prevEl = vm.$el;\n var prevVnode = vm._vnode;\n var restoreActiveInstance = setActiveInstance(vm);\n vm._vnode = vnode;\n // Vue.prototype.__patch__ is injected in entry points\n // based on the rendering backend used.\n if (!prevVnode) {\n // initial render\n vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);\n } else {\n // updates\n vm.$el = vm.__patch__(prevVnode, vnode);\n }\n restoreActiveInstance();\n // update __vue__ reference\n if (prevEl) {\n prevEl.__vue__ = null;\n }\n if (vm.$el) {\n vm.$el.__vue__ = vm;\n }\n // if parent is an HOC, update its $el as well\n if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n vm.$parent.$el = vm.$el;\n }\n // updated hook is called by the scheduler to ensure that children are\n // updated in a parent's updated hook.\n };\n\n Vue.prototype.$forceUpdate = function () {\n var vm = this;\n if (vm._watcher) {\n vm._watcher.update();\n }\n };\n\n Vue.prototype.$destroy = function () {\n var vm = this;\n if (vm._isBeingDestroyed) {\n return\n }\n callHook(vm, 'beforeDestroy');\n vm._isBeingDestroyed = true;\n // remove self from parent\n var parent = vm.$parent;\n if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n remove(parent.$children, vm);\n }\n // teardown watchers\n if (vm._watcher) {\n vm._watcher.teardown();\n }\n var i = vm._watchers.length;\n while (i--) {\n vm._watchers[i].teardown();\n }\n // remove reference from data ob\n // frozen object may not have observer.\n if (vm._data.__ob__) {\n vm._data.__ob__.vmCount--;\n }\n // call the last hook...\n vm._isDestroyed = true;\n // invoke destroy hooks on current rendered tree\n vm.__patch__(vm._vnode, null);\n // fire destroyed hook\n callHook(vm, 'destroyed');\n // turn off all instance listeners.\n vm.$off();\n // remove __vue__ reference\n if (vm.$el) {\n vm.$el.__vue__ = null;\n }\n // release circular reference (#6759)\n if (vm.$vnode) {\n vm.$vnode.parent = null;\n }\n };\n}\n\nfunction mountComponent (\n vm,\n el,\n hydrating\n) {\n vm.$el = el;\n if (!vm.$options.render) {\n vm.$options.render = createEmptyVNode;\n {\n /* istanbul ignore if */\n if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n vm.$options.el || el) {\n warn(\n 'You are using the runtime-only build of Vue where the template ' +\n 'compiler is not available. Either pre-compile the templates into ' +\n 'render functions, or use the compiler-included build.',\n vm\n );\n } else {\n warn(\n 'Failed to mount component: template or render function not defined.',\n vm\n );\n }\n }\n }\n callHook(vm, 'beforeMount');\n\n var updateComponent;\n /* istanbul ignore if */\n if (config.performance && mark) {\n updateComponent = function () {\n var name = vm._name;\n var id = vm._uid;\n var startTag = \"vue-perf-start:\" + id;\n var endTag = \"vue-perf-end:\" + id;\n\n mark(startTag);\n var vnode = vm._render();\n mark(endTag);\n measure((\"vue \" + name + \" render\"), startTag, endTag);\n\n mark(startTag);\n vm._update(vnode, hydrating);\n mark(endTag);\n measure((\"vue \" + name + \" patch\"), startTag, endTag);\n };\n } else {\n updateComponent = function () {\n vm._update(vm._render(), hydrating);\n };\n }\n\n // we set this to vm._watcher inside the watcher's constructor\n // since the watcher's initial patch may call $forceUpdate (e.g. inside child\n // component's mounted hook), which relies on vm._watcher being already defined\n new Watcher(vm, updateComponent, noop, {\n before: function before () {\n if (vm._isMounted && !vm._isDestroyed) {\n callHook(vm, 'beforeUpdate');\n }\n }\n }, true /* isRenderWatcher */);\n hydrating = false;\n\n // manually mounted instance, call mounted on self\n // mounted is called for render-created child components in its inserted hook\n if (vm.$vnode == null) {\n vm._isMounted = true;\n callHook(vm, 'mounted');\n }\n return vm\n}\n\nfunction updateChildComponent (\n vm,\n propsData,\n listeners,\n parentVnode,\n renderChildren\n) {\n {\n isUpdatingChildComponent = true;\n }\n\n // determine whether component has slot children\n // we need to do this before overwriting $options._renderChildren.\n\n // check if there are dynamic scopedSlots (hand-written or compiled but with\n // dynamic slot names). Static scoped slots compiled from template has the\n // \"$stable\" marker.\n var hasDynamicScopedSlot = !!(\n (parentVnode.data.scopedSlots && !parentVnode.data.scopedSlots.$stable) ||\n (vm.$scopedSlots !== emptyObject && !vm.$scopedSlots.$stable)\n );\n\n // Any static slot children from the parent may have changed during parent's\n // update. Dynamic scoped slots may also have changed. In such cases, a forced\n // update is necessary to ensure correctness.\n var needsForceUpdate = !!(\n renderChildren || // has new static slots\n vm.$options._renderChildren || // has old static slots\n hasDynamicScopedSlot\n );\n\n vm.$options._parentVnode = parentVnode;\n vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n\n if (vm._vnode) { // update child tree's parent\n vm._vnode.parent = parentVnode;\n }\n vm.$options._renderChildren = renderChildren;\n\n // update $attrs and $listeners hash\n // these are also reactive so they may trigger child update if the child\n // used them during render\n vm.$attrs = parentVnode.data.attrs || emptyObject;\n vm.$listeners = listeners || emptyObject;\n\n // update props\n if (propsData && vm.$options.props) {\n toggleObserving(false);\n var props = vm._props;\n var propKeys = vm.$options._propKeys || [];\n for (var i = 0; i < propKeys.length; i++) {\n var key = propKeys[i];\n var propOptions = vm.$options.props; // wtf flow?\n props[key] = validateProp(key, propOptions, propsData, vm);\n }\n toggleObserving(true);\n // keep a copy of raw propsData\n vm.$options.propsData = propsData;\n }\n\n // update listeners\n listeners = listeners || emptyObject;\n var oldListeners = vm.$options._parentListeners;\n vm.$options._parentListeners = listeners;\n updateComponentListeners(vm, listeners, oldListeners);\n\n // resolve slots + force update if has children\n if (needsForceUpdate) {\n vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n vm.$forceUpdate();\n }\n\n {\n isUpdatingChildComponent = false;\n }\n}\n\nfunction isInInactiveTree (vm) {\n while (vm && (vm = vm.$parent)) {\n if (vm._inactive) { return true }\n }\n return false\n}\n\nfunction activateChildComponent (vm, direct) {\n if (direct) {\n vm._directInactive = false;\n if (isInInactiveTree(vm)) {\n return\n }\n } else if (vm._directInactive) {\n return\n }\n if (vm._inactive || vm._inactive === null) {\n vm._inactive = false;\n for (var i = 0; i < vm.$children.length; i++) {\n activateChildComponent(vm.$children[i]);\n }\n callHook(vm, 'activated');\n }\n}\n\nfunction deactivateChildComponent (vm, direct) {\n if (direct) {\n vm._directInactive = true;\n if (isInInactiveTree(vm)) {\n return\n }\n }\n if (!vm._inactive) {\n vm._inactive = true;\n for (var i = 0; i < vm.$children.length; i++) {\n deactivateChildComponent(vm.$children[i]);\n }\n callHook(vm, 'deactivated');\n }\n}\n\nfunction callHook (vm, hook) {\n // #7573 disable dep collection when invoking lifecycle hooks\n pushTarget();\n var handlers = vm.$options[hook];\n var info = hook + \" hook\";\n if (handlers) {\n for (var i = 0, j = handlers.length; i < j; i++) {\n invokeWithErrorHandling(handlers[i], vm, null, vm, info);\n }\n }\n if (vm._hasHookEvent) {\n vm.$emit('hook:' + hook);\n }\n popTarget();\n}\n\n/* */\n\nvar MAX_UPDATE_COUNT = 100;\n\nvar queue = [];\nvar activatedChildren = [];\nvar has = {};\nvar circular = {};\nvar waiting = false;\nvar flushing = false;\nvar index = 0;\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}\n\n// Async edge case #6566 requires saving the timestamp when event listeners are\n// attached. However, calling performance.now() has a perf overhead especially\n// if the page has thousands of event listeners. Instead, we take a timestamp\n// every time the scheduler flushes and use that for all event listeners\n// attached during that flush.\nvar currentFlushTimestamp = 0;\n\n// Async edge case fix requires storing an event listener's attach timestamp.\nvar getNow = Date.now;\n\n// Determine what event timestamp the browser is using. Annoyingly, the\n// timestamp can either be hi-res (relative to page load) or low-res\n// (relative to UNIX epoch), so in order to compare time we have to use the\n// same timestamp type when saving the flush timestamp.\nif (inBrowser && getNow() > document.createEvent('Event').timeStamp) {\n // if the low-res timestamp which is bigger than the event timestamp\n // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n // and we need to use the hi-res version for event listeners as well.\n getNow = function () { return performance.now(); };\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue () {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n if (watcher.before) {\n watcher.before();\n }\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}\n\nfunction callUpdatedHooks (queue) {\n var i = queue.length;\n while (i--) {\n var watcher = queue[i];\n var vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {\n callHook(vm, 'updated');\n }\n }\n}\n\n/**\n * Queue a kept-alive component that was activated during patch.\n * The queue will be processed after the entire tree has been patched.\n */\nfunction queueActivatedComponent (vm) {\n // setting _inactive to false here so that a render function can\n // rely on checking whether it's in an inactive tree (e.g. router-view)\n vm._inactive = false;\n activatedChildren.push(vm);\n}\n\nfunction callActivatedHooks (queue) {\n for (var i = 0; i < queue.length; i++) {\n queue[i]._inactive = true;\n activateChildComponent(queue[i], true /* true */);\n }\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n */\nfunction queueWatcher (watcher) {\n var id = watcher.id;\n if (has[id] == null) {\n has[id] = true;\n if (!flushing) {\n queue.push(watcher);\n } else {\n // if already flushing, splice the watcher based on its id\n // if already past its id, it will be run next immediately.\n var i = queue.length - 1;\n while (i > index && queue[i].id > watcher.id) {\n i--;\n }\n queue.splice(i + 1, 0, watcher);\n }\n // queue the flush\n if (!waiting) {\n waiting = true;\n\n if (!config.async) {\n flushSchedulerQueue();\n return\n }\n nextTick(flushSchedulerQueue);\n }\n }\n}\n\n/* */\n\n\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n */\nvar Watcher = function Watcher (\n vm,\n expOrFn,\n cb,\n options,\n isRenderWatcher\n) {\n this.vm = vm;\n if (isRenderWatcher) {\n vm._watcher = this;\n }\n vm._watchers.push(this);\n // options\n if (options) {\n this.deep = !!options.deep;\n this.user = !!options.user;\n this.lazy = !!options.lazy;\n this.sync = !!options.sync;\n this.before = options.before;\n } else {\n this.deep = this.user = this.lazy = this.sync = false;\n }\n this.cb = cb;\n this.id = ++uid$2; // uid for batching\n this.active = true;\n this.dirty = this.lazy; // for lazy watchers\n this.deps = [];\n this.newDeps = [];\n this.depIds = new _Set();\n this.newDepIds = new _Set();\n this.expression = expOrFn.toString();\n // parse expression for getter\n if (typeof expOrFn === 'function') {\n this.getter = expOrFn;\n } else {\n this.getter = parsePath(expOrFn);\n if (!this.getter) {\n this.getter = noop;\n warn(\n \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n 'Watcher only accepts simple dot-delimited paths. ' +\n 'For full control, use a function instead.',\n vm\n );\n }\n }\n this.value = this.lazy\n ? undefined\n : this.get();\n};\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\nWatcher.prototype.get = function get () {\n pushTarget(this);\n var value;\n var vm = this.vm;\n try {\n value = this.getter.call(vm, vm);\n } catch (e) {\n if (this.user) {\n handleError(e, vm, (\"getter for watcher \\\"\" + (this.expression) + \"\\\"\"));\n } else {\n throw e\n }\n } finally {\n // \"touch\" every property so they are all tracked as\n // dependencies for deep watching\n if (this.deep) {\n traverse(value);\n }\n popTarget();\n this.cleanupDeps();\n }\n return value\n};\n\n/**\n * Add a dependency to this directive.\n */\nWatcher.prototype.addDep = function addDep (dep) {\n var id = dep.id;\n if (!this.newDepIds.has(id)) {\n this.newDepIds.add(id);\n this.newDeps.push(dep);\n if (!this.depIds.has(id)) {\n dep.addSub(this);\n }\n }\n};\n\n/**\n * Clean up for dependency collection.\n */\nWatcher.prototype.cleanupDeps = function cleanupDeps () {\n var i = this.deps.length;\n while (i--) {\n var dep = this.deps[i];\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this);\n }\n }\n var tmp = this.depIds;\n this.depIds = this.newDepIds;\n this.newDepIds = tmp;\n this.newDepIds.clear();\n tmp = this.deps;\n this.deps = this.newDeps;\n this.newDeps = tmp;\n this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n */\nWatcher.prototype.update = function update () {\n /* istanbul ignore else */\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync) {\n this.run();\n } else {\n queueWatcher(this);\n }\n};\n\n/**\n * Scheduler job interface.\n * Will be called by the scheduler.\n */\nWatcher.prototype.run = function run () {\n if (this.active) {\n var value = this.get();\n if (\n value !== this.value ||\n // Deep watchers and watchers on Object/Arrays should fire even\n // when the value is the same, because the value may\n // have mutated.\n isObject(value) ||\n this.deep\n ) {\n // set new value\n var oldValue = this.value;\n this.value = value;\n if (this.user) {\n try {\n this.cb.call(this.vm, value, oldValue);\n } catch (e) {\n handleError(e, this.vm, (\"callback for watcher \\\"\" + (this.expression) + \"\\\"\"));\n }\n } else {\n this.cb.call(this.vm, value, oldValue);\n }\n }\n }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\nWatcher.prototype.evaluate = function evaluate () {\n this.value = this.get();\n this.dirty = false;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\nWatcher.prototype.depend = function depend () {\n var i = this.deps.length;\n while (i--) {\n this.deps[i].depend();\n }\n};\n\n/**\n * Remove self from all dependencies' subscriber list.\n */\nWatcher.prototype.teardown = function teardown () {\n if (this.active) {\n // remove self from vm's watcher list\n // this is a somewhat expensive operation so we skip it\n // if the vm is being destroyed.\n if (!this.vm._isBeingDestroyed) {\n remove(this.vm._watchers, this);\n }\n var i = this.deps.length;\n while (i--) {\n this.deps[i].removeSub(this);\n }\n this.active = false;\n }\n};\n\n/* */\n\nvar sharedPropertyDefinition = {\n enumerable: true,\n configurable: true,\n get: noop,\n set: noop\n};\n\nfunction proxy (target, sourceKey, key) {\n sharedPropertyDefinition.get = function proxyGetter () {\n return this[sourceKey][key]\n };\n sharedPropertyDefinition.set = function proxySetter (val) {\n this[sourceKey][key] = val;\n };\n Object.defineProperty(target, key, sharedPropertyDefinition);\n}\n\nfunction initState (vm) {\n vm._watchers = [];\n var opts = vm.$options;\n if (opts.props) { initProps(vm, opts.props); }\n if (opts.methods) { initMethods(vm, opts.methods); }\n if (opts.data) {\n initData(vm);\n } else {\n observe(vm._data = {}, true /* asRootData */);\n }\n if (opts.computed) { initComputed(vm, opts.computed); }\n if (opts.watch && opts.watch !== nativeWatch) {\n initWatch(vm, opts.watch);\n }\n}\n\nfunction initProps (vm, propsOptions) {\n var propsData = vm.$options.propsData || {};\n var props = vm._props = {};\n // cache prop keys so that future props updates can iterate using Array\n // instead of dynamic object key enumeration.\n var keys = vm.$options._propKeys = [];\n var isRoot = !vm.$parent;\n // root instance props should be converted\n if (!isRoot) {\n toggleObserving(false);\n }\n var loop = function ( key ) {\n keys.push(key);\n var value = validateProp(key, propsOptions, propsData, vm);\n /* istanbul ignore else */\n {\n var hyphenatedKey = hyphenate(key);\n if (isReservedAttribute(hyphenatedKey) ||\n config.isReservedAttr(hyphenatedKey)) {\n warn(\n (\"\\\"\" + hyphenatedKey + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n vm\n );\n }\n defineReactive$$1(props, key, value, function () {\n if (!isRoot && !isUpdatingChildComponent) {\n warn(\n \"Avoid mutating a prop directly since the value will be \" +\n \"overwritten whenever the parent component re-renders. \" +\n \"Instead, use a data or computed property based on the prop's \" +\n \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n vm\n );\n }\n });\n }\n // static props are already proxied on the component's prototype\n // during Vue.extend(). We only need to proxy props defined at\n // instantiation here.\n if (!(key in vm)) {\n proxy(vm, \"_props\", key);\n }\n };\n\n for (var key in propsOptions) loop( key );\n toggleObserving(true);\n}\n\nfunction initData (vm) {\n var data = vm.$options.data;\n data = vm._data = typeof data === 'function'\n ? getData(data, vm)\n : data || {};\n if (!isPlainObject(data)) {\n data = {};\n warn(\n 'data functions should return an object:\\n' +\n 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',\n vm\n );\n }\n // proxy data on instance\n var keys = Object.keys(data);\n var props = vm.$options.props;\n var methods = vm.$options.methods;\n var i = keys.length;\n while (i--) {\n var key = keys[i];\n {\n if (methods && hasOwn(methods, key)) {\n warn(\n (\"Method \\\"\" + key + \"\\\" has already been defined as a data property.\"),\n vm\n );\n }\n }\n if (props && hasOwn(props, key)) {\n warn(\n \"The data property \\\"\" + key + \"\\\" is already declared as a prop. \" +\n \"Use prop default value instead.\",\n vm\n );\n } else if (!isReserved(key)) {\n proxy(vm, \"_data\", key);\n }\n }\n // observe data\n observe(data, true /* asRootData */);\n}\n\nfunction getData (data, vm) {\n // #7573 disable dep collection when invoking data getters\n pushTarget();\n try {\n return data.call(vm, vm)\n } catch (e) {\n handleError(e, vm, \"data()\");\n return {}\n } finally {\n popTarget();\n }\n}\n\nvar computedWatcherOptions = { lazy: true };\n\nfunction initComputed (vm, computed) {\n // $flow-disable-line\n var watchers = vm._computedWatchers = Object.create(null);\n // computed properties are just getters during SSR\n var isSSR = isServerRendering();\n\n for (var key in computed) {\n var userDef = computed[key];\n var getter = typeof userDef === 'function' ? userDef : userDef.get;\n if (getter == null) {\n warn(\n (\"Getter is missing for computed property \\\"\" + key + \"\\\".\"),\n vm\n );\n }\n\n if (!isSSR) {\n // create internal watcher for the computed property.\n watchers[key] = new Watcher(\n vm,\n getter || noop,\n noop,\n computedWatcherOptions\n );\n }\n\n // component-defined computed properties are already defined on the\n // component prototype. We only need to define computed properties defined\n // at instantiation here.\n if (!(key in vm)) {\n defineComputed(vm, key, userDef);\n } else {\n if (key in vm.$data) {\n warn((\"The computed property \\\"\" + key + \"\\\" is already defined in data.\"), vm);\n } else if (vm.$options.props && key in vm.$options.props) {\n warn((\"The computed property \\\"\" + key + \"\\\" is already defined as a prop.\"), vm);\n }\n }\n }\n}\n\nfunction defineComputed (\n target,\n key,\n userDef\n) {\n var shouldCache = !isServerRendering();\n if (typeof userDef === 'function') {\n sharedPropertyDefinition.get = shouldCache\n ? createComputedGetter(key)\n : createGetterInvoker(userDef);\n sharedPropertyDefinition.set = noop;\n } else {\n sharedPropertyDefinition.get = userDef.get\n ? shouldCache && userDef.cache !== false\n ? createComputedGetter(key)\n : createGetterInvoker(userDef.get)\n : noop;\n sharedPropertyDefinition.set = userDef.set || noop;\n }\n if (sharedPropertyDefinition.set === noop) {\n sharedPropertyDefinition.set = function () {\n warn(\n (\"Computed property \\\"\" + key + \"\\\" was assigned to but it has no setter.\"),\n this\n );\n };\n }\n Object.defineProperty(target, key, sharedPropertyDefinition);\n}\n\nfunction createComputedGetter (key) {\n return function computedGetter () {\n var watcher = this._computedWatchers && this._computedWatchers[key];\n if (watcher) {\n if (watcher.dirty) {\n watcher.evaluate();\n }\n if (Dep.target) {\n watcher.depend();\n }\n return watcher.value\n }\n }\n}\n\nfunction createGetterInvoker(fn) {\n return function computedGetter () {\n return fn.call(this, this)\n }\n}\n\nfunction initMethods (vm, methods) {\n var props = vm.$options.props;\n for (var key in methods) {\n {\n if (typeof methods[key] !== 'function') {\n warn(\n \"Method \\\"\" + key + \"\\\" has type \\\"\" + (typeof methods[key]) + \"\\\" in the component definition. \" +\n \"Did you reference the function correctly?\",\n vm\n );\n }\n if (props && hasOwn(props, key)) {\n warn(\n (\"Method \\\"\" + key + \"\\\" has already been defined as a prop.\"),\n vm\n );\n }\n if ((key in vm) && isReserved(key)) {\n warn(\n \"Method \\\"\" + key + \"\\\" conflicts with an existing Vue instance method. \" +\n \"Avoid defining component methods that start with _ or $.\"\n );\n }\n }\n vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);\n }\n}\n\nfunction initWatch (vm, watch) {\n for (var key in watch) {\n var handler = watch[key];\n if (Array.isArray(handler)) {\n for (var i = 0; i < handler.length; i++) {\n createWatcher(vm, key, handler[i]);\n }\n } else {\n createWatcher(vm, key, handler);\n }\n }\n}\n\nfunction createWatcher (\n vm,\n expOrFn,\n handler,\n options\n) {\n if (isPlainObject(handler)) {\n options = handler;\n handler = handler.handler;\n }\n if (typeof handler === 'string') {\n handler = vm[handler];\n }\n return vm.$watch(expOrFn, handler, options)\n}\n\nfunction stateMixin (Vue) {\n // flow somehow has problems with directly declared definition object\n // when using Object.defineProperty, so we have to procedurally build up\n // the object here.\n var dataDef = {};\n dataDef.get = function () { return this._data };\n var propsDef = {};\n propsDef.get = function () { return this._props };\n {\n dataDef.set = function () {\n warn(\n 'Avoid replacing instance root $data. ' +\n 'Use nested data properties instead.',\n this\n );\n };\n propsDef.set = function () {\n warn(\"$props is readonly.\", this);\n };\n }\n Object.defineProperty(Vue.prototype, '$data', dataDef);\n Object.defineProperty(Vue.prototype, '$props', propsDef);\n\n Vue.prototype.$set = set;\n Vue.prototype.$delete = del;\n\n Vue.prototype.$watch = function (\n expOrFn,\n cb,\n options\n ) {\n var vm = this;\n if (isPlainObject(cb)) {\n return createWatcher(vm, expOrFn, cb, options)\n }\n options = options || {};\n options.user = true;\n var watcher = new Watcher(vm, expOrFn, cb, options);\n if (options.immediate) {\n try {\n cb.call(vm, watcher.value);\n } catch (error) {\n handleError(error, vm, (\"callback for immediate watcher \\\"\" + (watcher.expression) + \"\\\"\"));\n }\n }\n return function unwatchFn () {\n watcher.teardown();\n }\n };\n}\n\n/* */\n\nvar uid$3 = 0;\n\nfunction initMixin (Vue) {\n Vue.prototype._init = function (options) {\n var vm = this;\n // a uid\n vm._uid = uid$3++;\n\n var startTag, endTag;\n /* istanbul ignore if */\n if (config.performance && mark) {\n startTag = \"vue-perf-start:\" + (vm._uid);\n endTag = \"vue-perf-end:\" + (vm._uid);\n mark(startTag);\n }\n\n // a flag to avoid this being observed\n vm._isVue = true;\n // merge options\n if (options && options._isComponent) {\n // optimize internal component instantiation\n // since dynamic options merging is pretty slow, and none of the\n // internal component options needs special treatment.\n initInternalComponent(vm, options);\n } else {\n vm.$options = mergeOptions(\n resolveConstructorOptions(vm.constructor),\n options || {},\n vm\n );\n }\n /* istanbul ignore else */\n {\n initProxy(vm);\n }\n // expose real self\n vm._self = vm;\n initLifecycle(vm);\n initEvents(vm);\n initRender(vm);\n callHook(vm, 'beforeCreate');\n initInjections(vm); // resolve injections before data/props\n initState(vm);\n initProvide(vm); // resolve provide after data/props\n callHook(vm, 'created');\n\n /* istanbul ignore if */\n if (config.performance && mark) {\n vm._name = formatComponentName(vm, false);\n mark(endTag);\n measure((\"vue \" + (vm._name) + \" init\"), startTag, endTag);\n }\n\n if (vm.$options.el) {\n vm.$mount(vm.$options.el);\n }\n };\n}\n\nfunction initInternalComponent (vm, options) {\n var opts = vm.$options = Object.create(vm.constructor.options);\n // doing this because it's faster than dynamic enumeration.\n var parentVnode = options._parentVnode;\n opts.parent = options.parent;\n opts._parentVnode = parentVnode;\n\n var vnodeComponentOptions = parentVnode.componentOptions;\n opts.propsData = vnodeComponentOptions.propsData;\n opts._parentListeners = vnodeComponentOptions.listeners;\n opts._renderChildren = vnodeComponentOptions.children;\n opts._componentTag = vnodeComponentOptions.tag;\n\n if (options.render) {\n opts.render = options.render;\n opts.staticRenderFns = options.staticRenderFns;\n }\n}\n\nfunction resolveConstructorOptions (Ctor) {\n var options = Ctor.options;\n if (Ctor.super) {\n var superOptions = resolveConstructorOptions(Ctor.super);\n var cachedSuperOptions = Ctor.superOptions;\n if (superOptions !== cachedSuperOptions) {\n // super option changed,\n // need to resolve new options.\n Ctor.superOptions = superOptions;\n // check if there are any late-modified/attached options (#4976)\n var modifiedOptions = resolveModifiedOptions(Ctor);\n // update base extend options\n if (modifiedOptions) {\n extend(Ctor.extendOptions, modifiedOptions);\n }\n options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);\n if (options.name) {\n options.components[options.name] = Ctor;\n }\n }\n }\n return options\n}\n\nfunction resolveModifiedOptions (Ctor) {\n var modified;\n var latest = Ctor.options;\n var sealed = Ctor.sealedOptions;\n for (var key in latest) {\n if (latest[key] !== sealed[key]) {\n if (!modified) { modified = {}; }\n modified[key] = latest[key];\n }\n }\n return modified\n}\n\nfunction Vue (options) {\n if (!(this instanceof Vue)\n ) {\n warn('Vue is a constructor and should be called with the `new` keyword');\n }\n this._init(options);\n}\n\ninitMixin(Vue);\nstateMixin(Vue);\neventsMixin(Vue);\nlifecycleMixin(Vue);\nrenderMixin(Vue);\n\n/* */\n\nfunction initUse (Vue) {\n Vue.use = function (plugin) {\n var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));\n if (installedPlugins.indexOf(plugin) > -1) {\n return this\n }\n\n // additional parameters\n var args = toArray(arguments, 1);\n args.unshift(this);\n if (typeof plugin.install === 'function') {\n plugin.install.apply(plugin, args);\n } else if (typeof plugin === 'function') {\n plugin.apply(null, args);\n }\n installedPlugins.push(plugin);\n return this\n };\n}\n\n/* */\n\nfunction initMixin$1 (Vue) {\n Vue.mixin = function (mixin) {\n this.options = mergeOptions(this.options, mixin);\n return this\n };\n}\n\n/* */\n\nfunction initExtend (Vue) {\n /**\n * Each instance constructor, including Vue, has a unique\n * cid. This enables us to create wrapped \"child\n * constructors\" for prototypal inheritance and cache them.\n */\n Vue.cid = 0;\n var cid = 1;\n\n /**\n * Class inheritance\n */\n Vue.extend = function (extendOptions) {\n extendOptions = extendOptions || {};\n var Super = this;\n var SuperId = Super.cid;\n var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n if (cachedCtors[SuperId]) {\n return cachedCtors[SuperId]\n }\n\n var name = extendOptions.name || Super.options.name;\n if (name) {\n validateComponentName(name);\n }\n\n var Sub = function VueComponent (options) {\n this._init(options);\n };\n Sub.prototype = Object.create(Super.prototype);\n Sub.prototype.constructor = Sub;\n Sub.cid = cid++;\n Sub.options = mergeOptions(\n Super.options,\n extendOptions\n );\n Sub['super'] = Super;\n\n // For props and computed properties, we define the proxy getters on\n // the Vue instances at extension time, on the extended prototype. This\n // avoids Object.defineProperty calls for each instance created.\n if (Sub.options.props) {\n initProps$1(Sub);\n }\n if (Sub.options.computed) {\n initComputed$1(Sub);\n }\n\n // allow further extension/mixin/plugin usage\n Sub.extend = Super.extend;\n Sub.mixin = Super.mixin;\n Sub.use = Super.use;\n\n // create asset registers, so extended classes\n // can have their private assets too.\n ASSET_TYPES.forEach(function (type) {\n Sub[type] = Super[type];\n });\n // enable recursive self-lookup\n if (name) {\n Sub.options.components[name] = Sub;\n }\n\n // keep a reference to the super options at extension time.\n // later at instantiation we can check if Super's options have\n // been updated.\n Sub.superOptions = Super.options;\n Sub.extendOptions = extendOptions;\n Sub.sealedOptions = extend({}, Sub.options);\n\n // cache constructor\n cachedCtors[SuperId] = Sub;\n return Sub\n };\n}\n\nfunction initProps$1 (Comp) {\n var props = Comp.options.props;\n for (var key in props) {\n proxy(Comp.prototype, \"_props\", key);\n }\n}\n\nfunction initComputed$1 (Comp) {\n var computed = Comp.options.computed;\n for (var key in computed) {\n defineComputed(Comp.prototype, key, computed[key]);\n }\n}\n\n/* */\n\nfunction initAssetRegisters (Vue) {\n /**\n * Create asset registration methods.\n */\n ASSET_TYPES.forEach(function (type) {\n Vue[type] = function (\n id,\n definition\n ) {\n if (!definition) {\n return this.options[type + 's'][id]\n } else {\n /* istanbul ignore if */\n if (type === 'component') {\n validateComponentName(id);\n }\n if (type === 'component' && isPlainObject(definition)) {\n definition.name = definition.name || id;\n definition = this.options._base.extend(definition);\n }\n if (type === 'directive' && typeof definition === 'function') {\n definition = { bind: definition, update: definition };\n }\n this.options[type + 's'][id] = definition;\n return definition\n }\n };\n });\n}\n\n/* */\n\n\n\nfunction getComponentName (opts) {\n return opts && (opts.Ctor.options.name || opts.tag)\n}\n\nfunction matches (pattern, name) {\n if (Array.isArray(pattern)) {\n return pattern.indexOf(name) > -1\n } else if (typeof pattern === 'string') {\n return pattern.split(',').indexOf(name) > -1\n } else if (isRegExp(pattern)) {\n return pattern.test(name)\n }\n /* istanbul ignore next */\n return false\n}\n\nfunction pruneCache (keepAliveInstance, filter) {\n var cache = keepAliveInstance.cache;\n var keys = keepAliveInstance.keys;\n var _vnode = keepAliveInstance._vnode;\n for (var key in cache) {\n var cachedNode = cache[key];\n if (cachedNode) {\n var name = getComponentName(cachedNode.componentOptions);\n if (name && !filter(name)) {\n pruneCacheEntry(cache, key, keys, _vnode);\n }\n }\n }\n}\n\nfunction pruneCacheEntry (\n cache,\n key,\n keys,\n current\n) {\n var cached$$1 = cache[key];\n if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {\n cached$$1.componentInstance.$destroy();\n }\n cache[key] = null;\n remove(keys, key);\n}\n\nvar patternTypes = [String, RegExp, Array];\n\nvar KeepAlive = {\n name: 'keep-alive',\n abstract: true,\n\n props: {\n include: patternTypes,\n exclude: patternTypes,\n max: [String, Number]\n },\n\n created: function created () {\n this.cache = Object.create(null);\n this.keys = [];\n },\n\n destroyed: function destroyed () {\n for (var key in this.cache) {\n pruneCacheEntry(this.cache, key, this.keys);\n }\n },\n\n mounted: function mounted () {\n var this$1 = this;\n\n this.$watch('include', function (val) {\n pruneCache(this$1, function (name) { return matches(val, name); });\n });\n this.$watch('exclude', function (val) {\n pruneCache(this$1, function (name) { return !matches(val, name); });\n });\n },\n\n render: function render () {\n var slot = this.$slots.default;\n var vnode = getFirstComponentChild(slot);\n var componentOptions = vnode && vnode.componentOptions;\n if (componentOptions) {\n // check pattern\n var name = getComponentName(componentOptions);\n var ref = this;\n var include = ref.include;\n var exclude = ref.exclude;\n if (\n // not included\n (include && (!name || !matches(include, name))) ||\n // excluded\n (exclude && name && matches(exclude, name))\n ) {\n return vnode\n }\n\n var ref$1 = this;\n var cache = ref$1.cache;\n var keys = ref$1.keys;\n var key = vnode.key == null\n // same constructor may get registered as different local components\n // so cid alone is not enough (#3269)\n ? componentOptions.Ctor.cid + (componentOptions.tag ? (\"::\" + (componentOptions.tag)) : '')\n : vnode.key;\n if (cache[key]) {\n vnode.componentInstance = cache[key].componentInstance;\n // make current key freshest\n remove(keys, key);\n keys.push(key);\n } else {\n cache[key] = vnode;\n keys.push(key);\n // prune oldest entry\n if (this.max && keys.length > parseInt(this.max)) {\n pruneCacheEntry(cache, keys[0], keys, this._vnode);\n }\n }\n\n vnode.data.keepAlive = true;\n }\n return vnode || (slot && slot[0])\n }\n};\n\nvar builtInComponents = {\n KeepAlive: KeepAlive\n};\n\n/* */\n\nfunction initGlobalAPI (Vue) {\n // config\n var configDef = {};\n configDef.get = function () { return config; };\n {\n configDef.set = function () {\n warn(\n 'Do not replace the Vue.config object, set individual fields instead.'\n );\n };\n }\n Object.defineProperty(Vue, 'config', configDef);\n\n // exposed util methods.\n // NOTE: these are not considered part of the public API - avoid relying on\n // them unless you are aware of the risk.\n Vue.util = {\n warn: warn,\n extend: extend,\n mergeOptions: mergeOptions,\n defineReactive: defineReactive$$1\n };\n\n Vue.set = set;\n Vue.delete = del;\n Vue.nextTick = nextTick;\n\n // 2.6 explicit observable API\n Vue.observable = function (obj) {\n observe(obj);\n return obj\n };\n\n Vue.options = Object.create(null);\n ASSET_TYPES.forEach(function (type) {\n Vue.options[type + 's'] = Object.create(null);\n });\n\n // this is used to identify the \"base\" constructor to extend all plain-object\n // components with in Weex's multi-instance scenarios.\n Vue.options._base = Vue;\n\n extend(Vue.options.components, builtInComponents);\n\n initUse(Vue);\n initMixin$1(Vue);\n initExtend(Vue);\n initAssetRegisters(Vue);\n}\n\ninitGlobalAPI(Vue);\n\nObject.defineProperty(Vue.prototype, '$isServer', {\n get: isServerRendering\n});\n\nObject.defineProperty(Vue.prototype, '$ssrContext', {\n get: function get () {\n /* istanbul ignore next */\n return this.$vnode && this.$vnode.ssrContext\n }\n});\n\n// expose FunctionalRenderContext for ssr runtime helper installation\nObject.defineProperty(Vue, 'FunctionalRenderContext', {\n value: FunctionalRenderContext\n});\n\nVue.version = '2.6.3';\n\n/* */\n\n// these are reserved for web because they are directly compiled away\n// during template compilation\nvar isReservedAttr = makeMap('style,class');\n\n// attributes that should be using props for binding\nvar acceptValue = makeMap('input,textarea,option,select,progress');\nvar mustUseProp = function (tag, type, attr) {\n return (\n (attr === 'value' && acceptValue(tag)) && type !== 'button' ||\n (attr === 'selected' && tag === 'option') ||\n (attr === 'checked' && tag === 'input') ||\n (attr === 'muted' && tag === 'video')\n )\n};\n\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\nvar isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');\n\nvar convertEnumeratedValue = function (key, value) {\n return isFalsyAttrValue(value) || value === 'false'\n ? 'false'\n // allow arbitrary string value for contenteditable\n : key === 'contenteditable' && isValidContentEditableValue(value)\n ? value\n : 'true'\n};\n\nvar isBooleanAttr = makeMap(\n 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n 'required,reversed,scoped,seamless,selected,sortable,translate,' +\n 'truespeed,typemustmatch,visible'\n);\n\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\n\nvar isXlink = function (name) {\n return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n};\n\nvar getXlinkProp = function (name) {\n return isXlink(name) ? name.slice(6, name.length) : ''\n};\n\nvar isFalsyAttrValue = function (val) {\n return val == null || val === false\n};\n\n/* */\n\nfunction genClassForVnode (vnode) {\n var data = vnode.data;\n var parentNode = vnode;\n var childNode = vnode;\n while (isDef(childNode.componentInstance)) {\n childNode = childNode.componentInstance._vnode;\n if (childNode && childNode.data) {\n data = mergeClassData(childNode.data, data);\n }\n }\n while (isDef(parentNode = parentNode.parent)) {\n if (parentNode && parentNode.data) {\n data = mergeClassData(data, parentNode.data);\n }\n }\n return renderClass(data.staticClass, data.class)\n}\n\nfunction mergeClassData (child, parent) {\n return {\n staticClass: concat(child.staticClass, parent.staticClass),\n class: isDef(child.class)\n ? [child.class, parent.class]\n : parent.class\n }\n}\n\nfunction renderClass (\n staticClass,\n dynamicClass\n) {\n if (isDef(staticClass) || isDef(dynamicClass)) {\n return concat(staticClass, stringifyClass(dynamicClass))\n }\n /* istanbul ignore next */\n return ''\n}\n\nfunction concat (a, b) {\n return a ? b ? (a + ' ' + b) : a : (b || '')\n}\n\nfunction stringifyClass (value) {\n if (Array.isArray(value)) {\n return stringifyArray(value)\n }\n if (isObject(value)) {\n return stringifyObject(value)\n }\n if (typeof value === 'string') {\n return value\n }\n /* istanbul ignore next */\n return ''\n}\n\nfunction stringifyArray (value) {\n var res = '';\n var stringified;\n for (var i = 0, l = value.length; i < l; i++) {\n if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {\n if (res) { res += ' '; }\n res += stringified;\n }\n }\n return res\n}\n\nfunction stringifyObject (value) {\n var res = '';\n for (var key in value) {\n if (value[key]) {\n if (res) { res += ' '; }\n res += key;\n }\n }\n return res\n}\n\n/* */\n\nvar namespaceMap = {\n svg: 'http://www.w3.org/2000/svg',\n math: 'http://www.w3.org/1998/Math/MathML'\n};\n\nvar isHTMLTag = makeMap(\n 'html,body,base,head,link,meta,style,title,' +\n 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +\n 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n 'embed,object,param,source,canvas,script,noscript,del,ins,' +\n 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n 'output,progress,select,textarea,' +\n 'details,dialog,menu,menuitem,summary,' +\n 'content,element,shadow,template,blockquote,iframe,tfoot'\n);\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nvar isSVG = makeMap(\n 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n true\n);\n\nvar isPreTag = function (tag) { return tag === 'pre'; };\n\nvar isReservedTag = function (tag) {\n return isHTMLTag(tag) || isSVG(tag)\n};\n\nfunction getTagNamespace (tag) {\n if (isSVG(tag)) {\n return 'svg'\n }\n // basic support for MathML\n // note it doesn't support other MathML elements being component roots\n if (tag === 'math') {\n return 'math'\n }\n}\n\nvar unknownElementCache = Object.create(null);\nfunction isUnknownElement (tag) {\n /* istanbul ignore if */\n if (!inBrowser) {\n return true\n }\n if (isReservedTag(tag)) {\n return false\n }\n tag = tag.toLowerCase();\n /* istanbul ignore if */\n if (unknownElementCache[tag] != null) {\n return unknownElementCache[tag]\n }\n var el = document.createElement(tag);\n if (tag.indexOf('-') > -1) {\n // http://stackoverflow.com/a/28210364/1070244\n return (unknownElementCache[tag] = (\n el.constructor === window.HTMLUnknownElement ||\n el.constructor === window.HTMLElement\n ))\n } else {\n return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n }\n}\n\nvar isTextInputType = makeMap('text,number,password,search,email,tel,url');\n\n/* */\n\n/**\n * Query an element selector if it's not an element already.\n */\nfunction query (el) {\n if (typeof el === 'string') {\n var selected = document.querySelector(el);\n if (!selected) {\n warn(\n 'Cannot find element: ' + el\n );\n return document.createElement('div')\n }\n return selected\n } else {\n return el\n }\n}\n\n/* */\n\nfunction createElement$1 (tagName, vnode) {\n var elm = document.createElement(tagName);\n if (tagName !== 'select') {\n return elm\n }\n // false or null will remove the attribute but undefined will not\n if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {\n elm.setAttribute('multiple', 'multiple');\n }\n return elm\n}\n\nfunction createElementNS (namespace, tagName) {\n return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nfunction createTextNode (text) {\n return document.createTextNode(text)\n}\n\nfunction createComment (text) {\n return document.createComment(text)\n}\n\nfunction insertBefore (parentNode, newNode, referenceNode) {\n parentNode.insertBefore(newNode, referenceNode);\n}\n\nfunction removeChild (node, child) {\n node.removeChild(child);\n}\n\nfunction appendChild (node, child) {\n node.appendChild(child);\n}\n\nfunction parentNode (node) {\n return node.parentNode\n}\n\nfunction nextSibling (node) {\n return node.nextSibling\n}\n\nfunction tagName (node) {\n return node.tagName\n}\n\nfunction setTextContent (node, text) {\n node.textContent = text;\n}\n\nfunction setStyleScope (node, scopeId) {\n node.setAttribute(scopeId, '');\n}\n\nvar nodeOps = /*#__PURE__*/Object.freeze({\n createElement: createElement$1,\n createElementNS: createElementNS,\n createTextNode: createTextNode,\n createComment: createComment,\n insertBefore: insertBefore,\n removeChild: removeChild,\n appendChild: appendChild,\n parentNode: parentNode,\n nextSibling: nextSibling,\n tagName: tagName,\n setTextContent: setTextContent,\n setStyleScope: setStyleScope\n});\n\n/* */\n\nvar ref = {\n create: function create (_, vnode) {\n registerRef(vnode);\n },\n update: function update (oldVnode, vnode) {\n if (oldVnode.data.ref !== vnode.data.ref) {\n registerRef(oldVnode, true);\n registerRef(vnode);\n }\n },\n destroy: function destroy (vnode) {\n registerRef(vnode, true);\n }\n};\n\nfunction registerRef (vnode, isRemoval) {\n var key = vnode.data.ref;\n if (!isDef(key)) { return }\n\n var vm = vnode.context;\n var ref = vnode.componentInstance || vnode.elm;\n var refs = vm.$refs;\n if (isRemoval) {\n if (Array.isArray(refs[key])) {\n remove(refs[key], ref);\n } else if (refs[key] === ref) {\n refs[key] = undefined;\n }\n } else {\n if (vnode.data.refInFor) {\n if (!Array.isArray(refs[key])) {\n refs[key] = [ref];\n } else if (refs[key].indexOf(ref) < 0) {\n // $flow-disable-line\n refs[key].push(ref);\n }\n } else {\n refs[key] = ref;\n }\n }\n}\n\n/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nvar emptyNode = new VNode('', {}, []);\n\nvar hooks = ['create', 'activate', 'update', 'remove', 'destroy'];\n\nfunction sameVnode (a, b) {\n return (\n a.key === b.key && (\n (\n a.tag === b.tag &&\n a.isComment === b.isComment &&\n isDef(a.data) === isDef(b.data) &&\n sameInputType(a, b)\n ) || (\n isTrue(a.isAsyncPlaceholder) &&\n a.asyncFactory === b.asyncFactory &&\n isUndef(b.asyncFactory.error)\n )\n )\n )\n}\n\nfunction sameInputType (a, b) {\n if (a.tag !== 'input') { return true }\n var i;\n var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;\n var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;\n return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)\n}\n\nfunction createKeyToOldIdx (children, beginIdx, endIdx) {\n var i, key;\n var map = {};\n for (i = beginIdx; i <= endIdx; ++i) {\n key = children[i].key;\n if (isDef(key)) { map[key] = i; }\n }\n return map\n}\n\nfunction createPatchFunction (backend) {\n var i, j;\n var cbs = {};\n\n var modules = backend.modules;\n var nodeOps = backend.nodeOps;\n\n for (i = 0; i < hooks.length; ++i) {\n cbs[hooks[i]] = [];\n for (j = 0; j < modules.length; ++j) {\n if (isDef(modules[j][hooks[i]])) {\n cbs[hooks[i]].push(modules[j][hooks[i]]);\n }\n }\n }\n\n function emptyNodeAt (elm) {\n return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n }\n\n function createRmCb (childElm, listeners) {\n function remove$$1 () {\n if (--remove$$1.listeners === 0) {\n removeNode(childElm);\n }\n }\n remove$$1.listeners = listeners;\n return remove$$1\n }\n\n function removeNode (el) {\n var parent = nodeOps.parentNode(el);\n // element may have already been removed due to v-html / v-text\n if (isDef(parent)) {\n nodeOps.removeChild(parent, el);\n }\n }\n\n function isUnknownElement$$1 (vnode, inVPre) {\n return (\n !inVPre &&\n !vnode.ns &&\n !(\n config.ignoredElements.length &&\n config.ignoredElements.some(function (ignore) {\n return isRegExp(ignore)\n ? ignore.test(vnode.tag)\n : ignore === vnode.tag\n })\n ) &&\n config.isUnknownElement(vnode.tag)\n )\n }\n\n var creatingElmInVPre = 0;\n\n function createElm (\n vnode,\n insertedVnodeQueue,\n parentElm,\n refElm,\n nested,\n ownerArray,\n index\n ) {\n if (isDef(vnode.elm) && isDef(ownerArray)) {\n // This vnode was used in a previous render!\n // now it's used as a new node, overwriting its elm would cause\n // potential patch errors down the road when it's used as an insertion\n // reference node. Instead, we clone the node on-demand before creating\n // associated DOM element for it.\n vnode = ownerArray[index] = cloneVNode(vnode);\n }\n\n vnode.isRootInsert = !nested; // for transition enter check\n if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n return\n }\n\n var data = vnode.data;\n var children = vnode.children;\n var tag = vnode.tag;\n if (isDef(tag)) {\n {\n if (data && data.pre) {\n creatingElmInVPre++;\n }\n if (isUnknownElement$$1(vnode, creatingElmInVPre)) {\n warn(\n 'Unknown custom element: <' + tag + '> - did you ' +\n 'register the component correctly? For recursive components, ' +\n 'make sure to provide the \"name\" option.',\n vnode.context\n );\n }\n }\n\n vnode.elm = vnode.ns\n ? nodeOps.createElementNS(vnode.ns, tag)\n : nodeOps.createElement(tag, vnode);\n setScope(vnode);\n\n /* istanbul ignore if */\n {\n createChildren(vnode, children, insertedVnodeQueue);\n if (isDef(data)) {\n invokeCreateHooks(vnode, insertedVnodeQueue);\n }\n insert(parentElm, vnode.elm, refElm);\n }\n\n if (data && data.pre) {\n creatingElmInVPre--;\n }\n } else if (isTrue(vnode.isComment)) {\n vnode.elm = nodeOps.createComment(vnode.text);\n insert(parentElm, vnode.elm, refElm);\n } else {\n vnode.elm = nodeOps.createTextNode(vnode.text);\n insert(parentElm, vnode.elm, refElm);\n }\n }\n\n function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n var i = vnode.data;\n if (isDef(i)) {\n var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;\n if (isDef(i = i.hook) && isDef(i = i.init)) {\n i(vnode, false /* hydrating */);\n }\n // after calling the init hook, if the vnode is a child component\n // it should've created a child instance and mounted it. the child\n // component also has set the placeholder vnode's elm.\n // in that case we can just return the element and be done.\n if (isDef(vnode.componentInstance)) {\n initComponent(vnode, insertedVnodeQueue);\n insert(parentElm, vnode.elm, refElm);\n if (isTrue(isReactivated)) {\n reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n }\n return true\n }\n }\n }\n\n function initComponent (vnode, insertedVnodeQueue) {\n if (isDef(vnode.data.pendingInsert)) {\n insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n vnode.data.pendingInsert = null;\n }\n vnode.elm = vnode.componentInstance.$el;\n if (isPatchable(vnode)) {\n invokeCreateHooks(vnode, insertedVnodeQueue);\n setScope(vnode);\n } else {\n // empty component root.\n // skip all element-related modules except for ref (#3455)\n registerRef(vnode);\n // make sure to invoke the insert hook\n insertedVnodeQueue.push(vnode);\n }\n }\n\n function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n var i;\n // hack for #4339: a reactivated component with inner transition\n // does not trigger because the inner node's created hooks are not called\n // again. It's not ideal to involve module-specific logic in here but\n // there doesn't seem to be a better way to do it.\n var innerNode = vnode;\n while (innerNode.componentInstance) {\n innerNode = innerNode.componentInstance._vnode;\n if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n for (i = 0; i < cbs.activate.length; ++i) {\n cbs.activate[i](emptyNode, innerNode);\n }\n insertedVnodeQueue.push(innerNode);\n break\n }\n }\n // unlike a newly created component,\n // a reactivated keep-alive component doesn't insert itself\n insert(parentElm, vnode.elm, refElm);\n }\n\n function insert (parent, elm, ref$$1) {\n if (isDef(parent)) {\n if (isDef(ref$$1)) {\n if (nodeOps.parentNode(ref$$1) === parent) {\n nodeOps.insertBefore(parent, elm, ref$$1);\n }\n } else {\n nodeOps.appendChild(parent, elm);\n }\n }\n }\n\n function createChildren (vnode, children, insertedVnodeQueue) {\n if (Array.isArray(children)) {\n {\n checkDuplicateKeys(children);\n }\n for (var i = 0; i < children.length; ++i) {\n createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);\n }\n } else if (isPrimitive(vnode.text)) {\n nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));\n }\n }\n\n function isPatchable (vnode) {\n while (vnode.componentInstance) {\n vnode = vnode.componentInstance._vnode;\n }\n return isDef(vnode.tag)\n }\n\n function invokeCreateHooks (vnode, insertedVnodeQueue) {\n for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n cbs.create[i$1](emptyNode, vnode);\n }\n i = vnode.data.hook; // Reuse variable\n if (isDef(i)) {\n if (isDef(i.create)) { i.create(emptyNode, vnode); }\n if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }\n }\n }\n\n // set scope id attribute for scoped CSS.\n // this is implemented as a special case to avoid the overhead\n // of going through the normal attribute patching process.\n function setScope (vnode) {\n var i;\n if (isDef(i = vnode.fnScopeId)) {\n nodeOps.setStyleScope(vnode.elm, i);\n } else {\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setStyleScope(vnode.elm, i);\n }\n ancestor = ancestor.parent;\n }\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n i !== vnode.fnContext &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setStyleScope(vnode.elm, i);\n }\n }\n\n function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n for (; startIdx <= endIdx; ++startIdx) {\n createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);\n }\n }\n\n function invokeDestroyHook (vnode) {\n var i, j;\n var data = vnode.data;\n if (isDef(data)) {\n if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n }\n if (isDef(i = vnode.children)) {\n for (j = 0; j < vnode.children.length; ++j) {\n invokeDestroyHook(vnode.children[j]);\n }\n }\n }\n\n function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (isDef(ch)) {\n if (isDef(ch.tag)) {\n removeAndInvokeRemoveHook(ch);\n invokeDestroyHook(ch);\n } else { // Text node\n removeNode(ch.elm);\n }\n }\n }\n }\n\n function removeAndInvokeRemoveHook (vnode, rm) {\n if (isDef(rm) || isDef(vnode.data)) {\n var i;\n var listeners = cbs.remove.length + 1;\n if (isDef(rm)) {\n // we have a recursively passed down rm callback\n // increase the listeners count\n rm.listeners += listeners;\n } else {\n // directly removing\n rm = createRmCb(vnode.elm, listeners);\n }\n // recursively invoke hooks on child component root node\n if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {\n removeAndInvokeRemoveHook(i, rm);\n }\n for (i = 0; i < cbs.remove.length; ++i) {\n cbs.remove[i](vnode, rm);\n }\n if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n i(vnode, rm);\n } else {\n rm();\n }\n } else {\n removeNode(vnode.elm);\n }\n }\n\n function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n var oldStartIdx = 0;\n var newStartIdx = 0;\n var oldEndIdx = oldCh.length - 1;\n var oldStartVnode = oldCh[0];\n var oldEndVnode = oldCh[oldEndIdx];\n var newEndIdx = newCh.length - 1;\n var newStartVnode = newCh[0];\n var newEndVnode = newCh[newEndIdx];\n var oldKeyToIdx, idxInOld, vnodeToMove, refElm;\n\n<<<<<<< HEAD\n // removeOnly is a special flag used only by <transition-group>\n // to ensure removed elements stay in correct relative positions\n // during leaving transitions\n var canMove = !removeOnly;\n=======\n/***/ }),\n/* 288 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n>>>>>>> 2606621664cb76ab783da1dddc55bd575ef271ea\n\n {\n checkDuplicateKeys(newCh);\n }\n\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (isUndef(oldStartVnode)) {\n oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n } else if (isUndef(oldEndVnode)) {\n oldEndVnode = oldCh[--oldEndIdx];\n } else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n } else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n } else {\n if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n idxInOld = isDef(newStartVnode.key)\n ? oldKeyToIdx[newStartVnode.key]\n : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);\n if (isUndef(idxInOld)) { // New element\n createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n } else {\n vnodeToMove = oldCh[idxInOld];\n if (sameVnode(vnodeToMove, newStartVnode)) {\n patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n oldCh[idxInOld] = undefined;\n canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);\n } else {\n // same key but different element. treat as new element\n createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n }\n }\n newStartVnode = newCh[++newStartIdx];\n }\n }\n if (oldStartIdx > oldEndIdx) {\n refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n } else if (newStartIdx > newEndIdx) {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n\n function checkDuplicateKeys (children) {\n var seenKeys = {};\n for (var i = 0; i < children.length; i++) {\n var vnode = children[i];\n var key = vnode.key;\n if (isDef(key)) {\n if (seenKeys[key]) {\n warn(\n (\"Duplicate keys detected: '\" + key + \"'. This may cause an update error.\"),\n vnode.context\n );\n } else {\n seenKeys[key] = true;\n }\n }\n }\n }", "title": "" }, { "docid": "e26737d7813a5bb4b4bf1200149b6d60", "score": "0.55833155", "text": "function renderStatic (\n index ,\n isInFor\n ) {\n var cached = this._staticTrees || ( this._staticTrees = [] );\n var tree = cached[ index ];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if ( tree && ! isInFor ) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[ index ] = this.$options.staticRenderFns[ index ].call (\n this._renderProxy ,\n null ,\n this // for render fns generated for functional component templates\n );\n markStatic ( tree , ( \"__static__\" + index ) , false );\n return tree\n }", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" }, { "docid": "b44c7bed46421254992c47c4aaa83edf", "score": "0.55640364", "text": "function renderStatic (\n index,\n isInFor\n) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree.\n if (tree && !isInFor) {\n return tree\n }\n // otherwise, render a fresh tree.\n tree = cached[index] = this.$options.staticRenderFns[index].call(\n this._renderProxy,\n null,\n this // for render fns generated for functional component templates\n );\n markStatic(tree, (\"__static__\" + index), false);\n return tree\n}", "title": "" } ]
6b9cf8557ea12009523e564c0b6f8ed4
For a new search
[ { "docid": "c68ffea56fd23010a286dacf696a1b74", "score": "0.0", "text": "function getSearchItem(event){\n event.preventDefault();\n if (searchText.val().trim() !== \"\") {\n meal = searchText.val().trim();\n searchMeal(meal);\n }\n}", "title": "" } ]
[ { "docid": "e45ee630ac042610be43dcb6b41ebb98", "score": "0.7042414", "text": "function newSearch(userInput) {\n hideResults();\n displayMessage();\n\tgetVidsResult(userInput);\n}", "title": "" }, { "docid": "953e73a355d6ff61b6020403e206e72f", "score": "0.6907353", "text": "function newsearch(opt) {\n var undef;\n if (opt.query === undef) return;\n\n opt.query = opt.query.replace(/^[▽▼]/g, ''); // for SKK\n if (!opt.page) opt.page = 1;\n opt.full = !!opt.full;\n\n query_string = serializeToQuery(opt);\n\n setHashDelay.cancel();\n\n searchDelay(function() {\n document.title = 'EijiroX: ' + opt.query + (opt.full ? ' (全文)' : '');\n searchRequest(opt, searchFinished);\n $('loading').className = ''; // show loading icon\n });\n}", "title": "" }, { "docid": "ed46b6b860e6343d17d376881c4a5a50", "score": "0.68609774", "text": "function search() {\n \n }", "title": "" }, { "docid": "fc10837769ec8481d37fb1bd48ec64ee", "score": "0.6515407", "text": "function input() {\n var q = $('query').value;\n if (q === last_query) return;\n last_query = q;\n newsearch({query: q});\n}", "title": "" }, { "docid": "ac3723c0844363d4b5887551e1a043c7", "score": "0.64670444", "text": "function beginSearch() {\n search(false);\n }", "title": "" }, { "docid": "614be914cfbe9b1b74bff8526b2a69ce", "score": "0.6403663", "text": "function buildQuery() {\n let isNewSearch = false;\n if (vm.newSearchRegion) {\n isNewSearch = true;\n vm.searchRegion = vm.newSearchRegion;\n }\n if (vm.newSearchColor) {\n isNewSearch = true;\n vm.searchColor = vm.newSearchColor;\n }\n if (vm.newSearchWine) {\n isNewSearch = true;\n vm.searchWine = vm.newSearchWine;\n }\n if (isNewSearch || vm.newSortWine !== vm.sortWine) {\n vm.sortWine = vm.newSortWine;\n vm.wines = [];\n loadPage(0);\n }\n }", "title": "" }, { "docid": "db0f0c8f95ae6791526f2addd8b9bee0", "score": "0.63942003", "text": "search() { }", "title": "" }, { "docid": "a830b088b13e8f2fc53772f246867b33", "score": "0.63802606", "text": "function doSearchCreator() { doSearch('creatordesc'); }", "title": "" }, { "docid": "1b8c63072e7f70cb331eeb1a69b0102d", "score": "0.6318897", "text": "function AddSearchItem(search, counter) {\n\n let searchDataNew = {\n name: search.toLowerCase(), // convert name to all lower case to prevent duplicates. Does not work for mispelling\n count: counter\n };\n tryCreateSearch(search.replace(/ /g, \"_\"), searchDataNew);\n}", "title": "" }, { "docid": "6000f5a2d753384383f6c288d5f05fcf", "score": "0.628751", "text": "runSearch() {\n\t\tthis.checkQuery() ? this.createRequest() : this.clearAll()\n\t}", "title": "" }, { "docid": "f741cc03b5846fff4690bda507b12a57", "score": "0.6275855", "text": "function processSearch() {\n let userSearch = $(\".search-box\").val().trim();\n // produce search results\n runApiCall(userSearch);\n let uSearch = new SearchedItem(userSearch);\n // add new search to gSearch.s array\n gSearch.s.push(uSearch);\n // reset search box text to placeholder\n $(\".search-box\").val(\"\");\n displayButtons();\n }", "title": "" }, { "docid": "efe206ccb05e6ca75f97c30637437d22", "score": "0.6223407", "text": "onSearch(value) {\n this.model.query = value;\n }", "title": "" }, { "docid": "db57d9559cd74bea4a77420008cf9972", "score": "0.62207365", "text": "function makeSearch(event) {\n event.preventDefault();\n\n /* reset variables and clear the page before new search */\n currentStartIndex = 0;\n searchResults.innerHTML = '';\n\n const url = composeUrl();\n sendRequest(url);\n}", "title": "" }, { "docid": "988a8a698bc3abbdd7b41330b6bb7532", "score": "0.6194024", "text": "async addOrUpdateSearchIndex() {\n return;\n }", "title": "" }, { "docid": "52273a4d633127413d775ddab33cc4fd", "score": "0.6177863", "text": "function handleSearch(newSearchQuery){\n setSearchQuery(newSearchQuery);\n repos.map((item)=>{\n if(item.login.includes(searchQuery)){\n //Storing the data in local storage\n localStorage.setItem(\"githubUser\",JSON.stringify(item))\n setFilteredName(item)\n }\n })\n }", "title": "" }, { "docid": "513e140ce0e854119703ca623a3b9ca8", "score": "0.6175753", "text": "function search(){\n\t\tif (tempSearchQuery.length > 0){\n\t\t\tsetSearchQuery(tempSearchQuery)\n\t\t\tsetSearching(true)\n\t\t} else if (searching){ // and temp search query is blank\n\t\t\tresetSearch()\n\t\t}\n\t}", "title": "" }, { "docid": "b907f86be37b95471dd2dda1482f9735", "score": "0.6167254", "text": "function newSearch(event) {\n event.preventDefault();\n var city = input.val();\n getCurrentWeather(city);\n getForecast(city);\n input.val(\"\");\n}", "title": "" }, { "docid": "e68e4908ae811cfa4d009b3c356566b7", "score": "0.6160704", "text": "function search_update(sample) {\n $scope.views.search.samples = sample_inventory(sample);\n $scope.views.search.count = 1;\n $scope.views.search.pages = aq.range(1 / 30);\n $scope.views.search.status = \"done\";\n }", "title": "" }, { "docid": "1d42f1f2acc7b22ef3a693bc8e2b887a", "score": "0.61426765", "text": "newSearch(){\n isBrushed = false;\n this.currentTopic = null;\n this.nrOfTweets = 0;\n this.geoTweets = [];\n this.noneGeoTweets = [];\n this.containingTopic = [];\n totalTweets = [];\n this.updateNumbers(0, 0);\n twitterPreview.removeTweets();\n this.svg.selectAll('.dot').remove();\n }", "title": "" }, { "docid": "cd2d3f062165668f79d58dc7b6d52d73", "score": "0.61373526", "text": "function makeAvailableToSearch(index){\n//alert(advancedsearch.length);\t\npointerIndex = add_to_array('advancedsearch',\"label\", info_fieldlist[index][3],-1); // -1 = start new entry\npointerIndex = add_to_array('advancedsearch',\"name\",info_fieldlist[index][0],pointerIndex);\npointerIndex = add_to_array('advancedsearch',\"type\",info_fieldlist[index][5],pointerIndex);\n}", "title": "" }, { "docid": "6437027ec8d058fd9a36f493d3368727", "score": "0.60968834", "text": "onSearched(data) {\n\t\tthis.setState({\n\t\t\tcurrentOutput: data,\n\t\t\tallRowsSelected : false,\n\t\t\tselectedRows : {}\n\t\t});\n\t\tif(data && data.query && data.updateUrl) {\n\t\t\tconst params = QueryModel.toUrlParams(data.query);\n\t\t\tFlexRouter.setBrowserHistory(\n\t\t\t\tparams, //will also be stored in the browser state (cannot exceed 640k chars)\n\t\t\t\tthis.constructor.name //used as the title for the state\n\t\t\t)\n\t\t}\n\t}", "title": "" }, { "docid": "383aa39500037a44f715ed8533a73223", "score": "0.6093959", "text": "function updateSearch() {\n\tvar query = currentQuery();\n\twith(query) {\n\t\tif((term && term.length)\n\t\t\t|| (place && place.length)\n\t\t\t|| (from && from.length)\n\t\t\t|| (to && to.length)\n\t\t\t|| (copybook && copybook.length && copybook != \"0\")\n\t\t\t|| (box && box.length && box != \"0\")) {\n\t\t\t$(\"#query_items\").button(\"enable\");\n\t\t\tcount_items();\n\t\t}\n\t\telse {\n\t\t\t$(\"#query_items\").button(\"disable\");\n\t\t\tcount_items();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "465010271a0519eeb811d51fefc52435", "score": "0.60848147", "text": "function makeSearch() {\n if (ctrl.searchQuery) {\n if (ctrl.selectedUser !== null) {\n resetSearch();\n\n // Filter search results\n angular.forEach(ctrl.selectedUser.rels.postsList, function (post) {\n post.isItemFitQuery = lodash.includes(post.title, ctrl.searchQuery) || lodash.includes(post.body, ctrl.searchQuery);\n });\n\n $rootScope.$broadcast('search-posts_make-search', {\n isItemPostsShown: true,\n userId: ctrl.selectedUser.id\n });\n } else {\n var posts = lodash.chain(ctrl.usersList)\n .map(function (userItem) {\n return lodash.get(userItem, 'rels.postsList');\n })\n .flatten()\n .value();\n\n // Filter search results\n angular.forEach(posts, function (post) {\n post.isItemFitQuery = lodash.includes(post.title, ctrl.searchQuery) || lodash.includes(post.body, ctrl.searchQuery);\n });\n\n $rootScope.$broadcast('search-posts_make-search', {isItemPostsShown: true});\n }\n } else {\n resetSearch();\n }\n }", "title": "" }, { "docid": "edb414a3f6494b4af33313b3cdde1ce0", "score": "0.60727984", "text": "function newSearch (req,res){\n // console.log(req.query );\n res.render('pages/index');\n}", "title": "" }, { "docid": "7e993f67523a7d8706d3663801eda29e", "score": "0.6047398", "text": "function search() {\n reset();\n findMeaning(); //i had to.\n findRank();\n findCelebs();\n }", "title": "" }, { "docid": "eb4f50518e7e6fd80b9a785aa8a88f8b", "score": "0.60158974", "text": "function updateSearchCriteria() {\n $scope.refineSearchValues = {\n OrigintoDisp: ($scope.refineSearchValues && $scope.refineSearchValues.OrigintoDisp) ? $scope.refineSearchValues.OrigintoDisp : undefined,\n Minfare: null,\n Maxfare: null,\n Region: null,\n Theme: null,\n FromDate: (typeof $scope.FromDate == 'string') ? new Date($scope.FromDate) : $scope.FromDate,\n ToDate: (typeof $scope.ToDate == 'string') ? new Date($scope.ToDate) : $scope.ToDate\n };\n }", "title": "" }, { "docid": "3f35f0b077ede9c2c1e240f27b1b60fe", "score": "0.60101336", "text": "async flushSearchResults() {\n\t\tif (MyOptions.getSaveHistResults()) { let saveResults = [...this.searchResults]; this.searchResults = []; await MYDB.addToDB('searching', 'results', saveResults); }\n\t}", "title": "" }, { "docid": "cc7fd28251e8b6cbae78da544f0bd381", "score": "0.60081345", "text": "function save_search() {\n setLoadingSaveSearch(true);\n let databases = [];\n checkedSpringer\n ? databases.push({\n name: 'springer',\n })\n : console.log('Springer not checked');\n\n checkedElsevier\n ? databases.push({\n name: 'elsevier',\n })\n : console.log('Elsevier not checked');\n\n checkedIeee\n ? databases.push({\n name: 'ieee',\n })\n : console.log('IEEE not checked');\n\n const config = {\n 'Content-Type': 'application/json',\n 'x-api-key': process.env.REACT_APP_API_KEY,\n };\n\n console.log(sub);\n\n const params = {\n event: {\n sub: sub,\n query: $('#builder').queryBuilder('getRules'),\n page: 0,\n databases: databases,\n name: searchname.value,\n },\n };\n\n if (totalResults <= 200) {\n console.log('fetch it');\n axios\n .post(\n process.env.REACT_APP_AWS_URL_DUSTIN + '/temp_search',\n params,\n { headers: config }\n )\n .then((res) => {\n console.log(res);\n setLoadingSaveSearch(false);\n })\n .catch(function (error) {\n console.log(error);\n });\n } else {\n console.log('Suche zu groß!!!');\n setLoadingSaveSearch(false);\n }\n }", "title": "" }, { "docid": "53fcb40b51169929af5f97745f6215c8", "score": "0.60069627", "text": "function updateSearch(searchString) {\n searchString = searchString.toLowerCase();\n if (searchString.length==0 || searchString=='start typing a name...') {\n var p = $('.top-org');\n hacky_count = p.length;\n p.removeClass('match');\n p.removeClass('childMatch');\n container.addClass('no-search');\n resultCountBox.text(hacky_count + ' Organizations');\n return;\n }\n container.removeClass('no-search');\n hacky_count = 0;\n for (var i=0;i<index.length;i++) {\n updateSearch_recur(searchString,index[i]);\n }\n resultCountBox.text(hacky_count + ' Results');\n }", "title": "" }, { "docid": "da760fb1859b9107fefb483d5c505fbf", "score": "0.60041684", "text": "function make_search_token(model, sid) {\n \n orig_rid = submittedTokens.get('form.orig_rid')\n if (typeof (sid) === 'string' && typeof(orig_rid) === 'string')\n {\n console.log(sid);\n var query= \"sid = \\\"\"+sid+\"\\\" orig_rid =\\\"\"+orig_rid + \"\\\"\";\n \n } submittedTokens.set('investigation_form', query);\n\n\n }", "title": "" }, { "docid": "d1e953ec4c28b321192b380037ae0357", "score": "0.59939295", "text": "function recoverSearch() {\n var keyword = gitbook.storage.get(\"keyword\", \"\");\n\n createForm(keyword);\n\n if (keyword.length > 0) {\n if(!isSearchOpen()) {\n toggleSearch(true); // [Yihui] open the search box\n }\n sidebarFilter(search(keyword));\n }\n }", "title": "" }, { "docid": "0612e9182c50b99c6181b16f91539efe", "score": "0.5992364", "text": "onSearch() {\n const newTags = formData.searchBox.value.split(' ');\n tagsArray = tagsArray.concat(newTags);\n newArr = Array.from(new Set(tagsArray)); // create the new array without duplicated values\n this.onDisplayTags(newArr);\n this.getResult(newArr);\n formData.searchBox.value = ''; // clear the field\n }", "title": "" }, { "docid": "57a5fe7a4cff4c9b6c04f068f0aa2384", "score": "0.59846723", "text": "_addNewSearchItem(videos) {\n _ytSearchState = videos;\n this.emit(CHANGE);\n }", "title": "" }, { "docid": "443f7e89054218e276c96081c7e30089", "score": "0.59799415", "text": "function getNewNews(e) {\n e.preventDefault();\n const searchInput = document.querySelector('.search-term');\n let searchValue = searchInput.value;\n\n // account for user not entering a search term\n if (!searchValue) {\n alert('Please enter a search term');\n return;\n }\n\n clearPreviousNews();\n getNews(searchValue);\n\n searchInput.value = '';\n\n // set the global variable to true, so we can make a new fetch request with the new search term\n newNews = true;\n }", "title": "" }, { "docid": "c37afa732cdbe90eb7369c830d3df722", "score": "0.59682155", "text": "function search() {\n window.location = (currEng.url + currEng.query + input.value);\n return false;\n}", "title": "" }, { "docid": "a7f943d557e86d8cddcfc9a03c57c1dd", "score": "0.59590137", "text": "ajouter_recherche(){\n var i =0;\n var trouver = false;\n if (this.recherche_courante) {\n while(i<this.recherches.length && !trouver){\n if (this.recherches[i].recherche == this.recherche_courante) {\n trouver = true;\n this.recherches[i].nouvelles = this.recherche_courante_news;\n }else{\n i++;\n }\n }\n if (!trouver) {\n var r = new Recherche(this.recherche_courante,this.recherche_courante_news);\n this.recherches.push(r);\n }\n this.local.setItem(\"recherches\",JSON.stringify(this.recherches));\n }else{\n trouver = true;\n }\n\n return trouver ;\n }", "title": "" }, { "docid": "5dd5563cc06570e21a2e8143a00c0da7", "score": "0.5947759", "text": "function handleSearchChange(newSearchText) {\n setSearchText(newSearchText);\n\n if (newSearchText) {\n // Here we should call TMDB\n\n const searchURL = \"https://api.themoviedb.org/3/search/person?api_key=53d2ee2137cf3228aefae083c8158855&query=\" + newSearchText;\n axios.get(searchURL).then(response => {\n setResults(response.data.results);\n });\n } else {\n setResults([]);\n }\n }", "title": "" }, { "docid": "5696ca27b48eac4b2cb0000336413b2d", "score": "0.59475946", "text": "async onSearch(event) {\n event.preventDefault();\n const searchType = event.target[0].value;\n const bookName = event.target[1].value;\n const searchQuery = bookName ? searchType + bookName : '';\n\n await this.updateBookList(searchQuery);\n history.pushState(null, '', `?search=${searchQuery}`);\n }", "title": "" }, { "docid": "10409423eed64c1adae3eb33c5c3786a", "score": "0.59408474", "text": "function search() {\r\n vm.hitSearch = \"\";\r\n vm.condition = [];\r\n addFilterdata();\r\n if (vm.searchText == undefined || vm.searchText === \"\") {\r\n init().then(function () {\r\n random();\r\n });\r\n\r\n } else {\r\n // autoFill();\r\n datasearch.basicSearch(vm.indicesName, $rootScope.logtype, vm.pagecount, vm.field, vm.searchText, vm.condition, vm.st, vm.ft)\r\n .then(function (resp) {\r\n\r\n /*vm.hitSearch = resp.data.Data;\r\n vm.total = resp.data.Total;\r\n vm.tt = resp.total < vm.pagecount ? resp.total : vm.pagecount;*/\r\n vm.hitSearch = resp.hits.hits;\r\n vm.total = resp.hits.total;\r\n vm.tt = resp.hits.total < vm.pagecount ? resp.hits.total : vm.pagecount;\r\n\r\n\r\n vm.getCurrentPageData(vm.hitSearch);\r\n random();\r\n }, function (err) {\r\n // log(\"search data error \" + err.message);\r\n });\r\n }\r\n\r\n }", "title": "" }, { "docid": "e176ef59f94b4c0c0bdd17bf2ab57e06", "score": "0.59382534", "text": "function lancerRecherche()\n\t{\n\t\t//Récupérer la valeur dans la zone de recherche\n\t\tvar term = $( \"#search\" ).val();\n\t\tif(term.length > 1)\n\t\t{\n\t\t\t//Effacer le résultat courant e\n\t\t\tclearOldResults();\n\n\t\t\t//Loader attente\n\t\t\tchargementLoader();\n\n\t\t\t//Capturer le temps\n\t\t\ttemps_debut = new Date().getTime();\n\n\t\t\tif(rechercheLocal)\n\t\t\t{\n\t\t\t\tlocalFullSearch(term);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfullSearch(term);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$( \"#search\" ).focus();\n\t\t}\n\n\t}", "title": "" }, { "docid": "94a9b299524b055c424e3134c40f7a04", "score": "0.5936151", "text": "search() {\n if (this.query) {\n let url = this.router.generate('documents', { q: this.query });\n console.log(`=== DocumentSearch search generated url: ${url}`);\n this.router.navigate(url);\n }\n }", "title": "" }, { "docid": "c6faeb8cba5d28e5adf4dbfca8a8cd99", "score": "0.5924749", "text": "function handleNormalSearch(query) {\n\tconsole.log(\"doing normal search with query: \" + query);\n\t// TODO: you should do normal search here\n\twindow.location.replace(\"/your-project-name/SearchResultsServlet?title=\" + query + \"&display=50&sort=rating\");\n}", "title": "" }, { "docid": "ebddbb00bdea877f78e0808aff9b65ed", "score": "0.59216434", "text": "pushSearchHistory (search) {\n return this.globalVimState.searchHistory.unshift(search)\n }", "title": "" }, { "docid": "f494aea509ed153118e7b78cebc001e8", "score": "0.5914141", "text": "function handleNormalSearch(query) {\n\twindow.location.replace(\"movielist.html?query=\" + query);\n}", "title": "" }, { "docid": "50607838dd944f951a890f1db3132992", "score": "0.5899747", "text": "function makeSearch() {\n var query = $('#searchInput').val();\n if (query.length < 2) {\n return null;\n }\n\n // cleanup & make AJAX query with building response\n $('#ajax-result-items').empty();\n $.getJSON(script_url+'/api/search/index?query='+query+'&lang='+script_lang, function (resp) {\n if (resp.status !== 1 || resp.count < 1)\n return;\n\n let searchContainer = $('#search-popup');\n let searchList = searchContainer.find('#search-list').empty();\n $.each(resp.data, function(id, item) {\n searchList.append('<a href=\"' + site_url + item.uri + '\" class=\"list-group-item list-group-item-action\">' + item.title + '</a>');\n });\n searchContainer.removeClass('d-none');\n });\n }", "title": "" }, { "docid": "f625ff804cdd33cc0e741474ad48bfd7", "score": "0.589856", "text": "newSearch () {\n \n\n // reset paging parameters\n this.setState ( {perPage: 5, page: 0, maxPage: 0} );\n console.log(this.getUrl());\n\n fetch ( this.getUrl(), this.headerArgs)\n .then ( response => response.json() )\n .then ( responseData => this.setState ({data: responseData}))\n .catch ( err => console.error(err));\n\n // load interactions after getting the search\n // ran in componentdidupdate\n \n }", "title": "" }, { "docid": "0619f47888edb4b1d3e5a56ec169344e", "score": "0.58638", "text": "action(i) { // Action to be executed when a index match with spoken word\n if(i == 3) {\n vm.search = \"\";\n } else {\n vm.fetchEmployees();\n }\n }", "title": "" }, { "docid": "25f04c27464847791bc656d2ed430f33", "score": "0.58601654", "text": "searchQueryChanged(query) {\n const { searchQuery } = query;\n console.log('searchQuery [FROM SEARCH]: ' + searchQuery);\n \n // true = clear all filters for new search\n this.fetchData(searchQuery, true);\n }", "title": "" }, { "docid": "2b05875a282c34fec1491f1134a6adcc", "score": "0.5858353", "text": "pushHistoryState(newSearch) {\n let newState = { searchTerm: newSearch }\n if (newSearch === this.props.searchTerm) {\n newState.results = this.props.location.state.results\n }\n const newLocation = '/search/' + newSearch\n this.props.history.push(newLocation, newState)\n }", "title": "" }, { "docid": "4f4a623237dedafd6b0184dc9bb3bef1", "score": "0.5857352", "text": "SET_SEARCH(state, newSearch) {\n state.search = newSearch;\n }", "title": "" }, { "docid": "cf4ccdb7238721014ee51be21287c63f", "score": "0.5856442", "text": "submitQuery() {\n if (this.isHuntId_(this.query)) {\n this.checkHunt_(this.query);\n } else {\n this.grrRoutingService_.go('search', {q: this.query});\n }\n }", "title": "" }, { "docid": "429f84b2704c0a2e9150fa248c5efd60", "score": "0.5851381", "text": "function gotoNew(url) {\r\n\t$(\"a\").click(function(){ return false; });\r\n\twindow.location = url+'&search[value][]=New:0';\r\n}", "title": "" }, { "docid": "9cd355c68c6a2a5271bebd7e158a9178", "score": "0.58354735", "text": "function search(searchEvent){\n\t// Set the new search string, escaping special rexexp characters\n\tvar searchTerms = searchEvent.target.value;\n\tfilterString=searchTerms.replace(/([\\^\\$\\/\\.\\+\\*\\\\\\?\\(\\)\\[\\]\\{\\}\\|])/ig, \"\\\\$1\");\n\tif(last_results && last_results.length){\n\t\t// Remove the current entries\n\t\tvar contents = document.getElementById('content');\n\t\tremoveEntriesFromContents(contents);\n\t\t// Filter entries\n\t\tvar searchResults = filterEntries(last_results);\n\t\t// Got no results?\n\t\tif (searchResults == null || searchResults.length < 1) {\n\t\t\tshowMessageInContents(contents, getLocalizedString(\"No Items Found\"),\n\t\t\t\tgetLocalizedString(\"No items matched the search terms.\"));\n\t\t}\n\t\telse{\n\t\t\t// Generate the display\n\t\t\taddEntriesToContents(contents, searchResults);\n\t\t}\n\t\t// update the scrollbar so scrollbar matches new data\n\t\trefreshScrollArea();\n\t}\n}", "title": "" }, { "docid": "680b7662f96f67186e7b42d90ac45fff", "score": "0.58334553", "text": "onSearchButtonClicked(userQuery) {\n this.liveSearch(userQuery);\n }", "title": "" }, { "docid": "e2f8e1ab3479b93b86f24c4115b6efca", "score": "0.58118486", "text": "search (searchInput) {\n console.log(`Default search action for: ${searchInput}`);\n this.searchFilter = searchInput;\n this._updateTableData(true);\n }", "title": "" }, { "docid": "5b11a36ef1291f33b2e0bef3f536af31", "score": "0.5811248", "text": "search(){\n\t\tthis.props.history.push(\"/search/\"+this.state.selectedSection+\"/\"+encodeURIComponent(this.state.searchTerm));\n\t}", "title": "" }, { "docid": "521437c6124b05b5333b897cc1938e50", "score": "0.58060443", "text": "function FuseSearch() {\n}", "title": "" }, { "docid": "b7027aa0dcc3a8759a80af4a44ed3788", "score": "0.58020973", "text": "function searchTextChange(text) {\n // formAtributosExtra.campoExtra.missing = true;\n }", "title": "" }, { "docid": "69d1beb1754cba6b2c60e50ac5adf90f", "score": "0.5799076", "text": "function searchSelection(agent){\n let query = agent.context.get('query').parameters.query;\n const year = agent.parameters.year;\n //if(query === 'car'){\n agent.add(`We'll search for your car model starting by the year. Which year is it?`);\n\n agent.context.set({\n name: 'year',\n lifespan: 2,\n parameters: {\n year: year\n }\n });\n\n // } else {\n // agent.add(`Type you car year, make & model.`);\n\n // const make = agent.parameters.make;\n // const model = agent.parameters.model;\n // agent.context.set({\n // name: 'parts',\n // lifespan: 2,\n // parameters: {\n // year: year,\n // make: make,\n // model: model\n // }\n // });\n // }\n }", "title": "" }, { "docid": "2baadc04c2f7b83e6a95f1c72ed96f0e", "score": "0.57987255", "text": "function UpdateSeachItem(search, counter) {\n let searchData = {\n name: search.toLowerCase(),\n count: counter\n };\n tryUpdateSearch(search.replace(/ /g, \"_\"), searchData);\n}", "title": "" }, { "docid": "c91c7261f584407f4ff1a577848f568d", "score": "0.5790545", "text": "function prepareNewSearchRequest(value) {\n if (script.debug) { console.log(\"searching for \" + value); }\n\n script.search_bar.blur(); // close search suggestions dropdown\n script.search_suggestions = []; // clearing the search suggestions\n\n sendSearchRequest(\"https://www.youtube.com/results?\" + (script.modern ? \"search_query=\" : \"disable_polymer=1&q=\") + encodeURIComponent(value));\n }", "title": "" }, { "docid": "a3775a4ddd9949e6f269107316768dd0", "score": "0.5789471", "text": "function reuseSearchData(query, queryType) {\n\tvar searchObject = {};\n\tif (queryType === 'movie') {\n\t\t// loops through user's search history and gets old search object data\n\t\tsearchObject = getSearchDataFromHistory(query, 'movie');\n\t}\n\tif (queryType === 'person') {\n\t\t// loops through user's search history and gets old search object data\n\t\tsearchObject = getSearchDataFromHistory(query, 'person');\n\t}\n\t// reuses search object data to update lastsearch\n\tdatabase.ref('usersearches/' + searchObject.id + '/lastsearch').set(searchObject);\n\t// redirects to search.html if not already there\n\tafterLoadRedirectTo(searchObject, 'search.html');\n}", "title": "" }, { "docid": "45c1e01096597483f25299f85d094dbb", "score": "0.5784653", "text": "submitSearch (search) {\n //empty the array\n app.searchResults.splice(0,app.searchResults.length) //clear the results from previous results\n // filters out whitespaces or null\n if(!(search.trim().length===0)){//cuts the spaces out on both ends\n\n //search first, due to cache\n socket.emit('search-character',search)//this sends a search to the socket to make an api call\n\n \n \n }\n this.lastSearch = this.search//we set our search to our last search\n this.search = '' // and then we clear search for its ready for the next\n }", "title": "" }, { "docid": "e2f5919d0ca4adab2df1293a240250ee", "score": "0.57838666", "text": "function handleSearchRequest(query){\r\n transcriptController.processSearchQuery(query);\r\n }", "title": "" }, { "docid": "2e60e98e3c5cb7fd8248dddea0970481", "score": "0.5782909", "text": "function searchValidateNewSearch() {\r\n\tif (document.forms[0].query.value.length > 0) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\tdocument.forms[0].query.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "ac262bd66d029a0e97a4ea52243e1fd3", "score": "0.5781627", "text": "function searchDatabase(addNewName) {\n processingStart()\n var name = \"\";\n if(addNewName) {\n name = $(\".newName\").val();\n $(\"#newNamePopup\").modal(\"hide\");\n $('.queryDatabase option[value=\"col\"]').attr(\"selected\", \"selected\");\n } else {\n name = $(\".name\").val();\n }\n if(name == \"\") {\n alert(\"Please provide a name to search!!\");\n return;\n }\n var dbName = $(\"#queryDatabase\").val();\n if(dbName == \"databaseName\") {\n alert(\"Please select a database to query from!!\");\n return;\n }\n searchAndPopupResult(name, dbName, addNewName);\n}", "title": "" }, { "docid": "90246bcea8281f759d26860a175d0b53", "score": "0.5780757", "text": "function addSearchTerm(searchTerm, noUpdate, openInAnalyze,datasetExplorerPath)\t{\n\tvar category = searchTerm.display == undefined ? \"TEXT\" : searchTerm.display;\n\t\n\tcategory = category + \"|\" + (searchTerm.category == undefined ? \"TEXT\" : searchTerm.category);\n\t\n\tvar text = (searchTerm.text == undefined ? (searchTerm.keyword == undefined ? searchTerm : searchTerm.keyword) : searchTerm.text);\n\tvar id = searchTerm.id == undefined ? -1 : searchTerm.id;\n\tvar key = category + \";\" + text + \";\" + id;\n\tif (currentSearchTerms.indexOf(key) < 0)\t{\n\t\tcurrentSearchTerms.push(key);\n\t\tif (currentCategories.indexOf(category) < 0)\t{\n\t\t\tcurrentCategories.push(category);\n\t\t\tcurrentSearchOperators.push(\"or\");\n\t\t}\n\t} \n\t\n\t// clear the search text box\n\tjQuery(\"#search-ac\").val(\"\");\n\n\t// only refresh results if the tree was not updated (the onSelect also fires these event, so don't want to do 2x)\n\t\n\tif (!noUpdate) {\n\t\tif(!openInAnalyze){\n\t\t\tjQuery.ajax({\n\t\t\t\turl:resetNodesRwgURL\n\t\t\t});\n\t\t\tshowSearchTemplate();\n\t\t}\n\t showSearchResults(openInAnalyze, datasetExplorerPath);\n\t}\n}", "title": "" }, { "docid": "b5afc685fe87877ed97ae9db0a020865", "score": "0.5778736", "text": "doActualSearch(query) {\n return [\n {id: 1, name: `fake-name-1-${query}`},\n {id: 2, name: `fake-name-2-${query}`},\n {id: 3, name: `fake-name-3-${query}`}\n ];\n }", "title": "" }, { "docid": "12358c7f97f8d47610cc0716a94ad04b", "score": "0.5772272", "text": "extend_reactions (new_reactions) {\n if (this.enable_search) {\n for (var r_id in new_reactions) {\n var reaction = new_reactions[r_id]\n this.search_index.insert('r' + r_id, { 'name': reaction.bigg_id,\n 'data': { type: 'reaction',\n reaction_id: r_id }})\n this.search_index.insert('r_name' + r_id, { 'name': reaction.name,\n 'data': { type: 'reaction',\n reaction_id: r_id }})\n if (reaction.bigg_id) {\n this.bigg_index.insert(reaction.bigg_id, r_id, reaction)\n }\n for (var g_id in reaction.genes) {\n var gene = reaction.genes[g_id]\n this.search_index.insert('r' + r_id + '_g' + g_id,\n { 'name': gene.bigg_id,\n 'data': { type: 'reaction',\n reaction_id: r_id }})\n this.search_index.insert('r' + r_id + '_g_name' + g_id,\n { 'name': gene.name,\n 'data': { type: 'reaction',\n reaction_id: r_id }})\n }\n }\n }\n utils.extend(this.reactions, new_reactions)\n }", "title": "" }, { "docid": "7a36b7c33bf4feaef714aaea6619a28b", "score": "0.57718545", "text": "function search() {\n $state.go('main.search.searchResults');\n }", "title": "" }, { "docid": "9f938fb438557a9fbcdff81b651d6bb4", "score": "0.5771155", "text": "_searchChanged(term, oldTerm) {\n if (term.length >= 3) {\n this.whileLoading = true;\n // only load up the lunr source data once they have 3 or more characters\n if (typeof this.dataSource === typeof undefined) {\n this.dataSource = \"lunrSearchIndex.json\";\n }\n }\n }", "title": "" }, { "docid": "247fb8cb5d8a8e1356cb9f5bd6b4d93a", "score": "0.57711506", "text": "function submitSearch() {\n\t/* If the user has already generated the SQL */\n\tif ($(\"#thequery\").html().length > 1) {\n\t\t$(\"#q\").val(encodeURIComponent($(\"#thequery\").html()));\n\t\t$(\"#qdata\").val(musicSearch.allSearchTags.join(\"[|]\"));\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\t\n\t}\n}", "title": "" }, { "docid": "a22efa4b06a562f20e706920b9451ef2", "score": "0.57594657", "text": "function newMovieSearch(searchType) {\n //search term\n var searchTerm = $('#movie-search').val();\n\n //avoid querying for an empty string\n if(searchTerm === '') {\n //notify user we don't allow empty searches\n $(\"#search-error\").removeClass('hide').html(\"Error: search term is required\");\n return;\n }\n\n //data to include in the search request\n var searchParams = {};\n //limit to movies (no tv series, etc)\n searchParams['type']='movie';\n //movie name\n searchParams[searchType]=searchTerm;\n //pull set #1 of search results\n searchParams['page']=1;\n //key allowing API access\n searchParams['apikey']=apiKey;\n\n searchForMovie(searchParams, true);\n}", "title": "" }, { "docid": "2765deb5084bed388a3ccffce69acf8f", "score": "0.574614", "text": "cache(query) {\n this.cachedSearches.push(query);\n }", "title": "" }, { "docid": "0d755294cd60637c8a392e43a6caae49", "score": "0.5745772", "text": "@action searchInput(input){\n\t\tthis.search_input = input;\n\t}", "title": "" }, { "docid": "9d5fbe05337540a7885b6b3ea0ddc94d", "score": "0.5733813", "text": "search() {\n\t\t\tif (this.search.length > 0) {\n\t\t\t\tthis.onSearch(this.search, this.toggleLoading)\n this.$emit('search', this.search, this.toggleLoading)\n }\n\t\t}", "title": "" }, { "docid": "140389a7ba1c87b66c3ad6433eff27f2", "score": "0.5726279", "text": "function search(){saveState();self.filtered=self.gridController.rawItems.filter(self.filterFunc);self.gridController.doFilter();}", "title": "" }, { "docid": "37e71ddd1c456aa289705ea935acb828", "score": "0.5725989", "text": "searchKeyword(event) {\n this.searchKey = event.target.value;\n this.selectedName = event.target.value;\n console.log(\"Search item\" + this.searchKey);\n if(this.selectedValue){\n return;\n }\n this.processing = true;\n this.getLookupResult();\n }", "title": "" }, { "docid": "feb679ce9a5b6e975f993f5ce2061758", "score": "0.57226837", "text": "function addSearchToDB(search, res, errorHandler) {\n\tDB.Search.create({\n\t\tstate: search.state,\n\t\tstart_date: search.startDate,\n\t\tend_date: search.endDate,\n\t\tUserId: search.id\n\t}).catch(function (reason) {\n\t\t// if an errorHandler was passed run it\n\t\tif (errorHandler) { errorHandler(reason); }\n\t});\n}", "title": "" }, { "docid": "4105591e94854fb6b82158e284485035", "score": "0.5718801", "text": "function recordSearchData(json){\n\t\t\t\tvar results = mymap.search.items;\n\t\t\t\t $.each(json, function(i, item) {\n\t\t\t\t\tvar resultObject = {\n\t\t\t\t\t\tname:item.chronname,\n\t\t\t\t\t\tnickname:item.nicknames,\n\t\t\t\t\t\tvalue: item.unitid,\n\t\t\t\t\t\ttype: \"institution\",\n\t\t\t\t\t\trate: item.grad_150_value,\n\t\t\t\t\t\tsize: item.cohort_size\n\t\t\t\t\t};\n\t\t\t\t\tresults.push(resultObject);\n\t\t\t\t});\n\t\t\t\tvar $customChooser = $('#custom_chooser');\n\t\t\t\tif (($customChooser.length > 0) && dataExpress) {\n\t\t\t\t\tdataExpress.customsearch();\n\t\t\t\t}\n\t\t\t\t// log(results);\n\t\t\t\tloadSearchBar();\n\t\t\t}", "title": "" }, { "docid": "009ae5272951e270eae9c4d05c31441e", "score": "0.5714249", "text": "research(contact_search) {\n\n\n\n this.contacts.forEach((contact,index, contacs ) => {\n\n // 1a modalitá primordiale\n // const search_string = this.contact_search.toLowerCase() ;\n\n // qui l'input dell'utente 'e stato modificato in modo da rendere mauscolo li primo carattere con il metodo .charAt(indice 0 in quanto di tratta della prima lettera) ed unito con la il resto della stringa prendendola completa ma rimuovendo il primo carattere in stringa il quale sarebbe minuscolo\n // const search_string_capitalized = search_string.charAt(0).toUpperCase() + search_string.slice(1) ;\n\n\n // Modalitá 2.0 piú solida : la prima versione soffriva di una criticitá che non permetteva di ricercare il contatto digitando caratteri nel mezzo del nominativo oppure alla fine, in quanto ponendo la prima lettera come maiuscola non veniva riconosciuto il contatto essendo case sensitive\n\n // se il nome del contatto attuale è filtrato da contact_search\n // in questa variabile é presente l'input di ricerca contatti dell'utente\n // porre la stringa di ricerca utente in minuscolo e condensare il tutto in una variabile cosi da rendere tutto piú leggibile\n const search_string = this.contact_search.toLowerCase() ;\n\n // facciamo la stessa cosa con l'elemento contatto e la propietá nome e la poniamo in minuscolo e condensata in una variabile\n const contact_name_lowercase = contact.name.toLowerCase();\n\n // poi verranno confrontate fra di loro ed eseguita la ricerca e quindi filtrare i vari contatti \n\n // DEBUG:\n // console.log(search_string);\n // console.log(search_string_capitalized);\n if (contact_name_lowercase.includes(search_string)) {\n\n // setta il contatto a visible = true\n contact.visible = true;\n }\n else {\n\n // altrimenti a visible = false\n contact.visible = false ;\n\n }\n });\n\n }", "title": "" }, { "docid": "8f89d106c120013cc87b6c361089276b", "score": "0.57101834", "text": "search(value) {\n // YOUR WORK HERE\n }", "title": "" }, { "docid": "b989853775e24aa4b3f12c487575e3ee", "score": "0.57098377", "text": "onSeachChange(event) {\n this.clearBooks()\n\n const searchString = event.target.value\n if (searchString) this.searchBooks(searchString)\n }", "title": "" }, { "docid": "29265a0d519cfacd940913d0564e7e07", "score": "0.5708566", "text": "_search() {\n ItemsStore.removeAll();\n let q = document.getElementById('query').value;\n AppActions.getItems(q);\n }", "title": "" }, { "docid": "3d45f11ab66be5b8df38706ca825783f", "score": "0.5707596", "text": "function searchLocation() {\r\n fetchResults(searchbox.value);\r\n}", "title": "" }, { "docid": "c1757894f354128aaca83a2f38c475ae", "score": "0.56932735", "text": "function myFind () {\r\n var searchRequest = document.getElementById(\"request\").value;\r\n var requestDB = window.indexedDB.open(\"DataBase\");\r\n\trequestDB.onsuccess = function(event){\r\n var db = event.target.result;\r\n if (db.objectStoreNames.contains(searchRequest)) {\r\n\t \tvar tx = db.transaction(document.getElementById(\"request\").value,\"readonly\");\r\n\t \tvar store = tx.objectStore(document.getElementById(\"request\").value);\r\n store.get(searchRequest).onsuccess = function(event) {xTemp = event.target.result;\r\n document.getElementById(\"parent\").innerHTML = \"\";\r\n rNumber = 0; // if searched again reset row counter to starting value\r\n showTemplate();\r\n document.getElementById(\"add\").style.display = \"block\";\r\n document.getElementById(\"save\").style.display = \"block\";\r\n document.getElementById(\"delete\").style.display = \"block\";\r\n\r\n verAdmin = db.version; \r\n };\r\n } else {\r\n document.getElementById(\"parent\").innerHTML = \"\";\r\n rNumber = 0; // if searched again reset row counter to starting value\r\n addRow()\r\n document.getElementById(\"add\").style.display = \"block\";\r\n document.getElementById(\"save\").style.display = \"block\";\r\n document.getElementById(\"delete\").style.display = \"block\";\r\n verAdmin = db.version + 1;\r\n }\r\n db.close();\r\n };\r\n\r\n}", "title": "" }, { "docid": "e45fedd9de55c5fc752b1bf03a44e312", "score": "0.5693204", "text": "function searchOnline(queryString, callback){\n request(searchQueryURL + queryString + \"&\" + books_key, (err, response, body) => {\n body = JSON.parse(body);\n if(body.totalItems == 0) return callback(null, false, \"No books were found\"); // In case no books were found return false and a Message.\n\n var books = body.items.map((book) => {\n var newBook = new Book();\n newBook.id = book.id;\n newBook.title = book.volumeInfo.title;\n newBook.subtitle = book.volumeInfo.subtitle || \"\";\n newBook.authors = book.volumeInfo.authors || \"\";\n newBook.description = book.description || (book.searchInfo && book.searchInfo.textSnippet ) || \"\";\n newBook.thumbnail = book.volumeInfo.imageLinks && book.volumeInfo.imageLinks.thumbnail || \"https://books.google.at/googlebooks/images/no_cover_thumb.gif\";\n newBook.save((err)=>{\n if(err) return callback(err);\n })\n return newBook;\n })\n\n var newSearchResult = new SearchResult();\n newSearchResult.query = queryString;\n newSearchResult.results = books;\n newSearchResult.save((err)=>{\n if(err) return callback(err);\n callback(null, books, \"We got brandnew data\");\n })\n })\n}", "title": "" }, { "docid": "27012eaaa36ccf03996576ea6e2d3678", "score": "0.5693012", "text": "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchbox.value);\n }\n}", "title": "" }, { "docid": "2f7c031c31cdebd887611efdeef3e8f4", "score": "0.5692833", "text": "function searchForListings(searchTerm) {\n\n}", "title": "" }, { "docid": "3fd7d81f59c1676bf8c262a78c7e015c", "score": "0.56920093", "text": "function searchAddressToAddHabitual(){\n\tsearchLocationsToAddHabitual(\"mapCanvasToAddHabitual\", $('#newAddressToAddHabitual').val());\n}", "title": "" }, { "docid": "c44a98a782e80d69977c3f49f540df1d", "score": "0.5687577", "text": "search (query, sync) {\n if (this.lunrIndex === null) {\n // Bail if lunr is not ready yet\n return\n }\n\n const lcSearch = query.toLowerCase()\n const results = this.lunrIndex.query((q) => {\n q.term(lcSearch, { boost: 100 })\n q.term(lcSearch, {\n boost: 10,\n wildcard: lunr.Query.wildcard.TRAILING\n })\n }).map((result) => {\n const doc = this.searchData[result.ref]\n doc.url = result.ref\n return doc\n })\n\n sync(results)\n }", "title": "" }, { "docid": "0ee90562979767fc92ca317768b205f6", "score": "0.5683335", "text": "function pushsearch () {\n \n let click = document.getElementById(\"search-button\");\n click.addEventListener(\"click\", getdata);\n }", "title": "" }, { "docid": "bcf5f6b4f60340f0b61660388ab7c598", "score": "0.5682867", "text": "search(data) {\n this.searchIcon.click()\n this.searchInput.addValue(data)\n return this\n }", "title": "" }, { "docid": "f0cdd8d2e3ed8ccf72f9b65d53cfb9b7", "score": "0.5681357", "text": "function storeRecentSearch() {\n if (vm.searchString !== \"\") {\n if (vm.recentSearches.indexOf(vm.searchString) === -1) {\n vm.recentSearches.push(vm.searchString);\n dt.storeRecentSearch(vm.searchString).then(_populateRecentSearches);\n }\n }\n }", "title": "" }, { "docid": "7751a2a80ee4d2dcbbc0353f497b184c", "score": "0.5679805", "text": "function saveResults(data) {\n searchResults = data.slice(0,20);\n}", "title": "" }, { "docid": "3b02a51d28585755a017196c603379b5", "score": "0.5678077", "text": "function selectSearchResult(searchElement, result) {\n searchElement.querySelector('#search-results').classList.add('hide')\n searchElement.querySelector('input[name=\"query\"]').value = ''\n\n PostModel.add(result, (error, post) => {\n if (error) {\n document.querySelector('.error').textContent = 'Failed to add the post.'\n } else {\n NewsfeedView.renderPost(document.querySelector('#newsfeed'), post)\n }\n })\n }", "title": "" }, { "docid": "c15dad6c38cd1b4850b253b7b1f36820", "score": "0.5674822", "text": "function submitSearch(e) {\n pageNumber = 0;\n fetchResults(e);\n}", "title": "" }, { "docid": "7c16087fbabd808521942d84c8eca5b5", "score": "0.56740344", "text": "run() {\n this.search.run();\n }", "title": "" }, { "docid": "e40aa402aded0994f4450ed939f1c61b", "score": "0.5670371", "text": "function onSearchInput() {\n var filter = $('search').value;\n rebuildAppList(filter);\n reloadAppDisplay();\n}", "title": "" }, { "docid": "50cfc1417fef49e501f96a02983d43f4", "score": "0.5670308", "text": "function search(){\n\n window.location = '/entries?start_date=' + $(\"#start_date\").val() + \n '&end_date=' + $(\"#end_date\").val() + \"&client_id=\" + \n $(\"#client_id\").val() + \"&confirmed=\" + $(\"#confirmed\").val() +\n \"&aircraft_type_id=\" + $(\"#aircraft_type_id\").val();\n}", "title": "" }, { "docid": "99bcc88ca941091e30afd1094a361884", "score": "0.56701994", "text": "function handleNormalSearch(query) {\n console.log(\"doing normal search with query: \" + query);\n // TODO: you should do normal search here\n}", "title": "" } ]
e03bf1d06e9179a46dd1574f22ceada5
Removes a given DOM Node from its parent.
[ { "docid": "850182ac8f2fad850473a1710800f14a", "score": "0.7153911", "text": "function removeNode(node) {\n\tvar p = node.parentNode;\n\tif (p) { p.removeChild(node); }\n}", "title": "" } ]
[ { "docid": "3d1ad842014c49e1fef160bbaa5acd65", "score": "0.75438946", "text": "function removeNode() {\n var parent = document.getElementsByTagName(\"div\")[19];\n parent.removeChild(parent.childNodes[0]);\n}", "title": "" }, { "docid": "2e171312f155dc07995fab6901d30e53", "score": "0.74161446", "text": "function remove(node) {\n var parent = node.parentNode;\n parent.removeChild(node);\n}", "title": "" }, { "docid": "18dceed5e7d5744d03dac2b860345814", "score": "0.73962176", "text": "remove(node, parent, prevSib){\n node._domNode.parentNode.removeChild(node._domNode);\n node._domNode = null;\n }", "title": "" }, { "docid": "e62c7bcec7b92d414dea13089428914d", "score": "0.7228202", "text": "remove() {\n var i, ref1;\n if (this.isRoot) {\n throw new Error(\"Cannot remove the root element. \" + this.debugInfo());\n }\n i = this.parent.children.indexOf(this);\n splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;\n return this.parent;\n }", "title": "" }, { "docid": "03178567d1e79f5c3dc7e0ce0b70b949", "score": "0.71906614", "text": "function removeNodeFromParent(targetNode) {\n\t\t\t\tvar arrayNodes = targetNode.parentNode.uiNodes;\n\t\t\t\tvar i = arrayNodes.length;\n\t\t\t\twhile (i--) {\n\t\t\t\t\tvar node = arrayNodes[i];\n\t\t\t\t\tif (targetNode===node) {\n\t\t\t\t\t\tarrayNodes.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "5e3c925c8efaad59b9e30318f7afa771", "score": "0.7179148", "text": "function removeNode(node) {\n\tvar p = node.parentNode;\n\tif (p) p.removeChild(node);\n}", "title": "" }, { "docid": "24728d9d813e8e42a2b859ab2d84e968", "score": "0.7115744", "text": "remove() {\n var i, ref;\n if (this.isRoot) {\n throw new Error(\"Cannot remove the root element\");\n }\n i = this.parent.children.indexOf(this);\n splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref;\n return this.parent;\n }", "title": "" }, { "docid": "a18bc026cef80986a1d7ee54cc857b1d", "score": "0.6973103", "text": "function removeChild(parent, node) {\n\t\t if (node.parentNode !== parent) {\n\t\t throw Error('The node to be removed is not a child of this node: ' + node);\n\t\t }\n\t\t if (!removeNode(node)) {\n\t\t // if removing from a shadyRoot, remove form host instead\n\t\t var container = utils.isShadyRoot(parent) ? parent.host : parent;\n\t\t // not guaranteed to physically be in container; e.g.\n\t\t // undistributed nodes.\n\t\t var nativeParent = (0, _nativeTree.parentNode)(node);\n\t\t if (container === nativeParent) {\n\t\t nativeMethods.removeChild.call(container, node);\n\t\t }\n\t\t }\n\t\t _scheduleObserver(parent, null, node);\n\t\t return node;\n\t\t}", "title": "" }, { "docid": "7c6f513a65a3300ce2687857a090c390", "score": "0.6941277", "text": "function removeParent(p) {\n\tp.target.parentElement.remove();\n}", "title": "" }, { "docid": "2b4780a7720474ef94e90610038fcee4", "score": "0.6923278", "text": "function _removeChild(parentNode,child){var previous=child.previousSibling;var next=child.nextSibling;if(previous){previous.nextSibling = next;}else {parentNode.firstChild = next;}if(next){next.previousSibling = previous;}else {parentNode.lastChild = previous;}_onUpdateChild(parentNode.ownerDocument,parentNode);return child;}", "title": "" }, { "docid": "db6631c0a6556c85ae78b5b7babe0e7a", "score": "0.6910879", "text": "function deleteNode(node) { node.parentNode.removeChild(node); }", "title": "" }, { "docid": "dcc8b924495b96e874de65a72d30f58c", "score": "0.68817663", "text": "function removeParent(evt) {\n evt.target.parentNode.remove();\n}", "title": "" }, { "docid": "b94f18bebcdf382661a0454856622c51", "score": "0.6872515", "text": "function removeNode(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }", "title": "" }, { "docid": "a10b8e74041cf2b56a260ca4546cb0b8", "score": "0.6845289", "text": "remove()\n\t{\n\t\tif (!this.parent) {\n\t\t\tthrow new Error(\"The root element cannot be removed by this function.\");\n\t\t}\n\n\t\t// TODO - step #8\n\n\t\tthis.parent.children = this.parent.children.filter(child => child !== this);\n\t\tthis.parent.render();\n\t\t\n\t}", "title": "" }, { "docid": "3bbb30bca89ad93a9e19bc12c8daaf55", "score": "0.67985374", "text": "function removeNode(e) {\n scrubNode(e);\n e.parentNode.removeChild(e);\n}", "title": "" }, { "docid": "ea9149c035b4607b61ec3179ad403c58", "score": "0.67805976", "text": "function removeParent(evt) {\r\n\tevt.target.parentNode.remove();\r\n}", "title": "" }, { "docid": "98221f082f630b42ebd8798e9f747e27", "score": "0.67802054", "text": "function eliminateNode(node, parent) {\n if (!node || !node.children) {\n return;\n }\n var nodeIndex = parent.children.indexOf(node);\n parent.children.splice(nodeIndex, 1);\n for (var i = 0; i < node.children.length; i++) {\n node.children[i].parent = parent;\n parent.children.splice(nodeIndex++, 0, node.children[i]);\n }\n }", "title": "" }, { "docid": "f651bb36183e85c1dca89d62e41e6253", "score": "0.6711524", "text": "function removeNode(node) {\n while (node.childNodes.length) {\n removeNode(node.childNodes[0]);\n }\n node.parentNode.removeChild(node);\n }", "title": "" }, { "docid": "039797c2f0f3b7c7cf180532a537874b", "score": "0.6710076", "text": "function removeItem() {\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n\n parent.removeChild(item);\n}", "title": "" }, { "docid": "f5683b4b27ab8a3220bd7974a04c6e94", "score": "0.67043895", "text": "function removefathers(element){\n var parent=element.parentNode;\n parent=parent.parentNode;\n parent.remove();\n }", "title": "" }, { "docid": "1acb86fac197ad1a2c86a1a1b628d301", "score": "0.67038107", "text": "function _removeChild(parentNode,child){\n \tvar previous = child.previousSibling;\n \tvar next = child.nextSibling;\n \tif(previous){\n \t\tprevious.nextSibling = next;\n \t}else {\n \t\tparentNode.firstChild = next;\n \t}\n \tif(next){\n \t\tnext.previousSibling = previous;\n \t}else {\n \t\tparentNode.lastChild = previous;\n \t}\n \t_onUpdateChild(parentNode.ownerDocument,parentNode);\n \treturn child;\n }", "title": "" }, { "docid": "fd85e47d138c2d4d68133642a5773ec8", "score": "0.6683636", "text": "function removeNode(node){\n\tnode.parentNode.removeChild(node);\n}", "title": "" }, { "docid": "b2501e474fe95f2b157fd670b1bbe324", "score": "0.667973", "text": "function removeItem() {\n const item = this.parentNode.parentNode;\n const parent = item.parentNode;\n parent.removeChild(item);\n}", "title": "" }, { "docid": "4a374ea1e78dbecf54b8f40cf6b4d595", "score": "0.6664419", "text": "remove(node) {\n node.parentNode.removeChild(node)\n return node\n }", "title": "" }, { "docid": "8ec16f06c0fd73cc2c2221281a91b439", "score": "0.6658371", "text": "removeChild( node ) {\n for ( var idx in this.childNodes ) {\n if ( node === this.childNodes[idx] ) {\n delete this.childNodes[idx];\n return;\n }\n }\n }", "title": "" }, { "docid": "bc12511da10ce72b9ddf0b469621f06c", "score": "0.6637757", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else {\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6630428", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "07a8b9a7d4fc7164ca278775f4ed83a9", "score": "0.6619844", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next;\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "07a8b9a7d4fc7164ca278775f4ed83a9", "score": "0.6619844", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next;\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "9226aca9b06051d8ea2f531d3b646789", "score": "0.66172343", "text": "remove() {\n\t\tif (!this._elementDom) return;\n\t\tif (!this._elementDom.parentElement) {\n\t\t\tthis._elementDom = null;\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis._elementDom.parentElement.removeChild(this._elementDom);\n\t\tthis._elementDom = null;\n\t}", "title": "" }, { "docid": "c1f7fc349a35effbed64e798acd4f0b1", "score": "0.66118056", "text": "function _removeChild(parentNode,child){\n\t\tvar previous = child.previousSibling;\n\t\tvar next = child.nextSibling;\n\t\tif(previous){\n\t\t\tprevious.nextSibling = next;\n\t\t}else{\n\t\t\tparentNode.firstChild = next\n\t\t}\n\t\tif(next){\n\t\t\tnext.previousSibling = previous;\n\t\t}else{\n\t\t\tparentNode.lastChild = previous;\n\t\t}\n\t\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\t\treturn child;\n\t}", "title": "" }, { "docid": "c1f7fc349a35effbed64e798acd4f0b1", "score": "0.66118056", "text": "function _removeChild(parentNode,child){\n\t\tvar previous = child.previousSibling;\n\t\tvar next = child.nextSibling;\n\t\tif(previous){\n\t\t\tprevious.nextSibling = next;\n\t\t}else{\n\t\t\tparentNode.firstChild = next\n\t\t}\n\t\tif(next){\n\t\t\tnext.previousSibling = previous;\n\t\t}else{\n\t\t\tparentNode.lastChild = previous;\n\t\t}\n\t\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\t\treturn child;\n\t}", "title": "" }, { "docid": "b8372296f44eae2023bf477deefca17f", "score": "0.6609237", "text": "function clearParent(parent){ //totally clear parent(any node like elm node,text node,...)\n while(parent.hasChildNodes()) parent.removeChild(parent.lastChild) ;\n}", "title": "" }, { "docid": "596dbc07e4214f1641a73c08baf25a77", "score": "0.6608124", "text": "function _removeChild(parentNode,child){\n\t\tvar previous = child.previousSibling;\n\t\tvar next = child.nextSibling;\n\t\tif(previous){\n\t\t\tprevious.nextSibling = next;\n\t\t}else{\n\t\t\tparentNode.firstChild = next;\n\t\t}\n\t\tif(next){\n\t\t\tnext.previousSibling = previous;\n\t\t}else{\n\t\t\tparentNode.lastChild = previous;\n\t\t}\n\t\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\t\treturn child;\n\t}", "title": "" }, { "docid": "596dbc07e4214f1641a73c08baf25a77", "score": "0.6608124", "text": "function _removeChild(parentNode,child){\n\t\tvar previous = child.previousSibling;\n\t\tvar next = child.nextSibling;\n\t\tif(previous){\n\t\t\tprevious.nextSibling = next;\n\t\t}else{\n\t\t\tparentNode.firstChild = next;\n\t\t}\n\t\tif(next){\n\t\t\tnext.previousSibling = previous;\n\t\t}else{\n\t\t\tparentNode.lastChild = previous;\n\t\t}\n\t\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\t\treturn child;\n\t}", "title": "" }, { "docid": "7cdae773289dd03c6f39cd96ebab2ec6", "score": "0.66041344", "text": "function remove() {\n if (this.parentNode) {\n this.parentNode.removeChild(this);\n }\n}", "title": "" }, { "docid": "e2654086f0ba23156f4a94607964602e", "score": "0.65977246", "text": "delete(){\n if (this.ownerDocument.root != this)\n {\n this.remove();\n }\n }", "title": "" }, { "docid": "a91e74a3f5eb70d7af278e9113aa659a", "score": "0.6590168", "text": "function remover(myNode){\r\n\r\nwhile(myNode.hasChildNodes())\r\n{\r\n myNode.removeChild(myNode.lastChild);\r\n}\r\n}", "title": "" }, { "docid": "d6d6a5ff6ac2290653b189c20ee86071", "score": "0.6588219", "text": "function removeItem() {\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n\n parent.removeChild(item);\n\n}", "title": "" }, { "docid": "57595f14a04aaf0bdb69ccc97c8b99de", "score": "0.65681815", "text": "function _removeChild(parentNode, child) {\n\t\t\tvar previous = child.previousSibling;\n\t\t\tvar next = child.nextSibling;\n\t\t\tif (previous) {\n\t\t\t\tprevious.nextSibling = next;\n\t\t\t} else {\n\t\t\t\tparentNode.firstChild = next\n\t\t\t}\n\t\t\tif (next) {\n\t\t\t\tnext.previousSibling = previous;\n\t\t\t} else {\n\t\t\t\tparentNode.lastChild = previous;\n\t\t\t}\n\t\t\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\t\t\treturn child;\n\t\t}", "title": "" }, { "docid": "3fec5900b21035eb8e92cb231b3bb3dd", "score": "0.6546472", "text": "function Java_cjdom_Node_removeChildImpl(lib, parentJS, childJS) { parentJS.removeChild(childJS); }", "title": "" }, { "docid": "5d718603dd8f005757025f7030abc149", "score": "0.6530006", "text": "function remover(myNode) {\r\n\r\n while (myNode.hasChildNodes()) {\r\n myNode.removeChild(myNode.lastChild);\r\n }\r\n}", "title": "" }, { "docid": "252204fdedf8afb29e57d9f668ded765", "score": "0.652928", "text": "function deleteNode(that) {\n var node, index;\n\n // remove node from DOM\n node = that.parentNode;\n node.parentNode.removeChild(node);\n\n // remove node from todoItems\n index = findParentAndIndex(node);\n parent.splice(index, 1);\n\n // store updated todoItems to localStorage\n storeTodoList();\n }", "title": "" }, { "docid": "1b7eee30dddfa934bd58040880d4fcb5", "score": "0.652527", "text": "removeChild(node) {\n if (this.left.priority === node.priority) {\n\n this.left.parent = null;\n this.left = null;\n\n } else if (this.right.priority === node.priority) {\n\n this.right.parent = null;\n this.right = null;\n\n } else {\n throw 'Not a child of this node';\n }\n }", "title": "" }, { "docid": "5dbcff65172bcc345c91fcd432c20598", "score": "0.6520728", "text": "function cleanChild(parentNode) {\n while (parentNode.firstChild) {\n parentNode.removeChild(parentNode.lastChild);\n }\n}", "title": "" }, { "docid": "7e691ef00fd91f62e199895c183404f1", "score": "0.6519829", "text": "function removeFromParent(element) {\n try {\n if (element.parentElement) {\n element.parentElement.removeChild(element);\n }\n } catch (e) {// this will throw if this happens due to a blur event, nasty business\n }\n}", "title": "" }, { "docid": "cd9a817b722d6fb1475704c69d571bc6", "score": "0.6467283", "text": "function remover(myNode){\r\n\r\n while(myNode.hasChildNodes())\r\n {\r\n myNode.removeChild(myNode.lastChild);\r\n }\r\n }", "title": "" }, { "docid": "7d9b5873c769f81a01e53a4ffa8a9cfb", "score": "0.6464385", "text": "remove() {\n this.parentNode && this.parentNode.removeChild(this);\n }", "title": "" }, { "docid": "d5c9f238d7b50350fecd28c1f9c627ab", "score": "0.6461939", "text": "removeChild(node) {\n if (node.parentNode && node.parentNode.parentNode === this.displayList) {\n this.displayList.removeChild(node.parentNode);\n }\n }", "title": "" }, { "docid": "4f1f18549cd6c3f3e301d4c81f7ce499", "score": "0.6451354", "text": "delete() {\n if (this.element) {\n if (this.parent) {\n this.parent.element.removeChild(this.element);\n this.parent = null;\n } else {\n deleteElement(this.element);\n }\n this.element = null;\n }\n }", "title": "" }, { "docid": "707b6146dd7b1310038635ae09046fb7", "score": "0.64458823", "text": "function removeNode() {\n node = selectedNode;\n if(node.parent.left == node){\n node.parent.left = null;\n } else {\n node.parent.right = null;\n }\n draw()\n}", "title": "" }, { "docid": "b94c0f4f154ac39176b4df32ea9632ba", "score": "0.6445044", "text": "function _removeChild(parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "0aef0f6fa7135a36b96042211128acd4", "score": "0.6435965", "text": "removeChild(element) {\n\n if (element.parentNode !== this)\n return this;\n\n return this.applyElementBoxInvalidatingActions(true, true, () => {\n\n let screenNode = element.screenNode;\n\n element.elementBox.invalidate();\n\n if (this.lastChild === element)\n this.lastChild = element.previousSibling;\n\n if (this.firstChild === element)\n this.firstChild = element.nextSibling;\n\n if (element.previousSibling)\n element.previousSibling.nextSibling = element.nextSibling;\n\n if (element.nextSibling)\n element.nextSibling.previousSibling = element.previousSibling;\n\n element.screenNode = null;\n element.parentNode = null;\n\n element._cascadeScreenNode();\n\n element.previousSibling = null;\n element.nextSibling = null;\n\n let index = this.childNodes.indexOf(element);\n this.childNodes.splice(index, 1);\n\n if (screenNode) {\n screenNode.invalidateNodeList();\n }\n\n });\n\n }", "title": "" }, { "docid": "3cf41c39dea1d5b7d3664751802e7bea", "score": "0.643519", "text": "function remove(el) {\n if (!el) return;\n var p = el.parentNode;\n if (p) {\n p.removeChild(el);\n if (!p.childNodes || !p.childNodes.length) remove(p);\n }\n}", "title": "" }, { "docid": "f5eedc17fb98ce6a1c74f2908f74ae76", "score": "0.6434657", "text": "function deleteEvent() {\n const element = this.parentNode\n element.remove()\n}", "title": "" }, { "docid": "b661f6217b18d04a65672e268a063d10", "score": "0.6421631", "text": "function removeFromTree(n) {\n\n // we've reached the root node\n if (n.parent === undefined) {\n return;\n }\n\n var parent = n.parent;\n var nIdx = parent.children.indexOf(n);\n var treeIdx = treeNodes .indexOf(n);\n\n if (nIdx > -1) parent.children.splice(nIdx, 1);\n if (treeIdx > -1) treeNodes .splice(treeIdx, 1);\n\n // If this node had no siblings,\n // then remove its parent too.\n if (parent.children.length === 0) {\n removeFromTree(parent);\n }\n }", "title": "" }, { "docid": "3f878bb586598c56ddca3b1aa3bf0b37", "score": "0.64212865", "text": "function tree_unlink_node(node) {\n var tree = node.closest('.tree');\n var root = tree.find('.node.root');\n var parent = node.parent().closest('.node');\n\n // Eliminate the pk from the parent and remove the node itself.\n node_remove_child_pk(parent, node.attr('pk'));\n node.detach();\n\n // Handle emptying a node's children.\n handle_emptied_node(parent);\n\n // Decide whether to put the node in the root.\n if(!tree.find('.node[pk=\"' + node.attr('pk') + '\"]').length) {\n node.prependTo(root.find('> .children')).show();\n\n // Hide the node's unlink action.\n node.find('> .container .actions .unlink').hide();\n\n // Remove reference to the parent.\n node_remove_parent_pk(node, parent.attr('pk'));\n }\n else\n node.remove();\n}", "title": "" }, { "docid": "2326eca4c6f50485a746648d525fe12d", "score": "0.64120734", "text": "function removeFromParent(element) {\n try {\n if (element.parentElement) {\n element.parentElement.removeChild(element);\n }\n }\n catch (e) {\n // this will throw if this happens due to a blur event, nasty business\n }\n}", "title": "" }, { "docid": "2326eca4c6f50485a746648d525fe12d", "score": "0.64120734", "text": "function removeFromParent(element) {\n try {\n if (element.parentElement) {\n element.parentElement.removeChild(element);\n }\n }\n catch (e) {\n // this will throw if this happens due to a blur event, nasty business\n }\n}", "title": "" }, { "docid": "0c8eac1b9aff43eda0b4780e5c39811e", "score": "0.6397144", "text": "function dele(e){\n var p =e.parentNode.parentNode;\n p.parentNode.removeChild(p);\n}", "title": "" }, { "docid": "a2e53119c90de9876612db0c7509afaa", "score": "0.6396048", "text": "function deleteParent() {\n $(this).parent().remove();\n}// end deleteParent", "title": "" }, { "docid": "2d5fb2fb249581a31a79f6e425ec2041", "score": "0.638475", "text": "function deleteElement( parentID , item) { $(parentID).removeChild( item ); }", "title": "" }, { "docid": "446a45cbad5e4cdb4851bdf277c132f5", "score": "0.63678145", "text": "function _removeChild(parentNode, child) {\n var previous = child.previousSibling;\n var next = child.nextSibling;\n if (previous) {\n previous.nextSibling = next;\n } else {\n parentNode.firstChild = next\n }\n if (next) {\n next.previousSibling = previous;\n } else {\n parentNode.lastChild = previous;\n }\n _onUpdateChild(parentNode.ownerDocument, parentNode);\n return child;\n }", "title": "" }, { "docid": "26e502c440a5ab1ef4679eaa5bbdab5a", "score": "0.6367718", "text": "clearNode() {\n while (this.node && this.node.lastChild) {\n this.node.removeChild(this.node.lastChild);\n }\n }", "title": "" }, { "docid": "7b7ab202be875bc16ca078e39711986c", "score": "0.6361811", "text": "remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }", "title": "" }, { "docid": "3896e9d4e99a877785dafa5ee0efe20f", "score": "0.63423866", "text": "function rm (child) {\n el.removeChild(child)\n }", "title": "" }, { "docid": "a2b76357217f46cd99700bd09a9e2eb6", "score": "0.63167065", "text": "disconnect(parent) {\n if(!this.parent || parent !== this.parent) {\n throw new Error('Invalid node to disconnect');\n }\n\n if(this.layer) {\n const nextSibling = this.nextElementSilbing;\n if(nextSibling) nextSibling.updateStyles(true);\n }\n\n const zOrder = this.zOrder;\n delete this.zOrder;\n delete this.parent;\n delete this.isDirty;\n\n this.dispatchEvent('remove', {\n parent,\n zOrder,\n }, true, true);\n\n parent.dispatchEvent('removeChild', {\n child: this,\n zOrder,\n }, true, true);\n\n return this;\n }", "title": "" }, { "docid": "c5a8e27b83b9c3f8cd566e4c72da637f", "score": "0.6273237", "text": "function removeItem() {\n let list = this.parentNode.parentNode;\n let parent = list.parentNode;\n\n parent.removeChild(list);\n}", "title": "" }, { "docid": "5ab3520be4f16d7bc07649691d753495", "score": "0.62663126", "text": "function myFunc(elem){\n var li = elem.parentNode;\n li.parentNode.removeChild(li);\n}", "title": "" }, { "docid": "673d565066237192012720b53be6cb0c", "score": "0.6262203", "text": "function remove(){\n var thread = this.parentNode.parentNode.parentNode;\n var row = this.parentNode.parentNode;\n thread.removeChild(row);\n}", "title": "" }, { "docid": "68c67018215435ba4d8bd1350af4eb3a", "score": "0.62618905", "text": "function removeNode(domNode) {\n debug$3('removeNode');\n if (domNode.nodeType !== window.Node.ELEMENT_NODE) return;\n var value = editor.value;\n var document = value.document,\n selection = value.selection;\n\n var node = editor.findNode(domNode);\n var nodeSelection = document.resolveRange(selection.moveToRangeOfNode(node));\n\n renderSync(editor, function () {\n editor.select(nodeSelection).delete().restoreDOM();\n });\n }", "title": "" }, { "docid": "29157bc4a63d94553cb44fabd1d20340", "score": "0.62522167", "text": "function removeAllChildNodes(parent) {\r\n while (parent.firstChild) {\r\n parent.removeChild(parent.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "b211de7973e94c456a54dde7595fd2f9", "score": "0.6239216", "text": "remove() {\n this.container.parent.removeChild(this.container);\n }", "title": "" }, { "docid": "8b6fdfd9e682138a3c5bf3a11a7dbb9b", "score": "0.62246275", "text": "disconnect(parent) {\n if (!this.parent || parent !== this.parent) {\n throw new Error('Invalid node to disconnect');\n }\n\n if (this.layer) {\n const nextSibling = this.nextElementSilbing;\n if (nextSibling) nextSibling.updateStyles(true);\n }\n\n const zOrder = this.zOrder;\n delete this.zOrder;\n delete this.parent;\n delete this.isDirty;\n this.dispatchEvent('remove', {\n parent,\n zOrder\n }, true, true);\n parent.dispatchEvent('removeChild', {\n child: this,\n zOrder\n }, true, true);\n return this;\n }", "title": "" }, { "docid": "cd1f043bf56968fcf244c0e14bd89c5b", "score": "0.62099814", "text": "function removeAllChildNodesOf(parent) {\r\n\twhile (parent.firstChild) {\r\n\t\tparent.removeChild(parent.firstChild);\r\n\t}\r\n}", "title": "" }, { "docid": "e4f0ec98f712848a5fd0e6ab3dfd213d", "score": "0.62007624", "text": "function removeNode(node) {\r\n if (node.clearListeners) {\r\n node.clearListeners();\r\n }\r\n node.parentElement.removeChild(node);\r\n}", "title": "" }, { "docid": "90cea1341230ed93774f1de10e591031", "score": "0.6200497", "text": "function remove(data) {\n this.root = removeNode(this.root, data);\n}", "title": "" }, { "docid": "a87a6ab2b16308dd5399ed214d743a20", "score": "0.6194153", "text": "function removeElement(element) {\n if(element) {\n var parentElement = element.parentNode;\n parentElement.removeChild(element);\n }\n}", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.61845285", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.61845285", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "52c72dd7b3fa58df7b5cba0c7cd06141", "score": "0.61840177", "text": "function kill_Parent(Pointer,node) { \r\n \r\n\tif (!Pointer) return;\r\n\tvar parent = Pointer.parentNode;\r\n\tif (!parent) return;\r\n \r\n\t// console.log(parent.nodeName)\r\n\twhile(parent.nodeName != node || (parent.nodeName == node && parent.className.indexOf(\"uiUnifiedStory\") == -1)) {\r\n\t\tparent = parent.parentNode;\r\n\t\tconsole.log(parent.nodeName)\r\n\t}\r\n\r\n\t// parent = parent.parentNode;\r\n\r\n\t// while(parent.nodeName != node) {\r\n\t// \tparent = parent.parentNode;\r\n\t// \tconsole.log(parent.nodeName)\r\n\t// }\r\n\t\r\n\t// GM_log(\"removed: \" +Pointer.nodeName); //debug the level we are killing\r\n\tconsole.log(parent.className)\r\n\tconsole.log(parent)\r\n\tparent.parentNode.removeChild(parent);\r\n\t//Pointer.style.visibility = 'hidden';\r\n }", "title": "" }, { "docid": "263405a484ac5b4723d6b3efa91c1577", "score": "0.6176255", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "263405a484ac5b4723d6b3efa91c1577", "score": "0.6176255", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "6dd4510a001b8e91f2f2b6da4423488c", "score": "0.616988", "text": "function removeElement(thisElement)\r\n{\r\n\t// if there arent any children, remove me\r\n\tthisElement.parentNode.removeChild(thisElement);\r\n}", "title": "" }, { "docid": "1180eaeb6b0cd852950c27d0f558ab46", "score": "0.6163408", "text": "function RemoveChild(classParent) {\n while (document.querySelector(classParent).firstChild) {\n document.querySelector(classParent)\n .removeChild(document.querySelector(classParent)\n .firstChild);\n }\n}", "title": "" }, { "docid": "736dc84bc70f3ecf9fe0e884c02feecc", "score": "0.61594504", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "f6c5ebe25549f12c833ddcb4e42fa9c5", "score": "0.6156121", "text": "function deleteItem() {\n\n\t\t// set variables to the parent and child to delete the child from the parent\n\t\tvar item = this.parentNode.parentNode;\n\t\tvar parent = item.parentNode;\n\n\t\tparent.removeChild(item);\n\n\t\tconsole.log('trashed!');\n\t}", "title": "" }, { "docid": "8d712c926107bc67b89a5ab4b4a28982", "score": "0.6151169", "text": "remove() {\r\n this.assertNotStale('call', 'remove');\r\n if (__classPrivateFieldGet(this, _parent)) {\r\n const parentReplacement = __classPrivateFieldGet(this, _parent).clone();\r\n __classPrivateFieldSet(parentReplacement, _children, Object.freeze(__classPrivateFieldGet(parentReplacement, _children).filter(child => child !== this)));\r\n __classPrivateFieldGet(this, _parent).replaceSelf(parentReplacement);\r\n }\r\n else {\r\n __classPrivateFieldGet(this, _tree)._changeRoot(null, IS_INTERNAL);\r\n }\r\n __classPrivateFieldSet(this, _isStale, true);\r\n // todo: recursively mark children as stale?\r\n this.dispatch('immutabletree.removenode');\r\n return this;\r\n }", "title": "" }, { "docid": "ba3fae8adfd631f3c7418f89fa3b10b4", "score": "0.6150734", "text": "function deleteFromDom(target) {\n target.parentElement.parentElement.parentElement.remove();\n}", "title": "" } ]
80cec8dd65d18e4d4b02a7de55d6cd14
set / get number of rows and columns
[ { "docid": "f387180b522876ddfb5ce471ca51257a", "score": "0.58673614", "text": "function dimensions() {\r\n let rows = 0;\r\n let cols = 0;\r\n return {\r\n setDimensions(r, c) {\r\n rows = r;\r\n cols = c;\r\n },\r\n getDimensions() {\r\n return { rows: rows, cols: cols };\r\n }\r\n }\r\n}", "title": "" } ]
[ { "docid": "8f2c053e6c9cffcb4438b46b8866c7de", "score": "0.686214", "text": "getSize() {\n return {r: this.rows, c: this.cols};\n }", "title": "" }, { "docid": "c7b473e4cb54eb9f813e37388d8b7b24", "score": "0.6611343", "text": "function gridSize()\r\n{\r\n return (countColumns() + ' x ' + countRows());\r\n}", "title": "" }, { "docid": "1476effe09e7b12487ce0edb5a53b54a", "score": "0.6551373", "text": "function countColumns()\r\n{\r\n return GRID[0].length;\r\n}", "title": "" }, { "docid": "c04bc74157e98292ea075a5cf69d1e37", "score": "0.6532777", "text": "cols() {\r\n return this.elements[0].length;\r\n }", "title": "" }, { "docid": "1bacb55dd486e645573fef317622ab52", "score": "0.64925754", "text": "function countColumns() {\n return GRID[0].length;\n}", "title": "" }, { "docid": "126afb6c228824500dfe4fabdc2c3e53", "score": "0.6481877", "text": "dimensions() {\r\n return {\r\n rows: this.elements.length,\r\n cols: this.elements[0].length\r\n };\r\n }", "title": "" }, { "docid": "2d169563d1485bda6270eb4932662dd7", "score": "0.6468954", "text": "_calcNumTiles() {\n this.numCols = this.width / this.tileWidth | 0;\n this.numRows = this.height / this.tileHeight | 0;\n\n this.numViewportCols = Math.ceil(this.viewportW / this.tileWidth);\n this.numViewportRows = Math.ceil(this.viewportH / this.tileHeight);\n }", "title": "" }, { "docid": "3a80719b140f20b0e545a785c90a6fb8", "score": "0.64427686", "text": "get totalLength() {\n return this._numRows * this._numCols;\n }", "title": "" }, { "docid": "25ca18fc14822eedec12b06bb56eb5f3", "score": "0.63860655", "text": "function totalCells()\r\n{\r\n return (countColumns() * countRows());\r\n}", "title": "" }, { "docid": "61d702a2b8870374ec95752ed296fca2", "score": "0.637633", "text": "get rows() {\n // ˅\n return 1;\n // ˄\n }", "title": "" }, { "docid": "0d77eaa9ec6b2b9225f1312f0153c974", "score": "0.63192505", "text": "function countRows() \r\n{\r\n return GRID.length;\r\n}", "title": "" }, { "docid": "18ae9402ead1ca7648563dba25109743", "score": "0.62871784", "text": "function rowCount() {\n return GRID.length;\n }", "title": "" }, { "docid": "e4a11186eb5e0d04326a3b3287e5dcd4", "score": "0.62563515", "text": "function setSizeToolsValues(columns, rows){\n getElement(\"blocks-columns\").value = columns;\n getElement(\"blocks-rows\").value = rows;\n}", "title": "" }, { "docid": "ff5dfe64664aa26b1d192a244ffddac1", "score": "0.6135784", "text": "function fillTilesVars_countWidthByCols(){\n\n\t\tg_vars.colWidth = (g_vars.availWidth - g_vars.colGap * (g_vars.numCols-1)) / g_vars.numCols;\n\t\tg_vars.colWidth = Math.floor(g_vars.colWidth);\n\n\t\tg_vars.totalWidth = g_functions.getSpaceByNumItems(g_vars.numCols, g_vars.colWidth, g_vars.colGap);\n\t\t\n\t}", "title": "" }, { "docid": "b461fef052bed0d9955981baffbaf113", "score": "0.61092925", "text": "rows() {\r\n return this.elements.length;\r\n }", "title": "" }, { "docid": "607862c86d897a7b649bdfbaa24ff101", "score": "0.60871875", "text": "setSize(rows, cols) {\n this.m_data = [];\n for (let j = 0; j < rows; j++) {\n const row = [];\n this.m_data.push(row);\n }\n this.m_attr_name = [];\n this.m_str_to_enum = [];\n this.m_enum_to_str = [];\n for (let i = 0; i < cols; i++) {\n this.m_attr_name.push('');\n this.m_str_to_enum.push(new Map());\n this.m_enum_to_str.push(new Map());\n }\n }", "title": "" }, { "docid": "a257214fc174c2960bea4a838b9d4398", "score": "0.60866845", "text": "getColumnNum() {\n const containerWidth = this.photoContainer.offsetWidth,\n imgWidth = globalConfig.size.width,\n imgGap = globalConfig.size.gap;\n \n return Math.floor((containerWidth + imgGap) / (imgWidth + imgGap));\n }", "title": "" }, { "docid": "3a6f2d8a651f98d83af92c7cb3463c9e", "score": "0.60806215", "text": "function monitorCount(rows, columns) {\n return rows * columns;\n}", "title": "" }, { "docid": "63b4dfff687bd37d7cbc11326f6244c8", "score": "0.6068979", "text": "getRowCount() {\n const rowSize = Math.ceil(this.props.queryResults.images.length / globals.DEFAULT_IMAGE_RESULT_COLUMNS);\n return rowSize;\n }", "title": "" }, { "docid": "1ebdad0bc668c249f8cbdcaf6332b327", "score": "0.60677826", "text": "function getMatrixSize(){\n\n\t\tconsole.log(\"Boton pulsado, ejecutando funcion getSize\");\n\n\t\tresetSquares();\n\n\t\t$x = parseInt($inputX.value);\n\t\t$y = parseInt($inputY.value);\n\t\tconsole.log(\"Ancho: \"+ $x);\n\t\tconsole.log(\"Alto: \"+ $y);\n\n\t\tfillTable();\n\t}", "title": "" }, { "docid": "ff73be8150e087a4240a792387fb208a", "score": "0.6037193", "text": "displaySize() {\r\n this.w = this.rcLen.col * 50 + 10;\r\n this.h = Math.floor((this.rcLen.row * 50 + 10) / 1.55);\r\n }", "title": "" }, { "docid": "c94b4564a5641b8a672d407715c17d18", "score": "0.6014875", "text": "get rowSize() {\n return this.rows === 'auto' ? this.DEFAULT_ROW_SIZE : this.calculateRowSize();\n }", "title": "" }, { "docid": "c94b4564a5641b8a672d407715c17d18", "score": "0.6014875", "text": "get rowSize() {\n return this.rows === 'auto' ? this.DEFAULT_ROW_SIZE : this.calculateRowSize();\n }", "title": "" }, { "docid": "f777adc60d4718da1fbc8f7f4650ccc6", "score": "0.5999713", "text": "getRowSize() {\r\n return this.ts.get(this.atts[0]).length;\r\n }", "title": "" }, { "docid": "eec671bd4ec57cc5530b7552e5c10e22", "score": "0.597853", "text": "mapSize() {\n\t\treturn Object.keys(this.cells).length;\n\t}", "title": "" }, { "docid": "1ded5ffd61bdff49e89c828f70b8004d", "score": "0.59317327", "text": "get columnCount() {\n\t\treturn this.nativeElement ? this.nativeElement.columnCount : undefined;\n\t}", "title": "" }, { "docid": "fe9722f972051af64cc101a0107c0bd0", "score": "0.5915265", "text": "get cols() { return this._cols; }", "title": "" }, { "docid": "241f36c929040411e4b2512ec3854ebe", "score": "0.5908696", "text": "get size() {\n return this._matrix.length;\n }", "title": "" }, { "docid": "b088c75eaf0847cf4dd8f4dbae34becb", "score": "0.59034055", "text": "cols () { return this._cols }", "title": "" }, { "docid": "cc7208d2d5ea537f78e8fabf78a3c557", "score": "0.58764315", "text": "get amtLines() {\n return Math.floor(this.gridWidth / this.cellSize);\n }", "title": "" }, { "docid": "f295d79da36d5789ca37a9a5ef30fd58", "score": "0.5845478", "text": "getRowNumber() {\n return this._rows\n }", "title": "" }, { "docid": "1b60fbc0f44a71139b9456efb8442616", "score": "0.58303386", "text": "function numberRowsAndColumns(table) {\n var rows = table.find(\"tr:first-child\").children(\"td, th\");\n var counter = 0;\n\n // number them row-wise\n rows.each(function() {\n $(this).html(counter++);\n });\n\n // number them column-wise\n var cols = table.find(\"tr:not(:nth-child(n+9)) td:first-child, tr:not(:nth-child(n+9)) th:first-child\");\n counter = 0;\n cols.each(function() {\n $(this).html(counter++);\n });\n}", "title": "" }, { "docid": "428ff9ac1abd76462ec0ec4ca880489d", "score": "0.5804071", "text": "get columnSize() {\n return this.dashboardRect.width / this.columns;\n }", "title": "" }, { "docid": "428ff9ac1abd76462ec0ec4ca880489d", "score": "0.5804071", "text": "get columnSize() {\n return this.dashboardRect.width / this.columns;\n }", "title": "" }, { "docid": "acc427154d2b0c529b454d193f6f430b", "score": "0.58006626", "text": "add(num)\n {\n const old_rows = this.rows;\n const old_size = this.rows.length;\n const new_size = old_size + num;\n this.rows = Array(new_size);\n\n // Copy all old rows into the new rows array, increasing their height by num\n var i = 0;\n for (; i < old_size; ++i)\n {\n this.rows[i] = Array(new_size);\n var j = 0;\n for (; j < old_size; ++j)\n {\n this.rows[i][j] = old_rows[i][j];\n }\n for (; j < new_size; ++j)\n {\n this.rows[i][j] = 0;\n }\n }\n\n // Add num columns\n for (; i < new_size; ++i)\n {\n this.rows[i] = Array(new_size);\n for (let j = 0; j < new_size; ++j)\n {\n this.rows[i][j] = 0.;\n }\n }\n\n return old_size;\n }", "title": "" }, { "docid": "bdd2e7029c4ee6af91f44b841e9e9d0d", "score": "0.57942396", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "bdd2e7029c4ee6af91f44b841e9e9d0d", "score": "0.57942396", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "708be423ee73132f7572f96c1a632d9f", "score": "0.5791352", "text": "columnCount() {\n return TileKey.columnsAtLevel(this.level);\n }", "title": "" }, { "docid": "708be423ee73132f7572f96c1a632d9f", "score": "0.5791352", "text": "columnCount() {\n return TileKey.columnsAtLevel(this.level);\n }", "title": "" }, { "docid": "fecbe4c1c316089cb4c1b95189785715", "score": "0.576278", "text": "rows() {\n return this.m_data.length;\n }", "title": "" }, { "docid": "266af5a1c60f14ceefb7ebf447b4e6a5", "score": "0.5762429", "text": "get rowCount() { return this.rowIndex + 1; }", "title": "" }, { "docid": "907af831f227fef9e92582f65dd6d517", "score": "0.574945", "text": "function _calcRowColSize() {\n column_width = (canvas_width - (margin_left + margin_right)) / (x_labels.length + 1);\n row_height = (canvas_height - (margin_top + margin_bottom)) / (y_labels.length + 1);\n }", "title": "" }, { "docid": "524429bcc4414bfef151542cc66aa186", "score": "0.57393485", "text": "getColNumber() {\n return this._cols\n }", "title": "" }, { "docid": "ec8470c671ad1f32853ac8b3099d26fe", "score": "0.5736223", "text": "rows() {return range(this.rowCount);}", "title": "" }, { "docid": "7c9999fbee5d44e8181c69fde4ba038e", "score": "0.5734635", "text": "function get_num_rows(terminal,char_size){return Math.floor(terminal.find(\".terminal-fill\").height()/char_size.height)}// -----------------------------------------------------------------------", "title": "" }, { "docid": "f22b3f9a6ffd5e9db2070e830c313d40", "score": "0.5701184", "text": "function DimensionsEditor() {\n destroyGrid();\n NumRows = Number(document.getElementById(\"NewDimensions\").value);\n NumRows = divisibleBy(NumRows);\n NumCols = NumRows;\n \n newGrid();\n}", "title": "" }, { "docid": "bcf47750ba41b87c49619b8fbdbe7645", "score": "0.56979895", "text": "get cols() {return this.#cols;}", "title": "" }, { "docid": "24a040d34709e50fe74b972cfcac8ee6", "score": "0.5691944", "text": "countColumns() {\n // crete a hash with {numColums: numRows}\n const columnCount = this._csvData.reduce((count, row) => {\n return {\n ...count,\n [row.length]: (count[row.length] || 0) + 1\n }\n }, {})\n\n // Select the most common column length\n const mostCommonLength = Object.keys(columnCount)\n .reduce((mostCommon, length) => (\n columnCount[length] > columnCount[mostCommon] ? length : mostCommon\n ))\n\n this._columnsCount = parseInt(mostCommonLength, 10)\n }", "title": "" }, { "docid": "863c61e1d8821cabdec7ec412bfcdc8d", "score": "0.56867623", "text": "function getRow() {\n return Lines.length;\n}", "title": "" }, { "docid": "50f82fb6c406a1542275953bc53538cd", "score": "0.56783664", "text": "setRowCount(props) {\n const { data } = props;\n const { rowLimit } = this.getConfiguredProperties();\n\n this.setState({ rowCount: this.hasMultipleRows() ? rowLimit : data.length });\n }", "title": "" }, { "docid": "478f5fc74149514ceb961d26ca77e7fa", "score": "0.5667658", "text": "getSizes(colCount, rowCount) {\n if (this.shapeType == 'square') {\n const cellWidth = (this.maxWidth - this.leftMargin - this.rightMargin) / colCount;\n const cellHeight = (this.maxHeight - this.topMargin - this.bottomMargin) / rowCount;\n const cellSide = Math.min(cellWidth, cellHeight);\n\n const effectiveWidth = (cellSide * colCount) + this.leftMargin + this.rightMargin;\n const effectiveHeight = (cellSide * rowCount) + this.topMargin + this.bottomMargin;\n\n return { cellSide: cellSide, effectiveWidth: effectiveWidth, effectiveHeight: effectiveHeight};\n } \n \n if (this.shapeType == 'triangle') {\n const cellWidth = (this.maxWidth - this.leftMargin - this.rightMargin) / ((colCount / 2) + 0.5);\n const cellHeight = (this.maxHeight - this.topMargin - this.bottomMargin) / (rowCount * Math.sin(Math.PI / 3));\n const cellSide = Math.min(cellWidth, cellHeight);\n\n const effectiveWidth = (cellSide * ((colCount / 2) + 0.5)) + this.leftMargin + this.rightMargin;\n const effectiveHeight = (cellSide * (rowCount * Math.sin(Math.PI / 3))) + this.topMargin + this.bottomMargin;\n\n return { cellSide: cellSide, effectiveWidth: effectiveWidth, effectiveHeight: effectiveHeight};\n }\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.5662792", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.5662792", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.5662792", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "ab8f1cbe5e0e9d3f627f1b38881b51f2", "score": "0.5624698", "text": "get row() {\n return index2row(getTop()) + 1;\n }", "title": "" }, { "docid": "cebbba5a49b4f128d18f7d1474cd9423", "score": "0.5612732", "text": "_laneCount() {\n const { lanes, horizontal } = this.props;\n const config = lanes[horizontal ? \"horizontal\" : \"vertical\"];\n const prop = horizontal ? \"offsetHeight\" : \"offsetWidth\";\n const containerWidth = this.domrefs.container.current[prop];\n\n const mqs = compact(\n map(config, (laneCount, key) => {\n const applies = containerWidth >= key;\n return applies ? laneCount : false;\n })\n );\n\n const colcount = last(mqs);\n\n return colcount;\n }", "title": "" }, { "docid": "131b77b5d5695765e66e44dba8ee69ed", "score": "0.56091297", "text": "get rowHeight() { return this._rowHeight; }", "title": "" }, { "docid": "42fa8b38e5880296c387940593544058", "score": "0.5604946", "text": "cols() {\n return this.m_attr_name.length;\n }", "title": "" }, { "docid": "ace2dbf73b3330b21d79173150729b08", "score": "0.559316", "text": "function RowPosition (i) { return (i % numRows) + 1;}", "title": "" }, { "docid": "d0602ae413fac1ddd8c39fea847c8ad6", "score": "0.5593056", "text": "function determineColumnCount(){\n\tif (window.innerWidth <= 800)\n\t\tstore.dispatch(setColumnCount(2));\n\telse\n\t\tstore.dispatch(setColumnCount(3));\n\n\tstore.dispatch(addImages(store.getState().imageState.images));\n}", "title": "" }, { "docid": "4256c1bd7bcb4a4a35b7cc3109ca883e", "score": "0.5580473", "text": "setRowGroupSize(cnt) {\n this.rowGroupSize = cnt;\n }", "title": "" }, { "docid": "3c955c3c1573daba991fc79502fa6d27", "score": "0.555168", "text": "_calculateNumberOfColumns(rows) {\n const columns = [ 0 ];\n for (const row of rows) {\n if (row instanceof TableSeparator) {\n continue;\n }\n\n columns.push(this._getNumberOfColumns(row));\n }\n\n this._numberOfColumns = Math.max(...columns);\n }", "title": "" }, { "docid": "38bea83eb9dedc3d182bb1358694e93f", "score": "0.5517289", "text": "function setup() {\n createCanvas(200, 200);\n // Calculate cell size - canvas dimensions divided by how many\n // cells we want per column and row\n cellWidth = width / G_WIDTH;\n cellHeight = height / G_HEIGHT;\n}", "title": "" }, { "docid": "3002f31397201c482895178e355cc775", "score": "0.5511619", "text": "itIdx (col, row) { return this.itCol(col) + this.itRow(row) * this._cols }", "title": "" }, { "docid": "3f7dc38f307b2591e8b763467e43a1fc", "score": "0.5509789", "text": "function getGridSizeS() {\n\t\t\treturn 3;\n\t\t}", "title": "" }, { "docid": "fab9661e602f2776c963bb3b01f5ef6b", "score": "0.54992944", "text": "getGridSize() {\n return this.gridSize_;\n }", "title": "" }, { "docid": "057ceb0e84cb5a652614491761648f8b", "score": "0.5476316", "text": "function findNumOfRows(seqLength, numberOfCols) {\n if (seqLength > 0) {\n var kk = 0;\n var lineNumber = \"\";\n var numberOfRows = Math.ceil(seqLength / numberOfCols);\n while (kk < numberOfRows) {\n if (kk === 0) {\n lineNumber += \"1\";\n $('#rowsTextArea').text(lineNumber);\n kk++;\n }\n else {\n lineNumber += \"\\r\\n\" + (numberOfCols * (kk));\n $('#rowsTextArea').text(lineNumber);\n kk++;\n }\n }\n }\n return numberOfRows;\n }", "title": "" }, { "docid": "ea6d8e28cd0cd3adb0e5ba4415456b65", "score": "0.546842", "text": "setIndex(cols, tileSize) {\n let col = Math.round(this.position.x / tileSize)\n let row = Math.round(this.position.y / tileSize)\n this.position.index = row * cols + col\n }", "title": "" }, { "docid": "951a0dc56ca357a2a1b8861dff20520f", "score": "0.54655546", "text": "function rows(matrix) {\n\treturn matrix.length;\n}", "title": "" }, { "docid": "67c6e1c3be354e6bd04b9c48146ed9ff", "score": "0.54564154", "text": "function columnNum(){\n\t var count;\n\t var $headerColumns = $header.find(opts.headerCellSelector);\n\t if(existingColGroup){\n\t count = $tableColGroup.find('col').length;\n\t } else {\n\t count = 0;\n\t $headerColumns.each(function () {\n\t count += parseInt(($(this).attr('colspan') || 1), 10);\n\t });\n\t }\n\t if(count != lastColumnCount){\n\t lastColumnCount = count;\n\t var cells = [], cols = [], psuedo = [], content;\n\t for(var x = 0; x < count; x++){\n\t content = $headerColumns.eq(x).text();\n\t cells.push('<th class=\"floatThead-col\" aria-label=\"'+content+'\"/>');\n\t cols.push('<col/>');\n\t psuedo.push(\n\t $('<fthtd>').css({\n\t 'display': 'table-cell',\n\t 'height': 0,\n\t 'width': 'auto'\n\t })\n\t );\n\t }\n\n\t cols = cols.join('');\n\t cells = cells.join('');\n\n\t if(createElements){\n\t $fthRow.empty();\n\t $fthRow.append(psuedo);\n\t $fthCells = $fthRow.find('fthtd');\n\t }\n\n\t $sizerRow.html(cells);\n\t $sizerCells = $sizerRow.find(\"th\");\n\t if(!existingColGroup){\n\t $tableColGroup.html(cols);\n\t }\n\t $tableCells = $tableColGroup.find('col');\n\t $floatColGroup.html(cols);\n\t $headerCells = $floatColGroup.find(\"col\");\n\n\t }\n\t return count;\n\t }", "title": "" }, { "docid": "f6a145eacf7505491109b7f2126e6128", "score": "0.5456376", "text": "function matrixRows(matrix) {\n return matrix.length;\n}", "title": "" }, { "docid": "db0a1f3868f8d14e28e91d93cfa5374f", "score": "0.5455938", "text": "function defaultGrid() {\n makeRows(16);\n makeColumns(16);\n}", "title": "" }, { "docid": "3442c5b3efadc9e995e52cbf3b3799b9", "score": "0.54499036", "text": "gridSize() {\n\t\t\treturn 25;\n\t\t}", "title": "" }, { "docid": "77b8878dce38fe7adf22edbb86ecfd39", "score": "0.54346186", "text": "function makeGrid(){\n for(let i=0; i<rowsNumber.value; i++){\n const row = pixelCanvas.insertRow(0);\n for(let j=0; j<cellsNumber.value; j++){\n row.insertCell(0);\n }\n }\n}", "title": "" }, { "docid": "3d56ad6486707bf3764719e9d90304e7", "score": "0.54266644", "text": "function defaultGrid() {\n makeRows(3);\n makeColumns(31);\n}", "title": "" }, { "docid": "f816f2911ba77bc700b7a0999b485dee", "score": "0.54201114", "text": "_getRowHeight (index) {\n return this.props.heights[index];\n }", "title": "" }, { "docid": "2355acf11646c14f2c672196d79a56f5", "score": "0.54194444", "text": "getTableRowCounts() {\n return this.rowCounts\n }", "title": "" }, { "docid": "b24ed4bc73a485e35d416bada8a05947", "score": "0.54136944", "text": "init(state) {\n this.cells = Array.from(Array(this.h), () => Array.from(Array(this.w), () => state))\n }", "title": "" }, { "docid": "fff72898f3443fe8bd9cde13bdf8fc35", "score": "0.5412206", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "fff72898f3443fe8bd9cde13bdf8fc35", "score": "0.5412206", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "7be1379f39987fdc39e5e57623c1ec82", "score": "0.5400803", "text": "function mapSize(){\n var c = $(\"#mapsize\").val();\n var r = $(\"#mapsize\").val();\n cols = (c === \"\")? cols:c;\n rows = (r === \"\")? rows:r;\n}", "title": "" }, { "docid": "110d224896deb4132a5a8a631c27db74", "score": "0.5399165", "text": "_size_elements () {\n\n\t\tthis.w = this.context.canvas.width\n\t\tthis.h = this.context.canvas.height\n\n\t\tif (this.w / this.h > 8/5) {\n\t\t\tthis.board_size = 4 * this.h / 5\n\t\t}\n\t\telse {\n\t\t\tthis.board_size = 4 * this.w / 8\n\t\t}\n\t\tthis.margin_h = (this.h - this.board_size) / 2\n\t\tthis.margin_w = (this.w - this.board_size) / 2\n\t}", "title": "" }, { "docid": "1a543de0c2c3e053766ee732a717cfe8", "score": "0.53882337", "text": "function calcNumberOnPosition(row, col, cols) {\n return row * cols + col + 1;\n }", "title": "" }, { "docid": "f97684e4f0862775fb79ae5bea3f0baf", "score": "0.5385667", "text": "width() { return this.w; }", "title": "" }, { "docid": "d4f4e90940f21240ebb706f0727eef8f", "score": "0.5378112", "text": "function setRow(rowValue){\n numRow = +rowValue.value;\n console.log(numRow);\n render();\n}", "title": "" }, { "docid": "4e7b96af5de1fd342ac7b8c2c7bb97fe", "score": "0.5378035", "text": "createGrid() {\n let indexOfTheLine = 0;\n let numberOfBoxes = this.nbOfLines * this.nbOfColumns;\n let i;\n let j;\n let x = 0;\n let y = 0;\n\n //create the lines\n for (j = 0; j < this.nbOfLines; j++) {\n const trElt = document.createElement(\"tr\");\n trElt.id = `line-${j}`;\n $(\"table\").append(trElt);\n }\n //create the cells\n for (i = 0; i < numberOfBoxes; i++) {\n const tdElt = document.createElement(\"td\");\n tdElt.id = `${x}-${y}`; //each td as a unique id -> his x/y position\n // tdElt.innerHTML = i; //just for info\n tdElt.classList.add(\"free\");\n $(tdElt).attr(\"data-value\", i);\n $(`#line-${indexOfTheLine}`).append(tdElt); //pushing into the tr element\n x++;\n\n //if there are 10 colmuns\n if (\n $(`#line-${indexOfTheLine}`).children().length === this.nbOfLines\n ) {\n indexOfTheLine++; //go to the next line\n x = 0; //for the X position of the cell\n y++; //for the Y position of the cell\n }\n }\n }", "title": "" }, { "docid": "ab25b6e6e6fa2ba9fe0dc2a09087c819", "score": "0.53772825", "text": "cellWidth() {\r\n return this._widthOrContainer() / this.getColumn();\r\n }", "title": "" }, { "docid": "933ec97f8fd23b2aa85ed0929b979c9d", "score": "0.5367083", "text": "function updateWidthHeight()\n {\n let rect = getClientRect(table.id)\n width = rect.width\n height = rect.height\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5358987", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5358987", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5358987", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "e7c63bdd1ac31f0fd365875084b67eaf", "score": "0.5358842", "text": "get rows() {\n return unique(\n Array.apply(getTop(), Array(1 + (getBottom() - getTop()))).map((x, y) =>\n index2row(y + getTop())\n )\n );\n }", "title": "" }, { "docid": "d45bd9a7349770ce413d7fb565419b50", "score": "0.5345875", "text": "function makeRows(parameter) {\n container.style.setProperty('--grid-rows', parameter);\n container.style.setProperty('--grid-cols', parameter);\n for (i = 0; i < (parameter * parameter); i++) {\n let gridItem = document.createElement(\"div\");\n gridItem.setAttribute('data-count',1);\n container.appendChild(gridItem).className = \"grid-item\";\n };\n}", "title": "" }, { "docid": "d74a3b64da35bb9669608fe050ff4f17", "score": "0.5339961", "text": "function getColSize() {\n var colSize;\n var i;\n for (i = 0; i < items.length; ++i) {\n if (!colSize || items[i].width < colSize) {\n colSize = items[i].width;\n }\n }\n return colSize;\n }", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" }, { "docid": "d8ac3603d8dc00d820b42cf3872ca620", "score": "0.5335419", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}", "title": "" } ]
84dc41ecf9d4ea9365566d61113bb19b
force refresh embeddings file but first rename existing embeddings file to .smartconnections/embeddingsYYYYMMDD.json
[ { "docid": "39b710d85e78c5651ff130edc6e7809e", "score": "0.85343575", "text": "async force_refresh_embeddings_file() {\n // get current datetime as unix timestamp\n let current_datetime = Math.floor(Date.now() / 1000);\n // rename existing embeddings file to .smart-connections/embeddings-YYYY-MM-DD.json\n await this.app.vault.adapter.rename(\".smart-connections/embeddings-2.json\", \".smart-connections/embeddings-\"+current_datetime+\".json\");\n // create new embeddings file\n await this.app.vault.adapter.write(\".smart-connections/embeddings-2.json\", \"{}\");\n new Obsidian.Notice(\"Smart Connections: embeddings file Force Refreshed, making new connections...\");\n // clear this.embeddings\n this.embeddings = null;\n this.embeddings = {};\n // trigger making new connections\n await this.get_all_embeddings();\n this.output_render_log();\n new Obsidian.Notice(\"Smart Connections: embeddings file Force Refreshed, new connections made.\");\n }", "title": "" } ]
[ { "docid": "e270e746523c9db55946d0dd3dd90342", "score": "0.70330834", "text": "async reload_embeddings_file() {\n await this.view.load_embeddings_file();\n await this.view.render_connections();\n }", "title": "" }, { "docid": "978bb7d9b2cebe1147e1d50d5f4e4a60", "score": "0.65607715", "text": "async migrate_embeddings_to_v2() {\n // get view and set to loading\n // read embeddings.json\n const embeddings = await this.app.vault.adapter.read(\".smart-connections/embeddings.json\");\n // parse embeddings.json\n const embeddings_json = JSON.parse(embeddings);\n // create new embeddings-2.json\n const embeddings_2_json = {};\n // loop through embeddings.json\n for (let key in embeddings_json) {\n // create new key using crypto SHA1 hash\n const new_key = crypto.createHash('md5').update(key).digest('hex');\n // create new embeddings-2.json entry\n embeddings_2_json[new_key] = {\n \"vec\": embeddings_json[key].values,\n \"meta\": {\n \"path\": key,\n \"hash\": embeddings_json[key].hash,\n \"mtime\": embeddings_json[key].mtime,\n \"tokens\": embeddings_json[key].tokens,\n },\n }\n // if has hashes\n if(embeddings_json[key].hashes) {\n embeddings_2_json[new_key].meta.blocks = [];\n // loop through hashes\n for (let hash of embeddings_json[key].hashes) {\n // iterate through embeddings_json\n for(let key2 in embeddings_json) {\n if (embeddings_json[key2].hash == hash) {\n // create hash from key\n const hash_key = crypto.createHash('md5').update(key2).digest('hex');\n embeddings_2_json[new_key].meta.blocks.push(hash_key);\n }\n }\n }\n // sort blocks\n embeddings_2_json[new_key].meta.blocks.sort();\n }\n // if key contains '#'\n if(key.indexOf(\"#\") > -1) {\n // split at '#' and get first part\n const file_key = crypto.createHash('md5').update(key.split(\"#\")[0]).digest('hex');\n embeddings_2_json[new_key].meta.file = file_key;\n }\n // re-write object create to exclude any undefined values\n embeddings_2_json[new_key] = JSON.parse(JSON.stringify(embeddings_2_json[new_key]));\n }\n // write embeddings-2.json\n await this.app.vault.adapter.write(\".smart-connections/embeddings-2.json\", JSON.stringify(embeddings_2_json));\n }", "title": "" }, { "docid": "49fe17c799c74535c6e5cade71f17e14", "score": "0.62356395", "text": "clean_up_embeddings(files) {\n for (let key in this.embeddings) {\n // console.log(\"key: \"+key);\n const path = this.embeddings[key].meta.path;\n // if no key starts with file path\n if(!files.find(file => path.startsWith(file.path))) {\n // delete key if it doesn't exist\n delete this.embeddings[key];\n this.render_log.deleted_embeddings++;\n // console.log(\"deleting (deleted file): \" + key);\n continue;\n }\n // if key contains '#'\n if(path.indexOf(\"#\") > -1) {\n // split at '#' and get first part\n const file_key = this.embeddings[key].meta.file;\n // if file_key and file.hashes exists and block hash not in file.hashes\n if(!this.embeddings[file_key]){\n // delete key\n delete this.embeddings[key];\n this.render_log.deleted_embeddings++;\n // console.log(\"deleting (missing file embedding)\");\n continue;\n }\n if(!this.embeddings[file_key].meta){\n // delete key\n delete this.embeddings[key];\n this.render_log.deleted_embeddings++;\n // console.log(\"deleting (missing file meta)\");\n continue;\n }\n if(this.embeddings[file_key].meta.blocks && (this.embeddings[file_key].meta.blocks.indexOf(key) < 0)) {\n // delete key\n delete this.embeddings[key];\n this.render_log.deleted_embeddings++;\n // console.log(\"deleting (missing block in file)\");\n continue;\n }\n // DEPRECATED - currently included to prevent existing embeddings from being refreshed all at once\n if(this.embeddings[file_key].meta.mtime && \n this.embeddings[key].meta.mtime && \n (this.embeddings[file_key].meta.mtime > this.embeddings[key].meta.mtime)\n ) {\n // delete key\n delete this.embeddings[key];\n this.render_log.deleted_embeddings++;\n // console.log(\"deleting (stale block - mtime): \" + key);\n }\n }\n }\n }", "title": "" }, { "docid": "79c45a925cbb4301651a74c4ba489d68", "score": "0.57889587", "text": "async save_failed_embeddings () {\n // write failed_embeddings to file one line per failed embedding\n let failed_embeddings = [];\n // if file already exists then read it\n const failed_embeddings_file_exists = await this.app.vault.adapter.exists(\".smart-connections/failed-embeddings.txt\");\n if(failed_embeddings_file_exists) {\n failed_embeddings = await this.app.vault.adapter.read(\".smart-connections/failed-embeddings.txt\");\n // split failed_embeddings into array\n failed_embeddings = failed_embeddings.split(\"\\r\\n\");\n }\n // merge failed_embeddings with render_log.failed_embeddings\n failed_embeddings = failed_embeddings.concat(this.render_log.failed_embeddings);\n // remove duplicates\n failed_embeddings = [...new Set(failed_embeddings)];\n // sort failed_embeddings array alphabetically\n failed_embeddings.sort();\n // convert failed_embeddings array to string\n failed_embeddings = failed_embeddings.join(\"\\r\\n\");\n // write failed_embeddings to file\n await this.app.vault.adapter.write(\".smart-connections/failed-embeddings.txt\", failed_embeddings);\n // reload failed_embeddings to prevent retrying failed files until explicitly requested\n await this.load_failed_files();\n }", "title": "" }, { "docid": "01380887f86e59f4449cc8b93c0ca859", "score": "0.55448276", "text": "function refresh_embedded_airtable() {\n\t// set the src to the src (forces refresh)\n\tdocument.querySelectorAll('iframe[class=airtable-embed]')[0].src = document.querySelectorAll('iframe[class=airtable-embed]')[0].src;\n\treturn false; // return false so doesn't reload the page\n}", "title": "" }, { "docid": "020ead22b4195e87af3487c8160e8305", "score": "0.5489116", "text": "async get_all_embeddings() {\n // get all files in vault and filter all but markdown and canvas files\n const files = (await this.app.vault.getFiles()).filter((file) => file instanceof Obsidian.TFile && (file.extension === \"md\" || file.extension === \"canvas\"));\n // const files = await this.app.vault.getMarkdownFiles();\n // get open files to skip if file is currently open\n const open_files = this.app.workspace.getLeavesOfType(\"markdown\").map((leaf) => leaf.view.file);\n this.render_log.total_files = files.length;\n this.clean_up_embeddings(files);\n // batch embeddings\n let batch_promises = [];\n for (let i = 0; i < files.length; i++) {\n // skip if path contains a #\n if(files[i].path.indexOf(\"#\") > -1) {\n // console.log(\"skipping file '\"+files[i].path+\"' (path contains #)\");\n this.log_exclusion(\"path contains #\");\n continue;\n }\n const curr_key = crypto.createHash(\"md5\").update(files[i].path).digest(\"hex\");\n // skip if file already has embedding and embedding.mtime is greater than or equal to file.mtime\n if((this.embeddings[curr_key]) && (this.embeddings[curr_key].meta.mtime >= files[i].stat.mtime)) {\n // log skipping file\n //console.log(\"skipping file (mtime)\");\n continue;\n }\n // check if file is in failed_files\n if(this.settings.failed_files.indexOf(files[i].path) > -1) {\n // log skipping file\n // console.log(\"skipping previously failed file, use button in settings to retry\");\n // use setTimeout to prevent multiple notices\n if(this.retry_notice_timeout) {\n clearTimeout(this.retry_notice_timeout);\n this.retry_notice_timeout = null;\n }\n // limit to one notice every 10 minutes\n if(!this.recently_sent_retry_notice){\n new Obsidian.Notice(\"Smart Connections: Skipping previously failed file, use button in settings to retry\");\n this.recently_sent_retry_notice = true;\n setTimeout(() => {\n this.recently_sent_retry_notice = false; \n }, 600000);\n }\n continue;\n }\n // skip files where path contains any exclusions\n let skip = false;\n for(let j = 0; j < this.file_exclusions.length; j++) {\n if(files[i].path.indexOf(this.file_exclusions[j]) > -1) {\n skip = true;\n this.log_exclusion(this.file_exclusions[j]);\n // break out of loop\n break;\n }\n }\n if(skip) {\n continue; // to next file\n }\n // check if file is open\n if(open_files.indexOf(files[i]) > -1) {\n // console.log(\"skipping file (open)\");\n continue;\n }\n try {\n // push promise to batch_promises\n batch_promises.push(this.get_file_embeddings(files[i], false));\n } catch (error) {\n console.log(error);\n }\n // if batch_promises length is 10\n if(batch_promises.length > 3) {\n // wait for all promises to resolve\n await Promise.all(batch_promises);\n // clear batch_promises\n batch_promises = [];\n }\n\n // save embeddings JSON to file every 100 files to save progress on bulk embedding\n if(i > 0 && i % 100 === 0) {\n await this.save_embeddings_to_file();\n }\n }\n // console.log(this.embeddings);\n // wait for all promises to resolve\n await Promise.all(batch_promises);\n // write embeddings JSON to file\n await this.save_embeddings_to_file();\n // if render_log.failed_embeddings then update failed_embeddings.txt\n if(this.render_log.failed_embeddings.length > 0) {\n await this.save_failed_embeddings();\n }\n }", "title": "" }, { "docid": "6df8ae7f6138c653f22e178437806706", "score": "0.53715056", "text": "SaveAndReimport() {}", "title": "" }, { "docid": "010c09076a79a78f730c740bae0f9219", "score": "0.53528255", "text": "updateExternalStorages() {}", "title": "" }, { "docid": "ca14f4d2ac511cdf381fa5b142ed937a", "score": "0.5325064", "text": "fixManifest () {\n const manifestFilePath = path.join(this.options.src, 'manifest.json')\n if (fse.existsSync(manifestFilePath) === true) {\n const manifestFileData = fse.readFileSync(manifestFilePath)\n let manifestData = JSON.parse(manifestFileData.toString())\n\n findAndReplaceInSection(manifestData.background.scripts, 'www/bex-background.js', 'www/js/bex-background.js')\n findAndReplaceInSection(manifestData.content_scripts[0].js, 'www/bex-content-script.js', 'www/js/bex-content-script.js')\n const newValue = JSON.stringify(manifestData)\n fse.writeFileSync(manifestFilePath, newValue, 'utf-8')\n }\n }", "title": "" }, { "docid": "4ee69543601740746a3a1262793504fc", "score": "0.5280063", "text": "async get_file_embeddings(curr_file, save=true) {\n // let batch_promises = [];\n let req_batch = [];\n let blocks = [];\n // initiate curr_file_key from md5(curr_file.path)\n const curr_file_key = this.get_file_key(curr_file);\n // intiate file_file_embed_input by removing .md and converting file path to breadcrumbs (\" > \")\n let file_embed_input = curr_file.path.replace(\".md\", \"\");\n file_embed_input = file_embed_input.replace(/\\//g, \" > \");\n // embed on file.name/title only if path_only path matcher specified in settings\n let path_only = false;\n for(let j = 0; j < this.path_only.length; j++) {\n if(curr_file.path.indexOf(this.path_only[j]) > -1) {\n path_only = true;\n console.log(\"title only file with matcher: \" + this.path_only[j]);\n // break out of loop\n break;\n }\n }\n // return early if path_only\n if(path_only) {\n // await this.get_embeddings(curr_file_key, file_embed_input, {\n // mtime: curr_file.stat.mtime,\n // path: curr_file.path,\n // });\n req_batch.push([curr_file_key, file_embed_input, {\n mtime: curr_file.stat.mtime,\n path: curr_file.path,\n }]);\n await this.get_embeddings_batch(req_batch);\n return;\n }\n /**\n * BEGIN Canvas file type Embedding\n */\n if(curr_file.extension === \"canvas\") {\n // get file contents and parse as JSON\n const canvas_contents = await this.app.vault.cachedRead(curr_file);\n if((typeof canvas_contents === \"string\") && (canvas_contents.indexOf(\"nodes\") > -1)) {\n const canvas_json = JSON.parse(canvas_contents);\n // for each object in nodes array\n for(let j = 0; j < canvas_json.nodes.length; j++) {\n // if object has text property\n if(canvas_json.nodes[j].text) {\n // add to file_embed_input\n file_embed_input += \"\\n\" + canvas_json.nodes[j].text;\n }\n // if object has file property\n if(canvas_json.nodes[j].file) {\n // add to file_embed_input\n file_embed_input += \"\\nLink: \" + canvas_json.nodes[j].file;\n }\n }\n }\n // console.log(file_embed_input);\n req_batch.push([curr_file_key, file_embed_input, {\n mtime: curr_file.stat.mtime,\n path: curr_file.path,\n }]);\n await this.get_embeddings_batch(req_batch);\n return;\n }\n \n /**\n * BEGIN Block \"section\" embedding\n */\n // get file contents\n const note_contents = await this.app.vault.cachedRead(curr_file);\n let processed_since_last_save = 0;\n const note_sections = this.block_parser(note_contents, curr_file.path);\n // console.log(note_sections);\n // if note has more than one section (if only one then its same as full-content)\n if(note_sections.length > 1) {\n // for each section in file\n //console.log(\"Sections: \" + note_sections.length);\n for (let j = 0; j < note_sections.length; j++) {\n // get embed_input for block\n const block_embed_input = note_sections[j].text;\n // console.log(note_sections[j].path);\n // get block key from block.path (contains both file.path and header path)\n const block_key = crypto.createHash('md5').update(note_sections[j].path).digest('hex');\n blocks.push(block_key);\n let block_hash; // set hash of block_embed_input in correct scope\n if (this.embeddings[block_key] && this.embeddings[block_key].meta) {\n // skip if length of block_embed_input same as length of embeddings[block_key].meta.len\n if (block_embed_input.length === this.embeddings[block_key].meta.len) {\n // log skipping file\n // console.log(\"skipping block (len)\");\n continue;\n }\n // add hash to blocks to prevent empty blocks triggering full-file embedding\n // skip if embeddings key already exists and block mtime is greater than or equal to file mtime\n if (this.embeddings[block_key].meta.mtime >= curr_file.stat.mtime) {\n // log skipping file\n // console.log(\"skipping block (mtime)\");\n continue;\n }\n // skip if hash is present in this.embeddings and hash of block_embed_input is equal to hash in this.embeddings\n block_hash = this.get_embed_hash(block_embed_input);\n if(this.embeddings[block_key].meta.hash === block_hash) {\n // log skipping file\n // console.log(\"skipping block (hash)\");\n continue;\n }\n }\n\n // create req_batch for batching requests\n req_batch.push([block_key, block_embed_input, {\n // oldmtime: curr_file.stat.mtime, \n // get current datetime as unix timestamp\n mtime: Date.now(),\n hash: block_hash, \n file: curr_file_key,\n path: note_sections[j].path,\n len: block_embed_input.length,\n }]);\n if(req_batch.length > 9) {\n // add batch to batch_promises\n await this.get_embeddings_batch(req_batch);\n processed_since_last_save += req_batch.length;\n // log embedding\n // console.log(\"embedding: \" + curr_file.path);\n if (processed_since_last_save >= 30) {\n // write embeddings JSON to file\n await this.save_embeddings_to_file();\n // reset processed_since_last_save\n processed_since_last_save = 0;\n }\n // reset req_batch\n req_batch = [];\n }\n }\n }\n // if req_batch is not empty\n if(req_batch.length > 0) {\n // process remaining req_batch\n await this.get_embeddings_batch(req_batch);\n req_batch = [];\n processed_since_last_save += req_batch.length;\n }\n \n /**\n * BEGIN File \"full note\" embedding\n */\n\n // if file length is less than ~8000 tokens use full file contents\n // else if file length is greater than 8000 tokens build file_embed_input from file headings\n file_embed_input += `:\\n`;\n /**\n * TODO: improve/refactor the following \"large file reduce to headings\" logic\n */\n if(note_contents.length < MAX_EMBED_STRING_LENGTH) {\n file_embed_input += note_contents\n }else{ \n const note_meta_cache = this.app.metadataCache.getFileCache(curr_file);\n // for each heading in file\n if(typeof note_meta_cache.headings === \"undefined\") {\n // console.log(\"no headings found, using first chunk of file instead\");\n file_embed_input += note_contents.substring(0, MAX_EMBED_STRING_LENGTH);\n // console.log(\"chuck len: \" + file_embed_input.length);\n }else{\n let note_headings = \"\";\n for (let j = 0; j < note_meta_cache.headings.length; j++) {\n // get heading level\n const heading_level = note_meta_cache.headings[j].level;\n // get heading text\n const heading_text = note_meta_cache.headings[j].heading;\n // build markdown heading\n let md_heading = \"\";\n for (let k = 0; k < heading_level; k++) {\n md_heading += \"#\";\n }\n // add heading to note_headings\n note_headings += `${md_heading} ${heading_text}\\n`;\n }\n //console.log(note_headings);\n file_embed_input += note_headings\n if(file_embed_input.length > MAX_EMBED_STRING_LENGTH) {\n file_embed_input = file_embed_input.substring(0, MAX_EMBED_STRING_LENGTH);\n }\n }\n }\n // skip embedding full file if blocks is not empty and all hashes are present in this.embeddings\n // better than hashing file_embed_input because more resilient to inconsequential changes (whitespace between headings)\n const file_hash = this.get_embed_hash(file_embed_input);\n const existing_hash = (this.embeddings[curr_file_key] && this.embeddings[curr_file_key].meta) ? this.embeddings[curr_file_key].meta.hash : null;\n if(existing_hash && (file_hash === existing_hash)) {\n // console.log(\"skipping file (hash): \" + curr_file.path);\n this.update_render_log(blocks, file_embed_input);\n return;\n };\n\n // if not already skipping and blocks are present\n const existing_blocks = (this.embeddings[curr_file_key] && this.embeddings[curr_file_key].meta) ? this.embeddings[curr_file_key].meta.blocks : null;\n let existing_has_all_blocks = true;\n if(existing_blocks && Array.isArray(existing_blocks) && (blocks.length > 0)) {\n // if all blocks are in existing_blocks then skip (allows deletion of small blocks without triggering full file embedding)\n for (let j = 0; j < blocks.length; j++) {\n if(existing_blocks.indexOf(blocks[j]) === -1) {\n existing_has_all_blocks = false;\n break;\n }\n }\n }\n // if existing has all blocks then check file size for delta\n if(existing_has_all_blocks){\n // get current note file size\n const curr_file_size = curr_file.stat.size;\n // get file size from this.embeddings\n let prev_file_size = 0;\n if (this.embeddings[curr_file_key] && this.embeddings[curr_file_key].meta && this.embeddings[curr_file_key].meta.size) {\n prev_file_size = this.embeddings[curr_file_key].meta.size;\n // if curr file size is less than 10% different from prev file size\n const file_delta_pct = Math.round((Math.abs(curr_file_size - prev_file_size) / curr_file_size) * 100);\n if(file_delta_pct < 10) {\n // skip embedding\n // console.log(\"skipping file (size) \" + curr_file.path);\n this.render_log.skipped_low_delta[curr_file.name] = file_delta_pct + \"%\";\n this.update_render_log(blocks, file_embed_input);\n return;\n }\n }\n }\n let meta = {\n mtime: curr_file.stat.mtime,\n hash: file_hash,\n path: curr_file.path,\n size: curr_file.stat.size,\n blocks: blocks,\n };\n // batch_promises.push(this.get_embeddings(curr_file_key, file_embed_input, meta));\n req_batch.push([curr_file_key, file_embed_input, meta]);\n // send batch request\n await this.get_embeddings_batch(req_batch);\n\n // log embedding\n // console.log(\"embedding: \" + curr_file.path);\n if (save) {\n // write embeddings JSON to file\n await this.save_embeddings_to_file();\n }\n\n }", "title": "" }, { "docid": "44c46f20bfdf9ca71778776d41b01a7e", "score": "0.5276918", "text": "function resetAvailableVideos(){\n availableVideos = {}; \n const newAvailableVideo = JSON.stringify(availableVideos, null, 2);\n FileSystem.writeFileSync(available_videos_path, newAvailableVideo);\n return \"resetAvailableVideos\";\n}", "title": "" }, { "docid": "a7ef1184a61ccdca7709f9736b670745", "score": "0.5252001", "text": "function reloadData(dataFile) {\n document.getElementById(dataFile).remove();\n\n var body = document.getElementsByTagName('body')[0];\n var json = document.createElement('script');\n json.src = dataFile + '.json';\n json.id = dataFile;\n body.appendChild(json);\n}", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.5069871", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.5069871", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.5069871", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "3169ec50ecac49fee0dc34be5bec346a", "score": "0.505454", "text": "updateFile() {\n if(!this.spooling) {\n let saveObject = {\n playData: this.playData,\n chkValues: this.chkValues\n };\n fs.writeFileSync(this.saveFile, JSON.stringify(saveObject));\n }\n }", "title": "" }, { "docid": "fbbc0498e0fed4f34f055eaa382d5b1b", "score": "0.5038205", "text": "invalidateFile(fileName) {\n this.metadataCache.delete(fileName);\n this.resolvedFilePaths.delete(fileName);\n const symbols = this.symbolFromFile.get(fileName);\n if (symbols) {\n this.symbolFromFile.delete(fileName);\n for (const symbol of symbols) {\n this.resolvedSymbols.delete(symbol);\n this.importAs.delete(symbol);\n this.symbolResourcePaths.delete(symbol);\n }\n }\n }", "title": "" }, { "docid": "e2bfd6cd4328156884806de35b66d946", "score": "0.49746037", "text": "function edit_existing_script(data, filename, evt_act, callback){\n var file_str = game_script_dir+filename+'.json'\n console.log(\"EDITING EXISTING\", file_str, data)\n // var file = require(file_str);\n var file = jsonfile.readFileSync(game_script_dir+filename+'.json')\n // console.log(file)\n for (var i = 0; i < file[`${evt_act}`].length;i++){\n console.log(data.id)\n if(file[`${evt_act}`][i].id == data.id){\n file[`${evt_act}`][i].name = data.name\n file[`${evt_act}`][i].event = data.event\n file[`${evt_act}`][i].eventType = data.eventType\n file[`${evt_act}`][i].action = data.action\n file[`${evt_act}`][i].actionType = data.actionType\n file[`${evt_act}`][i].data = data.data\n file[`${evt_act}`][i].description = data.description\n file[`${evt_act}`][i].can_toggle = data.can_toggle\n file[`${evt_act}`][i].message = data.message\n file[`${evt_act}`][i].actions = data.actions\n file[`${evt_act}`][i].dependencies = data.dependencies\n console.log(file)\n }\n }\n jsonfile.writeFile(file_str, file, {spaces: 2}, function (err) {\n console.error(err)\n console.log(\"written\")\n // callback(\"Edited: \", filename, JSON.stringify(file, null, 2))\n })\n // fs.writeFile(file_str, JSON.stringify(file, null, 2), function (err) {\n // if (err) return console.log(err);\n // console.log(JSON.stringify(file));\n // // console.log('writing to ' + filename);\n // });\n}", "title": "" }, { "docid": "6ea7ec7042cbf769f17efa1e1a113b64", "score": "0.49591628", "text": "async updateMeta (metaFile) {\n let pyFile = metaFile.substring(0, metaFile.lastIndexOf('.meta.json')) + '.py';\n let metaFilePath = path.join(this._objectsPath(), metaFile);\n\n let bodyRaw = await fs.readFile(path.join(this._objectsPath(), pyFile), 'utf8');\n let body = new Buffer(bodyRaw).toString('base64');\n\n let metaRaw = await fs.readFile(metaFilePath, 'utf8');\n let meta = JSON.parse(metaRaw);\n\n meta.stylesheet = body;\n await fs.writeFile(metaFilePath, json_stringify_readable(meta), 'utf8');\n }", "title": "" }, { "docid": "080eb7baddf4d2ae54348a26cb2b3e8d", "score": "0.494737", "text": "function updateJokes() {\n fs.writeFile(\n path.join(__dirname, \"data/jokes.json\"),\n JSON.stringify(jokes),\n err => {\n if (err) {\n console.error(\"witze speichern war nicht möglich wegen \", err);\n }\n }\n );\n}", "title": "" }, { "docid": "ecbf1e173c9e715a7f54a3e722789d0e", "score": "0.4939488", "text": "function reWrite() {\n fs.writeFileSync(DataPath, JSON.stringify(shopData));\n}", "title": "" }, { "docid": "873cf83c45db253035e587c95f329891", "score": "0.49380037", "text": "async function changeFiele() {\n let response = await axios.get(process.env.SYNCURL);\n let content = response.data;\n content = await smartReplace.inject(content);\n await fs.writeFileSync(\"./executeOnce.js\", content, \"utf8\");\n console.log(\"替换变量完毕\");\n}", "title": "" }, { "docid": "f08d54e8c28bd1416692cdcaa9d05987", "score": "0.49343765", "text": "function addSynonyms(lang, version, synonyms){\n var bibleInfo = require(\"./bibles/\" + lang + \"/\" + version + \"/info.js\");\n if (bibleInfo.books.length === synonyms.length){\n for (var i = 0; i < bibleInfo.books.length; i++){\n bibleInfo.books[i].synonyms.push(synonyms[i]);\n }\n }\n fswf(\"./bibles/\" + lang + \"/\" + version + \"/info.js\", \"var info = \" + JSON.stringify(bibleInfo, null, '\\t') + \";\\nmodule.exports = info;\");\n}", "title": "" }, { "docid": "61d7a633a51d533622b05f7a70925daa", "score": "0.4931615", "text": "_onEditMedia({media, newMediaJSON, forceReload}) {\n const mediaIndex = this._medias.indexOf(media);\n const newMedia = SectionCommon.initMedia({\n media: newMediaJSON,\n mediaCache: this._mediaCache,\n isNewMedia: true\n });\n\n let isMediaAlreadyLoaded = this.isMediaAlreadyLoaded(newMediaJSON);\n if (!isMediaAlreadyLoaded) {\n media.getNode().after(SectionCommon.renderBackground({\n media: newMedia,\n transition: this._transitions[mediaIndex]\n }));\n }\n else if (forceReload) {\n media.getNode().replaceWith(SectionCommon.renderBackground({\n media: newMedia,\n transition: this._transitions[mediaIndex]\n }));\n }\n\n if (isMediaAlreadyLoaded && newMediaJSON.video) {\n SectionCommon.onEditBackgroundVideo(this._medias, newMediaJSON, newMedia);\n }\n\n newMedia.postCreate({\n container: this._node,\n delayBuilderInit: false,\n onToggleMediaConfig: this._onToggleMediaConfig.bind(this),\n onConfigAction: app.isInBuilder ? this._onMediaConfigAction.bind(this) : null,\n onConfigChange: app.isInBuilder ? this._onMediaConfigChange.bind(this) : null,\n builderConfigurationTabs: this.MEDIA_BUILDER_TABS_BACKGROUND,\n // TODO: for video, need to goes away\n sectionType: 'immersive'\n });\n\n if (!isMediaAlreadyLoaded || forceReload) {\n newMedia.load({\n isBuilderAdd: true,\n isUniqueInSection: true\n });\n }\n else if (newMedia.onDuplicateOrEdit) {\n newMedia.onDuplicateOrEdit(media, true);\n }\n\n this._medias[mediaIndex] = newMedia;\n\n // see if the node is used by another media in this immersive... if so, don't destroy it.\n let firstMatchIndex = this._medias.findIndex(item => {\n return item.getNode().is(media.getNode());\n });\n\n // if there was no match found, remove the DOM node.\n if (firstMatchIndex === -1) {\n media.destroy();\n }\n\n // do an issue check -- do this before this.update()\n SectionCommon.checkMedia(newMediaJSON);\n\n this.update();\n // make the view active\n newMedia.getNode().addClass('active');\n // if the view is a reused one from earlier, make sure it's still shown (make any views after that un-active).\n newMedia.getNode().nextAll().removeClass('active');\n }", "title": "" }, { "docid": "354fb114837dd032c623c672df3035fa", "score": "0.49259084", "text": "static reloadCurrentScript() {\n event_sliderUpdate();\n ToxenScriptManager.events = [];\n\n // Prevent the intensity from going mayham on smooth setters, which it does for some unknown reason.\n VisualizerProperties.setIntensity(15)\n\n var id = getPlayingId();\n if (fs.existsSync(allMusicData[id].folderPath + \"/storyboard.txn\")) {\n ToxenScriptManager.ScriptParser(allMusicData[id].folderPath + \"/storyboard.txn\");\n new Popup(\"Reloaded Script File\", [], 1000);\n }\n }", "title": "" }, { "docid": "e838b519b26828310219525b66823f6d", "score": "0.48493397", "text": "function updateSavedData(targetChannel, lastVideoUrl) {\n let newData = {};\n newData.lastVideoUrl = lastVideoUrl;\n if (fs.existsSync(getSaveFilename(targetChannel))) {\n fs.unlinkSync(getSaveFilename(targetChannel));\n }\n fs.writeFileSync(getSaveFilename(targetChannel), JSON.stringify(newData));\n}", "title": "" }, { "docid": "60c05eeec4c1b64381e4601333c23304", "score": "0.48396978", "text": "function initalizeToyTagsJSON(){\n\tconst data = fs.readFileSync(toytagFileName, 'utf8');\n\tconst databases = JSON.parse(data);\n\tdatabases.forEach(db => {\n\t\tdb.index = \"-1\";\n });\n\tfs.writeFileSync(toytagFileName, JSON.stringify(databases, null, 4), function(){\n\t\tconsole.log(\"Initalized toytags.JSON\");\n\t})\n}", "title": "" }, { "docid": "d9a74ba4d2a48301adf4bfb1e7b767cd", "score": "0.48306814", "text": "async load_failed_files () {\n // check if failed-embeddings.txt exists\n const failed_embeddings_file_exists = await this.app.vault.adapter.exists(\".smart-connections/failed-embeddings.txt\");\n if(!failed_embeddings_file_exists) {\n this.settings.failed_files = [];\n console.log(\"No failed files.\");\n return;\n }\n // read failed-embeddings.txt\n const failed_embeddings = await this.app.vault.adapter.read(\".smart-connections/failed-embeddings.txt\");\n // split failed_embeddings into array and remove empty lines\n const failed_embeddings_array = failed_embeddings.split(\"\\r\\n\");\n // split at '#' and reduce into unique file paths\n const failed_files = failed_embeddings_array.map(embedding => embedding.split(\"#\")[0]).reduce((unique, item) => unique.includes(item) ? unique : [...unique, item], []);\n // return failed_files\n this.settings.failed_files = failed_files;\n // console.log(failed_files);\n }", "title": "" }, { "docid": "a4087e6ccc06e09eee0129aa8db12a72", "score": "0.4826853", "text": "function resync() {\n if (this.removed) return;\n\n this._resyncParent();\n this._resyncList();\n this._resyncKey();\n //this._resyncRemoved();\n}", "title": "" }, { "docid": "c49ab6f11f00af7622335b619891be36", "score": "0.48171577", "text": "function updateSavedManga() {\n chrome.storage.sync.get(\"mangaUpdates\", function(data) {\n var mangaUpdates = data[\"mangaUpdates\"];\n for (var manga in mangaUpdates) {\n saveManga(manga);\n }\n });\n}", "title": "" }, { "docid": "cd27e45ab89f8536bd5ef4860597f4cb", "score": "0.48122516", "text": "reloadIndexFile() {\n LocalFileServer.readIndexFile();\n }", "title": "" }, { "docid": "db79b8d4c5cd95b90ba4c4d8f6ed8000", "score": "0.48113975", "text": "replaceAssetsInStories() {\n this.stepMessage('4', ``, `0 of ${this.assets.length} URLs replaced`)\n this.updated_stories = this.stories_list.slice(0)\n this.assets.forEach((asset, index) => {\n const asset_url_reg = new RegExp(asset.original_url.replace('https:', '').replace('http:', ''), 'g')\n // If the asset was uploaded its URL gets replaced in the content\n if (asset.new_url) {\n this.updated_stories = JSON.parse(JSON.stringify(this.updated_stories).replace(asset_url_reg, asset.new_url))\n } else {\n this.updated_stories = JSON.parse(JSON.stringify(this.updated_stories).replace(asset_url_reg, ''))\n }\n this.stepMessage('4', ``, `${index} of ${this.assets.length} URLs replaced`)\n })\n this.stepMessageEnd('4', `Replaced all URLs in the stories.`)\n }", "title": "" }, { "docid": "8d482502635b832f3a744ab59f2d396f", "score": "0.47971106", "text": "function iframeReload() {\n var iframe = document.getElementsByTagName('iframe');\n iframe[0].src = iframe[0].src;\n }", "title": "" }, { "docid": "b677b181456ceb51c5cde807d4a99419", "score": "0.47949335", "text": "function downloadUpdate(file) {\n// Get the updated module and load it into a script tag.....\n let hotMod = document.createElement('script')\n hotMod.charset = 'utf8'\n hotMod.type = 'text/javascript'\n hotMod.src = `/hot-module?file=${file}`\n\n// Append module to head of document....\n document.head.append(hotMod)\n }", "title": "" }, { "docid": "12ea06abba3a967fe95f57585efc0f92", "score": "0.47931024", "text": "function updateCache (src, data) {\n data = JSON.parse(data);\n data.nbaAppLastCheck = new Date(dateNow).toISOString();\n fs.writeFileSync(src.urlLocal, JSON.stringify(data), 'utf-8');\n }", "title": "" }, { "docid": "4218fd9a3d8d901c8d2b3ef2a0a5e755", "score": "0.47760546", "text": "function onWinClose(e) {\n if (_dataModified) {\n refreshAssets();\n }\n}", "title": "" }, { "docid": "eeaf601fbab83ff7111583c74aadb728", "score": "0.47752857", "text": "replaceAssetsUrls() {\n this.migrated_assets.forEach(asset => {\n try {\n const reg = new RegExp(asset.original_url, 'g')\n this.stories_to_migrate = JSON.parse(JSON.stringify(this.stories_to_migrate).replace(reg, asset.new_url))\n } catch (err) {\n console.log(`Problem replacing URL ${asset.original_url}`)\n }\n })\n }", "title": "" }, { "docid": "cf92690ecd936ce9dd2cbcc9a35c488f", "score": "0.47729212", "text": "_exportChangedDocuments (sessions, buffer, rawArchive) {\n // Note: we are only adding resources that have changed\n // and only those which are registered in the manifest\n let entries = this.getDocumentEntries()\n for (let entry of entries) {\n let { id, type, path } = entry\n const hasChanged = buffer.hasResourceChanged(id)\n // skipping unchanged resources\n if (!hasChanged) continue\n // We mark a resource dirty when it has changes, or if it is an article\n // and pub-meta has changed\n if (type === 'article') {\n let session = sessions[id]\n // TODO: how should we communicate file renamings?\n rawArchive.resources[path] = {\n id,\n // HACK: same as when loading we pass down all sessions so that we can do some hacking there\n data: this._exportDocument(type, session, sessions),\n encoding: 'utf8',\n updatedAt: Date.now()\n }\n }\n }\n }", "title": "" }, { "docid": "f4a9e2275f672dc1379daf488cfd9e16", "score": "0.47716326", "text": "function dllFilesAddRamdomId() {\n const dllPath = paths.appBuild + '/dll';\n if (fs.existsSync(dllPath)) {\n const dllFiles = fs.readdirSync(dllPath);\n dllFiles.forEach(file => {\n // if file is dll_xxxxx.js, change name\n if (/^dll_.*\\.js$/.test(file)) {\n const token = file.split('.');\n const nextFile = `${token[0]}${paths.randomId}.js`;\n fs.moveSync(path.resolve(dllPath, file), path.resolve(dllPath, nextFile));\n console.log(`move ${file} to ${nextFile}`);\n }\n });\n }\n}", "title": "" }, { "docid": "03731207446f825b75246981f5b9fe80", "score": "0.47579613", "text": "async function updateChampions() {\n const CHAMP_LIST = JSON.parse(FS.readFileSync(\"./src/data/champion.json\", \"utf-8\"))\n let qString;\n\n for ( let champ in CHAMP_LIST.data) {\n\n let dir = `./src/data/${champ}`\n MKDIR(dir)\n\n // get and store champion details file\n qString = ROOT + PATCH + BRANCH_CHAMP_DETAILS + champ + \".json\"\n console.log(qString)\n AXIOS.get(qString)\n .then(\n (response) => {\n FS.writeFileSync(`${dir}/${champ}.json` , JSON.stringify(response.data))\n }\n )\n .catch(\n (error) => {\n console.log(\"error: \" + error)\n throw error\n }\n )\n\n // get and store splash art\n qString = ROOT + BRANCH_SPLASH + champ + \"_0.jpg\"\n console.log(qString)\n AXIOS.get(qString, {responseType: 'arraybuffer'})\n // the responseType: arraybuffer option is necessary to correctly format the image data into a local file\n // see https://stackoverflow.com/questions/41846669/download-an-image-using-axios-and-convert-it-to-base64\n .then(\n (response) => {\n FS.writeFileSync(`${dir}/${champ}_0.jpg` , response.data)\n }\n )\n .catch(\n (error) => {\n console.log(\"error: \" + error)\n throw error\n }\n )\n await DELAY(2450)\n }\n\n // TODO save index of champ names, aliases, and ids\n}", "title": "" }, { "docid": "ddac4e0fba81b627fa52ce5a69b04786", "score": "0.47429058", "text": "updateLocalStorage(updatedMovieDatabase){\n\t\t\t\n\t\t\tsaveToLocalStorage(updatedMovieDatabase);\n\t\t}", "title": "" }, { "docid": "138d6215c1bae4503bc81ef33ca3d53e", "score": "0.47210968", "text": "function savefilefirsttime() {\n var savenewfile = ipcRenderer.sendSync('savenewfile', document.getElementById('code').value);\n if (savenewfile.err == undefined) {\n wrking_file = savenewfile.path;\n document.getElementById('filename').innerHTML = path.basename(wrking_file);\n }\n}", "title": "" }, { "docid": "d156e558db309a60d2294d869ddd2d59", "score": "0.47194183", "text": "function fileRecentClear() {\n $.jsonRPC('clearRecent', [get_package_id(),'']);\n}", "title": "" }, { "docid": "727940fb197d0a0cb5c8ac408e8620f4", "score": "0.4705072", "text": "function reload_authoring(){\n\tif (\"reload_authoring\" in window.frames['authoringIFrame1']) {\n \t\twindow.frames['authoringIFrame1'].reload_authoring();\n\t} else {\n\t\twindow.frames['authoringIFrame1'].location = 'authoring/';\n\t}\n}", "title": "" }, { "docid": "081d316c9888a36c7ce54a2d194869c1", "score": "0.47038034", "text": "async updateDiskStorage() {\n fs.ensureDir('./.metaapi');\n const getItemSize = this.getItemSize;\n const accountId = this._accountId;\n const application = this._application;\n const historyStorage = this._historyStorage;\n async function replaceRecords(type, startIndex, replaceItems, sizeArray) {\n const filePath = `./.metaapi/${accountId}-${application}-${type}.bin`;\n let fileSize = (await fs.stat(filePath)).size;\n if(startIndex === 0) {\n await fs.writeFile(filePath, JSON.stringify(replaceItems), 'utf-8');\n } else {\n const replacedItems = sizeArray.slice(startIndex);\n // replacedItems.length - skip commas, replacedItems.reduce - skip item sizes, 1 - skip ] at the end\n const startPosition = fileSize - replacedItems.length - replacedItems.reduce((a, b) => a + b, 0) - 1;\n await fs.truncate(filePath, startPosition);\n await fs.appendFile(filePath, \n ',' + JSON.stringify(replaceItems).slice(1), {encoding: 'utf-8'});\n } \n return sizeArray.slice(0, startIndex).concat(replaceItems.map(item => getItemSize(item)));\n }\n\n if(!this._isUpdating) {\n this._isUpdating = true;\n try {\n await this._updateConfig();\n if(this._startNewDealIndex !== -1) {\n const filePath = `./.metaapi/${accountId}-${application}-deals.bin`;\n if(!await fs.pathExists(filePath)) {\n const deals = JSON.stringify(historyStorage.deals);\n fs.writeFile(filePath, deals, 'utf-8', (err) => {\n if (err) {\n this._logger.error(`${accountId}: Error saving deals on disk`, err);\n }\n });\n this._dealsSize = historyStorage.deals.map(item => getItemSize(item));\n } else {\n const replaceDeals = historyStorage.deals.slice(this._startNewDealIndex);\n this._dealsSize = await replaceRecords('deals', this._startNewDealIndex, replaceDeals, this._dealsSize);\n }\n this._startNewDealIndex = -1;\n }\n if(this._startNewOrderIndex !== -1) {\n const filePath = `./.metaapi/${accountId}-${application}-historyOrders.bin`;\n if(!await fs.pathExists(filePath)) {\n const historyOrders = JSON.stringify(historyStorage.historyOrders);\n fs.writeFile(filePath, historyOrders, 'utf-8', (err) => {\n if (err) {\n this._logger.error(`${accountId}: Error saving historyOrders on disk`, err);\n }\n });\n this._historyOrdersSize = historyStorage.historyOrders.map(item => getItemSize(item));\n } else {\n const replaceOrders = historyStorage.historyOrders.slice(this._startNewOrderIndex);\n this._historyOrdersSize = await replaceRecords('historyOrders', this._startNewOrderIndex, \n replaceOrders, this._historyOrdersSize);\n } \n this._startNewOrderIndex = -1;\n }\n } catch(err) {\n this._logger.error(`${accountId}: Error updating disk storage`, err);\n }\n this._isUpdating = false;\n }\n }", "title": "" }, { "docid": "14438b4ef36d904c5660d5b992304a48", "score": "0.46967903", "text": "function updateMetadata() {\n navigator.mediaSession.metadata = new MediaMetadata({\n title: song.title,\n artist: song.artist,\n album: song.album,\n artwork: [\n { src: song.art, sizes: '96x96', type: 'image/png' },\n { src: song.art, sizes: '128x128', type: 'image/png' },\n { src: song.art, sizes: '192x192', type: 'image/png' },\n { src: song.art, sizes: '256x256', type: 'image/png' },\n { src: song.art, sizes: '384x384', type: 'image/png' },\n { src: song.art, sizes: '512x512', type: 'image/png' },\n ]\n });\n}", "title": "" }, { "docid": "16b8969c758b0fd971673a37bce94bdf", "score": "0.4691564", "text": "function syncStore(data) {\n fs.writeFileSync(\n \"player.json\",\n JSON.stringify(data),\n { flag: \"w+\" },\n function (err) {\n if (err) {\n return console.log(err);\n }\n }\n )\n}", "title": "" }, { "docid": "ab3bd67abca99ad8649061b011f61fd8", "score": "0.46870843", "text": "function updateLatest(mangaUrl) {\n $.get(mangaUrl, function(response) {\n console.log(\"Updating manga\");\n var manga_updates = $(response).find(\".manga_updates\").children();\n\n manga_updates.each(function() {\n var mangaPage = \"http:\" + $(this).find(\"dt a\").attr(\"href\");\n var latestChapter = $(this).find(\"dd a\").first().text();\n var chapterNumber = latestChapter.trim().split(\" \").pop().trim();\n var latestChapterLink = \"http:\" + $(this).find(\"dd a\").attr(\"href\");\n\n chrome.storage.sync.get(\"mangaUpdates\", function(data) {\n var mangaUpdates = data[\"mangaUpdates\"]\n if (mangaPage in mangaUpdates) {\n mangaUpdates[mangaPage][\"latestChapter\"] = chapterNumber;\n mangaUpdates[mangaPage][\"latestChapterLink\"] = latestChapterLink;\n data[\"mangaUpdates\"] = mangaUpdates;\n chrome.storage.sync.set(data);\n }\n });\n });\n });\n}", "title": "" }, { "docid": "5c562548c0361560c7c1014c37375fbd", "score": "0.46832258", "text": "static replaceContent(filename, newContent, encoding) {\r\n fs.writeFileSync(filename, newContent, { encoding: encoding });\r\n }", "title": "" }, { "docid": "3a09629410fd2f06a781dd365d0d55ce", "score": "0.46582776", "text": "function append_to_existing_script(data, filename){\n var file = game_script_dir+filename+'.json'\n jsonfile.writeFile(filename, data, {flag: 'a', spaces: 2}, function (err) {\n console.error(err)\n })\n}", "title": "" }, { "docid": "52a1131ccc94ed1951c9e2faac86eeae", "score": "0.4656104", "text": "function backgroundUpdateOfPromptsFileFromServer() {\n console.log(\"updating saved prompts file with new one from VoxForge server\");\n self._getFromServer(); // discard returned jsonObject\n }", "title": "" }, { "docid": "d2cd961afb4c7d9fc59fd5b11c272996", "score": "0.464921", "text": "function resync() {\n\n\tconst stream = function (file, enc, done) {\n\t\tsync(file.path, true)\n\t\tdone(null, file)\n\t}\n\n\treturn through.obj(stream)\n}", "title": "" }, { "docid": "a7b5431203134b290af414b1d54bc5bf", "score": "0.46456444", "text": "async generated () {\n // @todo check context.markdown.$data.typeLinks for existence\n\n const tempMetadataPath = path.resolve(context.tempPath, 'metadata')\n fs.ensureDirSync(tempMetadataPath)\n for (const version in processed) {\n fs.ensureDirSync(path.join(tempMetadataPath, version))\n for (const typeName in processed[version]) {\n const metadata = metadataService.findMetadata(typeName, version)\n const destPath = path.join(tempMetadataPath, version, `${typeName.toLowerCase()}.json`)\n fs.writeFileSync(destPath, JSON.stringify(metadata))\n }\n }\n\n await fs.copy(tempMetadataPath, path.resolve(context.outDir, 'metadata'))\n }", "title": "" }, { "docid": "c7c65528cf81016da329c01830bc7d28", "score": "0.4644982", "text": "function clearStore() {\n fs.writeFile(\n \"player.json\",\n \"{}\",\n { flag: \"w\" },\n function (err) {\n if (err) {\n return console.log(err);\n }\n }\n )\n}", "title": "" }, { "docid": "12090c6d21acbb92bb506b5731e934f4", "score": "0.46446556", "text": "function update_sas_token()\n{\n sastoken = create_sas_token(connectionstring, settings.keyname, settings.key);\n console.log(\"New SAS token generated: \" + sastoken); \n}", "title": "" }, { "docid": "c3056de9b7a582fa48794fcb85e5c00a", "score": "0.4643237", "text": "function afterUpload(__MD_OBJECT_ID, __MD_OBJECT_CLASS){\n mdMediaDoctrine.getInstance().updateAssetList(__MD_OBJECT_ID, __MD_OBJECT_CLASS) \n}", "title": "" }, { "docid": "33621099c4ef1478f956054c7b3493ed", "score": "0.46422178", "text": "function updateEmplMang(){\n\n}", "title": "" }, { "docid": "2833f98d01b2fd04d6979c59fd079be1", "score": "0.46415356", "text": "function configureAppManifest() {\n const original = readJSONFile(APP_MANIFEST);\n\n const manifest = {\n ...original,\n $schema: undefined,\n name: \"Viewfinder\",\n displayName: \"Viewfinder\",\n components: [],\n android: {\n package: APP_IDENTIFIER,\n },\n ios: {\n bundleIdentifier: APP_IDENTIFIER,\n },\n };\n\n fs.writeFileSync(APP_MANIFEST, JSON.stringify(manifest, null, 2) + \"\\n\");\n}", "title": "" }, { "docid": "1e632f14cf4daf3c7ee9a46d9eb00f55", "score": "0.4639951", "text": "function addmetaTitleAndDecription(files){\n var localObj = new Object();\n files.forEach(function (file) {\n var originalSchema = JSON.parse(fs.readFileSync(file).toString());\n var id = originalSchema[\"$id\"];\n var schemaname = id.substr(id.lastIndexOf('/') + 1);\n addMetaId(originalSchema,\"title\",null,schemaname);\n addMetaId(originalSchema,\"description\",null,schemaname);\n fs.writeFileSync(file, JSON.stringify(originalSchema,null, 2), 'utf8');\n\n\tcreateLocalizationFileAttributes(originalSchema, localObj)\n });\n fs.writeFileSync('../__localization__/en-US.json', JSON.stringify(localObj,null, 2), 'utf8');\n}", "title": "" }, { "docid": "459179e5f6e3cad25d5ba1356b5d626b", "score": "0.46394572", "text": "async function editFile(file, message, newContent) {\n const r = await fetchGithubApi('PUT', `/repos/${owner}/${repo}/contents/${file.path}`, { 'Content-Type': 'application/json' }, {\n message: message,\n content: Buffer.from(newContent).toString('base64'),\n sha: file.sha,\n branch: 'main'\n });\n const data = await r.json();\n fileCache.set(file.path, {\n path: data.content.path,\n content: newContent,\n sha: data.content.sha\n });\n}", "title": "" }, { "docid": "69cc82e41f418404f2b4887cf000a868", "score": "0.46387652", "text": "function updateJson(res){\n const uuidv4 = require('uuid/v4');\n const MY_NAMESPACE = uuidv4();\n // Generate a couple namespace uuids \n const uuidv5 = require('uuid/v5');\n return function(req, res){\n var json_update = req.param('json');\n fs.readFile('server/model-config.json',\"utf8\",function(err, data){\n var config = JSON.parse(data);\n json_update.forEach(function(item, id){\n var dirPath= \"server/\"+config._meta.sources[2]+\"/\";\n if(item.id.length < 30){\n var file_name = (item.name+'.json').toLowerCase();\n json_update[id].ld_id = uuidv5(file_name, MY_NAMESPACE);\n json_update[id].id = undefined;\n json_update[id].idInjection = true;\n json_update[id].options = {\n \"validateUpsert\": true\n };\n json_update[id].validations = [];\n json_update[id].acls = [];\n json_update[id].methods = {};\n json_update[id].file = file_name;\n fs.writeFileSync(dirPath+json_update[id].file, JSON.stringify(json_update[id], null, 2));\n var model_name = item.name.charAt(0).toUpperCase() + item.name.slice(1);\n fs.writeFileSync(dirPath+item.name.toLowerCase()+\".js\", \"module.exports = function(\"+model_name+\") {};\");\n }\n else{\n fs.readFile(dirPath+(item.name).toLowerCase()+\".json\",\"utf8\",function(err, data){\n data = JSON.parse(data);\n data.name = item.name;\n data.base = item.base;\n data.properties = item.properties;\n data.relations = item.relations;\n fs.writeFileSync(dirPath+item.name.toLowerCase()+\".json\",JSON.stringify(data, null, 2) );\n });\n }\n });\n });\n }\n}", "title": "" }, { "docid": "127b8a2eaa974c119f086fa9b1cef57a", "score": "0.4633336", "text": "function _removeEmbed(state, id) {\r\n // get existing embed\r\n var embeds = state.uniqueEmbeds;\r\n var embed = embeds[id];\r\n var parent = embed.parent;\r\n var property = embed.property;\r\n\r\n // create reference to replace embed\r\n var subject = {'@id': id};\r\n\r\n // remove existing embed\r\n if(_isArray(parent)) {\r\n // replace subject with reference\r\n for(var i = 0; i < parent.length; ++i) {\r\n if(jsonld.compareValues(parent[i], subject)) {\r\n parent[i] = subject;\r\n break;\r\n }\r\n }\r\n } else {\r\n // replace subject with reference\r\n var useArray = _isArray(parent[property]);\r\n jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray});\r\n jsonld.addValue(parent, property, subject, {propertyIsArray: useArray});\r\n }\r\n\r\n // recursively remove dependent dangling embeds\r\n var removeDependents = function(id) {\r\n // get embed keys as a separate array to enable deleting keys in map\r\n var ids = Object.keys(embeds);\r\n for(var i = 0; i < ids.length; ++i) {\r\n var next = ids[i];\r\n if(next in embeds && _isObject(embeds[next].parent) &&\r\n embeds[next].parent['@id'] === id) {\r\n delete embeds[next];\r\n removeDependents(next);\r\n }\r\n }\r\n };\r\n removeDependents(id);\r\n}", "title": "" }, { "docid": "ce559aff833ec90267938d382bb752f5", "score": "0.46265945", "text": "function _removeEmbed(state, id) {\n // get existing embed\n var embeds = state.uniqueEmbeds;\n var embed = embeds[id];\n var parent = embed.parent;\n var property = embed.property;\n\n // create reference to replace embed\n var subject = {'@id': id};\n\n // remove existing embed\n if(_isArray(parent)) {\n // replace subject with reference\n for(var i = 0; i < parent.length; ++i) {\n if(jsonld.compareValues(parent[i], subject)) {\n parent[i] = subject;\n break;\n }\n }\n } else {\n // replace subject with reference\n var useArray = _isArray(parent[property]);\n jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray});\n jsonld.addValue(parent, property, subject, {propertyIsArray: useArray});\n }\n\n // recursively remove dependent dangling embeds\n var removeDependents = function(id) {\n // get embed keys as a separate array to enable deleting keys in map\n var ids = Object.keys(embeds);\n for(var i = 0; i < ids.length; ++i) {\n var next = ids[i];\n if(next in embeds && _isObject(embeds[next].parent) &&\n embeds[next].parent['@id'] === id) {\n delete embeds[next];\n removeDependents(next);\n }\n }\n };\n removeDependents(id);\n}", "title": "" }, { "docid": "ce559aff833ec90267938d382bb752f5", "score": "0.46265945", "text": "function _removeEmbed(state, id) {\n // get existing embed\n var embeds = state.uniqueEmbeds;\n var embed = embeds[id];\n var parent = embed.parent;\n var property = embed.property;\n\n // create reference to replace embed\n var subject = {'@id': id};\n\n // remove existing embed\n if(_isArray(parent)) {\n // replace subject with reference\n for(var i = 0; i < parent.length; ++i) {\n if(jsonld.compareValues(parent[i], subject)) {\n parent[i] = subject;\n break;\n }\n }\n } else {\n // replace subject with reference\n var useArray = _isArray(parent[property]);\n jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray});\n jsonld.addValue(parent, property, subject, {propertyIsArray: useArray});\n }\n\n // recursively remove dependent dangling embeds\n var removeDependents = function(id) {\n // get embed keys as a separate array to enable deleting keys in map\n var ids = Object.keys(embeds);\n for(var i = 0; i < ids.length; ++i) {\n var next = ids[i];\n if(next in embeds && _isObject(embeds[next].parent) &&\n embeds[next].parent['@id'] === id) {\n delete embeds[next];\n removeDependents(next);\n }\n }\n };\n removeDependents(id);\n}", "title": "" }, { "docid": "4c50cc8e0a298b2b9e696a68b3561657", "score": "0.46260437", "text": "done( obj, stats ) {\n\t\t\t\tconst newManifest = obj.assets;\n\t\t\t\tObject.keys( oldManifest ).forEach( key => {\n\t\t\t\t\tconst oldFile = path.resolve( __dirname, distDir + '/' + oldManifest[ key ] );\n\t\t\t\t\tif ( newManifest[ key ] !== oldManifest[ key ] && fs.existsSync( oldFile ) ) {\n\t\t\t\t\t\tfs.unlinkSync( oldFile, () => {} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\t// Replace old manifest\n\t\t\t\toldManifest = Object.assign( {}, newManifest );\n\t\t\t}", "title": "" }, { "docid": "8f371e2a3d8f4237fac9e965cb967f5f", "score": "0.46259174", "text": "async function replaceAllWords() {\n await BLM.use(program.wordsFile).withDirectory(program.path).replace();\n}", "title": "" }, { "docid": "f39f44497f418945befffb8f33289e8b", "score": "0.46258888", "text": "function updateAudio(audioFile) {\n var x = document.getElementById(\"audio\");\n x.setAttribute(\"src\", \"assets/music/silence.mp3\");\n musicElement.setAttribute(\"src\", audioFile);\n}", "title": "" }, { "docid": "e5d257a4125b50ae069f08e758cce3be", "score": "0.46254015", "text": "function save() {\n var saveObject = {\n \"frames\" : videotagging.frames,\n \"inputTags\": $('#inputtags').val(),\n \"exportTo\": $('#exportTo').val(),\n \"visitedFrames\": Array.from(visitedFrames),\n };\n \n fs.writeFileSync(`${videotagging.src}.json`, JSON.stringify(saveObject));\n}", "title": "" }, { "docid": "5c0923d415e661b90d8cabadc18de5e3", "score": "0.46146062", "text": "function refresh() {\n $('#currentStreamers').children().remove();\n $('#codeChannels').children().remove();\n currentStreams();\n frequentCoders();\n }", "title": "" }, { "docid": "01e0806c2dcd5cc6c04762292658a320", "score": "0.46119863", "text": "function notifyLiveReload(event) {\n var fileName = path.relative(__dirname, event.path);\n tinylr.changed({body: {files: [fileName]}});\n}", "title": "" }, { "docid": "16e26fcb02a84be4622346ce2fd4fb43", "score": "0.46095383", "text": "function loadFile(){\n location.reload();\n}", "title": "" }, { "docid": "7e844a1cd0d07046dfedb45fd882ca16", "score": "0.46027318", "text": "function saveLoadData (newData, suffix = '') {\n const updated = newData.updated.substr(0, 10);\n const loadedData = loadData(suffix);\n if (loadedData) {\n loadedData[updated] = newData;\n const loadedDataKeys = Object.keys(loadedData);\n const lastDaysKeys = loadedDataKeys.slice(Math.max(Object.keys(loadedData).length - 7, 0));\n let loadedDataLimited = {}\n lastDaysKeys.forEach(key => {\n loadedDataLimited[key] = loadedData[key];\n })\n let fm = FileManager.iCloud();\n let path = fm.joinPath(fm.documentsDirectory(), 'covid19' + suffix + '.json');\n fm.writeString(path, JSON.stringify(loadedDataLimited));\n return loadedData;\n }\n return {};\n}", "title": "" }, { "docid": "d2546d04b5b16f4e8b7f612bb947fac2", "score": "0.45990682", "text": "function reparseEmbed(id) {\n const videoDiv = document.getElementById(\"video\");\n const embedPrefix = \"https://www.youtube.com/embed/\";\n const targetVideo = embedPrefix + id;\n\n const youtubeEmbed = document.createElement(\"IFRAME\");\n youtubeEmbed.style.width = WIDTH;\n youtubeEmbed.style.height = HEIGHT + 1220;\n youtubeEmbed.src = targetVideo;\n youtubeEmbed.frameborder = \"0\";\n youtubeEmbed.allow =\n \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\";\n youtubeEmbed.setAttribute(\"allowFullScreen\", \"\");\n videoDiv.innerHTML = \"\";\n videoDiv.appendChild(youtubeEmbed);\n}", "title": "" }, { "docid": "27e295d952450eec8f0b665a70ee007e", "score": "0.45892012", "text": "function refreshMetaData() {\n $('#metadata')[0].innerHTML = '';\n if (!(Object.keys(editor.openStories).includes(current_story))) {\n current_page = null;\n return;\n }\n\n meta = 'Engine Details: ';\n num_pages = Object.keys(editor.getStoryPageList(current_story)).length;\n story_id = editor.openStories[current_story].getCurrent().story_id;\n meta += 'id=' + story_id + ', name=' + current_story + ', root=' + \n editor.getStoryState(current_story)['root_name'] + ', #pages=' + num_pages;\n $('#metadata')[0].innerHTML = meta;\n}", "title": "" }, { "docid": "2004e058daacdf6d9809974cae20bad3", "score": "0.4587601", "text": "function update_available_videos_path(newPath){ \n if (update_json_path_validity(newPath) == \"valid path\") {\n const available_videos = FileSystem.readFileSync(newPath);\n availableVideos = JSON.parse(available_videos); \n available_videos_path = newPath; \n return \"availableVideos updated\";\n } \n}", "title": "" }, { "docid": "783389fc68e8566a5f68d914ec9d0470", "score": "0.45829484", "text": "deleteOldSource() {\n let result = findRemoveSync(path.join(rootPath, \"store\"), {\n age: { seconds: 3600 * 12 }, // 12 hr\n maxLevel: 2,\n extensions: \".json\",\n ignore: \"index.json\"\n });\n\n console.log(\"Old json source file which were deleted :\", result);\n }", "title": "" }, { "docid": "0f562c6f4518bda840487d02bcca6347", "score": "0.45778993", "text": "static unloadTextFile (fileName)\n {\n Engine.resourceMap.unloadAsset(fileName);\n }", "title": "" }, { "docid": "3947363c3ceb010b6d13d20a1aabc265", "score": "0.45664495", "text": "function updateStreams(gameName) {\n requestStreams.onload = () => {\n if (requestStreams.status >= 200 && requestStreams.status < 400) {\n removeEmptyItem();\n const response = JSON.parse(requestStreams.responseText);\n const streamList = response.streams;\n setStreamItem(streamList);\n addEmptyItem(2);\n } else {\n console.log('error');\n }\n };\n\n requestStreams.onError = () => {\n console.log('error');\n };\n\n const game = encodeURIComponent(gameName);\n const offset = streamNum;\n requestStreams.open('GET', `${url}/streams?game=${game}&limit=20&offset=${offset}`, true);\n requestStreams.setRequestHeader('Accept', 'application/vnd.twitchtv.v5+json');\n requestStreams.setRequestHeader('Client-ID', clientID);\n requestStreams.send();\n}", "title": "" }, { "docid": "954dc13ec39a2553c2d035dfb9416e4a", "score": "0.45626876", "text": "sync(force) {\n this.resync(false);\n }", "title": "" }, { "docid": "112b20935780a709a3ac8587019adcb3", "score": "0.4560013", "text": "function autosave() {\r\n archiveData('autosave');\r\n}", "title": "" }, { "docid": "074a15018c4b52e72f4ee7c54fa1d105", "score": "0.4557688", "text": "function updateBuild(){\n fs.readdir(dataPath, (err, documents) => {\n if(err) throw err; // this should never occur\n\n documents.forEach((document) => {\n let documentPath = path.join(dataPath, document);\n const srcPath = path.join(documentPath, \"index.html\");\n \n // if the XML structure file does not contain this document then insert it at root level\n // but insert only if index.html src file exists as well\n if(!XML.containsDocument(documentPath) && fs.existsSync(srcPath)){\n XML.insertXMLDocument(documentPath, \"root\");\n }\n });\n });\n}", "title": "" }, { "docid": "5a7c2f187a334f887d4b310ca8462c3e", "score": "0.45571226", "text": "function updateIframe() {\n $.getJSON(\"/current\", function(data) {\n let currentStream = $(\"#twitch_iframe\").prop(\"src\");\n console.log(currentStream);\n if (currentStream != data[\"stream_url\"]) {\n $(\"#twitch_iframe\").prop(\"src\", data[\"stream_url\"]);\n $(\"#streamer_name\").text(data[\"stream_name\"] + \" - \" + data[\"alive\"]);\n }\n });\n }", "title": "" }, { "docid": "44cc8a380f451d938eb8be3c9d96a9df", "score": "0.45533696", "text": "async function main() {\n try {\n // const stats = fs.statSync(\"resources/spells.json\");\n // const mtime = new Date(stats.mtime).toISOString();\n const mtime = \"2019-06-27T10:48:41.312Z\";\n fs.writeFileSync('assets/sitemap.xml', \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\", 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\\\">\\n', 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '\\t<url>\\n', 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<loc>https://scrollbear.com/</loc>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<lastmod>${(new Date()).toISOString()}</lastmod>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '\\t</url>\\n', 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '\\t<url>\\n', 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<loc>https://scrollbear.com/about</loc>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<lastmod>${mtime}</lastmod>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '\\t</url>\\n', 'utf8');\n spells.forEach((spell) => {\n const url = spell.name.toLowerCase().trim().replace(/[.*+?^$ ,{}()|[\\]\\\\\\/]/g, '-').replace(/[’]/g, '_');\n const url1 = `https://scrollbear.com/spells/${url}`;\n fs.appendFileSync('assets/sitemap.xml', '\\t<url>\\n', 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<loc>${url1}</loc>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', `\\t\\t<lastmod>${mtime}</lastmod>\\n`, 'utf8');\n fs.appendFileSync('assets/sitemap.xml', '\\t</url>\\n', 'utf8');\n // const url2 = `https://scrollbear.com/#!/spells/${url}`;\n // fs.appendFileSync('assets/sitemap.xml', '\\t<url>\\n', 'utf8');\n // fs.appendFileSync('assets/sitemap.xml', `\\t\\t<loc>${url2}</loc>\\n`, 'utf8');\n // fs.appendFileSync('assets/sitemap.xml', `\\t\\t<lastmod>${mtime}</lastmod>\\n`, 'utf8');\n // fs.appendFileSync('assets/sitemap.xml', '\\t</url>\\n', 'utf8');\n });\n fs.appendFileSync('assets/sitemap.xml', '</urlset>', 'utf8');\n logSuccess(`\\n\\nFinished sitemap with ${spells.length+1} links \\n\\tCurrent date ${(new Date()).toISOString()} \\n\\tspells.json date ${mtime} \\n\\n`);\n } catch (e) {\n logError(e);\n }\n}", "title": "" }, { "docid": "3d93324632d5277250606761a934c154", "score": "0.4552762", "text": "function embedOn (data)\n{\n\n // -----------------------------------------------\n // Resend embeds from original message\n // Only if content is forwared to another channel\n // -----------------------------------------------\n\n function sendEmbeds (data)\n {\n\n if (data.forward && data.embeds && data.embeds.length > 0)\n {\n\n const maxEmbeds = data.config.maxEmbeds;\n\n if (data.embeds.length > maxEmbeds)\n {\n\n // eslint-disable-next-line no-use-before-define\n sendBox({\n \"channel\": data.channel,\n \"color\": \"warn\",\n \"text\": `:warning: Cannot embed more than ${maxEmbeds} links.`\n });\n\n data.embeds = data.embeds.slice(0, maxEmbeds);\n\n }\n\n for (let i = 0; i < data.embeds.length; i += 1)\n {\n\n data.channel.send(data.embeds[i].url);\n\n }\n\n }\n\n }\n\n // -------------------\n // Resend attachments\n // -------------------\n\n function sendAttachments (data)\n {\n\n if (!data.attachments)\n {\n\n return;\n\n }\n let attachments = data.attachments.array();\n\n if (attachments && attachments.length > 0)\n {\n\n const maxAtt = data.config.maxEmbeds;\n\n if (attachments.length > maxAtt)\n {\n\n // eslint-disable-next-line no-use-before-define\n sendBox({\n \"channel\": data.channel,\n \"color\": \"warn\",\n \"text\": `:warning: Cannot attach more than ${maxAtt} files.`\n\n });\n attachments = attachments.slice(0, maxAtt);\n\n }\n\n for (let i = 0; i < attachments.length; i += 1)\n {\n\n const attachmentObj = new discord.MessageAttachment(\n attachments[i].url,\n attachments[i].name\n );\n data.channel.send(`**${data.message.author.username}** sent a file:`, attachmentObj);\n\n }\n\n }\n\n }\n\n // ----------\n // Send data\n // ----------\n\n function sendBox (data)\n {\n\n\n /*\n If (data.author)\n {\n data.author = {\n name: data.author.username,\n //eslint-disable-next-line camelcase\n icon_url: data.author.displayAvatarURL()\n };\n }*/\n\n if (data.text && data.text.length > 1)\n {\n\n {\n\n if (!data.author)\n {\n\n // console.log(\"DEBUG: Is bot.author - embed on\");\n // eslint-disable-next-line no-redeclare\n var embed = {\n \"author\": {\n \"icon_url\": data.bot.displayAvatarURL(),\n \"name\": data.bot.username\n },\n \"color\": colors.get(data.color),\n \"description\": data.text,\n \"fields\": data.fields,\n \"footer\": data.footer,\n \"title\": data.title\n };\n\n }\n else\n {\n\n // console.log(\"DEBUG: Is data.author - embed on\");\n // eslint-disable-next-line no-redeclare\n var embed = {\n \"author\": {\n \"icon_url\": data.message.author.displayAvatarURL(),\n \"name\": data.author.username\n },\n \"color\": colors.get(data.color),\n \"description\": data.text,\n \"fields\": data.fields,\n \"footer\": data.footer,\n \"title\": data.title\n };\n\n }\n\n }\n\n data.channel.send({\n\n embed\n }).then(() =>\n {\n\n sendEmbeds(data);\n sendAttachments(data);\n\n }).\n catch((err) =>\n {\n\n let errMsg = err;\n\n // -------\n // Errors\n // -------\n\n if (err.code && err.code === error.content)\n {\n\n data.channel.send(\":warning: Message is too long.\");\n\n }\n\n if (err.code && err.code === error.perm || error.access)\n {\n\n // console.log(\"DEBUG: Error 50013 - Origin\");\n return logger(\"custom\", {\n \"color\": \"ok\",\n \"msg\": `:exclamation: Write Permission Error - Origin \\n\n Server: **${data.guild.name}** \\n\n Channel: **${data.channel.name}**\\n\n Chan ID: **${data.channel.id}**\\n\n Server ID: **${data.channel.guild.id}**\\n\n Owner: **${data.channel.guild.owner}**\\n\n The server owner has been notified. \\n`\n }).catch((err) => console.log(\n \"error\",\n err,\n \"warning\"\n ));\n\n }\n\n if (err.code && err.code === error.fileTooLarge)\n {\n\n // console.log(\"DEBUG: Error 40005\");\n return logger(\"custom\", {\n \"color\": \"ok\",\n \"msg\": `:exclamation: File To Large \\n\n Server: **${data.guild.name}** \\n\n Channel: **${data.channel.name}**\\n\n Chan ID: **${data.channel.id}**\\n\n Owner: **${data.channel.guild.owner}**\\n`\n }).catch((err) => console.log(\n \"error\",\n err,\n \"warning\"\n ));\n\n }\n\n if (err.code && err.code === error.unknownUser || errorunknownMember || error.invalidRecipient)\n {\n\n // console.log(`DEBUG: Error ${err.code}`);\n return logger(\"custom\", {\n \"color\": \"ok\",\n \"msg\": `:exclamation: Unknonw User / Member / Recipient \\n\n Server: **${data.guild.name}** \\n\n Channel: **${data.channel.name}**\\n\n Chan ID: **${data.channel.id}**\\n\n Owner: **${data.channel.guild.owner}**\\n`\n }).catch((err) => console.log(\n \"error\",\n err,\n \"warning\"\n ));\n\n }\n\n // -----------------------------------------------------------\n // Handle error for users who cannot recieve private messages\n // -----------------------------------------------------------\n\n if (err.code && err.code === error.sendDm && data.origin)\n {\n\n const badUser = data.channel.recipient;\n errMsg = `@${badUser.username}#${badUser.discriminator}\\n${err}`;\n\n db.removeTask(data.origin.id, `@${badUser.id}`, function error (err)\n {\n\n if (err)\n {\n\n return logger(\"error\", err, \"dm\", data.message.channel.guild.name);\n\n }\n\n return data.origin.send(`:no_entry: User ${badUser} cannot recieve direct messages ` +\n `by bot because of **privacy settings**.\\n\\n__Auto ` +\n `translation has been stopped. To fix this:__` +\n \"```prolog\\nServer > Privacy Settings > \" +\n \"'Allow direct messages from server members'\\n```\");\n\n }).catch((err) => console.log(\n \"error\",\n err,\n \"warning\"\n ));\n\n }\n\n logger(\"error\", errMsg, \"warning\", data.message.channel.guild.name);\n\n }).\n catch((err) => console.log(\n \"error\",\n err,\n \"warning\"\n ));\n\n }\n else if (data.attachments.array().length > 0)\n {\n\n sendAttachments(data);\n\n }\n\n }\n\n return checkPerms(data, sendBox);\n\n}", "title": "" }, { "docid": "da55b3bb451544bbd31c62dc433f0699", "score": "0.45522517", "text": "function nocache(module) {\n\trequire(\"fs\").watchFile(path.resolve(module), () => {\t\t\n\t\tconsole.log(\"Config File Updated\");\n\t\tLog.Write(\"Config File Updated\", true);\n\t\tdelete require.cache[require.resolve(module)]; Config = require(module)\n\t})\n}", "title": "" }, { "docid": "c55d181f579a9d69b5f9a18aee836088", "score": "0.45521256", "text": "function iframe_rename(_id, Parent){\n if(util.checkBrowser()){\n\n var dom = (Parent)?Parent.document:document;\n var orgObj = dom.getElementById(_id);\n orgObj.style.display = \"\";\n return;\n }\n\n\n\n var dom = (Parent)?Parent.document:document;\n var orgObj = dom.getElementById(_id);\n var bakObj = dom.getElementById(_id+\"_bak\");\n\n\n if(orgObj==null||orgObj.tagName==null||bakObj==null||bakObj.tagName==null){\n return;\n }\n\n\n var orgName = _id;\n var bakName = _id+\"_bak\";\n\n orgObj.setAttribute(\"id\", bakName);\n bakObj.setAttribute(\"id\", orgName);\n\n\n dom.getElementById(_id).style.display = \"\";\n dom.getElementById(_id+\"_bak\").style.display = \"none\";\n\n //iframe_src(dom.getElementById(_id+\"_bak\"), \"about:blank\");\n dom.getElementById(_id+\"_bak\").parentNode.removeChild(dom.getElementById(_id+\"_bak\"));\n\n}", "title": "" }, { "docid": "f28a0c6db049f619790de1828a73608c", "score": "0.45483977", "text": "function initUpdateMetaKernelspec () {\n Jupyter.notebook.save_notebook();\n }", "title": "" }, { "docid": "c8bbf2ae984a177e4f60d5e4e94c0aa3", "score": "0.45421055", "text": "function fbManifestPatch(filePath, relPath, options) {\n\n let fileContent = fs.readFileSync(filePath, 'utf8');\n\n fileContent = permissionPatch(fileContent);\n fileContent = metaPatch(fileContent);\n\n if(options.fb_app_share_media){\n fileContent = providerPatch(fileContent, options);\n }\n\n fs.writeFileSync( filePath, fileContent, 'utf8' );\n\n console.log(chalk.green(`Fb: ${relPath || filePath} patched.`)); \n}", "title": "" }, { "docid": "57ff0a124ffdfea9384988f3073a02a7", "score": "0.4541408", "text": "function reload_media_library( folder_data ) {\n\n if ( wp.media && wp.media.frame.content.get() != null && wp.media.frame.content.get() != undefined) {\n\n if( wp.media.frame.content.get().collection != null && wp.media.frame.content.get().collection != undefined) {\n wp.media.frame.content.get().collection.props.set({folder_data: folder_data, ignore: (+(new Date()))});\n wp.media.frame.content.get().options.selection.reset();\n }\n }\n\n setTimeout(function() {\n media_files_drag()\n }, 1000);\n}", "title": "" }, { "docid": "37756f6fc7939766d7ed66b7233023ab", "score": "0.454091", "text": "function updateGames() {\n const games_serialized = JSON.stringify(games_deserialized);\n localStorage.setItem(\"games\", games_serialized);\n}", "title": "" }, { "docid": "9d19a6b004974783b3c1f7c53ec5d017", "score": "0.45307145", "text": "async flush() {\n const initialPath = path.join(initialState.dir, initialState.filename);\n const filePath = path.join(state.dir, state.filename);\n\n if (deleted === true) {\n await fse.remove(initialPath);\n\n const list = await fse.readdir(initialState.dir);\n if (list.length === 0) {\n await fse.remove(initialState.dir);\n }\n }\n if (modified === true) {\n await fse.ensureFile(filePath);\n await fse.writeJSON(filePath, state.schema, { spaces: 2 });\n\n // remove from oldPath\n if (initialPath !== filePath) {\n await fse.remove(initialPath);\n\n const list = await fse.readdir(initialState.dir);\n if (list.length === 0) {\n await fse.remove(initialState.dir);\n }\n }\n }\n\n return Promise.resolve();\n }", "title": "" }, { "docid": "bcee49257e611d50a87f53bfff6a942c", "score": "0.45285168", "text": "reload() {\n this._callWrapper( this._do_load ).then( () => {\n this.emit( 'change', 'change', this.filename );\n } );\n }", "title": "" }, { "docid": "6342b710676aeb57a47f35f7a2efaf97", "score": "0.45281142", "text": "function updatePositions(contents){\n jsonfile.writeFile(file, contents, {spaces: 2}, function (err) {\n if (err){\n console.error(err)\n }\n })\n}", "title": "" }, { "docid": "ab70253716ac28e0c22e8513161652fc", "score": "0.45279092", "text": "invalidateMetadata() {\r\n this.awaitingMetadata = null;\r\n }", "title": "" }, { "docid": "acf5045a4a4c28d36ec659a17b2e9f24", "score": "0.45256826", "text": "function save_json_gd(name) {\n var parent = get_parent_full(name)\n var data = get_t3_data(parent)\n var age = get_age(data.created_utc)\n var title = data.title\n \n if(age <= WAIT_DAYS) {\n console.info(\"not saved,age=%d:%s:%s\", age, title, name)\n return undefined \n }\n \n var text = JSON.stringify(parent)\n var name = data.name\n var sr = data.subreddit\n\n if(sr != SUBREDDIT) {\n console.info(\"SR=%s\", sr)\n return undefined \n }\n \n var flair = data.link_flair_text\n var title = get_escaped_title(data.title)\n\n var fileName = Utilities.formatString(\"[%s]%s_%s.json\", flair, title, name)\n var r = check_values(flair, title, name, fileName)\n \n if(r == false) {\n return undefined\n }\n \n var ids_gd = get_ids_fr_gd(GD_FOLDER_ID)\n var id = get_id(name)\n \n if(ids_gd.indexOf(id) > -1) {\n return undefined\n }\n \n var file = DriveApp.createFile(fileName,text)\n if(file) {\n var folder = DriveApp.getFolderById(GD_FOLDER_ID)\n folder.addFile(file)\n clean_folders_gd(file) \n console.info(\"saved:%d:%s\", age, fileName)\n return fileName\n } else {\n console.info(\"not saved:%d:%s\", age, name)\n return undefined\n }\n}", "title": "" }, { "docid": "03bd54d4d551b8bd946cde8d37b47d7d", "score": "0.45255896", "text": "function editFileName() {\n $('#file-name').attr('value', '' + dateToYMD(dataobj,\"-\") + '-' + $('#title').val().replace(/\\s/g,'-') + '.markdown');\n}", "title": "" }, { "docid": "84c736c1deaf766e89d00df35e53e8d3", "score": "0.4524487", "text": "stop() {\n fs.unwatchFile(this._context.discovery.file);\n var content = fs.readFileSync(this._context.discovery.file, 'utf8');\n content.replace(this._context.listen + '\\n', '');\n fs.writeFileSync(this._context.discovery.file, content, 'utf8');\n }", "title": "" }, { "docid": "d6a95e437138a293560a8a4d5bb07b74", "score": "0.45236364", "text": "updateMeta({metadata,metadataFiles,owner,path}) { this.$publish('updateMeta', {metadata,metadataFiles,owner,path})}", "title": "" }, { "docid": "d6a95e437138a293560a8a4d5bb07b74", "score": "0.45236364", "text": "updateMeta({metadata,metadataFiles,owner,path}) { this.$publish('updateMeta', {metadata,metadataFiles,owner,path})}", "title": "" }, { "docid": "d6a95e437138a293560a8a4d5bb07b74", "score": "0.45236364", "text": "updateMeta({metadata,metadataFiles,owner,path}) { this.$publish('updateMeta', {metadata,metadataFiles,owner,path})}", "title": "" } ]
e63c2149e557720199409d05035ed7d3
==================== Working w/ Files ====================
[ { "docid": "df397d32eee0a07f5852aaeefb56db68", "score": "0.0", "text": "function SaveFile() {\n\n\t\tvar currentState = Windows.UI.ViewManagement.ApplicationView.value;\n\t\tif (currentState === Windows.UI.ViewManagement.ApplicationViewState.snapped &&\n\t\t\t!Windows.UI.ViewManagement.ApplicationView.tryUnsnap()) {\n\t\t\t// Fail silently if we can't unsnap\n\t\t\treturn;\n\t\t}\n\t\t//=================\n\t\t//THIS IS WHERE THE SHTUFF ACTUALLY HAPPENS\n\t\t//=================\n\n\t\tvar SavingContent = Fields + \"\\n\" + ContNum + \"\\n\" + RepNum + \"\\n\" + SubNum + \"\\n\" + SplitLoc + \"\\n\" + AffContNum + \"\\n\";\n\t\tSavingContent += document.getElementById(\"MainContent\").innerHTML.replace(/(\\r\\n|\\n|\\r)/gm, \"\") + \"\\n\";\n\n\t\t//var NumRep = 0;\n\n\t\tfor (var i = 1; i <= Fields; i++) {\n\t\t\tSavingContent += document.getElementById(\"Input\" + i).value + \"\\n\";\n\t\t\t//We can add a variable that tracks the number of responses and then loop through that to get the stuff in the respones dialogs\n\n\t\t\tif (document.getElementById(\"Input\" + i).getAttribute(\"data-source\") == \"true\") {\n\t\t\t\tSavingContent += document.getElementById(\"Source-Input\" + i).value + \"\\n\";\n\t\t\t}\n\n\t\t\tfor (var j = 1; j <= Number(document.getElementById(\"Input\" + i).getAttribute(\"data-rep\")) ; j++) {\n\t\t\t\tvar El = document.getElementById(\"Input\" + i);\n\t\t\t\tvar CurrRow = Number(El.id.substring(5));\n\n\t\t\t\tSavingContent += document.getElementById(CurrRow + \"ResponseInput\" + j).value + \"\\n\";\n\n\t\t\t\tif (document.getElementById(CurrRow + \"ResponseInput\" + j).getAttribute(\"data-source\") == \"true\") {\n\t\t\t\t\tSavingContent += document.getElementById(\"Source-\" + CurrRow + \"ResponseInput\" + j).value + \"\\n\";\n\t\t\t\t}\n\t\t\t\tif (document.getElementById(CurrRow + \"ResponseInput\" + j).getAttribute(\"data-hasreprow\") == \"true\") {\n\t\t\t\t\tvar h = 1;\n\t\t\t\t\twhile (document.getElementById(CurrRow + \"ResponseInput\" + j + \"-\" + h) != null) {\n\t\t\t\t\t\tSavingContent += document.getElementById(CurrRow + \"ResponseInput\" + j + \"-\" + h).value + \"\\n\";\n\t\t\t\t\t\th++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (IsPre) {\n\t\t\t//TODO: Save all the stuff and then return\n\t\t\tvar localSettings = Windows.Storage.ApplicationData.current.localSettings;\n\t\t\tvar localFolder = Windows.Storage.ApplicationData.current.localFolder;\n\n\t\t\tif (CurrAff) {\n\t\t\t\tlocalFolder.createFileAsync(\"AffPre.xflow\", Windows.Storage.CreationCollisionOption.replaceExisting).then(function (sampleFile) {\n\t\t\t\t\t//var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(\"longtime\");\n\t\t\t\t\t//var timestamp = formatter.format(new Date());\n\n\t\t\t\t\treturn Windows.Storage.FileIO.writeTextAsync(sampleFile, SavingContent);\n\t\t\t\t}).done(function () {\n\t\t\t\t\t//Finished saving settings\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlocalFolder.createFileAsync(\"NegPre.xflow\", Windows.Storage.CreationCollisionOption.replaceExisting).then(function (sampleFile) {\n\t\t\t\t\t//var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(\"longtime\");\n\t\t\t\t\t//var timestamp = formatter.format(new Date());\n\n\t\t\t\t\treturn Windows.Storage.FileIO.writeTextAsync(sampleFile, SavingContent);\n\t\t\t\t}).done(function () {\n\t\t\t\t\t//Finished saving settings\n\t\t\t\t});\n\t\t\t}\n\n\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Create the picker object and set options\n\t\tvar savePicker = new Windows.Storage.Pickers.FileSavePicker();\n\t\tsavePicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.desktop;\n\t\t// Dropdown of file types the user can save the file as\n\t\tsavePicker.fileTypeChoices.insert(\"Xing Flow\", [\".xflow\"]);\n\t\t// Default file name if the user does not type one in or select a file to replace\n\t\tsavePicker.suggestedFileName = \"Epic Flow\";\n\n\n\t\tsavePicker.pickSaveFileAsync().then(function (file) {\n\t\t\tif (file) {\n\t\t\t\t// Prevent updates to the remote version of the file until we finish making changes and call CompleteUpdatesAsync.\n\t\t\t\tWindows.Storage.CachedFileManager.deferUpdates(file);\n\t\t\t\t// write to file\n\t\t\t\tWindows.Storage.FileIO.writeTextAsync(file, SavingContent).done(function () {\n\t\t\t\t\t// Let Windows know that we're finished changing the file so the other app can update the remote version of the file.\n\t\t\t\t\t// Completing updates may require Windows to ask for user input.\n\t\t\t\t\tWindows.Storage.CachedFileManager.completeUpdatesAsync(file).done(function (updateStatus) {\n\t\t\t\t\t\tif (updateStatus === Windows.Storage.Provider.FileUpdateStatus.complete) {\n\t\t\t\t\t\t\tWinJS.log && WinJS.log(\"File \" + file.name + \" was saved.\", \"sample\", \"status\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWinJS.log && WinJS.log(\"File \" + file.name + \" couldn't be saved.\", \"sample\", \"status\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tWinJS.log && WinJS.log(\"Operation cancelled.\", \"sample\", \"status\");\n\t\t\t}\n\t\t});\n\n\t}", "title": "" } ]
[ { "docid": "f99c96895d4cc519dff1e3b0dace2047", "score": "0.6602904", "text": "function mainFun(files){\r\n\tstartTime()\r\n\thandle_file(files[0]);\r\n}", "title": "" }, { "docid": "2d9b6e5b4b15c52c7f7940287b5a344e", "score": "0.65635854", "text": "function handleFiles(files) {\r\n\r\n\tvar file = files[0];\r\n\tif (file) {\r\n\t var reader = new FileReader();\r\n\t reader.readAsText(file, \"UTF-8\");\r\n\t reader.onload = function (evt) {\r\n\t document.getElementById(\"obj_file\").innerHTML = evt.target.result;\r\n\t main() ;\r\n\t }\r\n\t reader.onerror = function (evt) {\r\n\t document.getElementById(\"obj_file\").innerHTML = \"error reading file\";\r\n\t }\r\n\t}\r\n}", "title": "" }, { "docid": "2c35cde9724fe653f4a33e7f19786910", "score": "0.642578", "text": "function IniFile(fptr) {\n}", "title": "" }, { "docid": "61b17cd3a6ed8d169e0db6f18c18f3ae", "score": "0.6364433", "text": "function readFromFile() {\n file_entry.file(fileReaderSuccess,failed);\n}", "title": "" }, { "docid": "d5ed89b30fcdb6ae1fa0eb9e03b3afb8", "score": "0.62925637", "text": "function fileGen() {}", "title": "" }, { "docid": "ab2334eacf8603e8c29867b4b1f1aa87", "score": "0.6062162", "text": "function Init_File() {\n\t// @class File\n\trb_cFile = rb_define_class(\"File\", rb_cIO);\n\t\n\t// VM methods for core file access.\n\trb_define_singleton_method(rb_cFile, 'join', file_s_join);\n\trb_define_singleton_method(rb_cFile, 'dirname', file_s_dirname);\n\trb_define_singleton_method(rb_cFile, 'expand_path', file_s_expand_path);\n\trb_define_singleton_method(rb_cFile, \"exists?\", file_s_exists_p);\n\trb_define_singleton_method(rb_cFile, \"extname\", file_extname);\n}", "title": "" }, { "docid": "5dc40480ddbdc70062ea258fdb2d243f", "score": "0.60567784", "text": "function Ins_Files() {\n \n FilesBO.Ins();\n}", "title": "" }, { "docid": "beb464749d9ca2091cd72cfc847db447", "score": "0.6039845", "text": "function getCurrentFilenames() {\nconsole.log(\"\\nCurrent filenames:\");\nfs.readdirSync(__dirname).forEach(file => {\n\tconsole.log(file);\n\t\tconsole.log(\"successfully coppied extra-filters.js\");\n});\n}", "title": "" }, { "docid": "6217b479d52663121ae3b530da4f036a", "score": "0.60334915", "text": "function readFiles() {\n //alert(\"recommendor reading files\");\n //this.readFile(inheritancesFilename);\n this.createFiles();\n this.readFile(ratingsFilename);\n\t\tthis.updateLinks();\n\t\tthis.updatePredictions();\n\t\tmessage(\"recommendor done reading files\\r\\n\");\n\t\talert(\"recommendor done reading files\");\n }", "title": "" }, { "docid": "89f1aab38d98cf89683e5e8a2e23f339", "score": "0.6006354", "text": "function _file (index) {\n//console.log(index)\n\t\t// initialize arguments\n\t\tinterface(this, {\n\t\t\tindex : isHTTP.test(index) ? index : getURI(index),\n\t\t\t// initialize file\n\t\t\tstatus: 1,\n\t\t\t// triggle callback list\n\t\t\tevents: [],\n\t\t\t// typeof file\n\t\t\tisCSS : risCSS.test(index)\n\t\t});\n\n\t}", "title": "" }, { "docid": "35cf7027483bf1a692bd880dccbbaa12", "score": "0.59512234", "text": "function handleFiles(files) {\n\t// Check for the various File API support.\n\tif (window.FileReader) {\n\t\t// FileReader are supported.\n\t\tgetAsText(files[0]);\n\t} else {\n\t\talert('FileReader are not supported in this browser.');\n\t}\n}", "title": "" }, { "docid": "a948627a6838e98941d94aaa5b9520d6", "score": "0.5929363", "text": "function checkForFiles(){\n try{\n presentation_id_map = fs.readFileSync('src/parameters/presentation.json');\n console.log(colors.green.bold('presentation.js file FOUND'))\n } catch(err){\n if (err.code !== 'ENOENT') {\n throw e;\n } else {\n console.log(colors.red.bold('presentation.json FILE NOT FOUND!'));\n return false;\n }\n }\n\n try{\n slide_map = fs.readFileSync('src/parameters/slide.json');\n console.log(colors.green.bold('slide.js file FOUND'));\n } catch(err){\n if (err.code !== 'ENOENT') {\n throw e;\n } else {\n console.log(colors.red.bold('slide.json FILE NOT FOUND!'));\n return false;\n }\n }\n\n try{\n keymessage_map = fs.readFileSync('src/parameters/keymessage.json');\n console.log(colors.green.bold('keymessage.js file FOUND'));\n } catch(err){\n if (err.code !== 'ENOENT') {\n throw e;\n } else {\n console.log(colors.red.bold('keymessage.json FILE NOT FOUND!'));\n return false;\n }\n }\n}", "title": "" }, { "docid": "46d9686cd8f6ed576ef6c086af956c63", "score": "0.58527833", "text": "function FileChecking(file,filePath,OEBPSFolder){\n\ti++;\n\t\n\t//File Path Defining\n\tif(filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/') == file){\n\t\thref = filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/');\n\t}\n\telse{\n\t\thref = filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/');\n\t}\n\t\n\t//If File name has the extension of \".ncx\"\n\tif(file.toString().indexOf('.ncx')>0){\n\t\titemTag('ncx-' + i,href,'application/x-dtbncx+xml','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".css\"\n\telse if(file.toString().indexOf('.css')>0){\n\t\titemTag('css-' + i,href,'text/css','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".mp3\"\n\telse if(file.toString().indexOf('.mp3')>0){\n\t\titemTag('audio-' + i,href,'audio/mpeg','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".otf\"\n\telse if(file.toString().indexOf('.otf')>0){\n\t\titemTag('font-' + i,href,'application/opentype','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".ttf\"\n\telse if(file.toString().indexOf('.ttf')>0){\n\t\titemTag('font-' + i,href,'application/truetype','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".jpg\"\n\telse if(file.toString().indexOf('.jpg')>0){\n\t\t\n\t\t//If File name has the extension of \"cover.jpg\"\n\t\tif((file == 'cover.jpg' || file == 'frontcover.jpg') && (filePath.toString().match('images') || filePath.toString().match('image'))){\n\t\t\titemTag('cover-image',href,'image/jpeg','',false,false);\n\t\t}\n\t\telse {\n\t\t\titemTag('image' + i,href,'image/jpeg','',false,false);\n\t\t}\n\t}\n\t\n\t//If File name has the extension of \".png\"\n\telse if(file.toString().indexOf('.png')>0){\n\t\t\n\t\t//If File name has the extension of \"cover.png\"\n\t\tif((file == 'cover.png' || file == 'frontcover.png') && (filePath.toString().match('images') || filePath.toString().match('image'))){\n\t\t\titemTag('cover-image',href,'image/png','',false,false);\n\t\t}\n\t\telse {\n\t\t\titemTag('image-' + i,href,'image/png','',false,false);\n\t\t}\n\t}\n\t\n\t//If File name has the extension of \".html\"\n\telse if((file.toString().indexOf('.html')>0)){\n\t\t\n\t\t//Find the nav.html file and update in the manifest\n\t\tif(file == 'nav.html'){\n\t\t\titemTag('nav-1',href,'application/html+xml','',false,true)\n\t\t}\n\t\t\n\t\t//Find the cover.html file and update in the manifest\n\t\telse if(file == 'cover.html' || file == 'frontcover.html'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','cover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t\tif(guideRequired == true){\n\t\t\t\tguideTag = guideTag + '\\n' + '<guide>\\n<reference type=\"cover\" title=\"cover\" href=\"' + href + '\"/>' + '\\n</guide>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tguideTag = '';\n\t\t\t}\n\t\t}\n\t\t//Find the backcover.html file and update in the manifest\n\t\telse if(file == 'backcover.html' || file == 'back_cover.html'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tbackcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','backcover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t}\n\t\t\n\t\t//other HTML files\n\t\telse{\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\thtmlPageID(file,href,OEBPSFolder,'xhtml'); //Function to check the html files and update in the manifest\n\t\t}\n\t}\n\n\t//If File name has the extension of \".xhtml\"\n\telse if((file.toString().indexOf('.xhtml')>0)){\n\t\t\n\t\t//Find the nav.html file and update in the manifest\n\t\tif(file == 'nav.xhtml'){\n\t\t\titemTag('nav-1',href,'application/xhtml+xml','',false,true)\n\t\t}\n\t\t\n\t\t//Find the cover.html file and update in the manifest\n\t\telse if(file == 'cover.xhtml' || file == 'frontcover.xhtml'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','cover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t\tif(guideRequired == 1 || guideRequired == '1'){\n\t\t\t\tguideTag = guideTag + '\\n' + '<guide>\\n<reference type=\"cover\" title=\"cover\" href=\"' + href + '\"/>' + '</guide>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tguideTag = '';\n\t\t\t}\n\t\t}\n\t\t//Find the backcover.html file and update in the manifest\n\t\telse if(file == 'backcover.xhtml' || file == 'back_cover.xhtml'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tbackcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','backcover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t}\n\t\t\n\t\t//other HTML files\n\t\telse{\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\thtmlPageID(file,href,OEBPSFolder,'xhtml'); //Function to check the html files and update in the manifest\n\t\t}\n\t}\n\t\n\telse if(file.toString().indexOf('.smil')>0){\n\t\tif(file == 'cover.smil' || file == 'frontcover.smil'){\n\t\t\titemTag('cover-smil',href,'application/xhtml+xml','',false,false)\n\t\t}\n\t\telse if(file == 'backcover.smil'){\n\t\t\titemTag('backcover-smil',href,'application/xhtml+xml','',false,false)\n\t\t}\n\t\telse{\n\t\t\tsmilPageID(file,href,OEBPSFolder); //Function to check the smil file and update in the manifest\n\t\t}\n\t}\n}", "title": "" }, { "docid": "98d6cf014764485888dc724be46937f4", "score": "0.58402014", "text": "function dealWithFile(txt, url) {\r\n\tif (dbug) console.log(\"wwvf-cs::5. dealWithFile: \" + url);\r\n\tcountFiles++;\r\n\tvar ver = getVersion(txt);\r\n\tif (ver && vStr.indexOf(ver) == -1) vStr.push(ver);\r\n\t//if (countFiles >= totFiles) {\r\n\t//\tchrome.runtime.sendMessage({vStr: vStr});\r\n\t//}\r\n}", "title": "" }, { "docid": "d079a0c2dcaa92d986fe42681c3809e0", "score": "0.5824166", "text": "function LocalFileSystem() {\n}", "title": "" }, { "docid": "9742d942ebfc23da3d31bb31a7fd3965", "score": "0.58198243", "text": "function init() {\n readFile(file_name);\n\n }", "title": "" }, { "docid": "95ffbffae4ad75f02ccf3d0040e7ae9b", "score": "0.5812659", "text": "function FileReader() {}", "title": "" }, { "docid": "95ffbffae4ad75f02ccf3d0040e7ae9b", "score": "0.5812659", "text": "function FileReader() {}", "title": "" }, { "docid": "74e5c5f58de33ded3bee7d892801e3e2", "score": "0.58055955", "text": "function getFile(files){\n\tconsole.log(1);\n\tif(window.FileReader){\n\t\tgetAsText(files[0]);\n\t\tfileUpload = true;\n\t}else{\n\t\talert('File not supported');\n\t}\n}", "title": "" }, { "docid": "697fbdb44a68fa973d22b5ff5f109ed2", "score": "0.57978433", "text": "function initFiles(){\n //Try to get the url GET var. This is undefined if it is not set\n var filesVar = comparativus.util.getURLVar('files');\n if(filesVar == undefined){\n //\n //This is done when we haven't defined vars in the GET variable\n //\n comparativus.ui.showFileSelection();\n\n }else{\n //\n //This is done in case we have defined files already in the GET VAR\n //\n if(!comparativus.util.isDebug()){\n //Load the files from the GET URL variables\n filesVar.split(',').forEach(function(id){\n comparativus.file.loadFromID(id, function(data, plain){\n comparativus.text.add(id, comparativus.file.getTitleFromID(id), data, plain);\n });\n });\n }else{\n //Load the data files from disc\n comparativus.file.loadDebug();\n }\n }\n}", "title": "" }, { "docid": "0db610df8f67682ee006d8f9e24d5ee3", "score": "0.57964486", "text": "parseFile() {\n throw new Error(\"Not Implemented\");\n }", "title": "" }, { "docid": "b20f4b1606d4195f926b240d0ddd6136", "score": "0.5788831", "text": "function FileInfo() {\n}", "title": "" }, { "docid": "527485aaa4526b2c7e5adfbcf7f9cdea", "score": "0.57840353", "text": "function playdownFile() {\n\n}", "title": "" }, { "docid": "6b3f97630f16a9406d86b1dbd4ab6ac2", "score": "0.5772129", "text": "get filesToOpenOrCreate() { return undefined; }", "title": "" }, { "docid": "edbcecbd93f0a0c62a5de9a02f654c1d", "score": "0.5747711", "text": "function fileSys() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\n if (error) {\n return console.log(error);\n }\n\n console.log(\"We looked at the file random.txt and searched Spotify!\");\n var dataArr = data.split(\",\");\n // console.log(dataArr);\n chooseTask(dataArr[0], dataArr[1]);\n });\n\n}", "title": "" }, { "docid": "2e81d9e01dff2a9691bc404c0d14bc3f", "score": "0.57330245", "text": "function Ut_file() {\n TestSet.call(this, \"ut_file.js\");\n\n // Add tests to set.\n this\n .add(this.fileRead, \"Read a text file from the disk.\")\n .add(this.fileWrite, \"Write a text file to the disk.\")\n .add(this.fileExists, \"Test that file exists.\")\n .add(this.fileIsDir, \"Checks to see if file is a directory.\")\n .add(this.fileIsFile, \"Checks to see if file is a file.\")\n .add(this.fileListDir, \"Gets a list of the files in the directory.\")\n .add(this.fileGetAbsolute, \"Gets the absolute path of a file.\")\n .add(this.fileGetFileName, \"Gets the file name from absolute path.\")\n .add(this.fileGetExt, \"Gets the file extension.\")\n .add(this.fileUnlink, \"Deletes a file.\")\n .add(this.fileMkdir, \"Create a new directory.\")\n .add(this.fileSetWorkingDir, \"Sets the working directory.\")\n .add(this.fileReadBinary, \"Reads a binary object as a Buffer.\")\n .add(this.fileWriteBinary, \"Writes binary data from a Buffer to file.\")\n .add(this.fileCp, \"Copy file.\");\n}", "title": "" }, { "docid": "be7cd95463ed8976714bdc7ae943b4ea", "score": "0.5727385", "text": "doMahabhuta(fpath) {\n return true;\n }", "title": "" }, { "docid": "fdd281cc1bc8cc58d672cffe6308535b", "score": "0.57072705", "text": "static getModuleFiles(){\n\t\treturn (new Runtime.Vector()).push(\"Core.FileSystem.Provider.FileSystemProvider\").push(\"Core.FileSystem.Provider.FileSystemProviderFactory\").push(\"Core.FileSystem.Provider.ModuleDescription\");\n\t}", "title": "" }, { "docid": "b6eaf194ad561cff88e39d783c027d10", "score": "0.5675908", "text": "function openAny() {\n my.workingFile = getNode(\"*\", fileTree);\n if (!my.workingFile) {\n my.mkfile('root', 'index.html');\n }\n my.workingFile = getNode(\"*\", fileTree);\n document.getElementById(\"workingFile\").innerHTML = my.workingFile.name;\n setWorkspaceContent(my.workingFile);\n document.getElementById(my.workingFile.fileId).style.color = \"\";\n }", "title": "" }, { "docid": "1022d3826a42c503e74f4c412aa11175", "score": "0.56704956", "text": "function GetSubFoldersBook(theFolder) { \n var myFileList = theFolder.getFiles(); \n for (var i = 0; i < myFileList.length; i++) { \n var myFile = myFileList[i]; \n \n if(myFile.toString().match('__MACOSX')!=null){}\n else{\n if (myFile instanceof Folder){ \n GetSubFoldersBook(myFile); \n } \n else if (myFile instanceof File && myFile.name.match(/\\.indb$/i) && myFile.name.match(/\\._/gi) == null) { \n if(myFile.name.toString().toLowerCase().match(UnitRegex) != null || myFile.name.toString().toLowerCase().match('unit') != null ){\n unitBookFiles.push(myFile); \n unitBookFileName.push(myFile.name);\n }\n else if(myFile.name.toString().toLowerCase().match('resource') != null || myFile.name.toString().toLowerCase().match('res') != null) {\n additionalResourcesBookFiles.push(myFile); \n additionalResourcesBookFileName.push(myFile.name);\n }\n } \n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match(/\\.indd$/i) && myFile.name.match(/\\._/gi) == null) {\n if(myFile instanceof File && myFile.name.toString().toLowerCase().match('_rr_')) {\n RRInddFiles.push(myFile);\n RRInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fold')) {\n FOLDInddFiles.push(myFile);\n FOLDInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('tabs')) {\n tabsInddFiles.push(myFile);\n tabsInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fc')) {\n fcInddFiles.push(myFile);\n fcInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('_bc')) {\n bcInddFiles.push(myFile);\n bcInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fm')) {\n fmInddFiles.push(myFile);\n fmInddFileName.push(myFile.name);\n }\n else {\n otherInddFiles.push(myFile);\n }\n }\n else{}\n }\n } \n}", "title": "" }, { "docid": "6c983ee40d8d33da20bf8eb0b06c67c4", "score": "0.5666139", "text": "addEntries (files){\n files.forEach(file => {\n this.addEntry(file.replace(this.srcDir, ''), file);\n });\n }", "title": "" }, { "docid": "72ffcd465b6e13311c39b13c3c3bc752", "score": "0.56550694", "text": "function main() {\n\tvar files;\n\tvar fpath;\n\tvar dpath;\n\tvar opts;\n\tvar out;\n\tvar i;\n\tvar j;\n\n\tout = [];\n\tfor ( i = 0; i < dirs.length; i++ ) {\n\t\tdpath = resolve( __dirname, '..', 'data', dirs[ i ] );\n\t\tfiles = readDirSync( dpath );\n\t\tif ( files instanceof Error ) {\n\t\t\tthrow files;\n\t\t}\n\t\tfor ( j = 0; j < files.length; j++ ) {\n\t\t\tif (\n\t\t\t\tfiles[ j ][ 0 ] !== '.' &&\n\t\t\t\tRE_EXT.test( files[ j ] )\n\t\t\t) {\n\t\t\t\tout.push( dirs[ i ]+'/'+files[ j ] );\n\t\t\t}\n\t\t}\n\t}\n\topts = {\n\t\t'encoding': 'utf8'\n\t};\n\tfpath = resolve( __dirname, '..', 'data', 'file_list.json' );\n\twriteFileSync( fpath, JSON.stringify( out, null, 2 ), opts );\n}", "title": "" }, { "docid": "2a037cca438b9af5c22f06970b52df6a", "score": "0.5650667", "text": "constructor(file)\n {\n this.file = file;\n }", "title": "" }, { "docid": "da1b37cc686547ebd7d8edbf0047e318", "score": "0.56328034", "text": "function analyzeFiles(files) {\n app.file = files[0]\n app.fileType = (app.file.type.slice(app.file.type.indexOf('/') + 1))\n app.fileSize = app.file.size\n rs = new ReadStream(app.file)\n rs.setEncoding('utf8')\n getStreamStructure(rs, app.fileType)\n}", "title": "" }, { "docid": "59b6a88106cf057621409674b474426a", "score": "0.5624263", "text": "function handleFiles(files) {\n files = [...files]\n files.forEach(previewFile) \n }", "title": "" }, { "docid": "34d812f036223873e06fb2908b994033", "score": "0.5614718", "text": "needsToReadFileContents() {\n return true;\n }", "title": "" }, { "docid": "dde8860bcfb9087148f20b6103219a5d", "score": "0.5600712", "text": "function OnGetFile(fileEntry) {\n fileEntry.file(OnFileEntry, fail);\n }", "title": "" }, { "docid": "dde8860bcfb9087148f20b6103219a5d", "score": "0.5600712", "text": "function OnGetFile(fileEntry) {\n fileEntry.file(OnFileEntry, fail);\n }", "title": "" }, { "docid": "b2c9677cd0adb5b0b221b9458bbb3c5d", "score": "0.5599", "text": "function script02(){\n console.log('script02 파일');\n}", "title": "" }, { "docid": "2b6905f6eb0c38fbf9bef667803fc8fa", "score": "0.5587546", "text": "function handleFiles(files) {\r\n\tparameters = [];\r\n\tmeasurements =[];\r\n\tvar temp = files[0].name.split(\".\");\r\n\tif(temp[1] != \"csv\")\r\n\t\tdisplayError(\"File type\")\r\n\telse if (window.FileReader) \r\n\t{\r\n\t\tgetAsText(files[0]);\r\n\t\tfileUploaded = true;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tdisplayError(\"FR\");\r\n\t}\r\n}", "title": "" }, { "docid": "30c9513ea747bedc7f83e0b8f8510c84", "score": "0.5587071", "text": "loadFiles() {\n let {\n root,\n sourceDir,\n files\n } = loadProcessFiles(this.buildConf, this.logger);\n\n this.files = files;\n this.root = root;\n this.sourceDir = sourceDir;\n this.babelConfig = babelUtil.readBabelConfig(root);\n\n let {output} = this.buildConf;\n this.compileContext = {\n cache: this.cache,\n resolve: npm.resolve.bind(null, this),\n addFile: this.files.addFile.bind(this.files),\n getFileByFullPath: this.getFileByFullPath.bind(this),\n appType: this.appType,\n logger: this.logger,\n root,\n output\n };\n }", "title": "" }, { "docid": "a6c1149ba49c202725722a12449a7877", "score": "0.5582621", "text": "_generateObjectDataFromFiles() {\n\t\t// ---- LANG FILE ---\n\t\tvar langFile = fs.readFileSync(this.langFilePath, 'utf16le');\n\t\tthis.langData = vdf.parse(langFile);\n\t\t//Hack for tought Little Indian Character in object name after VDF.parse\n\t\t//Little Indian Character here \"-->\\\"lang\\\"\"\n\t\tvar littleEndianName = '\\uFEFF\\\"lang\\\"';\n\t\tthis.langData.lang = this.langData[littleEndianName];\n\t\tdelete this.langData[littleEndianName];\n\n\t\t// ---- ITEMGAME FILE ---\n\t\tvar itemsFile = fs.readFileSync(this.itemsFilePath, 'utf8');\n\t\tthis.itemsData = simplevdf.parse(itemsFile);\n\n\t\t// ---- SCHEMA FILE --- \n\t\tvar schemaFile = fs.readFileSync(this.schemaFilePath, 'utf8');\n\t\tthis.schemaData = simplevdf.parse(schemaFile);\n\t}", "title": "" }, { "docid": "baec29c8d1eac17c52627daeb54fda46", "score": "0.5575062", "text": "function FileManagerInit(node,ref_node,type)\r\n{\r\n}", "title": "" }, { "docid": "2b88e393b32a7f4f3de550f9c5bf477c", "score": "0.5570495", "text": "function processFiles(files) {\n if (files[0].name.endsWith(\".puz\")) {\n loadFromFile(files[0], FILE_PUZ).then(parsePUZ_callback, error_callback);\n } else {\n loadFromFile(files[0], FILE_JPZ).then(parseJPZ_callback, error_callback);\n }\n }", "title": "" }, { "docid": "4d1f1ebe770ccd8ee25b71e6f52d3a8a", "score": "0.5567201", "text": "processFile (file) {\n if (file.path === \"file2.txt\") {\n this.file2Source = file.source;\n }\n return file;\n }", "title": "" }, { "docid": "e3a260d1ba86636e06712a697f2fa4a3", "score": "0.55645317", "text": "readFiles(dirPath, filenames) {\r\n return filenames.map(function (filename) {\r\n return function (cb) {\r\n fs.readFile(path.join(dirPath, filename), function (err, content) {\r\n if (err) { return cb(err); }\r\n \r\n cb(null, {\r\n name: filename,\r\n content: content.toString()\r\n });\r\n });\r\n };\r\n });\r\n }", "title": "" }, { "docid": "d44040d9294c8c66c57b7b0fd8fb0338", "score": "0.5563017", "text": "visitFilename(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "8505cf4bd400545ccfcaed93758501dc", "score": "0.5552297", "text": "function process_files(fileset){\n\n // 1)\n var item_number = jQuery('li').length + 1,\n fileset_names = '';\n\n for( var i=0; i<fileset.length; i++ ){\n if( !fileset[i][4] ){\n //the server checked for the file in the page content and marked it in this JS list\n add_file( fileset[i][0], fileset[i][1], fileset[i][2], fileset[i][3], item_number);\n item_number++;\n }\n\t\t\n fileset_names += fileset[i][1] + ',';\n }\n\n // 2)\n jQuery('.msfile').each(function(){\n if( fileset_names.indexOf ( jQuery(this).attr('href') ) == -1 ){\n jQuery(this).parent().addClass('file_not_found').attr('title','FILE MISSING or NOT REGISTERED IN WP DB');\n }\n });\n\n //update mechanism\n makeactive();\n}", "title": "" }, { "docid": "84ca58a024335d78f67d77ddaf5c2b9e", "score": "0.5550294", "text": "function main(filePath) {\n\treadFile(filePath);\n\t// Sent to read the file\n}", "title": "" }, { "docid": "5c4b070d8c083fed2749399a49e7cbdb", "score": "0.5548468", "text": "function File() {\n \n /**\n The id of the file (if stored in the FC).\n * @name File#id\n * @type number\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.id = undefined; \n /**\n The size of the file in bytes.\n * @name File#size\n * @type number\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.size = undefined; \n /**\n Return the URL of the file (if stored in the FC).\n * @name File#url\n * @type string\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.url = undefined; \n /**\n The path to the file in the file cabinet.\n * @name File#path\n * @type string\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.path = undefined; \n /**\n The type of the file.\n * @name File#fileType\n * @type string\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.fileType = undefined; \n /**\n * Indicates whether or not the file is text-based or binary.\n * @name File#isText\n * @type boolean\n * @readonly\n * @throws READ_ONLY_PROPERTY when setting the property is attempted\n */ \n this.prototype.isText = undefined; \n /**\n * The character encoding for the file.\n * @name File#encoding\n * @type string\n */ \n this.prototype.encoding = undefined; \n /**\n * The name of the file.\n * @name File#name\n * @type string\n */ \n this.prototype.name = undefined; \n /**\n * The internal ID of the folder that this file is in.\n * @name File#folder\n * @type number\n */ \n this.prototype.folder = undefined; \n /**\n * The file description.\n * @name File#description\n * @type string\n */ \n this.prototype.description = undefined; \n /**\n * The file's inactive status.\n * @name File#isInactive\n * @type boolean\n */ \n this.prototype.isInactive = undefined; \n /**\n * The file's \"Available without Login\" status.\n * @name File#isOnline\n * @type boolean\n */ \n this.prototype.isOnline = undefined; \n /**\n * @name File#lines\n * @type {Iterator} iterator - Iterator which provides the next line of text from the text file to the iterator function.\n * <pre> file.lines.iterator().each(function(lineContext){...}); </pre>\n *\n * @throws {SuiteScriptError} YOU_CANNOT_READ_FROM_A_FILE_AFTER_YOU_BEGAN_WRITING_TO_IT if you call after having called appendLine\n * @readonly\n */ \n this.prototype.lines = undefined; \n /**\n * Return the value (Base64 encoded for binary types) of the file.\n * Note: Contents are lazy loaded and must be less than 10MB in size in order to access.\n *\n * @throws {SuiteScriptError} SSS_FILE_CONTENT_SIZE_EXCEEDED when trying to get contents of a file larger than 10MB\n *\n * @return {string}\n */ \n this.prototype.getContents = function(options) {}; \n \n /**\n * Add/update a file in the file cabinet based on the properties of this object.\n *\n * @governance 20 units\n *\n * @throws {SuiteScriptError} SSS_MISSING_REQD_ARGUMENT when the folder property is not set\n * @throws {SuiteScriptError} INVALID_KEY_OR_REF if trying to save to a non-existing folder\n *\n * @return {number} return internal ID of file in the file cabinet\n *\n * @since 2015.2\n */ \n this.prototype.save = function(options) {}; \n \n /**\n * Append a chunk of text to the file.\n *\n * @param {Object} options\n * @param {string} options.value text to append\n * @return {file} Returns this file\n * @throws {SuiteScriptError} YOU_CANNOT_WRITE_TO_A_FILE_AFTER_YOU_BEGAN_READING_FROM_IT If you call it after having called FileLines#each\n * @since 2017.1\n */ \n this.prototype.append = function(options) {}; \n \n /**\n * Append a line of text to the file.\n *\n * @param {Object} options\n * @param {string} options.value text to append\n * @return {file} Returns this file\n * @throws {SuiteScriptError} YOU_CANNOT_WRITE_TO_A_FILE_AFTER_YOU_BEGAN_READING_FROM_IT If you call it after having called FileLines#each\n * @since 2017.1\n */ \n this.prototype.appendLine = function(options) {}; \n \n /**\n * Reset the reading and writing streams that may have been opened by appendLine or FileLines#each\n *\n * @since 2017.1\n */ \n this.prototype.resetStream = function(options) {}; \n \n /**\n * Returns the object type name (file.File)\n *\n * @returns {string}\n */ \n this.prototype.toString = function(options) {}; \n \n /**\n * JSON.stringify() implementation.\n *\n * @returns {{type: string, id: *, name: *, description: *, path: *, url: *, folder: *, fileType: *, isText: *,\n * size: *, encoding: *, isInactive: *, isOnline: *, contents: *}}\n */ \n this.prototype.toJSON = function(options) {}; \n}", "title": "" }, { "docid": "b6e0341c4e747d4dc6bfeb4091e68c01", "score": "0.55476266", "text": "function superviseAllFiles (p) {\n // console.log('superviseAllFiles', p)\n memFsCount = memFsTotal = 0\n memFsChanged = 0\n\n if (p && p.forceReload) {\n memFsChanged++\n }\n // walkFileTree won't work the same way with file:// (regardless of chrome|firefox) , use alternative\n const rawData = (!rootFs || rootFs.length === 0 || me === 'web-offline') ? currentFiles : rootFs\n handleFilesAndFolders(rawData)\n }", "title": "" }, { "docid": "29cb06e3210c8ad7c3b424ab7c08c7dc", "score": "0.55454254", "text": "function handleFilesAndFolders (items) {\n const files = walkFileTree(items)\n files.catch(function (error) {\n console.error('failed to read files', error)\n if (gProcessor) gProcessor.clearViewer()\n previousScript = null\n })\n files.then(function (files) {\n //console.log('processed files & folders', files)\n afterFilesRead({memFs, memFsCount, memFsTotal, memFsChanged}, files)\n })\n }", "title": "" }, { "docid": "c223a9687e8c8b8ca26fd1ba64c71b37", "score": "0.55414015", "text": "async run() {\n await this.addNorskaFiles();\n await this.addSovFiles();\n }", "title": "" }, { "docid": "d51ea071cae3d50731e71677fc018f88", "score": "0.5539877", "text": "constructor(){\n this.fileSystem = require('fs');\n }", "title": "" }, { "docid": "fbe7e8c221e88451b7144ad83cabd261", "score": "0.55280435", "text": "function File(obj, files, fid){\n\tthis.name = obj.name;\n\tthis.size = obj.size;\n\tthis.modTime = obj.modTime;\n\tthis.parent = files[obj.parent];\t\n\tthis.parent.fileChildren.push(this);\n\tthis.path = getPathName(this);\n\tvar dotSplit = obj.name.split(\".\");\n\tif (dotSplit.length>1) this.type = dotSplit[dotSplit.length-1].toLocaleLowerCase();\n\telse this.type = \"\";\n\tthis.fid = fid;\n}", "title": "" }, { "docid": "eca5d93fcc50355bd5eb704ca44965c8", "score": "0.55273014", "text": "function printcurrentFile() {\n\tfs.readFile(path.resolve(__dirname, \"../\", \"main.json\"), function (\n\t\terr,\n\t\tdata\n\t) {\n\t\tvar jsonFile = JSON.parse(data);\n\t\tvar currentFile = jsonFile.currentFile\n\t\tfs.readFile(\n\t\t\tpath.resolve(__dirname, \"../asciiArt/\", currentFile + \".txt\"),\n\t\t\tprintFunction\n\t\t);\n\t});\n}", "title": "" }, { "docid": "c005f404d40f49071a37fcb4927466e9", "score": "0.552309", "text": "function process_inbound_files(file) {\n\n file_to_upload = file;\n\n meta.name = file.name;\n meta.size = file.size;\n meta.filetype = file.type;\n meta.browser = isChrome ? 'chrome' : 'firefox';\n $log.info(\"file info: \"+meta);\n logger.log(\"file info: \"+meta);\n\n send_meta();\n FileTransfer.sendData(\"You have received a file. Download and Save it.\");\n $log.info(\"can download and save file now\")\n logger.log(\"can download and save file now\")\n // user 0 is this user!\n create_upload_stop_link(file_to_upload.name, 0);//, username);\n }", "title": "" }, { "docid": "bf25dd4edbb7564a2be96301ec0a95d9", "score": "0.5519361", "text": "function _getFileType(f) {\n\tlet retVal = 0;\n\tlet extName = path.extname( path.basename(f) );\n\tif (!extName || extName.length < 2) {\n\t\tconsole.info(`☯︎ ignore:`, path.basename(f));\n\t}\n\telse if (copyFileExt.test(extName)) {\n\t\tretVal = 1;\n\t}\n\telse if (pageFileExt.test(extName)) {\n\t\tif (f.indexOf('index.js') > 0) {\n\t\t\tretVal = 2;\n\t\t}\n\t\telse if (f.indexOf('pages/') > 0) {\n\t\t\tretVal = 3;\n\t\t}\n\t\telse if (build_all_triggers.filter( t => f.indexOf(t) > 0).length > 0) {\n\t\t\tretVal = 4;\n\t\t}\n\t}\n\n\treturn retVal;\n}", "title": "" }, { "docid": "d63b9d9e80d48dd97f3dd42645681330", "score": "0.55173516", "text": "function readProgramFiles() {\n\tdir.readFiles(__dirname + '/../python',{\n\t\tmatch: /.py$/\n\t}, function (err, content, filename, next) {\n\t\tcount ++\n\t\tif (err) throw err;\n\t\tconsole.log('reading ' + filename)\n\n\t\tif(filename.includes('_solution')) {\n\t\t\t// comment the top line to remove imports\n\t \tpayload = content + \"\\n# \"\n\t\t\tnext()\n\t\t}\n\t\telse if(filename.includes('_test')) {\n\t \tvar fname = filename.substr(filename.lastIndexOf('/') + 1)\n\t\t\tvar m = content.lastIndexOf('$$TEST_METHOD$$')\n\t\t\tvar testMethod = content.substr(m + PADDING,content.length)\n\t\t\tpayload = payload + content + \"\\n\" + testMethod\n\t\t\tsendPayload(payload, fname, next)\n\t \tpayload = ''\n\t } else {\n\t\t\tnext()\n\t\t}\n\t}, function(err, files){\n\t if (err) throw err;\n\t console.log('------------------Reading Complete--------------------')\n\t console.log('disconnecting repl'.bold)\n\t repl.disconnect()\n\t\tif(isError) {\n\t\t\tthrow new Error('failed REPL checks')\n\t\t\tisError = false\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f27d63df5677f1d87f99ea771c587abb", "score": "0.5517123", "text": "function pegarArquivoRead(directoryEntry){\n directoryEntry.root.getFile('texto\".zy\"',{create:true, exclusive:false}, sucessRead, fail);\n}", "title": "" }, { "docid": "276084399e36e81433e2cd3630c0f557", "score": "0.5514237", "text": "open()\r\n {\r\n var fs = require('fs');\r\n const vscode = require('vscode');\r\n vscode.debug.activeDebugConsole.appendLine(\"OUTPUT FILE PATH \" + this.filePath);\r\n \r\n fs.unlink (this.filePath, function(err)\r\n {\r\n if (err) throw err;\r\n });\r\n \r\n fs.appendFileSync(this.filePath, '<html>');\r\n fs.appendFileSync(this.filePath, '<head>');\r\n fs.appendFileSync(this.filePath, '<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF8\">');\r\n fs.appendFileSync(this.filePath, '<style>');\r\n fs.appendFileSync(this.filePath, this.fillFileWithStyle ());\r\n fs.appendFileSync(this.filePath, '</style>');\r\n fs.appendFileSync(this.filePath, '</head>');\r\n fs.appendFileSync(this.filePath, '<body>');\r\n\r\n }", "title": "" }, { "docid": "aca503696b52a6e94ef86482e2786df3", "score": "0.55079556", "text": "function main () {\n //reading source file for file system\n fs.readFile(DATA_SOURCE, 'utf8', function (err,data) {\n if (err) {\n return console.log(err);\n }\n // initializing field calss with raw data\n var field = new Field(data);\n field.prepareData();\n field.countNonMineFields();\n field.showField();\n // TODO: output field into the file.\n });\n}", "title": "" }, { "docid": "3bda630239889455b0533661fc2d3d9c", "score": "0.5500524", "text": "function File()\n{\n var name = \"\";\n}", "title": "" }, { "docid": "cda0eb059c84e7987304f3118009baa3", "score": "0.54930043", "text": "function handleFiles(files) {\r\n try {\r\n for (var i = 0, f; f = files[i]; i++) {\r\n\r\n var reader = new FileReader();\r\n\r\n reader.onload = (function () {\r\n return function (event) {\r\n $('#convertedHelp').empty();\r\n\r\n resetGlobals();\r\n\r\n var fileContents = event.target.result;\r\n var htmlResults = parseFileContents(fileContents);\r\n console.log(htmlResults);\r\n\r\n // Format the results for a new window\r\n htmlResults = \"<pre><xmp>\" + htmlResults + \"</xmp></pre>\";\r\n $('#convertedHelp').append(htmlResults);\r\n\r\n // TODO: Remove once articles are parsed correctly\r\n\r\n return;\r\n var wnd = window.open(\"\", \"_blank\");\r\n htmlResults = \"<!DOCTYPE html><html><head><title>\" + gcTitle + \"</title></head><body>\" + htmlResults + \"</body></html>\";\r\n wnd.document.write(htmlResults);\r\n };\r\n })(f);\r\n\r\n reader.readAsText(f);\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}", "title": "" }, { "docid": "bd2c73096c67a31ffe4d834089c8a86d", "score": "0.54907006", "text": "function findFile (fmsg,file) {\nif(!fmsg){fmsg = message};\nconsole.log(\"!!findFile called!!\");\n if (fs.existsSync(\"Music/converted/\"+file)) {\n path = \"Music/converted/\"+file;\n return(path)\n }\n if (fs.existsSync(\"Music/downloaded/\"+file)) {\n path = \"Music/downloaded/\"+file;\n return(path)\n}\n if (fs.existsSync(\"Music/mp3/\"+file)) {\n path = \"Music/mp3/\"+file\n return(path)\n }\n if (fs.existsSync(\"Music/mp4/\"+file)) {\n path = \"Music/mp4/\"+file\n return(path)\n }\n}", "title": "" }, { "docid": "c3ac7f2726646d9432cdd8e48415e1ac", "score": "0.54875815", "text": "function getIndividualFileInfo(pp, files, loopInfo, callback, $index) {\n parsePath(paths.posix.join(pp.uiPath, files[$index]), function (ipp) {\n getinfo(ipp, function (result) {\n loopInfo.results[result.Path] = result;\n if ($index + 1 >= loopInfo.total) {\n callback(loopInfo.results);\n }//if\n });//getinfo\n });//parsePath\n }//getIndividualFileInfo", "title": "" }, { "docid": "39e2b3f00f0486ab3870322f535438ee", "score": "0.5481873", "text": "_parse () {\n let fileList\n if (this.dirname) {\n fileList = fs.readdirSync(this.dirname)\n .filter((file) => {\n return fs.statSync(`${this.dirname}/${file}`).isFile() && /.*\\.cls$/.test(file)\n })\n .map((file) => { return `${this.dirname}/${file}` })\n } else {\n fileList = [this.filename]\n }\n\n return Promise.all(\n fileList.map((fileName) => {\n return this._readFile(fileName)\n })\n )\n }", "title": "" }, { "docid": "1f86c43bccaaeeed9588c54c746da8cc", "score": "0.5476173", "text": "createFileObjects() {\n // redo step 7, in case it got skipped last time and its objects are\n // still in memory\n this.removeFileObjects(); // create fileReader\n\n this.fileReader = new FileReader();\n this.fileReader.onload = this.onload; // tw: Use FS API when available\n\n if (_tw_filesystem_api__WEBPACK_IMPORTED_MODULE_7__[\"default\"].available()) {\n (async () => {\n try {\n const handle = await _tw_filesystem_api__WEBPACK_IMPORTED_MODULE_7__[\"default\"].showOpenFilePicker();\n const file = await handle.getFile();\n this.handleChange({\n target: {\n files: [file],\n handle: handle\n }\n });\n } catch (err) {\n // If the user aborted it, that's not an error.\n if (err && err.name === 'AbortError') {\n return;\n } // eslint-disable-next-line no-console\n\n\n console.error(err);\n }\n })();\n } else {\n // create <input> element and add it to DOM\n this.inputElement = document.createElement('input');\n this.inputElement.accept = '.sb,.sb2,.sb3';\n this.inputElement.style = 'display: none;';\n this.inputElement.type = 'file';\n this.inputElement.onchange = this.handleChange; // connects to step 3\n\n document.body.appendChild(this.inputElement); // simulate a click to open file chooser dialog\n\n this.inputElement.click();\n }\n }", "title": "" }, { "docid": "3fbeed205c0dc71e50d4ca22258f065f", "score": "0.54731", "text": "function FileExtension() {\n\t//\n}", "title": "" }, { "docid": "8f60950935ed3b842b3c643ac08fa412", "score": "0.54703605", "text": "constructor(Files) {\n this.Files = Files\n }", "title": "" }, { "docid": "4d2be393a8f6867a634b0e6c56168550", "score": "0.5467896", "text": "function afterFilesRead ({memFs, memFsCount, memFsTotal, memFsChanged}, files) {\n memFsCount = files.length\n memFsTotal = files.length\n\n // console.log('afterFilesRead', memFs, memFsTotal, files, 'changed',)\n // NOTE: order is important, if you cache new data first, it will fail\n const changedFilesCount = changedFiles(memFs, files).length\n // FIXME : THIRD time the SAME data is cached\n files.forEach(file => saveScript(memFs, file.name, file.source, file.fullpath))\n const mainFile = findMainFile({memFs, memFsTotal}, files)\n\n if (changedFilesCount > 0) {\n if (!mainFile) throw new Error('No main.jscad found')\n setCurrentFile(mainFile, memFsTotal)\n }\n }", "title": "" }, { "docid": "f66bac9dc51b5864e6c724f728bbb07a", "score": "0.54669386", "text": "function FileEntry() {\n this.isFile = true;\n this.isDirectory = false;\n}", "title": "" }, { "docid": "e42c6fd55bc34e623187ce419788b14f", "score": "0.54662716", "text": "readBuiltInFile(f) {\r\n if (Sk.builtinFiles === undefined || Sk.builtinFiles[\"files\"][f] === undefined)\r\n throw \"File not found: '\" + f + \"'\";\r\n return Sk.builtinFiles[\"files\"][f];\r\n }", "title": "" }, { "docid": "0d845922f1aa8bc25d9ac9e4513bc161", "score": "0.54616016", "text": "function openFile(fileName) {\n\tvar fileContaint; \n\ttry {\n\t\tfileContaint = fs.readFileSync(__dirname + '/' + fileName, 'utf8'); //read file with calling name\n\t} catch (error) { //handel errors\n\t\tif (error.code === 'ENOENT') {\n\t\t\treturn console.log(fileName + ' Not exist! (or your dog ate your ' + fileName + ' file)');\n\t\t} else {\n\t\t\treturn console.log('Error: Something went wrong', error);\n\t\t}\n\t}\n\treturn fileContaint;\n}", "title": "" }, { "docid": "a42802565adef12177084a710678de6a", "score": "0.5459817", "text": "function wikiReadFile( filename )\n{\n result = FILE.loadFromFile(filename);\n return result;\n}", "title": "" }, { "docid": "f15fc1b6aee08f19c92d16e773b6108c", "score": "0.5458614", "text": "function initFileSystem() {\t\n console.log(\"initing the filesystem..\");\n regular_fileSystemInit();\n}", "title": "" }, { "docid": "5671d911dae625ccc20da903c53616b8", "score": "0.5456615", "text": "function init() {\n writeToFile() \n \n}", "title": "" }, { "docid": "036fd44f6d576bbc352a7dbc7d4eb21b", "score": "0.5456364", "text": "function MyFile(name, mode) {\r\n let myFile = '';\r\n try {\r\n\t\tif(mode === \"1\"){\r\n\t\t\tmyFile = fs.readFileSync(\"Data/Members/\" + name + \"/info.txt\", 'utf8');\r\n\t\t}else{\r\n\t\t\tmyFile = fs.readFileSync(\"Data/newMembers.txt\", 'utf8');\r\n\t\t}\r\n\t} catch(e) {\r\n\t\tconsole.log('Error:', e.stack);\r\n\t}\r\n\treturn myFile;\r\n}", "title": "" }, { "docid": "40a809462fd76318997cc99d1ed86bbc", "score": "0.54447997", "text": "function ProcFile(path,f)\r\n{\r\n // Return string, do something with f(line N), add it to the return string.\r\n var r=\"\";\r\n \r\n // INIT: file system stuff\r\n var fs=new ActiveXObject(\"Scripting.FileSystemObject\");\r\n var file=fs.OpenTextFile(path,1,-2);\r\n \r\n // READ: each line of le file!\r\n while(!file.AtEndOfStream) r+=f(file.ReadLine());\r\n\r\n // CLEAN: remove .raw files and close text streams\r\n file.Close();\r\n \r\n return r;\r\n}", "title": "" }, { "docid": "4e807668bf41e51dd8a89c6c48400a56", "score": "0.5444396", "text": "function gotFileEntry(fileEntry) {\n\t\t\tvar nomearquivo;\n\t\t\tif (URL_foto == 0) {\n\t\t\t\tnomearquivo = pegaNomeProximaFoto();\n\t\t\t\tfileEntry.moveTo(fs.root, nomearquivo , fsSuccess, deuerro);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (URL_foto.indexOf(\"foto_1.jpg\") > -1)\n\t\t\t\t\tnomearquivo = nomefoto1;\n\t\t\t\tif (URL_foto.indexOf(\"foto_2.jpg\") > -1)\n\t\t\t\t\tnomearquivo = nomefoto2;\n\t\t\t\tif (URL_foto.indexOf(\"foto_3.jpg\") > -1)\n\t\t\t\t\tnomearquivo = nomefoto3;\n\t\t\t\t\n\t\t\t\t$scope.fotos = [];\n\t\t\t\tfileEntry.moveTo(fs.root, nomearquivo , fsSuccess, deuerro);\n\t\t\t\twindow.cache.clear(cachesuccess, deuerro);\n\t\t\t\t\n\t\t\t\t// so le os arquivos que nao estao sendo gravador, pois este ja chamara o lefotos na subrotina fsSuccess do moveTo \n\t\t\t\tif (nomearquivo != nomefoto1) \n\t\t\t\t\tlefotos(nomefoto1);\n\t\t\t\tif (nomearquivo != nomefoto2) \n\t\t\t\t\tlefotos(nomefoto2);\n\t\t\t\tif (nomearquivo != nomefoto3) \n\t\t\t\t\tlefotos(nomefoto3);\t\t\n\n\t\t\t\t// limpa o cache para evitar de mostrar a foto antiga\n\t\t\t\t// recarrega tela\n\n\t\t\t}\n\n\n\t\t}", "title": "" }, { "docid": "40d72791bab99bcd2a364ede3b21d6fc", "score": "0.54429764", "text": "function handleFileSelect(evt) {\n\t // These are the files\n\t var files = evt.target.files;\n\t // Load each one and trigger a callback\n\t for (var i = 0; i < files.length; i++) {\n\t var f = files[i];\n\t var reader = new FileReader();\n\t function makeLoader(theFile) {\n\t // Making a p5.File object\n\t var p5file = new p5.File(theFile);\n\t return function(e) {\n\t p5file.data = e.target.result;\n\t callback(p5file);\n\t };\n\t };\n\t reader.onload = makeLoader(f);\n\n\t // Text or data?\n\t // This should likely be improved\n\t if (f.type.indexOf('text') > -1) {\n\t reader.readAsText(f);\n\t } else {\n\t reader.readAsDataURL(f);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.54428613", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.54428613", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "8499e4ab73748b78ab76b0134edf4aae", "score": "0.54422885", "text": "function loadFiles(files) {\n var file = files.shift();\n\n logStart('open: ' + file.name);\n\n loadFile(file).then(function() {\n logEnd();\n files.length && loadFiles(files);\n });\n}", "title": "" }, { "docid": "268e3bc059426a944afb094b4719e716", "score": "0.5436707", "text": "function processFiles(list) {\r\n\r\n var i, file, filename, main, hist;\r\n var files = {\r\n 'hist': {},\r\n 'main': {},\r\n 'list': [],\r\n 'ordList': ordList\r\n };\r\n\r\n for (i = 0; i < list.length; i++) {\r\n file = list[i];\r\n filename = file.filename;\r\n main = files.main[filename];\r\n if (main === undefined) {\r\n files.main[filename] = file;\r\n files.list.push(file);\r\n } else {\r\n hist = files.hist[filename];\r\n hist = hist ? hist : [];\r\n hist.push(file);\r\n files.hist[filename] = hist;\r\n }\r\n }\r\n return files;\r\n\r\n function move(index, movement) {\r\n moveElementInArray(files.list, index, movement);\r\n }\r\n\r\n function ordList() {\r\n var i, res = [];\r\n // [{'fileTid':'1234',...},...]\r\n for (i = 0; i < files.list.length; i++) {\r\n res.push(files.list[i].fileTid);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "914633eff6a1dc33d9463019e5a85912", "score": "0.54346657", "text": "function ObjectFiles() {\n _super.call(this, \"Files\");\n }", "title": "" }, { "docid": "727a5e3e8a4dbf0112f6dc76d24e69fc", "score": "0.5431217", "text": "function handleFiles(files) {\n for (var i = 0, ie = files.length; i < ie; i++) {\n PENDING_FILES.push(files[i]);\n }\n}", "title": "" }, { "docid": "0c019989328f74c9c478f2f824ecfd22", "score": "0.5430607", "text": "function FoundFile(file) {\n\tthis.file = file;\n}", "title": "" }, { "docid": "a31ef7a9a15a92c78fd6cbd6ee685dbc", "score": "0.5428039", "text": "function fs(){ return ''; }", "title": "" }, { "docid": "26b80caacce81d5e61441ae2ebd45ef0", "score": "0.5427835", "text": "handleFileSelect(evt) {\n let files = evt.target.files;\n if (!files.length) {\n //alert('No file select');\n return;\n }\n let file = files[0];\n let that = this;\n let reader = new FileReader();\n reader.onload = function(e) {\n that.dataLoader(e.target.result);\n };\n reader.readAsText(file);\n\n }", "title": "" }, { "docid": "d8ace0b95f1a43fc28f58c3065939823", "score": "0.5422608", "text": "_writeChangeFiles() {\n this._changeFileData.forEach((changeFile) => {\n this._writeChangeFile(changeFile);\n });\n }", "title": "" }, { "docid": "791b906e5dbd48b0e90c7164e22932bb", "score": "0.54225147", "text": "function handleFiles(files) {\n //clear editor for file contents\n editor.getSession().setValue(\"\");\n var file = files[0];\n var reader = new FileReader();\n // init the reader event handlers\n reader.onloadend = handleReaderLoadEnd;\n\n // begin the read operation\n reader.readAsBinaryString(file);\n}", "title": "" }, { "docid": "9bd6428c8c1d3cb35de0cbbb9a38e1f1", "score": "0.54224056", "text": "function handleFileSelect(evt) {\n\tevt.stopPropagation();\n\tevt.preventDefault();\n\n\tvar files = evt.dataTransfer.items;\n\n\tvar output = $('#fileList')[0];\n\t//sharedFiles = [];\n\t$('.upload-box h1').hide();\n\n\tfunction processFile(f) {\n\t\tconsole.log(f.name);\n\t\tif (f.size > 1000*1000*1000) {\n\t\t\talert('Could not use ' + f.name + ' because the file was larger than 1GB.' +\n\t\t\t\t'\\n\\n We cannot currently use files over 1GB due to limits in Chrome.');\n\t\t\treturn;\n\t\t}\n\t\tif (f.name == \".DS_Store\" || f.name == \"thumbs.db\") { return; }\n\t\tif ($.inArray(f.name + f.size + f.type, sharedFiles.map(function(object) { return object.name + object.size + object.type })) != -1) { return; }\n\t\tsharedFiles.push(f);\n\t\toutput.innerHTML += ['<li><strong>', f.name, '</strong><br/> (', f.type || 'n/a', ') - ',\n\t\t\tf.size, ' bytes, last modified: ',\n\t\t\tf.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',\n\t\t\t'</li>'].join('');\n\t}\n\n\tfunction loadFiles(files) {\n\t\tfor (var i = 0; i < files.length; i++) {\n\t\t\tvar f, e;\n\t\t\tif (files[i].isFile || files[i].isDirectory) {\n\t\t\t\te = files[i];\n\t\t\t} else {\n\t\t\t\tf = files[i].getAsFile();\n\t\t\t\te = files[i].webkitGetAsEntry();\n\t\t\t}\n\t\t\tif(e.isFile) {\n\t\t\t\tif (f === undefined) {\n\t\t\t\t\te.file(function(file) {\n\t\t\t\t\t\tconsole.log(\"load file;\");\n\t\t\t\t\t\tprocessFile(file);\n\t\t\t\t\t}, function(error) { console.log('error opening file.') });\n\t\t\t\t} else {\n\t\t\t\t\tprocessFile(f);\n\t\t\t\t}\n\t\t\t} else if (e.isDirectory) {\n\t\t\t\tvar reader = e.createReader();\n\t\t\t\treader.readEntries(function(traversedEntries) {\n\t\t\t\t\tloadFiles(traversedEntries);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tloadFiles(files);\n\t$('#skip').addClass('btn-primary');\n\t$('#skip')[0].innerHTML = \"Done >>\";\n\n\twindow.setTimeout(function() {\n\t\tsocket.emit('sharing_files', sharedFiles);\n\t}, 1000);\n}", "title": "" }, { "docid": "4d822850ed096f51aa13f789e45b2b8e", "score": "0.5419992", "text": "function readSelectedFiles() {\n\n file_list.forEach(function (item, index, array) {\n console.log('item:', item, index);\n\n var filePath = './' + item;\n console.log(filePath);\n\n splitFile2(filePath, '#', function (content) {\n console.log(content);\n // var filename = newDest + path.sep + index.toString();\n // createFile(content, filename);\n // console.log(filename);\n appendToFile(before + content + after, './event/2021/4developers/index.html');\n });\n });\n\n}", "title": "" }, { "docid": "839a9f02009268814372f70b17ba2169", "score": "0.54199517", "text": "function MyFile(nombre){\n this.name = nombre; //nombre del archivo con su extension\n this.type; //tipo de archivo (ej application, image etc) \n this.codeType; //tipo codificacion del contenido (ej base64, base32, etc)\n this.data; //contenido del archivo\n \n //trabajamos sobre el dataURL --> \"data:application/pdf;base64,datossss\" \"data:image/png;base64,datosss\"\n this.parseDataURL = function(dataURL){\n var dataURLSeparado = dataURL.split(\",\");\n \n //obtenemos los datos\n this.data = dataURLSeparado[1];\n //la primera parte es la cabecera del archivo\n var cabecera = dataURLSeparado[0].split(\";\"); \n \n //obtenemos el typo de codificacion\n this.codeType = cabecera[1];\n //obtenemos el tipo de archivo\n this.type = cabecera[0].split(\":\")[1];\n };\n}", "title": "" }, { "docid": "bfcb25d812f7041e087ca59c831d0d88", "score": "0.5419728", "text": "addFileToFilepond(e) {\n e && this.filepondInstance.addFile(e);\n }", "title": "" }, { "docid": "ee941d3d5341c742ec99f63bb8213ae1", "score": "0.54131484", "text": "function list() {\n\tfs.readFile(\n\t\tpath.resolve(__dirname, \"../\", \"main.json\"),\n\t\t\"utf8\",\n\t\tfunction readFileCallback(err, data) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t} else {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"Current File \" + chalk.keyword(\"green\")(JSON.parse(data).currentFile)\n\t\t\t\t);\n\t\t\t\tfs.readdir(path.resolve(__dirname, \"../\", \"asciiArt\"), function (err, items) {\n\t\t\t\t\tconsole.log(\"Files: \");\n\t\t\t\t\titems.forEach(item => {\n\t\t\t\t\t\tconsole.log(\"Name: \" + chalk.keyword(\"green\")(item.replace(\".txt\", \"\")) + \" File: \" + chalk.keyword(\"green\")(item));\n\t\t\t\t\t})\n\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\t);\n\n\n}", "title": "" }, { "docid": "c28c11e07241d39ca574186730b4a5e9", "score": "0.54093194", "text": "processFiles(filePaths) {\n for (let i = 0; i < filePaths.length; i++) {\n this.processFile(filePaths[i]);\n }\n }", "title": "" }, { "docid": "d795a7a5b0dac9749a57e8756890c1a2", "score": "0.54072213", "text": "constructor(filename){\n super(filename)\n }", "title": "" }, { "docid": "d795a7a5b0dac9749a57e8756890c1a2", "score": "0.54072213", "text": "constructor(filename){\n super(filename)\n }", "title": "" }, { "docid": "5d4f779e68059bb4231590bab6ca2ab0", "score": "0.5405643", "text": "function startApp(){\n readFile();\n}", "title": "" } ]
4ccf6421d9d911ef016d92b215a4ed4d
register new renderer and corresponding context
[ { "docid": "4add730594499a373b9287be6463091b", "score": "0.58893406", "text": "function addFrameRenderer(frameRender, renderContext) {\r\n if (frameRender && typeof (frameRender) === \"function\") {\r\n frameRenderersCollection.push(frameRender);\r\n renderContextesCollection.push(renderContext);\r\n }\r\n }", "title": "" } ]
[ { "docid": "6e8eea307bdffc8e5d70ad692b228c13", "score": "0.614745", "text": "function registerRenderer(info, force) {\n if (!info || !info.name || !info.renderer) return;\n var name = info.name;\n var pattern = info.pattern;\n var registry = exports.rendererRegistry;\n if (name in registry) {\n if (!force) {\n throw new Error(\"CodeRenderer \" + name + \" already exists\");\n }\n }\n if (typeof pattern === \"string\") {\n var t_1 = pattern.toLowerCase();\n pattern = function (lang) {\n return lang.toLowerCase() === t_1;\n };\n } else if (pattern instanceof RegExp) {\n pattern = function (lang) {\n return info.pattern.test(lang);\n };\n }\n var newInfo = {\n name: name,\n suggested: !!info.suggested,\n pattern: pattern,\n renderer: info.renderer,\n };\n registry[name] = newInfo;\n exports.defaultOption[name] = false;\n exports.suggestedOption[name] = newInfo.suggested;\n }", "title": "" }, { "docid": "2196d1a432c4acb44ccf73752e401763", "score": "0.6064033", "text": "function injectRenderer2() {\n return getOrCreateRenderer2(getLView());\n}", "title": "" }, { "docid": "2196d1a432c4acb44ccf73752e401763", "score": "0.6064033", "text": "function injectRenderer2() {\n return getOrCreateRenderer2(getLView());\n}", "title": "" }, { "docid": "c290c70c821eaf1bc4774d8d4f9da4df", "score": "0.60444546", "text": "function Renderer(){}", "title": "" }, { "docid": "c290c70c821eaf1bc4774d8d4f9da4df", "score": "0.60444546", "text": "function Renderer(){}", "title": "" }, { "docid": "c290c70c821eaf1bc4774d8d4f9da4df", "score": "0.60444546", "text": "function Renderer(){}", "title": "" }, { "docid": "a981fe72d71122136d27cdbe014ba8de", "score": "0.59657884", "text": "setCurrentRenderer(renderer) {\n this.currentRenderer = renderer;\n }", "title": "" }, { "docid": "cfce57972c0c0182d1630293960d5087", "score": "0.5962181", "text": "function BaseRenderer(){}", "title": "" }, { "docid": "72020427a54d852529f9a43ff2df9332", "score": "0.5938875", "text": "function BaseRenderer() {}", "title": "" }, { "docid": "79c4a3372fb5415a2c20cabe42d08ccd", "score": "0.59248793", "text": "function FakeRenderer() {}", "title": "" }, { "docid": "1a77684b6cb5ca8b5936d156e8a2eb99", "score": "0.5917514", "text": "function setupContext(renderer) {\n var context = renderer.getContext();\n context.setFont(\"Arial\", 10, \"\").setBackgroundFillStyle(\"#eed\");\n return context;\n }", "title": "" }, { "docid": "af1cc8a171510943c9bc091042b11885", "score": "0.5878515", "text": "createNew(nb, context) {\n let wManager = new manager_1.WidgetManager(context, nb.rendermime);\n this._registry.forEach(data => wManager.register(data));\n nb.rendermime.addFactory({\n safe: false,\n mimeTypes: [WIDGET_MIMETYPE],\n createRenderer: (options) => new renderer_1.WidgetRenderer(options, wManager)\n }, 0);\n return new disposable_1.DisposableDelegate(() => {\n if (nb.rendermime) {\n nb.rendermime.removeMimeType(WIDGET_MIMETYPE);\n }\n wManager.dispose();\n });\n }", "title": "" }, { "docid": "a8341e1ef34f0106517bcc56eca43b50", "score": "0.5803568", "text": "set customRendering(f) { this._renderFunc = f; }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.5777624", "text": "function Renderer() {\n }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.5777624", "text": "function Renderer() {\n }", "title": "" }, { "docid": "4ad47f3b352f4ec2325cd13b5f61bf11", "score": "0.5715747", "text": "function Renderer() {\n }", "title": "" }, { "docid": "4ad47f3b352f4ec2325cd13b5f61bf11", "score": "0.5715747", "text": "function Renderer() {\n }", "title": "" }, { "docid": "754a79b5f62c6b7558dfbc55d2a5cb3c", "score": "0.571214", "text": "function FakeSingletonRenderer() {}", "title": "" }, { "docid": "351439dac0e7aa4f35c1e65e60b6a8c0", "score": "0.56965566", "text": "set BasedOnRenderers(value) {}", "title": "" }, { "docid": "53d8d57ca69f0027b9f185c26184670b", "score": "0.56930494", "text": "function RendererType2(){}", "title": "" }, { "docid": "0efa82b6673a9b8f5d7c1ec2d14981ee", "score": "0.56380045", "text": "function RendererType2() {}", "title": "" }, { "docid": "0efa82b6673a9b8f5d7c1ec2d14981ee", "score": "0.56380045", "text": "function RendererType2() {}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "110446403811d75fe751da8eaf5f3bf4", "score": "0.56341875", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "ec84e361a6d7e87165b5b86b8174c6cb", "score": "0.56159794", "text": "set renderers(value) {}", "title": "" }, { "docid": "2971ce04ad0cc205fa5268d9a0ce5d90", "score": "0.55898815", "text": "notifyRenderer() {\n const that = this;\n for (let id in that.renderers_) {\n that.renderers_[id].update(that);\n }\n }", "title": "" }, { "docid": "c1cf2a14e9c0298723159d19c6f9ad15", "score": "0.5587556", "text": "setContext(context) {\n super.setContext(context);\n this.onResize();\n this.createMesh();\n\n }", "title": "" }, { "docid": "e3229a7f2fd150621c07a2970ebe6ca9", "score": "0.55855376", "text": "function renderContextPrototype () {}", "title": "" }, { "docid": "c55b24d5d1a218eed79323a88cf72421", "score": "0.55791104", "text": "get context() {\n return this.renderer.getContext();\n }", "title": "" }, { "docid": "39dc458fda7a321ee7ee83da97d4d337", "score": "0.5578979", "text": "function init() { render(this); }", "title": "" }, { "docid": "818fba0f424a81cf1c4d15a58f260917", "score": "0.5578027", "text": "function Renderer(){\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "29c9e4a69837cdc3e2d4bad40476bd86", "score": "0.5570096", "text": "function AbstractRenderer() {\n\n}", "title": "" }, { "docid": "2023bdcc733e0182374fe8c518e6f56b", "score": "0.5563371", "text": "function init()\n {\n app.hooks.clearHooks();\n app.hooks.setHook({\n name : 'RenderTest',\n functionName : function ()\n {\n app.thisTemplate.render();\n }\n });\n }", "title": "" }, { "docid": "9aa24dafefabec57f4f7612020478971", "score": "0.5553047", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getPreviousOrParentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "81faaa1ccf34084bd569154389ea7aa9", "score": "0.55382705", "text": "function Renderer(options, system) {\n this.construct(options, system, 'available');\n}", "title": "" }, { "docid": "fabfb84837cc9cf96144caabd6e98e77", "score": "0.55291283", "text": "function injectRenderer2() {\n return function(view) {\n var renderer = Object(_state__WEBPACK_IMPORTED_MODULE_10__.m)()[_interfaces_view__WEBPACK_IMPORTED_MODULE_7__.o];\n if (Object(_interfaces_renderer__WEBPACK_IMPORTED_MODULE_6__.c)(renderer)) return renderer;\n throw new Error(\"Cannot inject Renderer2 when the application uses Renderer3!\");\n }();\n }", "title": "" }, { "docid": "ef8894348b9cfb5a7e27264df4b077c3", "score": "0.55133146", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n var lView = getLView();\n var tNode = getPreviousOrParentTNode();\n var nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "0ef7bb5d2547e6e0b7a73161df036347", "score": "0.5509494", "text": "function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n var lView = getLView();\n var tNode = getPreviousOrParentTNode();\n var nodeAtIndex = getComponentViewByIndex(tNode.index, lView);\n return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n}", "title": "" }, { "docid": "6b42078b2c60d82a0bc354e741fe39c1", "score": "0.5505525", "text": "function addRenderer(name, parentNode, interactive=false, bg=[0.97, 0.97, 0.97]) {\n const renderWindow = vtk.Rendering.Core.vtkRenderWindow.newInstance();\n const renderer = vtk.Rendering.Core.vtkRenderer.newInstance({ background: bg });\n renderWindow.addRenderer(renderer);\n\n const openglRenderWindow = vtk.Rendering.OpenGL.vtkRenderWindow.newInstance();\n renderWindow.addView(openglRenderWindow);\n\n const container = parentNode;\n openglRenderWindow.setContainer(container);\n\n let interactor;\n if (interactive) {\n // Add interactor to main renderer\n interactor = vtk.Rendering.Core.vtkRenderWindowInteractor.newInstance();\n interactor.setView(openglRenderWindow);\n interactor.initialize();\n interactor.bindEvents(container);\n interactor.setInteractorStyle(vtk.Interaction.Style.vtkInteractorStyleTrackballCamera.newInstance());\n }\n\n renderers[name] = {\"renderer\":renderer, \"container\":container, \"openglRenderWindow\":openglRenderWindow, \"interactor\": interactor};\n}", "title": "" }, { "docid": "566f8f779de0750d7a7ea7cb0e680378", "score": "0.5505454", "text": "get renderer(){\r\n\t\treturn this.__render_root ?? this }", "title": "" }, { "docid": "26575c7efd64eb62744ccb83ccd7d540", "score": "0.5504889", "text": "setup() {\n this.prepareRender();\n }", "title": "" }, { "docid": "809f71663da4e92b2fda9caecf1e94fa", "score": "0.54970473", "text": "function render(renderProperties,encodings,options){\nencodings=(0, _linearizeEncodings2.default)(encodings);\n\nfor(var i=0;i<encodings.length;i++){\nencodings[i].options=(0, _merge2.default)(options,encodings[i].options);\n(0, _fixOptions2.default)(encodings[i].options);\n}\n\n(0, _fixOptions2.default)(options);\n\nvar Renderer=renderProperties.renderer;\nvar renderer=new Renderer(renderProperties.element,encodings,options);\nrenderer.render();\n\nif(renderProperties.afterRender){\nrenderProperties.afterRender();\n}\n}", "title": "" }, { "docid": "ee8ee769b684c633a45471987d55edd2", "score": "0.5494404", "text": "function AbstractRenderer() {\r\n\r\n}", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.54922277", "text": "function RendererType2() { }", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.54922277", "text": "function RendererType2() { }", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.54922277", "text": "function RendererType2() { }", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.54922277", "text": "function RendererType2() { }", "title": "" }, { "docid": "7db430bf6a12bc4813d40dacd2ae477c", "score": "0.54909205", "text": "function Renderer(args) {\n\n\n}", "title": "" }, { "docid": "a32dbebaacd08050b69f1db502a4c6b8", "score": "0.5485434", "text": "enterSpecialRegister(ctx) {\n\t}", "title": "" }, { "docid": "b5854af002175a55000d83660ef1d97e", "score": "0.54838175", "text": "function setRenderer(renderer) {\n this.prototype._renderHtml = renderer;\n return this;\n }", "title": "" }, { "docid": "d6b30dbe2415bea7e327dd289229d520", "score": "0.54077184", "text": "register() {\n\t\tthis.loadAndPublishConfig(this.app.formatPath(__dirname, 'config'));\n\t\tthis.bindViewFactory();\n\t\tthis.bindViewEngine();\n\t\tthis.bindViewResolver();\n\t}", "title": "" }, { "docid": "34f5f08fd90a7c6d86b6cdf6b99b96e6", "score": "0.53559065", "text": "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model);}}", "title": "" }, { "docid": "2f6261483942abecaa365acad75dbadd", "score": "0.5354786", "text": "startRendering() {\n\t\tthis._shouldRender = true;\n\t}", "title": "" }, { "docid": "3c28c66f37cd9f35950bc05626aadd3f", "score": "0.5354613", "text": "constructor({ renderer }) {\n this.renderer = renderer;\n this.children = [];\n }", "title": "" }, { "docid": "91f801de78186b0d882f8bac2a8ba1fd", "score": "0.5342493", "text": "function applyRenderer(renderer) {\r\n rich.setRenderer(renderer);\r\n rich.redraw();\r\n createLegend(app.map, rich);\r\n }", "title": "" }, { "docid": "e3ed53a67348daecf3c13f0df1020fa9", "score": "0.5334147", "text": "function Renderer(){_classCallCheck(this,Renderer);return _possibleConstructorReturn(this,(Renderer.__proto__||Object.getPrototypeOf(Renderer)).call(this));}", "title": "" }, { "docid": "d57c674a8eb8aecb2e7e8aadc210eb87", "score": "0.5300646", "text": "register() { }", "title": "" }, { "docid": "f741d917d3643739cb5877ebd2d4284b", "score": "0.52954394", "text": "init(){\n this.render();\n \n }", "title": "" }, { "docid": "08d330ad25d1e16f4b4acf8e17c400b5", "score": "0.52845925", "text": "didMount () {\n const markersManager = this.context.markersManager\n if (markersManager) {\n this._isRegistered = markersManager.register(this)\n }\n // if not managed by the MarkersManager we let the component be updated directly\n if (!this._isRegistered) {\n this.context.appState.addObserver(['document'], this.rerender, this, { stage: 'render', document: { path: this.getPath() } })\n }\n }", "title": "" }, { "docid": "3757aa45866a73a6f2383e2e38e14520", "score": "0.5282554", "text": "function Renderer (options) {\n this.options = options || {};\n}", "title": "" }, { "docid": "c1c577ff8744b2a4ec8c0e2fb6be4a93", "score": "0.5254209", "text": "function init(container, view, action) {\r\n var renderer = new Renderer(container, view, action);\r\n renderer.scheduleRender();\r\n return renderer;\r\n }", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.5252315", "text": "function render() {}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.5252315", "text": "function render() {}", "title": "" }, { "docid": "df816ea254f1bb8a19b3482efee9de6b", "score": "0.5247684", "text": "init() {\n this.render();\n }", "title": "" }, { "docid": "df816ea254f1bb8a19b3482efee9de6b", "score": "0.5247684", "text": "init() {\n this.render();\n }", "title": "" }, { "docid": "7ade237b7ad8fc914dd2114b17367cdb", "score": "0.52463275", "text": "_initRendering() {\r\n this.sprite = new PIXI.Container();\r\n\r\n // Move the viewport to the spawn point\r\n let spawn = this.map.getSpawnPoint();\r\n this.setViewport(spawn.x, spawn.y);\r\n\r\n this._mapRenderer = this.map.createRenderer();\r\n this.sprite.addChild(this._mapRenderer.sprite);\r\n\r\n this.sprite.addChild(this.attackSprites);\r\n\r\n for(let monster of this.monsters) {\r\n monster.createSprite();\r\n }\r\n for(let player of this.players) {\r\n player.createSprite();\r\n }\r\n\r\n this.ladder.setPosition(this.map.ladder.x, this.map.ladder.y);\r\n \r\n for(let item of this.items) {\r\n item.createSprite();\r\n }\r\n this.sprite.addChild(this.itemSprites);\r\n this.sprite.addChild(this.playerSprites);\r\n this.sprite.addChild(this.monsterSprites);\r\n this.sprite.addChild(this.ladder.sprite);\r\n\r\n }", "title": "" }, { "docid": "4e477e42840fd0fbdff02c3922902ba5", "score": "0.52426517", "text": "get renderer() {\n return this._renderer;\n }", "title": "" }, { "docid": "84eafd55c654ee74da41a27e3a178e5e", "score": "0.524014", "text": "constructor() {\n super();\n\n this.loaderPlugins = Object.create(null);\n this.moduleRegistry = Object.create(null);\n\n this.useTemplateLoader(new TextTemplateLoader());\n this.useTemplateRegistryEntryPlugin();\n }", "title": "" }, { "docid": "e3a069579ebb9a006abd37af83bc8e93", "score": "0.5237504", "text": "function registerRuntimeCompiler(_compile) {\n compile = _compile;\n installWithProxy = i => {\n if (i.render._rc) {\n i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\n }\n };\n}", "title": "" }, { "docid": "0befd442f177d97aa042d371004b30dd", "score": "0.5230148", "text": "_renderNewRootComponent() {}", "title": "" }, { "docid": "a508352e25dc92a802c4c856c444f019", "score": "0.5219411", "text": "register(options = {}) {\n if (options.register) {\n this.configuration.register = true;\n }\n this.registerContext.register(options);\n return this;\n }", "title": "" }, { "docid": "949ab746538a1014c071ce0f49069ca1", "score": "0.52121246", "text": "_renderNewRootComponent() { }", "title": "" }, { "docid": "cd4ec9efc2353f7209543273f4bd8204", "score": "0.5193963", "text": "function init() {\n cacheDom();\n bindEvents();\n render();\n }", "title": "" }, { "docid": "c9dade818e7bedf0c076a0fa895bce78", "score": "0.51857007", "text": "preRender() {\n\t}", "title": "" }, { "docid": "e170bea7710ab4f243f57263d95b7987", "score": "0.5185268", "text": "initRegl() {\n this.regl = REGL({\n\t\t canvas: this.canvas,\n\t\t pixelRatio: window.innerHeight/window.innerHeight\n });\n\n this.regl._gl.disable(this.regl._gl.BLEND);\n this.regl._gl.enable(this.regl._gl.DEPTH_TEST);\n\n this.regl.frame(this.render.bind(this));\n }", "title": "" }, { "docid": "8054ff352040ca720f91a7ad787edab1", "score": "0.5177995", "text": "register() {\n this.registerHelper()\n this.registerPluginLoader()\n this.registerMessageHandler()\n this.registerScheduler()\n this.registerStartBot()\n }", "title": "" }, { "docid": "8185d53604134a5509531b24e9383b09", "score": "0.51732504", "text": "function register() {\n if (registered) return;\n events.on('execute.CodeCell', cell_execute_called);\n events.on('kernel_idle.Kernel', cell_execute_finished);\n events.on('delete.Cell', cell_deleted)\n //TODO clear queue on execute error\n //For Debugging purposes. Highlights the currently running cell in grey colour.\n //events.on('started.currentcell', function (event, cell) { cell.element.css('background-color', '#EEEEEE') });\n //events.on('finished.currentcell', function (event, cell) { cell.element.css('background-color', 'white') });\n}", "title": "" }, { "docid": "c55084d54afdf9d4faa4fc40d4b04be1", "score": "0.51678085", "text": "get BasedOnRenderers() {}", "title": "" }, { "docid": "62c0912c40c4ce23a2ebc9c98ab4b802", "score": "0.5167484", "text": "request_render() {\n this.request_paint();\n }", "title": "" }, { "docid": "9d316a7fbeec215ee8b39de4648c78a8", "score": "0.51611483", "text": "function _createRenderer({template,bundle,manifest}={}){\n const viewTemplate = template || fs.readFileSync(TEMPLATE_PATH,'utf-8')\n const serverBundle = bundle || require('./../build/vue-ssr-server-bundle.json')\n const clientManifest = manifest || require('./../build/vue-ssr-client-manifest.json')\n\n return createBundleRenderer(serverBundle,{\n runInNewContext:false,\n template:viewTemplate,clientManifest,\n cache:useCache?LRU({max:1000,maxAge:1000 * 60 * 15}):false\n })\n}", "title": "" }, { "docid": "8757e40f29d17b27712d160a54452ed1", "score": "0.51493317", "text": "onContextChange() {\n /*const gl = this.renderer.gl;\n \n this.shader = new GLShader(gl, Shaders.VERTEX_TILE, Shaders.FRAGMENT_TILE);\n \n \n this.simpleShader = new GLShader(gl,Shaders.VERTEX_TILE, Shaders.FRAGMENT_TILE);\n \n this.renderer.bindVao(null);\n this.quad = new Quad(gl, this.renderer.state.attribState);\n this.quad.initVao(this.shader);*/\n }", "title": "" }, { "docid": "5595ba6f1ea84d263b72140743ad7183", "score": "0.5140565", "text": "register() {\n const self = this;\n this.handlers = [\n this.viewer.addHandler('open', () => {\n self.refresh();\n self.updateSize();\n }),\n this.viewer.addHandler('animation', () => {\n self.refresh();\n }),\n this.viewer.addHandler('resize', () => {\n self.refresh();\n self.updateSize();\n }),\n ];\n }", "title": "" }, { "docid": "cd4956edd3e50f29f2d717d991052ae5", "score": "0.51354533", "text": "Render() {}", "title": "" }, { "docid": "23b31d703ddcd3c1895cf1f479d47760", "score": "0.51275617", "text": "onRender(){}", "title": "" }, { "docid": "3039bb513daee4b20343812349ad3972", "score": "0.51271796", "text": "_updateRendering() {\n //Create output from route\n var output = document.createElement(this.routes[this.currentroute]);\n //Empty shadow\n while (this.shadow.firstChild) {\n this.shadow.removeChild(this.shadow.firstChild);\n }\n //Append element to shadow\n this.shadow.appendChild(output);\n }", "title": "" }, { "docid": "9419fd776ead1b98843381a43583275a", "score": "0.5120641", "text": "function TextRenderer() {} // no need for block level renderers", "title": "" }, { "docid": "20526e263e7e3aa9bced8cf06a0bafd0", "score": "0.5117481", "text": "function registerSelf() {\n let msg = {value: winUtil.outerWindowID, href: content.location.href};\n // register will have the ID and a boolean describing if this is the main process or not\n let register = sendSyncMessage(\"Marionette:register\", msg);\n\n if (register[0]) {\n listenerId = register[0][0].id;\n // check if we're the main process\n if (register[0][1] == true) {\n addMessageListener(\"MarionetteMainListener:emitTouchEvent\", emitTouchEventForIFrame);\n }\n importedScripts = FileUtils.getDir('TmpD', [], false);\n importedScripts.append('marionetteContentScripts');\n startListeners();\n }\n}", "title": "" }, { "docid": "d4d621b9c873138bebf88d12ca32ccb3", "score": "0.5113974", "text": "init() {\n this.renderView();\n }", "title": "" }, { "docid": "45218d688b6dd2e987da5af25a2e03ef", "score": "0.5101889", "text": "register() {\n\t\t//Allow the App to share an instance of itself.\n\t\tthis.app.bind('App', this.app, true)\n\t\tthis.app.bind('Kernel', Kernel, false)\n\t}", "title": "" }, { "docid": "7da264be468ff7b52c44c35925187ae4", "score": "0.50918067", "text": "function render() {\n var key, spec, w;\n \n // render the console wrapper\n render_console();\n \n // look for keys in the debug payload\n // and render each as a widget\n for (klass in data) {\n // class name to lowercase\n key = klass.toLowerCase();\n if (data.hasOwnProperty(key) && data[key].data) {\n // get a new widget object and render\n w = widgets[key]({\n 'name' : key,\n 'data' : data[key].data\n });\n \n // render widget passing in content div element\n w.render($('#' + id + ' .content'));\n \n // hide if not default\n if (key !== default_tab) {\n w.hide();\n }\n \n // add to registry\n registry[key] = w;\n }\n }\n }", "title": "" }, { "docid": "9a9aeb28b4d5d88c121c2c0890996cc4", "score": "0.50905055", "text": "getRenderer() {\n return this.renderer;\n }", "title": "" }, { "docid": "d79d385e4e7aad67354fdade182277d8", "score": "0.50792503", "text": "function Context() {\n Element.call(this);\n\n document.body.appendChild(this.domElement);\n\n this.domElement.setAttribute('id', 'dom-renderer');\n\n this.width = 0;\n this.height = 0;\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.5075609", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" } ]
6bfa4db69d74a1f60df99a16f4d5cc41
Callback for when tweet is sent.
[ { "docid": "a5ec866d9ed08d1b65327cd6c85ddeda", "score": "0.67821485", "text": "function tweeted(err, data, response) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t} else {\n\t\t\t\tconsole.log( 'Sent custom gradient back.' );\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "e1aa30ba3e3faae92d404cc80b95962f", "score": "0.79726344", "text": "function tweeted(err, data, response) {//this is a call back function work after tweet has posted.\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }", "title": "" }, { "docid": "e1aa30ba3e3faae92d404cc80b95962f", "score": "0.79726344", "text": "function tweeted(err, data, response) {//this is a call back function work after tweet has posted.\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }", "title": "" }, { "docid": "358ba616e27e91ec5d15551e5020e162", "score": "0.7770534", "text": "function tweeted(err, data, response) {\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }", "title": "" }, { "docid": "19cd7ca7d0c1b2847033a1a1ff44161a", "score": "0.76385474", "text": "function retweet(eventMsg){\n var tweet={\n status: 'Thanks for following me '+'@'+eventMsg.source.screen_name\n }\n T.post('statuses/update', tweet,tweeted);\n \n //this is a call back function work after tweet has posted.\n function tweeted(err, data, response) {//this is a call back function work after tweet has posted.\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }\n}", "title": "" }, { "docid": "79ec5650c28c3db140ce46e6b30aac26", "score": "0.7551618", "text": "function tweetIt(mensaje){\n\tvar tweet={\n\tstatus: mensaje \n\t}\n\n\tT.post('statuses/update',tweet,tweeted )\n\n\n\tfunction tweeted(err, data, response) {\n\t\tif(err){\n\t\t\tconsole.log(\"Something went wrong...\");\n\t\t\tconsole.log(err);\n\t\t}else{\n\t\t\tconsole.log(\"tweet Sent!\");\n\n\t\t}\n\t \n\t}\n\n\n}", "title": "" }, { "docid": "bf188ed8995fe083a7a3e26f46c8f211", "score": "0.75172716", "text": "function tweeted(err, data, response) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\tconsole.log( 'Instructions sent.' );\n\t\t}\n\t}", "title": "" }, { "docid": "0714f79a3bd0524cca7784501cb61ecb", "score": "0.74960524", "text": "function sendTweet() {\n const Tweet = new Twit(config);\n\n // Arguments to make Tweet.post function work\n const params = {\n status: countdownMessage()\n };\n function tweet(err, data, response) {\n if (err) {\n console.log(\"Something went wrong :(\");\n } else {\n console.log(\"Tweet sent!\");\n }\n };\n\n // Sending out tweet\n Tweet.post('statuses/update', params, tweet);\n}", "title": "" }, { "docid": "eac3735cfe4677a1455c4aba6d936cdf", "score": "0.7479174", "text": "function tweeted(err, data, response) {\n if (err) {\n console.log(err);\n } else {\n console.log('Success: ' + data.text);\n }\n }", "title": "" }, { "docid": "eeb2c81da99731557af7bad378167255", "score": "0.7297731", "text": "function BotTweet() {\n\tBot.post('statuses/update', { status: \"Primeiro Tweet do BOT!\" }, function (error, tweet, response) {\n\t\tif (error) console.log(\"error\", error);\n\t\telse\n\t\t\tconsole.log(\"Tweet enviado.\");\n\t});\n}", "title": "" }, { "docid": "3d441ab79e9940f28b96b8bbfce0cd8a", "score": "0.72906", "text": "function tweetNow(tweetTxt) { \n var tweet = {\n status: tweetTxt\n }\n Twitter.post('statuses/update', tweet, function(err, data, response) {\n if(err){\n console.log(\"Error in Replying\");\n }\n else{\n console.log(\"Gratitude shown successfully\");\n }\n });\n}", "title": "" }, { "docid": "3d441ab79e9940f28b96b8bbfce0cd8a", "score": "0.72906", "text": "function tweetNow(tweetTxt) { \n var tweet = {\n status: tweetTxt\n }\n Twitter.post('statuses/update', tweet, function(err, data, response) {\n if(err){\n console.log(\"Error in Replying\");\n }\n else{\n console.log(\"Gratitude shown successfully\");\n }\n });\n}", "title": "" }, { "docid": "185b5b32bb5dac115dd5a0a281bd9498", "score": "0.72867703", "text": "function tweeted(err, data, response) {\n if (err) {\n console.log(err);\n } else {\n console.log('Success: ' + data.text);\n //console.log(response);\n }\n }", "title": "" }, { "docid": "1fe279f45454275708d7fb0d02042d2a", "score": "0.7206441", "text": "function like(){\n var stream=T.stream('user');\n stream.on('favorite',retweet);\n \n\n function retweet(eventMsg){\n var tweet={\n status: 'Thanks for like my tweet '+'@'+eventMsg.source.screen_name\n }\n T.post('statuses/update', tweet,tweeted);\n \n //this is a call back function work after tweet has posted.\n function tweeted(err, data, response) {//this is a call back function work after tweet has posted.\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }\n}\n\n}", "title": "" }, { "docid": "95594d7d07c88e65a509c7ced1b21257", "score": "0.7184939", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Tweeted \" + reply.text);\n }\n }", "title": "" }, { "docid": "0f9fe7f623f481041d6aeb73dd1f9c16", "score": "0.7142003", "text": "function tweetEvent(tweet) {\n\n // If we wanted to write a file out\n // to look more closely at the data\n // var fs = require('fs');\n // var json = JSON.stringify(tweet,null,2);\n // fs.writeFile(\"tweet.json\", json, output);\n\n // Who is this in reply to?\n var reply_to = tweet.in_reply_to_screen_name;\n // Who sent the tweet?\n var name = tweet.user.screen_name;\n // What is the text?\n var txt = tweet.text;\n // If we want the conversation thread\n var id = tweet.id_str;\n\n // Ok, if this was in reply to me\n // Tweets by me show up here too\n if (reply_to === 'm_prabs'){\n // Get rid of the @ mention\n txt = txt.replace(/@m_prabs/g,'');\n var randomNumber=Math.floor(Math.random()*100);\n // Start a reply back to the sender\n var replyText = '@'+name + ' Thank you for the text! #BotPrabin'+ randomNumber;\n // Reverse their text\n // for (var i = txt.length-1; i >= 0; i--) {\n // replyText += txt.charAt(i);\n // }\n\n // Post that tweet\n T.post('statuses/update', { status: replyText, in_reply_to_status_id: id}, tweeted);\n\n // Make sure it worked!\n function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }\n }\n}", "title": "" }, { "docid": "97e8327ed2634f61fc3528bb02ef5a77", "score": "0.7105682", "text": "function tweetSend(event){\n var atMen = event.in_reply_to_screen_name;\n var msg = event.text;\n var name = event.user.screen_name;\n\n if(atMen = 'GlmBottest'){\n if(msg.search('band name') != -1){\n //retrive and tweet a band name from list\n var bandName = chooseName();\n var bandTweet = '@' + name + ', your new band is ' + bandName;\n postStatus(bandTweet);\n console.log('Just sent @' + name + \" a hella band name.\");\n }\n }\n}", "title": "" }, { "docid": "b03d1119cfd23b5c0142036ba634dd2f", "score": "0.7049392", "text": "function tweetEvent(tweet) {\n\n // If we wanted to write a file out\n // to look more closely at the data\n // var fs = require('fs');\n // var json = JSON.stringify(tweet,null,2);\n // fs.writeFile(\"tweet.json\", json, output);\n\n // Who is this in reply to?\n var reply_to = tweet.in_reply_to_screen_name;\n\n // Who is the author of the tweet?\n var author = tweet.user.screen_name;\n // What is the text?\n var txt = tweet.text;\n // If we want the conversation thread\n var id = tweet.id_str;\n console.log(id);\n // Ok, if this was in reply to me\n // Tweets by me show up here too\n console.log(reply_to);\n // Get rid of the @ mention\n txt = txt.replace(/@BotAlagador/g,'');\n\n // Start a reply back to the sender\n var replyText = '@'+author +' Eres una persona maravillosa brillas más que los dientes del knekro. ' + '@'+reply_to;\n\n // Post that tweet\n T.post('statuses/update', { status: replyText, in_reply_to_status_id: id, username: author}, tweeted);\n\n // Make sure it worked!\n function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }\n}", "title": "" }, { "docid": "1d132a6580842a4a4c54e4c8fd178284", "score": "0.7032691", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }", "title": "" }, { "docid": "d613f2ab7a511c809ef5c45cf647ece7", "score": "0.7025183", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }", "title": "" }, { "docid": "b7d9ff766225eb4f9996cd0e1eff2a7a", "score": "0.70158315", "text": "function postTweet(msg){\n\tT.post('statuses/update', { status: `${msg}` }, function(err, data, response) {\n if(err) {\n \t\tconsole.log(err)\n \t}\n });\n}", "title": "" }, { "docid": "d4d742e2602a5eeff628a287a74c7923", "score": "0.7014058", "text": "function postTweet(tweet) {\n client.post('statuses/update', { status: tweet }, function(err, data, response) {\n if (err) {\n console.log('Error: ', err);\n } else {\n console.log('Success: ', data);\n }\n });\n}", "title": "" }, { "docid": "25ab94fd942ba94145d5094996c6d158", "score": "0.6975855", "text": "function tweet(txt) {\n Bot.post('statuses/update', {\n status: txt\n }, (err, data, response) => {\n if (err) {\n console.log(err)\n } else {\n console.log(`${data.text} tweeted!`)\n }\n })\n}", "title": "" }, { "docid": "bbe85c80fdb8ee443735c5e11f6facb4", "score": "0.6940205", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Reply sent!');\n }\n }", "title": "" }, { "docid": "b266efbcec8a2beddbc1b9594e73d55b", "score": "0.6940096", "text": "function tweet(){\n var params=[{q: '@screenrant',count: 3},{q: '@CinemaBlend',count: 1},{q: '@IMDb',count: 1},{q: '@comingsoonnet',count: 1},{q: '@RottenTomatoes',count: 3}];\n for(j=0;j<params.length;j++){\n T.get('search/tweets', params[j], gotData);//get tweets about queries(q) in param\n function gotData(err, data, response){\n console.log(data);\n for(i=0;i<data.statuses.length;i++){\n \n var tweet={\n status: '#MovieNews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com'\n }\n //console.log('#Movienews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com');\n //This posts tweets mentioned in tweet param.\n T.post('statuses/update', tweet,tweeted);\n }\n }\n //this is a call back function work after tweet has posted.\n function tweeted(err, data, response) {\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }\n }\n}", "title": "" }, { "docid": "d55b35cc31e6d2efc9c0d13d0ed4c0b2", "score": "0.69399196", "text": "function tweetThis(command){\n client.post('statuses/update', {status: command}, function(error, tweet, response) {\n if(error) throw error;\n console.log(tweet); // Tweet body. \n console.log(response); // Raw response object. \n });\n}", "title": "" }, { "docid": "86fe327421ffa10568de2e2022daccff", "score": "0.69295406", "text": "function sendTestTweet(msg) {\n client.post('statuses/update', {status: msg},  function(error, tweet, response) {\n   if(error) throw error;\n console.log(\"Tweet Sent\");\n });\n}", "title": "" }, { "docid": "5a3be008cc050a4fd581d20fcc415f44", "score": "0.69256544", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }", "title": "" }, { "docid": "8a907f1d3e23427fc3d335b102ee2e2f", "score": "0.69040084", "text": "function postTweetCallback(tweetText) {\n\tvar textbox = getChromeElement('textboxid');\n\ttextbox.reset();\n\ttextbox.disabled = false;\n\tgetChromeElement('statusid').label = updateLengthDisplay();\n\tif (tweetText.match(/^d(\\s){1}(\\w+?)(\\s+)(\\w+)/)) {\n\t\t// It was a DM, need to display it manually.\n\t\tvar tweet = {\n\t\t\tid : 0,\n\t\t\ttext : \"\",\n\t\t\tcreated_at : new Date(),\n\t\t\tsender : \"\",\n\t\t\tuser : {\n\t\t\t \tscreen_name : \"\",\n\t\t\t\tprofile_image_url : \"\",\n\t\t\t\tname : \"\"\n\t\t\t},\n\t\t\tsource : \"\"\n\t\t};\n\t\ttweet.text = \"Directly to \" + tweetText.substring(2);\n\t\ttweet.sender = getUsername();\n\t\ttweet.user.screen_name = getUsername();\n\t\ttweet.user.profile_image_url = getChromeElement(\"avatarLabelId\").value;\n\t\ttweet.user.name = getChromeElement(\"realnameLabelId\").value;\n\t\ttweet.in_reply_to_screen_name = \"\";\n\t\ttweet.sender = undefined;\n\t\tinsertAtTop(formatTweet(tweet));\n\t}\n\tforceUpdate();\n}", "title": "" }, { "docid": "2ffcedfae6626315c1e8c474f0ac3486", "score": "0.6888575", "text": "function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }", "title": "" }, { "docid": "c16437257a32911beecbe10fa71869cd", "score": "0.68796855", "text": "function tweetNow(text) {\n let tweet = {\n status: text\n }\n\n bot.post('statuses/update', tweet, (err, data, response) => {\n if (err) {\n console.log('ERRORDERP Reply', err)\n }\n console.log('SUCCESS: Replied: ', text)\n })\n}", "title": "" }, { "docid": "7a5c559cc1896241fbbe30a7db0e6957", "score": "0.68267727", "text": "function follow(){\n //when stream is on bot will listen to events like follow.\n var stream=T.stream('user');\n stream.on('follow',retweet);\n \n //if someone follow bot bot will reply\n function retweet(eventMsg){\n var tweet={\n status: 'Thanks for following me '+'@'+eventMsg.source.screen_name\n }\n T.post('statuses/update', tweet,tweeted);\n \n //this is a call back function work after tweet has posted.\n function tweeted(err, data, response) {//this is a call back function work after tweet has posted.\n if(err){\n console.log(err); \n }\n else{\n console.log(\"Bot tweeted.\");\n }\n }\n}\n\n}", "title": "" }, { "docid": "49e4ec0a61f88111afea2f74b8e5bf4c", "score": "0.67531043", "text": "function tweetNow (tweetTxt) {\n var tweet = {\n status: tweetTxt\n }\n\n // HARCODE user name in and check before RT\n var n = tweetTxt.search(/@istereotype/i)\n\n if (n !== -1) {\n console.log('TWEET SELF! Skipped!!')\n } else {\n Twitter.post('statuses/update', tweet, function (err, data, response) {\n if (err) {\n console.log('Cannot Reply to Follower. ERROR!: ' + err)\n } else {\n console.log('Reply to follower. SUCCESS!')\n }\n })\n }\n}", "title": "" }, { "docid": "bb8e6247b349adf2f582a571c166cec7", "score": "0.67149127", "text": "function tweetEvent(tweet) {\n\n // Who is this in reply to?\n var reply_to = tweet.in_reply_to_screen_name;\n\n // What is the text?\n var txt = tweet.text\n\n // Get rid of the @ mention\n short_url = txt.replace(/@dev_celestial /g,'');\n\n var tweet_link = '';\n\n // Expand the shortened url\n expandUrl(short_url)\n .then(function (longUrl) {\n var my_regex = /https:\\/\\/twitter\\.com\\/([a-zA-Z0-9_.]+)\\/status\\/([0-9]+)\\?/g;\n\n var extracted_info = my_regex.exec(longUrl);\n\n // Username of the given tweet owner\n var name = extracted_info[1];\n \n // Id of the given tweet\n var id = extracted_info[2];\n\n // If this was in reply to me\n if (reply_to === 'dev_celestial') {\n var file_text = '';\n fs.readFile('Input.txt', (err, data) => { \n if (err) throw err; \n file_text = data.toString(); \n // Start a reply back to the sender\n var replyText = '@'+ name + ' ' + file_text + ' Right?!';\n\n // Post that tweet\n T.post('statuses/update', { status: replyText, in_reply_to_status_id: id}, tweeted);\n\n // Make sure it worked!\n function tweeted(err, reply) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('Tweeted: ' + reply.text);\n }\n }\n })\n }\n });\n}", "title": "" }, { "docid": "48eae3a39e673ba5b111dace61378a8d", "score": "0.6695947", "text": "function setTweet(receivedTweet) {\r\n tweet = receivedTweet;\r\n}", "title": "" }, { "docid": "ba6c2349b826a6794b128450ed78b3ee", "score": "0.6691759", "text": "function tweetEvent(tweet) {\n \n //Check tweet is replying to us/mentions us\n var reply_to = tweet.in_reply_to_screen_name;\n if (reply_to === self_username) {\n console.log('Someone mentioned me in a tweet!')\n \n //--------create answer:\n var tweet_txt = tweet.text; //for analysis & answering\n var screen_name = tweet.user.screen_name; //to reply to user\n var tweet_id = tweet.id_str;\n var quote_tweet = 'https://twitter.com/'+screen_name+'/status/'+tweet_id; //url for quotation\n var reply_txt = '@' + screen_name + ' ' + quote_tweet;\n \n //download appropriate gif\n getGif(tweet_txt)\n \n //wait for gif download & post Tweet with media:\n console.log('setting timeout')\n setTimeout(postTweetWithMedia, 5000, reply_txt)\n \n }\n}", "title": "" }, { "docid": "23e00f8bbc696617e52bf6cdcf37c791", "score": "0.6675539", "text": "function onReTweet(err) {\n if(err) {\n console.error(\"retweeting failed :(\");\n console.error(err);\n }\n}", "title": "" }, { "docid": "0240b3accab07d7f8c89494a9fdddcb3", "score": "0.66568285", "text": "function postTweet() {\n\n\tif(!scriboData) {\n\t\tconsole.log(\"I am unable to understand what you want to be tweeted. Please tell me exactly what you want to say.\");\n\t\tlogData.error = true;\n\t\tlogData.errorText = 'No tweet data provided.';\n\t\tupdateLog(logData);\n\t\treturn;\n\t}\n\n\t\n\tlogData.tweetText = scriboData;\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"confirm\",\n \t\tmessage: \"Are you sure you want me to post \" + scriboData + \" for you?\",\n \t\tname: \"confirm\",\n \t\tdefault: true\n\t\t}\n\t]).then(function(response){\n\n\t\tlogData.response = \"User confirmed tweet = \" + response.confirm;\n\t\t\n\t\tif (response.confirm) {\n\n\t\t\tclient.post('statuses/update', {status: scriboData}, function(error, tweet, response) {\n\t\t\t if(error) {\n\t\t\t \tlogData.error = true;\n\t\t\t \tlogData.errorText = \"Error occurred when posting tweet.\";\n\t\t\t \tupdateLog(logData);\n\t\t\t \tconsole.log(\"I could not post your tweet at this time.\");\n\t\t\t \tthrow error;\n\t\t\t }\n\t\t\t console.log(\"I just tweeted for you: \");\n\t\t\t console.log(scriboData);\n\t\t\t logData.response = 'success'; \n\t\t\t // console.log(response); // Raw response object.\n\t\t\t \n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"Okay. I won't post this tweet.\");\n\t\t}\n\t\tupdateLog(logData);\n\t});\t\n}", "title": "" }, { "docid": "2e4b2b10361dfc474d396d98eabd7f5b", "score": "0.6644619", "text": "function tweetHandler(event){\n event.preventDefault();\n let tweetCompose = $('#tweet-textarea').val().length;\n if(tweetCompose !== 0 && tweetCompose < 140){\n $.post(\"/tweets/\", $(this).serialize(), (data) => {\n\n $('#tweet-textarea').val(\"\");\n $('.all-tweets').html(\"\");\n\n loadTweets();\n\n $(\".new-tweet\").slideUp();//toggles back up after submit\n }).done(function() {\n $('.new-tweet').find('.counter').text('140');\n });\n } else if(tweetCompose == 0){\n alert(\"Tweet must contain an actual tweet\");\n return;\n }\n }", "title": "" }, { "docid": "de3cbc0ecd9130effd3ad40358cb7012", "score": "0.6618365", "text": "function newTweet(status) {\n var status = status;\n T.post('statuses/update', { status: status }, function(err, data, response) {\n if (err) {\n console.log(err);\n } else {\n console.log(data);\n }\n });\n}", "title": "" }, { "docid": "2d5297fa79344fea590d1d2dd2abe829", "score": "0.6603874", "text": "function tweetCheck(err, data, response){\n if(err){\n console.log(\"Something went wrong and the tweet did not go out!\");\n console.log(err);\n }else{\n console.log(\"The twitter bot Tweeted!\");\n }\n}", "title": "" }, { "docid": "e7ecee4d9d52bc20d20f314e1db1f859", "score": "0.6596462", "text": "function tweeted(err, data, response) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t} else {\n\t\t\t\tconsole.log( 'Random gradient posted.' );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a8cf787475e6899c9b1bf2ef2fd305de", "score": "0.65840983", "text": "function doTweet (tweet) {\n \n var service = getTwitterService();\n \n if (service.hasAccess()) {\n var status = 'https://api.twitter.com/1.1/statuses/update.json';\n var payload = \"status=\" + fixedEncodeURIComponent(tweet);\n \n } else {\n var authorizationUrl = service.authorize();\n //msgPopUp(\"<iframe src='\" + authorizationUrl + \"&output=embed' width='600' height='500'></iframe>\");\n msgPopUp('<p>Please visit the following URL and then re-run \"Send a Test Tweet\": <br/> <a target=\"_blank\" href=\"' + authorizationUrl + '\">' + authorizationUrl + '</a></p>');\n }\n\n var parameters = {\n \"method\": \"POST\",\n \"escaping\": false,\n \"payload\" : payload\n };\n\n try {\n var result = service.fetch('https://api.twitter.com/1.1/statuses/update.json', parameters);\n Logger.log(result.getContentText()); \n } \n catch (e) { \n Logger.log(e.toString());\n }\n\n}", "title": "" }, { "docid": "3943aeafbca80d71da7ad788144d0b87", "score": "0.6578537", "text": "function handleTextTweet(t) {\n return 0;\n}", "title": "" }, { "docid": "6925d0c2d4980521c61c58c704f699c8", "score": "0.6566498", "text": "function sendTweet(incomingTweetIdStr, messageText) {\n\n // Update the lastTweetSent variable, so we can make sure to not send duplicate tweets\n // later on. Don't send in T.post then clause in case of network issues.\n lastTweetSent = messageText;\n\n let params = {\n in_reply_to_status_id: incomingTweetIdStr,\n status: messageText\n };\n\n T.post('statuses/update', params).then((results) => {\n console.log('Tweet sent: ' + messageText);\n } \n ).catch((err) => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "849967a6bc4f0a848dae14b0eb751e6b", "score": "0.6550486", "text": "function sendTweets(message, res, ui){\n\n client.post('statuses/update', {\n status: message\n }, function(error, tweet, response) {\n if (error) {\n if(ui) res.sendFile(__dirname, \"/public/HTML/failure.html\");\n else res.send(\"Sorry, there is an error with the twitter-API\");\n }\n else{\n var status = response.statusCode;\n\n res.status = status; //set the HTML status code to response\n\n if(ui){ // if the request is from the UI\n if(status === 200){\n res.sendFile(__dirname + \"/public/HTML/success.html\");\n } else res.sendFile(\"/public/HTML/failure.html\");\n }\n else if(status === 200){ // if the request was not from the UI\n res.send(\"Wowwwwww what a brillient tweet!!\");\n }\n else res.send(\"Error, Status Code:\" + status);\n }\n });\n}", "title": "" }, { "docid": "054507161644dcc20f5444a3409e32cb", "score": "0.6534131", "text": "function tweetResponse(eventMsg) {\n console.log(eventMsg.text); //debugging, check if the event text is the tweet\n var name = eventMsg.user.name; //this function wants this to be the target we'll check below\n console.log('Name: ' + name);\n var screenName = eventMsg.user.screen_name;\n console.log('Screen Name: ' + screenName);\n var tweetedAt = eventMsg.in_reply_to_screen_name;\n console.log('Tweeted At: ' + tweetedAt + '\\n\\n');\n var text = eventMsg.text;\n\n //check that the tweet came from the target and respond\n //if\n if (screenName === 'YOURTWITTERSCREENNAME'){\n //skipping my replies that show up in his feed\n }\n //if the target tweets\n else if (screenName === 'TARGETUSERSCREENNAME') {\n fs.readdir(__dirname + '/images', function(err, files) {\n if (err){\n console.log(err);\n }\n else{\n var images = [];\n files.forEach(function(f) {\n images.push(f);\n });\n //call main worker function\n upload_random_image(images,text);\n\n } // end of else\n }); // end of readdir callback\n\n\n\n\n }//end of else if\n}//end of tweetResponse", "title": "" }, { "docid": "02a2cb9d08b1f515e5016fe21cd33c58", "score": "0.6510441", "text": "function tweetToUser() {\n postTweet(function(data) {\n var tweet = $('#tweetContent');\n tweet.slideUp().empty().slideDown('fast');\n tweet.parent().parent().find(\"div.error\").empty();\n tweet.val(\"@\" + userLogin + \" \");\n });\n return false;\n}", "title": "" }, { "docid": "0cc70cc67176f4a0c2c9918ffa80c07b", "score": "0.649484", "text": "function postTweet(query) {\n\n\ttwitter.post('statuses/update',\n\t\t\t\tquery,\n\t\t\t\tfunction(err, data, response) {\n\t\t\t\t\t\t\n\t\t\t\t\tif (err) {\n\t\t \t\t\t\n\t\t \t\t\tconsole.log(data)\n\t\t \t\t\t\n\t\t \t\t} else {\n\n\t\t \t\t}\n\t\t\t\t\n\t\t\t\t})\n\n}", "title": "" }, { "docid": "c1b3b1832591f524c22e72920413ac12", "score": "0.649353", "text": "function tweet() {\n var categoryCodes = ['w', 'n', 'b', 'tc', 'e', 's'];\n getTopics(pickRemove(categoryCodes))\n .then(function(topics) {\n var topic = pickRemove(topics);\n logger('topic:');\n logger(topic);\n\n getHeadline(topic.url).then(function(headline) {\n logger('headline: ' + headline);\n\n try {\n // for goats, only need one headline\n var nouns = getNounArray(headline);\n // if no nouns, skip\n // this means we skip a tweet\n // look at the BoingBoingHuffr architecture for promises, etc.\n if (nouns.length > 0) {\n var noun = pickRemove(nouns);\n var goat = getGoatWord();\n\n logger('noun: ' + noun);\n logger('goat: ' + goat);\n\n if (isFirstLetterUpperCase(noun)){\n goat = capitalize(goat);\n logger('Goat: ' + goat);\n }\n\n var goatHeadline = headline.replace(noun, goat);\n\n console.log('old: ' + headline);\n logger('spelled: ' + goatHeadline);\n\n goatHeadline = respell(goatHeadline);\n\n goatHeadline = tagit(goatHeadline);\n\n console.log('new: ' + goatHeadline);\n\n if (config.tweet_on) {\n T.post('statuses/update', { status: goatHeadline }, function(err, reply) {\n if (err) {\n console.log('error:', err);\n }\n else {\n logger('tweet success');\n }\n });\n }\n }\n } catch(ex) {\n console.log(ex);\n }\n\n });\n });\n}", "title": "" }, { "docid": "5aaa26b0075d49064965a42aa362d53a", "score": "0.6481597", "text": "function postResult(error, data, response) {\n if (error) {\n console.log(\"Couldn't post the tweet!\");\n }\n else {\n console.log(\"Tweet posted!\");\n }\n}", "title": "" }, { "docid": "45831711625767f58103112d46dc5511", "score": "0.64562047", "text": "function tweetUpdates(){\r\n\tcreatePlayerOptions();\r\n}", "title": "" }, { "docid": "cff40b7bf20399db2946c042adaad5de", "score": "0.64560986", "text": "function postTweet(){\n var $msg = $('body').find('#tweetInput');\n if($msg.val().length <= 180 && $msg.val().length > 0){\n writeTweet($msg.val());\n $msg.val('');\n }\n}", "title": "" }, { "docid": "3072c85d12ed58de143458f0d5e1586c", "score": "0.64251614", "text": "function tweetHandler(tweet, onProcessed) {\n\t// Process attached media\n\tif(tweet.entities && tweet.entities.media) {\n\t\tfor(var i = 0; i < tweet.extended_entities.media.length; i++) {\n\t\t\t// tweet.extended_entities contains more data than tweet.entities\n\t\t\t// included the media type\n\t\t \tvar m = tweet.extended_entities.media[i];\n\t\t\tif(m.type === 'photo') {\n\t\t\t\ttweet.text += '<img src=\"' + m.media_url.replace(\"http://\", \"https://\") + '\"></img>';\n\t\t\t} else if (m.type === 'animated_gif') {\n\t\t\t\t// Twitter GIF are actually MP4 videos\n\t\t\t\tvar video_url = m.video_info.variants[0].url;\n\t\t\t\ttweet.text += '<video src=\"' + video_url.replace(\"http://\", \"https://\") + '\" loop autoplay />';\n\t\t\t}\n\t\t}\n\t}\n\n\t// Formatted tweet\n\tvar tl = {\n\t\ttext: tweet.text,\n\t\ttime: tweet.timestamp_ms,\n\t\tuser: {\n\t\t\tname: tweet.user.name,\n\t\t\tscreen_name: tweet.user.screen_name,\n\t\t\timage: tweet.user.profile_image_url.replace(\"http://\", \"https://\")\n\t\t}\n\t};\n\n\tvar lowText = tl.text.toLowerCase();\n\n\t// Check if the tweet contains one of the battle's hashtag\n\t_.forEach(config.battle, function (hashtag) {\n\t\tif (lowText.indexOf(hashtag) !== -1) {\n\t\t\tonProcessed(hashtag, tl);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a6b33f90d11afaede3199d390fbca496", "score": "0.64150405", "text": "function onTweet(tweet) {\n // Reject the tweet if:\n // 1. it's flagged as a retweet\n // 2. it matches our regex rejection criteria\n // 3. it doesn't match our regex acceptance filter\n var regexReject = new RegExp(config.regexReject, 'i');\n var regexFilter = new RegExp(config.regexFilter, 'i');\n if (tweet.retweeted) {\n return;\n }\n if (config.regexReject !== '' && regexReject.test(tweet.text)) {\n return;\n }\n if (regexFilter.test(tweet.text)) {\n console.log(tweet);\n console.log(\"RT: \" + tweet.text);\n // Note we're using the id_str property since javascript is not accurate\n // for 64bit ints.\n tu.retweet({\n id: tweet.id_str\n }, onReTweet);\n }\n}", "title": "" }, { "docid": "2d7455dc846c288cae49d360252ab5dd", "score": "0.6374638", "text": "function Tweets(){\n grphoto.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n // console.log(tweets);\n for(var i = 0; i < 20; i++) {\n console.log(\"\\n============== Tweet \" + [i] + \" ======== \"+timeStamp+\" ======\\n\");\n console.log(tweets[i].text);\n console.log(\"Created At: \" + tweets[i].created_at);\n // console.log(tweets);\n\n\t \t\tfs.appendFile(\"log.txt\", \"\\n============== Tweet \" + [i] + \" ======== \"+timeStamp+\" ======\\n\"\n + tweets[i].text \n + \"\\nCreated At: \" + tweets[i].created_at \n + \"\\n\", function(err){\n if(err) \n throw err;});\n\n }\n }\n });\n }", "title": "" }, { "docid": "39841881b014258ca5046b1e9daed9fe", "score": "0.63619494", "text": "function gotData(err, data, response){\n console.log(data);\n for(i=0;i<data.statuses.length;i++){\n \n var tweet={\n status: '#MovieNews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com'\n }\n //console.log('#Movienews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com');\n //This posts tweets mentioned in tweet param.\n T.post('statuses/update', tweet,tweeted);\n }\n }", "title": "" }, { "docid": "e5f7f798be67be13c8d6641f1aae6ad4", "score": "0.6352154", "text": "function handleWriteTweet(event) {\n $('#tweet-editor').empty().append(renderTweetWriter());\n $('#send-tweet').on('click', handleSendTweet);\n $('#cancel-tweet').on('click', handleCancelTweet);\n}", "title": "" }, { "docid": "17bf280494c38291d133c3815abe09c6", "score": "0.6342136", "text": "function tweetedAt(eventMessage) {\n // Check to see if this is a tweet towards me.\n if (eventMessage.in_reply_to_screen_name === 'FoodGuruBot'){\n let incomingTweetIdStr = eventMessage.id_str;\n let screenName = eventMessage.user.screen_name;\n\n let tweetText = trimTweet(eventMessage.text);\n let commandObject = getCommandObject(tweetText);\n\n let messageText = generateMessageText(screenName, commandObject);\n\n sendTweet(incomingTweetIdStr, messageText);\n }\n}", "title": "" }, { "docid": "b27d55ea9699b629e103286e4fdee37c", "score": "0.6319069", "text": "function tweetNow(text, filePath) {\n \tbot.postMediaChunked({ file_path: filePath }, function (err, data, response) {\n \t\tif (err) {\n \t\tconsole.lol('ERRORDERP Reply', err)\n \t}\n \tconsole.log(data)\n \tvar mediaIdStr = data.media_id_string\n\n \tlet tweet = {\n\t\t\tstatus: text,\n\t\t\tmedia_ids: [mediaIdStr]\n\t\t}\n\n\t\tbot.post('statuses/update', tweet, (err, data, response) => {\n\t\t\tif (err) {\n\t\t\t \tconsole.lol('ERRORDERP Reply', err)\n\t\t\t}\n\t\t\tconsole.lol('SUCCESS: ', text)\n\t\t})\n\t})\n}", "title": "" }, { "docid": "794bda3e23fdf66422d95742c3da9a0f", "score": "0.6308352", "text": "function tweeted (err, reply) {\n if (err !== undefined) {\n console.log(err)\n } else {\n console.dir(reply)\n }\n}", "title": "" }, { "docid": "a793eb4d0c3b59b347dc40be5161061c", "score": "0.62935376", "text": "function postTweet(txt, id) {\n var tweet = {\n status: txt,\n in_reply_to_status_id: id,\n };\n\n // Post that tweet.\n T.post(\"statuses/update\", tweet, tweeted);\n\n // Function to make sure tweet was sent.\n function tweeted(err, reply) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Tweeted \" + reply.text);\n }\n }\n}", "title": "" }, { "docid": "1309d08c8b81652d07902abeb615d9fd", "score": "0.6259297", "text": "function tweet(text) {\n $(\".twitter-share-button\").attr(\"href\", \"https://twitter.com/intent/tweet?text=\" + text);\n }", "title": "" }, { "docid": "35682b3e682b5a4cc839f18b381d51f2", "score": "0.625014", "text": "function tweetFn(){\n\t// initialize twitter API keys\n\tvar client = new Twitter({\n\t\tconsumer_key: keysJS.twitterKeys.consumer_key,\n\t\tconsumer_secret: keysJS.twitterKeys.consumer_secret,\n\t\taccess_token_key: keysJS.twitterKeys.access_token_key,\n\t\taccess_token_secret: keysJS.twitterKeys.access_token_secret\n\t});\n\n\t// set twitter handle\n\tvar params = {screen_name: 'chezkevintam'};\n\n\t// get the last 20 tweets for given twitter handle\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n\t\tif (!error) {\n\t\t\tfor (var i = 0; i < 20; i++){\n\t\t\t\tconsole.log(tweets[i].created_at + \"\\n\");\n\t\t\t\tconsole.log(tweets[i].text)\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2fa0af8d4bb906b20ab394213344be51", "score": "0.624974", "text": "function sendTweetToProgrammer(tweet){\n if(!_.isEmpty(tweet.user.name)){\n var buf = new Buffer(158);\n buf.fill(0);\n buf.write(\"TWT\", 0, 3);\n buf.write(tweet.user.screen_name, 3,15);\n //console.log(tweet.user);\n buf.write(tweet.text,18,140);\n console.log(buf.toString());\n udp.send(buf, 0, buf.length, settings.ecue.port, settings.ecue.ipAddress);\n }\n\n}", "title": "" }, { "docid": "27a73d02a22977a9d1350c657d4b6985", "score": "0.62337863", "text": "function tweetJawn() {\n // Get the tweets\n var params = { screen_name: 'mmory' };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n tweets.forEach(function (uselessChatter) {\n var tweetString = \"\";\n var dateString = formatDate(uselessChatter.created_at);\n tweetString = \"On \" + dateString + \" \" + uselessChatter.user.name + \"(@\" + uselessChatter.user.screen_name + \") tweeted:\\n\";\n tweetString += uselessChatter.text + \"\\n\\n\";\n fs.appendFileSync(\"./log.txt\", tweetString)\n console.log(tweetString);\n })\n }\n else {\n console.log(error);\n }\n });\n\n}", "title": "" }, { "docid": "48672c4c209a79d75988e3a0584ea308", "score": "0.62202036", "text": "function postNewStatus(intent, session, response) {\n var speechOutput = \"Okay, I tweeted: \"\n var repromptText = \"\"\n var cardTitle = \"New Tweet\"\n var input = intent.slots.input.value\n // build url from intent slots, replace hashtags with percent encoded chars for url\n input = replaceHashtags(input, 'hashtag ', '%23')\n input = replaceHashtags(input, 'hash tag ', '%23')\n var url = 'https://api.twitter.com/1.1/statuses/update.json?status=' + input\n // need to sanitize/format tweet input and append #AlexaTwitter\n speechOutput += \"\\\"\" + input + \"for you. Is there anything else you want to do on Twitter?\"\n speechOutput = replaceHashtags(speechOutput, '%23', '#')\n\n postStatus(url, response, function (data, res) {\n // store id of tweet in session so user can cancel\n session.attributes.tweet = data.id_str\n console.log(data)\n\n response.askWithCard(speechOutput, repromptText, cardTitle, speechOutput)\n })\n}", "title": "" }, { "docid": "254976945fa116f37e854ece2dc98d70", "score": "0.6216291", "text": "function onSend(){\n completed += 1;\n if(completed === stat.length){\n if(typeof callback === 'function'){\n callback();\n }\n }\n }", "title": "" }, { "docid": "db701c183734bfa3ef441ecb1fe9d299", "score": "0.6194006", "text": "function GenTweet() {\n\n}", "title": "" }, { "docid": "c94f2ef5a3dd73c32786c308c6e9a631", "score": "0.61876", "text": "function tweetEvent(eventMsg) {\n console.log('event: mention_occurred');\n \n var json = JSON.stringify(eventMsg, null, 2);\n fs.writeFile('tweet.json', json);\n \n var replyTo;\n \n // if tweet event was a direct reply ('@twitbot_testbed ....')\n if (eventMsg.in_reply_to_screen_name != null)\n replyTo = eventMsg.in_reply_to_screen_name;\n // this covers tweets that start with text first ('... @twitbot_testbed')\n else if (eventMsg.in_reply_to_screen_name == null && \n eventMsg.entities.user_mentions.length == 1)\n replyTo = eventMsg.entities.user_mentions[0].screen_name;\n \n var text = eventMsg.text;\n var from = eventMsg.user.screen_name;\n \n if (replyTo === 'twitbot_testbed') {\n newTweet = 'Hey @' + from + ', here is your unique RoboHash gravatar!';\n \n // download RoboHash unique image with from's handle\n var beginningURL = 'https://robohash.org/set_set1/bgset_bg1/',\n endingURL = '?size=500x500',\n usersURL = beginningURL + from + endingURL;\n \n const options = {\n url: usersURL,\n dest: 'pics/RoboHash.png'\n }\n \n download.image(options)\n .then(({ filename, image }) => {\n console.log('File saved to', filename);\n tweet(newTweet);\n }).catch((err) => {\n throw err\n });\n }\n}", "title": "" }, { "docid": "e9e377914f10f215ff6442adb35a56aa", "score": "0.6182231", "text": "function myTweets() {\n const Twitter = require('twitter');\n // console.log(JSON.stringify(keys.twitter));\n var client = new Twitter(keys.twitter);\n var params = {\n screen_name: 'honestgraphics1'\n };\n client.get('statuses/user_timeline', params,\n function (error, tweets, response) {\n if (!error) {\n for (let tweetNum = 0; tweetNum < 20; tweetNum++) {\n if (tweets[tweetNum] === undefined) {\n break;\n }\n console.log(tweets[tweetNum].created_at + ': ' + tweets[tweetNum].text);\n\n // sends data to log.txt file\n var data = {\n Time: tweets[tweetNum].created_at,\n Tweets: tweets[tweetNum].text\n \n }\n logCommand(JSON.stringify(data));\n }\n // console.log(tweets);\n } else {\n // console.log(error);\n }\n });\n // console.log(\"working\");\n}", "title": "" }, { "docid": "2100f5278e3854c114c3802a9bc03e62", "score": "0.61459625", "text": "function shareTweet() {\n var quoteToTweet = quotes[currentIndex].quote;\n\n // Cuts the string if length is greater than 100.\n if(quoteToTweet.length > 100) {\n quoteToTweet = quoteToTweet.substr(0,100).match(/(^.+)(\\s)/)[0] + \"...\";\n\n }\n quoteToTweet = encodeURI(\"\\\"\" + quoteToTweet);\n window.open(\"https://twitter.com/intent/tweet?text=\" + quoteToTweet + \"\\\"\");\n}", "title": "" }, { "docid": "4738b89c551aba568065f09d77890cca", "score": "0.6127287", "text": "function postTweet(user, message, url) {\n $.post(tweetsUrl, {\n userId: user.id,\n message: message\n }).done(function(data) {\n var html = renderThread(user, data.message, data.id);\n $('#tweets').append(html);\n });\n }", "title": "" }, { "docid": "da8ad87c13c23335c4fffbf99febcc12", "score": "0.6126531", "text": "function postTweet(message) {\n console.log(`🐦: ${message}`);\n}", "title": "" }, { "docid": "b1e34b949e7049ddfc2187d07b40160b", "score": "0.6106121", "text": "function pressStart(tweet) {\n const id = tweet.id_str;\n const text = tweet.text;\n // this gives username of person who twitted and mentioned you\n const name = tweet.user.screen_name;\n\n // this regex search for word 'please' to activate the bot \n let regex1 = /(congrats)/gi;\n const check1 = text.match(regex1) || [];\n const check2 = check1.length > 0;\n \n if(check2==true && text.includes(twtusername)){\n const reply = ('@'+ name + repliesArray[Math.floor(Math.random() * repliesArray.length)]);\n // this👇 is used to post the tweet \n T.post('statuses/update', { status:reply, in_reply_to_status_id: id});\n\n } else {\n config.log(':|');\n };\n}", "title": "" }, { "docid": "5c18245b4975f8ea88731007d9da50b5", "score": "0.6101803", "text": "function tweetAfterMatchEnds(text) {\n //create a tweet\n var tweet = {\n status: text\n };\n //post the tweet\n Twitter.post('statuses/update', tweet, function (err, data, response) {\n if (err) {\n console.log(\"Error: \" + err.text);\n } else {\n console.log(\"Success: \" + text);\n }\n });\n}", "title": "" }, { "docid": "fadad2583014417f7ba4742c0afa7cbe", "score": "0.6098415", "text": "function tweet() {\n let tweetQuotetxt = qoute.innerText;\n let author = Author.innerText;\n const tweetUrl = `https://twitter.com/intent/tweet?text=${tweetQuotetxt} by ${author}`;\n window.open(tweetUrl, '_blank');\n}", "title": "" }, { "docid": "da2e85bb9892d64168de06a169aab418", "score": "0.6095912", "text": "function retweet(id, callback){\n // output of callback is transferred to caller of this function.\n twitter.post('statuses/retweet/:id', { id: id }, callback);\n }", "title": "" }, { "docid": "75aab17c35fb75a1342314aadbb9a468", "score": "0.6083421", "text": "function myTweets(){\n var sName = {screen_name: 'CBmoate'}\n client.get('statuses/user_timeline', sName, function(error, tweet, response){\n if(error) throw error;\n for (var i = 0; i < 20; i++) {\n console.log(tweet[i].text);\n fs.appendFile(\"log.txt\", \"\\n\" + tweet[i].text + \"\\n\");\n console.log(\"Tweeted on: \" + tweet[i].created_at + \"\\n\");\n fs.appendFile(\"log.txt\", \"Tweeted on: \" + tweet[i].created_at + \"\\n\")\n }\n });\n}", "title": "" }, { "docid": "c3bdb3986af750b95f48d5697abde9c9", "score": "0.6075262", "text": "function tweetIt(txt) {\n var very = 0;\n var tweet = {status:txt};\n TEST_DIR = \"./Pics/\";\n items = [];\n fse.walk(TEST_DIR).on(\"readable\", function() {\n for (var a;a = this.read();) {\n items.push(a.path);\n }\n }).on(\"end\", function() {\n items.shift();\n console.log(items);\n if (items.length > 0) {\n var uploaded = function(err, data, response) {\n var id = data.media_id_string;\n var tweet = {status:\"#ecchiforthelife \" + weekday, media_ids:[id]};\n console.log(tweet);\n T.post(\"statuses/update\", tweet, tweeted);\n };\n var filename = items[Math.floor(Math.random() * items.length)];\n console.log(filename);\n var params = {encoding:\"base64\"};\n var b64 = fs.readFileSync(filename, params);\n T.post(\"media/upload\", {media_data:b64}, uploaded);\n fse.remove(filename, function(err) {\n if (err) {\n return console.error(err);\n }\n console.log(\"success!\");\n if (items.length == 10) {\n T.post(\"statuses/update\", {status:\"Your text\"}, function(err, data, response) {\n });\n } else {\n console.log(\"Number of pics \" + items.length);\n }\n });\n } else {\n if (very == 0) {\n console.log(\"No pics\");\n T.post(\"statuses/update\", {status:\"Your text\"}, tweeted);\n T.post(\"statuses/update\", {status:\"Your text\"}, tweeted);\n } else {\n console.log(\"I think the bot have no pics\");\n }\n very = +1;\n }\n });\n}", "title": "" }, { "docid": "d82144af5703cf699031f701377ecfbf", "score": "0.60721993", "text": "function postTweet(user, message) {\n $.post(tweetsUrl, {\n userId: user.id,\n message: message\n })\n .then(function(data) {\n var thread = template.renderThread(user, data.message, null);\n $('#tweets').append(thread);\n })\n .fail(function (xhr) {\n console.log(xhr.status);\n });\n }", "title": "" }, { "docid": "accaa6f41e532c37831ed48376636574", "score": "0.60670847", "text": "function instructionsTweet(tweetObj) {\n\tconst name = tweetObj.user.screen_name;\n\tconst instructionMessage = `I can make you a nice gradient! Just @ me with two (2) hex codes ${responses.emoji[`${randomNum(responses.emoji.length)}`]}`;\n\tconst tweet = {\n\t\tstatus: `@${name} ${instructionMessage}`\n\t};\n\n\tT.post('statuses/update', tweet, tweeted);\n\n\t// Callback for when tweet is sent.\n\tfunction tweeted(err, data, response) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\tconsole.log( 'Instructions sent.' );\n\t\t}\n\t} // end tweeted\n}", "title": "" }, { "docid": "05b12713167fb8a70992b6de48877c59", "score": "0.60644704", "text": "function BotInit() {\n BotRetweet();\n}", "title": "" }, { "docid": "d550535802b35481514f5fac15f2ad8b", "score": "0.6064172", "text": "async function handleSendTweet(event) {\n const result = await axios({\n method: 'post',\n url: base_url,\n withCredentials: true,\n data: {\n body: $('#written-tweet').val(),\n }\n });\n handleCancelTweet();\n location.reload();\n}", "title": "" }, { "docid": "31ad97c491269ae2341320c9c5d8f5e4", "score": "0.60615325", "text": "function postFlyActionWithTwitterCallback(data){\n\t console.log(data);\n if (\"error\" in data){\n alert(data.error);\n }\n else{\n posts()[data.array_index].fly_counter(posts()[data.array_index].fly_counter() + 1);\n }\n }", "title": "" }, { "docid": "6f05c776c36e46965d4e14a24c30d3f1", "score": "0.60564494", "text": "function tweet(text) {\n console.log('event: creating_reply_to_mention');\n \n var newTweet = text;\n \n // info needed to upload RoboHash image\n var filename = 'pics/RoboHash.png';\n var params = {\n encoding: 'base64'\n }\n\n var b64content = fs.readFileSync(filename, params);\n\n // uploading RoboHash image\n T.post('media/upload', { media: b64content }, uploaded);\n \n function uploaded(err, data, response) {\n var idStr = data.media_id_string;\n var tweet = {\n status: newTweet,\n media_ids: [idStr]\n }\n\n T.post('statuses/update', tweet, tweeted);\n }\n\n function tweeted(err, data, response) {\n if (err)\n console.log(err);\n if (data)\n console.log('event: tweet_with_image_successful');\n }\n}", "title": "" }, { "docid": "0189a529fac4c7781a2388d55c85abb3", "score": "0.6041756", "text": "function tweetFunction () {\r\n let quoteString = quote.innerText;\r\n let authorString = author.innerText;\r\n let tweetUrl = `https://twitter.com/intent/tweet?text=\"${quoteString}\" - ${authorString}`;\r\n\r\n // Creates the tweet in a new window\r\n window.open(tweetUrl, '_blank');\r\n}", "title": "" }, { "docid": "32ae68bfabe355d4168f0180949c5d7a", "score": "0.6040057", "text": "function postStatus(url, response, callback) {\n var oauth = oauthInit()\n var body = null\n\n oauth.post(\n url,\n userToken,\n userSecret,\n body,\n // error, data, response\n function(err, data, res) {\n var speechOutput = \"\"\n var repromptText = \"\"\n\n if(err) {\n console.log(err)\n var error = JSON.parse(err.data)\n console.log(error)\n // tweet not found/doesn't exist/stored improperly(hopefully not)\n if(error.errors[0].code === '34') {\n speechOutput = \"Sorry, I couldn't find the tweet you were looking for. Is there something else I can help you with?\"\n response.ask(speechOutput, repromptText)\n }\n // commented out because successful unfollow requests still throw an authentication error\n // wtf twitter\n /*if(error.errors[0].code === '32') {\n speechOutput = \"There was a problem authenticating with twitter.\"\n response.tell(speechOutput)\n }*/\n // other errors\n speechOutput = \"Sorry, there was an error communicating with Twitter.\"\n response.tell(speechOutput)\n }\n data = JSON.parse(data)\n console.log(data)\n\n callback(data, res)\n }\n )\n}", "title": "" }, { "docid": "d0ad8769185b06779c77e275e047a53b", "score": "0.6038352", "text": "function tweeting() {\n\t//The next command envokes the twitter api keys, parses out the timeline and passes into a function that pulls 20 tweets\n\ttwitterKeys.get('statuses/user_timeline', params, function(error, tweets, response){\n\t\t\tfor(i = 0; i < tweets.length; i++) { //passes each of the 20 or less tweets into a variable\n\t \t\tconsole.log(\"------------------------------------------------------------\");//displays the tweets in the console\n\t \tconsole.log(\"Today's tweet: \" + tweets[i].text);\n\t \tconsole.log(\"-\")\n\t \tconsole.log(\"At about: \" + tweets[i].created_at);\n\t \tconsole.log(\"------------------------------------------------------------\");\n\t \t\t\n\t \tfs.appendFile(\"log.txt\", \"\\nToday's tweet: \" + tweets[i].text + \"\\n\" + \"\\nat about: \" \n\t \t\t\t+ tweets[i].created_at + \"\\n--------------------------------------\", \n\t \t\t\tfunction(err) {\t//pushes the tweets to a txt file\n\t \t\t\t\tif (err) {\t//longs an error if there is one\n\t \t\t\t\t\treturn console.log('Error occured: ' + err);\n\t \t\t\t\t}\n\t \t\t\t\t});\n\t }\n\t});\n}", "title": "" }, { "docid": "026fca8644b6659f25d74d576e893e5c", "score": "0.60336214", "text": "function MyTwitter() {\n var self = this;\n self.client = client;\n\n // main functions\n self.printRecentTweets = function (count, cb) {\n // this method will get the past X number of tweets where\n // x will be equal to count\n client.get('statuses/home_timeline', {\n count: count\n }, function (error, tweets, response) {\n if (!error) {\n self.prettyPrintTweets(tweets);\n } else {\n console.log(error);\n }\n if (cb) {\n cb(error, tweets);\n }\n });\n }\n self.prettyPrintTweets = function (tweets) {\n // this will log the tweets in a nice format\n console.log('\\n\\n');\n console.log('Tweet Timeline, Past ' + tweets.length + ' tweets.');\n console.log('----------------------------------------------------------------------------------');\n for (var i = 0; i < tweets.length; i++) {\n console.log(tweets[i].text);\n console.log('@' + tweets[i].user.screen_name);\n console.log('Tweeted at: ' + tweets[i].created_at);\n console.log('Retweet Count: ' + tweets[i].retweet_count);\n console.log('__________________________________________________________________________________');\n }\n }\n self.tweet = function (message, cb) {\n // this will tweet whatever the message is to the user that is authenticated aka me.\n client.post('statuses/update', {\n status: message\n }, function (error, tweet, response) {\n // tweet - Tweet body.\n // response - Raw response object.\n if (cb) {\n cb(error, tweet);\n }\n });\n }\n // end main functions\n}", "title": "" }, { "docid": "1e06fded59b99c9d8f582734357dc0f9", "score": "0.60312676", "text": "function sendQuote(){\n\tvar quote = messages.quote();\n\tconsole.log(quote);\n\ttweetIt(quote);\n}", "title": "" }, { "docid": "d246f02fbae0d01b37bd66db9aed1f8a", "score": "0.60163915", "text": "function deleteTweet (e) {\n client.post('statuses/destroy', {id: e}, function(error, tweet, response){\n if(error) console.log(error);\n });\n}", "title": "" }, { "docid": "2040f3d1a0286e0ebb3ce23c81da4cca", "score": "0.600888", "text": "function myTweets(){\n\tif (commands === \"my-tweets\") {\n\t\n\t//create a twitter client to authenicate my twitter account\n\tvar client = new Twitter(tweetKeys);\n\n\t//the person whose tweets you want to search\n\tvar params = {screen_name: 'AmazingSpeciali'};\n\n\t//get the tweets from the user timeline\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n \tif (!error) {\n //console.log(tweets);\n for(var i =0 ; i<tweets.length; i++){\n \tconsole.log(JSON.stringify(tweets[i].text, null, 2));\n \tconsole.log(JSON.stringify(tweets[i].created_at, null, 2));\n }//end of for loop\n\n \t}//end of if error statemnt\n\t});//end of get ajax call to twitter api\n \n }//end of entire if command\n\n}//end of function", "title": "" }, { "docid": "5a767d35034b2801a4967c9176b23d69", "score": "0.59943736", "text": "function submited() {\n var text = $(\"#input-tweetField\").val();\n\n //Text must be less than 200 characters\n if (text.length > 200) {\n window.alert(\"Over 200\");\n }\n\n //Must start with a hashtag\n else if (text[0] != \"#\" || text.length == 0) {\n $(\"#hashtagError\").show();\n $(\"#input-tweetField\").addClass(\"red accent-3\");\n $(\"#input-tweetField\").fadeOut(\"fast\", function() {\n $(this).removeClass(\"red accent-1\").fadeIn(\"fast\", function() {\n $(this).css({\n opacity: 1.0\n })\n });\n });\n }\n\n //Calls post()\n else {\n post(text);\n $(\"#input-tweetField\").val(\"\");\n $(\"#hashtagError\").hide();\n }\n\n //Resets character counter\n $(\"#charCount\").html((200 - $(\"#input-tweetField\").val().length).toString() + \" characters left\");\n $(\"#input-tweetField\").focus();\n }", "title": "" }, { "docid": "118d8e84d7f9c9241f4ac230e96fb071", "score": "0.5988815", "text": "function myTweets(){\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n var twitTxt = \"\";\n for(i in tweets){\n if(i <= 20){\n console.log(tweets[i].text);\n twitTxt += tweets[i].text + \"\\n\";\n console.log(tweets[i].created_at);\n twitTxt += tweets[i].created_at + \"\\n\";\n \n } else {\n break;\n }\n }\n fs.appendFile('log.txt', twitTxt, (err) => {\n if(err) throw err;\n console.log('The File has been saved!');\n });\n }\n if(error){\n throw error;\n }\n })\n}", "title": "" }, { "docid": "6e2d39bdfd83fe5efae7e0068b5b1390", "score": "0.59873164", "text": "function tweets() {\n\n var keys = require('./keys.js');\n var client = new twitter(keys.twitterKeys);\n var paramaters = {\n screen_name: 'davimatos',\n count: 20\n };\n\n client.get('statuses/user_timeline', function(error, tweets, response) {\n if (error) {\n console.log(err);\n }\n var twitterData = [];\n for (var i = 0; i < tweets.length; i++) {\n twitterData.push({\n 'Date': tweets[i].created_at,\n 'Update': tweets[i].text\n })\n }\n console.log(twitterData);\n writeTextFile(twitterData);\n })\n}", "title": "" }, { "docid": "f4e19912f533cc19dce5d8cfdbc60695", "score": "0.5984192", "text": "function handleNewTweet(event) {\n event.preventDefault();\n const $form = $(this);\n const formText = $form.find(\"textarea\").val();\n if (validateTweet(formText)) {\n $.ajax({\n type: \"POST\",\n url: \"/tweets\",\n data: $form.serialize()\n })\n .done($form[0].reset())\n .done(loadTweets)\n .done($(\".counter\").text(\"140\"));\n }\n }", "title": "" }, { "docid": "989666f3f54573e463fa232a1a09c759", "score": "0.59831774", "text": "function myTweets() {\n var params = {screen_name: 'jschneid94'};\n twitter.get('statuses/user_timeline', params, function(error, tweets) {\n if (!error) {\n for (var i = 0; i < 20; i++) {\n // If there are less than 20 tweets, stop the for loop\n if (tweets[i] === undefined) { \n break; \n }\n var post = tweets[i];\n var output = \"\\nTweet: \" \n + post.text \n + \"\\nPosted On: \" \n + post.created_at \n + \"\\n-----------------\";\n console.log(output);\n outputLog(output);\n }\n }\n });\n}", "title": "" }, { "docid": "9ac758378e30759f2cb4bce3cd370af8", "score": "0.59815645", "text": "function post(text) {\n var key = \"\";\n var here = 0;\n while (text[here] != \" \" && here < text.length) {\n key += text[here];\n here++;\n }\n text = text.replace(key, \"\");\n angular.element($('#conId')).scope().postTweet(text, key);\n angular.element($('#conId')).scope().$apply();\n\n }", "title": "" }, { "docid": "e76349131f9ed09daaf078f4f1a5fd4c", "score": "0.5954557", "text": "function followed(event) {\n var randomNumber=Math.floor(Math.random()*100);\n var name = event.source.name;\n var screenName = event.source.screen_name;\n tweetPost('Thank you for liking my tweet : ' + name + '@' + screenName + ' #BotPrabin' + randomNumber);\n}", "title": "" }, { "docid": "4565e678cb630b7a5c1cdcc817b7672b", "score": "0.59514475", "text": "function twitterFunc(){\n\n\t//limits response to most recent 20 tweets\n\tvar params = {count: 20};\n\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n\t\tif (error) {\n\t\t return console.log('Error occurred: ' + error);\n\t\t}\n\t\telse{\n\t\t\t//console logs tweets and tweet timestamps\n\t\t\tfor(i=0;i<tweets.length;i++){\n\t\t\t console.log(\"Tweet #\"+ (tweets.length - i) + \" ---- \" + tweets[i].text + \" ----Tweeted at---- \" + tweets[i].created_at);\n\t\t\t}\t\t\n\t\t}\n\t});\n}", "title": "" } ]
36a93fac3295439031d6fcb94876635e
Returns the 'hasDirectText' status of all PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode. A PageElement's 'hasDirectText' status is set to true if its actual direct text equals the expected direct text. A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
[ { "docid": "8bd9d18c743da2a5ae694976973698f8", "score": "0.75014174", "text": "getHasDirectText(directTexts) {\n return this.eachCompare(isIElementNode, ({ node, expected }) => node.getHasDirectText(expected), directTexts);\n }", "title": "" } ]
[ { "docid": "696b15628cf4cdca347e187b7b6aa94a", "score": "0.7559167", "text": "getHasDirectText(directTexts) {\n return this._node.eachCompare(isIElementNode, ({ node, expected }) => node.currently.getHasDirectText(expected), directTexts);\n }", "title": "" }, { "docid": "174b3947db539043c04ae27eb4f23c77", "score": "0.7335141", "text": "hasDirectText(directTexts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.hasDirectText(expected), directTexts);\n }", "title": "" }, { "docid": "af373ad13322c5464890310f30c83dde", "score": "0.7289774", "text": "hasDirectText(directTexts, opts) {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.hasDirectText(expected, opts), directTexts);\n }", "title": "" }, { "docid": "8b91852ee41742f74aec8fe7bfc91bcf", "score": "0.7058484", "text": "hasDirectText(directTexts, opts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.eventually.hasDirectText(expected, opts), directTexts);\n }", "title": "" }, { "docid": "d27fcd237ec557139f593e240264c2fd", "score": "0.703621", "text": "containsDirectText(directTexts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.containsDirectText(expected), directTexts);\n }", "title": "" }, { "docid": "268775f367f6e3ccf23daed5fda42fba", "score": "0.70270026", "text": "getContainsDirectText(directTexts) {\n return this._node.eachCompare(isIElementNode, ({ node, expected }) => node.currently.getContainsDirectText(expected), directTexts);\n }", "title": "" }, { "docid": "18e7c790efe14f335f4aa9e7f3691ecc", "score": "0.6950242", "text": "getContainsDirectText(directTexts) {\n return this.eachCompare(isIElementNode, ({ node, expected }) => node.getContainsDirectText(expected), directTexts);\n }", "title": "" }, { "docid": "e1a6ff6df59b06ac8a3775a620adc702", "score": "0.6832004", "text": "containsDirectText(directTexts, opts) {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.containsDirectText(expected, opts), directTexts);\n }", "title": "" }, { "docid": "349415006503dc44a0fcecee891bde61", "score": "0.663648", "text": "containsDirectText(directTexts, opts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.eventually.containsDirectText(expected, opts), directTexts);\n }", "title": "" }, { "docid": "308e3ae31003a9ac9d06eea1be3ebe56", "score": "0.6165578", "text": "hasAnyDirectText(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.hasAnyDirectText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n }", "title": "" }, { "docid": "d43256a7b2f726b4b5ef3140a6aa6322", "score": "0.61308867", "text": "getHasText(texts) {\n return this._node.eachCompare(isIElementNode, ({ node, expected }) => node.currently.getHasText(expected), texts);\n }", "title": "" }, { "docid": "4c9302804600b43dd91b9a4ad9bbcfa8", "score": "0.5990013", "text": "getHasText(texts) {\n return this.eachCompare(isIElementNode, ({ node, expected }) => node.getHasText(expected), texts);\n }", "title": "" }, { "docid": "956b6579b7481c139d82a7867eb6e8de", "score": "0.5865393", "text": "getHasAnyDirectText(filterMask) {\n return this._node.eachCompare(isIElementNode, ({ node, filter }) => node.currently.getHasAnyDirectText(filter), filterMask, true);\n }", "title": "" }, { "docid": "149b5dd5106f423788d56236ca245354", "score": "0.58515817", "text": "hasAnyDirectText(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.eventually.hasAnyDirectText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n }", "title": "" }, { "docid": "65c363becc0ba618063af2856ee08bdc", "score": "0.58073974", "text": "hasText(texts, opts) {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.hasText(expected, opts), texts);\n }", "title": "" }, { "docid": "ef187b1ece0ed6494ae92f29a3e82863", "score": "0.5757715", "text": "hasText(texts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.hasText(expected), texts);\n }", "title": "" }, { "docid": "c5ab7c2ba912c71018465b5ebea32f15", "score": "0.5744974", "text": "getHasAnyDirectText(filterMask) {\n return this.eachCompare(isIElementNode, ({ node, filter }) => node.getHasAnyDirectText(filter), filterMask, true);\n }", "title": "" }, { "docid": "d691ee65907a4ff10867c854e1f11570", "score": "0.5689765", "text": "hasAnyDirectText(filterMask) {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.hasAnyDirectText(filter), filterMask, true);\n }", "title": "" }, { "docid": "59579ae0ceaa314eb3b7eb667a1b82dc", "score": "0.56044656", "text": "hasTextElements() {\n return this.m_textElementGroups.count() > 0;\n }", "title": "" }, { "docid": "02418ed3cc35615d0b74502d8e9c06c2", "score": "0.55614656", "text": "hasText(texts, opts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.eventually.hasText(expected, opts), texts);\n }", "title": "" }, { "docid": "31359eccc929a9fbf7caaf6214ef7f00", "score": "0.5529597", "text": "getContainsText(texts) {\n return this._node.eachCompare(isIElementNode, ({ node, expected }) => node.currently.getContainsText(expected), texts);\n }", "title": "" }, { "docid": "65e5e0730c4981314d50683a2c86816a", "score": "0.5449052", "text": "containsText(texts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.containsText(expected), texts);\n }", "title": "" }, { "docid": "ae72bc448ceaa844d6fd745788366f39", "score": "0.54130095", "text": "containsText(texts, opts) {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.containsText(expected, opts), texts);\n }", "title": "" }, { "docid": "c06894138489913004d5eb1612990432", "score": "0.5382274", "text": "getContainsText(texts) {\n return this.eachCompare(isIElementNode, ({ node, expected }) => node.getContainsText(expected), texts);\n }", "title": "" }, { "docid": "be92620c50cd3864c43346fd483bbcf8", "score": "0.5184342", "text": "isTextVisible() {\n let rv = true;\n if (this.attachToSelector) {\n return true;\n }\n this.textBlocks.forEach((block) => {\n if (block.text.x < 0 || block.text.y < 0) {\n rv = false;\n }\n });\n return rv;\n }", "title": "" }, { "docid": "7cc04d1384286fc29228d1eacb4b64a5", "score": "0.5151172", "text": "containsText(texts, opts) {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.eventually.containsText(expected, opts), texts);\n }", "title": "" }, { "docid": "8691591e432c924b04827d49788a3e54", "score": "0.50578785", "text": "function getStatusText( node ) {\n\n\t\t\tvar text = '';\n\n\t\t\t// Text node\n\t\t\tif( node.nodeType === 3 ) {\n\t\t\t\ttext += node.textContent;\n\t\t\t}\n\t\t\t// Element node\n\t\t\telse if( node.nodeType === 1 ) {\n\n\t\t\t\tvar isAriaHidden = node.getAttribute( 'aria-hidden' );\n\t\t\t\tvar isDisplayHidden = window.getComputedStyle( node )['display'] === 'none';\n\t\t\t\tif( isAriaHidden !== 'true' && !isDisplayHidden ) {\n\n\t\t\t\t\ttoArray( node.childNodes ).forEach( function( child ) {\n\t\t\t\t\t\ttext += getStatusText( child );\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn text;\n\n\t\t}", "title": "" }, { "docid": "02a84a4e1b015e8462dad6a310f7397f", "score": "0.5036524", "text": "hasAnyText(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.hasAnyText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n }", "title": "" }, { "docid": "cf68e5d01922deb3e5e9be84971cc696", "score": "0.49833158", "text": "getHasAnyText(filterMask) {\n return this._node.eachCompare(isIElementNode, ({ node, filter }) => node.currently.getHasAnyText(filter), filterMask, true);\n }", "title": "" }, { "docid": "8ef9592279f9cf7d51a7fb231045918a", "score": "0.488161", "text": "getHasAnyText(filterMask) {\n return this.eachCompare(isIElementNode, ({ node, filter }) => node.getHasAnyText(filter), filterMask, true);\n }", "title": "" }, { "docid": "f6f16c28b6ba46f2fa7dd13b417dc54c", "score": "0.4879282", "text": "getDirectText(filterMask) {\n return this._node.eachGet(isIElementNode, ({ node, filter }) => node.currently.getDirectText(filter), filterMask);\n }", "title": "" }, { "docid": "2a39f9bf46def7b1be2e579aa7bf5704", "score": "0.48236835", "text": "function checkHomePageElementsTextLink(homePageElements) {\n for (x in homePageElements) {\n var currentHomePageElements = homePageElements[x];\n if (currentHomePageElements.text != '' && currentHomePageElements.link != '') {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n browser.expect.element(currentHomePageElements.element).text.to.contain(currentHomePageElements.text);\n browser.expect.element(currentHomePageElements.element).to.have.attribute('href').which.contains(currentHomePageElements.link);\n } else if (currentHomePageElements.text != '' && currentHomePageElements.link == '') {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n browser.expect.element(currentHomePageElements.element).text.to.contain(currentHomePageElements.text);\n } else {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n }\n }\n }", "title": "" }, { "docid": "2a39f9bf46def7b1be2e579aa7bf5704", "score": "0.48236835", "text": "function checkHomePageElementsTextLink(homePageElements) {\n for (x in homePageElements) {\n var currentHomePageElements = homePageElements[x];\n if (currentHomePageElements.text != '' && currentHomePageElements.link != '') {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n browser.expect.element(currentHomePageElements.element).text.to.contain(currentHomePageElements.text);\n browser.expect.element(currentHomePageElements.element).to.have.attribute('href').which.contains(currentHomePageElements.link);\n } else if (currentHomePageElements.text != '' && currentHomePageElements.link == '') {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n browser.expect.element(currentHomePageElements.element).text.to.contain(currentHomePageElements.text);\n } else {\n browser.expect.element(currentHomePageElements.element).to.be.present;\n browser.expect.element(currentHomePageElements.element).to.be.visible;\n }\n }\n }", "title": "" }, { "docid": "245a86d04ea0e22e68ce9bef8d210911", "score": "0.4808827", "text": "getDirectText(filterMask) {\n return this.eachGet(isIElementNode, ({ node, filter }) => node.getDirectText(filter), filterMask);\n }", "title": "" }, { "docid": "4c30598da8edca25fb8601d3a9afd681", "score": "0.4804192", "text": "function waitForText(elementFinder) {\n return function () {\n return elementFinder.getAttribute(\"value\").then(function(text) {\n// console.log(\"text = \" + text);\n return text !== \"\"; // could also be replaced with \"return !!text;\"\n });\n };\n}", "title": "" }, { "docid": "4c30598da8edca25fb8601d3a9afd681", "score": "0.4804192", "text": "function waitForText(elementFinder) {\n return function () {\n return elementFinder.getAttribute(\"value\").then(function(text) {\n// console.log(\"text = \" + text);\n return text !== \"\"; // could also be replaced with \"return !!text;\"\n });\n };\n}", "title": "" }, { "docid": "ccff04360f721ca9bfe70606288bf24c", "score": "0.479863", "text": "formatTextBeforeFirstChild() {\n // After all the children have been evaluated, check for text before the first child.\n let elInnerHTML = this.el.innerHTML;\n let firstChildIndex = elInnerHTML.indexOf(\"<\");\n this.textBeforeChild = firstChildIndex > -1 ? elInnerHTML.substring(0, firstChildIndex) : elInnerHTML;\n\n // Save the previously evaluated string to add back later\n let stringAfterText = firstChildIndex > -1 ? elInnerHTML.substring(firstChildIndex) : \"\";\n\n if (this.textBeforeChild.trim().length > 0) {\n let words = this.textBeforeChild.trim().split(\" \");\n\n if (words.length + this.previousWordCount === this.options.wordCount) {\n // Prevent entire element from wrapping\n\n if (this.options.inlineStyles) {\n this.el.setAttribute(\"style\", nowrapCSS);\n }\n\n if (this.options.className.length) {\n this.el.classList.add(this.options.className);\n }\n\n // console.log(\"Text and children exactly equal word count \\n\", this.el.outerHTML.replace(/\\r?\\n|\\r/g,\" \"));\n return true;\n }\n else if (words.length + this.previousWordCount >= this.options.wordCount) {\n // Get number of additional words needed\n let wordsNeeded = this.options.wordCount - this.previousWordCount;\n\n // Split string into two parts\n let leftoverText = getLeadingSpace(this.textBeforeChild) + words.splice(0, words.length - wordsNeeded).join(\" \");\n let textToWrap = words.join(\" \") + getTrailingSpace(this.textBeforeChild);\n\n // Update target element HTML\n this.el.innerHTML = leftoverText + wrapString(textToWrap + stringAfterText, this.options);\n // console.log(\"Text and string have more than enough words \\n\", this.el.outerHTML.replace(/\\r?\\n|\\r/g,\" \"));\n return true;\n }\n }\n }", "title": "" }, { "docid": "79e7b0a37319c95ce3d9015a80014c19", "score": "0.47748914", "text": "function collectTextNodes(element, texts) {\n for (var child = element.firstChild; child !== null; child = child.nextSibling) {\n if (child.nodeType === 3)\n texts.push(child);\n else if (child.nodeType === 1)\n collectTextNodes(child, texts);\n }\n}", "title": "" }, { "docid": "aafd78e73de0ecdb1e28f35a9da5cb81", "score": "0.47744507", "text": "async function goToText() {\n var searchText = document.getElementById(\"searchtext\").value\n searchText.replace(/\\s+/g, '');\n var currentPage = myState.currentPage\n if(searchText) {\n console.log(searchText, currentPage)\n }\n searchText = searchText.toLowerCase()\n var maxPages = myState.pdf._pdfInfo.numPages;\n var countPromises = []; // collecting all page promises\n var pageNum = currentPage;\n for (var j = parseInt(currentPage) + 1; j <= maxPages; j++) {\n var page = await myState.pdf.getPage(j);\n\n var txt = \"\";\n var textContent = await page.getTextContent();\n textContent = textContent.items.map(function (s) { return s.str; }).join('').toLowerCase(); // value page text\n if (textContent.includes(searchText)) {\n // console.log(textContent)\n // console.log(searchText + \" -----> \" + j)\n pageNum = j;\n break;\n }\n }\n myState.currentPage = pageNum\n document.getElementById(\"current_page\").value = pageNum\n render(myState)\n}", "title": "" }, { "docid": "bf98382eba638ecef22e3504f1abd943", "score": "0.47688997", "text": "verifyPageHeader(expectedText) {\n this.pageHeaderText.waitForVisible();\n const actualText = this.pageHeaderText.getText();\n expect(expectedText).equal(actualText);\n }", "title": "" }, { "docid": "6d1d030edd043b52c6a6f89a497185a8", "score": "0.47654095", "text": "function hasTextExcludingChildren(element){\n\t\t//Loop through the child nodes of this element looking for text\n\t\tvar l = element.childNodes.length;\n\t\tif(l){//has child nodes\n\t\t\tfor(var x=0; x<l; x++){\n\t\t\t\tif(element.childNodes[x].nodeType === Node.TEXT_NODE && element.childNodes[x].nodeValue.trim() !== \"\"){\n\t\t\t\t\treturn true; //one of the immediate children has text\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($(element).is(\"input:not([type=radio],[type=checkbox])\")){//element has no child nodes but still can contain text\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "2ec4954e92d6a8bda60a2700131b6e3b", "score": "0.4761228", "text": "async function getFinalResults(page, currentSelector) {\n return await page.$$eval(currentSelector, (nodes, ancestor, format, primary, prioritizing) => {\n return nodes.map(node => {\n let cnode = node;\n for (let i = 0; i < ancestor; i++) {\n cnode = cnode.parentNode;\n }\n let tree = cnode.children;\n let treeContent = {};\n let x = 0;\n let treeLength = tree.length;\n\n if (prioritizing) {\n if (Object.values(format).includes(primary)) {\n treeContent[x] = node.textContent.trim().replace(/\\n\\s+/g, '');\n x++;\n }\n }\n\n for (let i = 0; i < treeLength; i++) {\n if (tree[i].children.length > 0) {\n subtreeLength = tree[i].children.length;\n for (let k = 0; k < subtreeLength; k++) {\n if (tree[i].children[k].textContent.trim() != \"\") {\n treeContent[x] = tree[i].children[k].textContent.trim().replace(/\\n\\s+/g, '');\n x++;\n }\n }\n continue;\n }\n if (tree[i].textContent.trim() != \"\") {\n treeContent[x] = tree[i].textContent.trim().replace(/\\n\\s+/g, '');\n x++;\n }\n }\n return treeContent;\n })\n }, ancestor, format, primary, prioritizing);\n}", "title": "" }, { "docid": "3237db1d608023a2d7ab90d1e9fc0363", "score": "0.47250292", "text": "function findTextsOnNode(texts) {\n // First deduplicate all the texts\n let textsTypes = texts.reduce((all, t) => ({\n ...all,\n [t.word]: t.label\n }), {});\n let textsSet = Array.from([...new Set(texts.map(r => r.word))]);\n let highlights = [];\n\n // We basically have to do this on promises so that we give enough\n // time to return to the main loop and for the DOM to update ...\n textsSet.forEach((t) => {\n let rectified = t.replace(\"'\", \"\");\n const query = document.evaluate(`//div[text()[contains(.,'${rectified}')]]`, document);\n let nodes = [];\n let next = query.iterateNext();\n\n while (next) {\n nodes.push(next);\n next = query.iterateNext();\n }\n\n // Hopefully this doesn't take too long ...\n for (let node of nodes) {\n let child = node.firstChild;\n\n let range = document.createRange();\n\n let idx = child.textContent.indexOf(rectified);\n range.setStart(child, idx);\n range.setEnd(child, idx + rectified.length);\n\n const page = getPageFromRange(range);\n\n if (!page) {\n return;\n }\n\n const rects = getClientRects(range, page.node);\n\n if (rects.length === 0) {\n return;\n }\n\n const boundingRect = getBoundingRect(rects);\n\n const viewportPosition = { boundingRect, rects, pageNumber: page.number };\n\n const content = {\n text: range.toString()\n };\n const scaledPosition = viewportPositionToScaled(viewportPosition);\n\n highlights.push({\n position: {\n ...scaledPosition\n },\n content,\n color: selectColors[textsTypes[t]][500],\n type: textsTypes[t]\n });\n }\n });\n\n return highlights;\n}", "title": "" }, { "docid": "32fd73a951d56e8a0a388472d8790c2e", "score": "0.4724039", "text": "function hasTextExcludingChildren(element) {\n //Loop through the child nodes of this element looking for text\n var l = element.childNodes.length;\n if (l) {//has child nodes\n for (var x = 0; x < l; x++) {\n if (element.childNodes[x].nodeType === Node.TEXT_NODE && element.childNodes[x].nodeValue.trim() !== \"\") {\n return true; //one of the immediate children has text\n }\n }\n } else if ($(element).is(\"input:not([type=radio],[type=checkbox])\")) {//element has no child nodes but still can contain text\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "6fcdbebc9c8634b14a67035c488e0cef", "score": "0.4719891", "text": "hasAnyText(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.eventually.hasAnyText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n }", "title": "" }, { "docid": "62b115bc6045cf1aebb37df88d47a0d3", "score": "0.47124258", "text": "get not() {\n return {\n /**\n * Returns true if all PageNodes managed by PageElementGroup currently do not exist.\n *\n * @param filterMask can be used to skip the invocation of the `exists` function for some or all managed\n * PageNodes\n */\n exists: (filterMask) => {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.not.exists(filter), filterMask, true);\n },\n /**\n * Returns true if all PageNodes managed by PageElementGroup are currently not visible.\n *\n * @param filterMask can be used to skip the invocation of the `isVisible` function for some or all managed\n * PageNodes\n */\n isVisible: (filterMask) => {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.not.isVisible(filter), filterMask, true);\n },\n /**\n * Returns true if all PageNodes managed by PageElementGroup are currently not enabled.\n *\n * @param filterMask can be used to skip the invocation of the `isEnabled` function for some or all managed\n * PageNodes\n */\n isEnabled: (filterMask) => {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.not.isEnabled(filter), filterMask, true);\n },\n /**\n * Returns true if the actual texts of all PageNodes managed by PageElementGroup currently do not equal the\n * expected texts.\n *\n * @param texts the expected texts supposed not to equal the actual texts\n */\n hasText: (texts) => {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.not.hasText(expected), texts);\n },\n /**\n * Returns true if all PageNodes managed by PageElementGroup currently do not have any text.\n *\n * @param filterMask can be used to skip the invocation of the `hasAnyText` function for some or all managed\n * PageNodes\n */\n hasAnyText: (filterMask) => {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.not.hasAnyText(filter), filterMask, true);\n },\n /**\n * Returns true if the actual texts of all PageNodes managed by PageElementGroup currently do not contain the\n * expected texts.\n *\n * @param texts the expected texts supposed not to be contained in the actual texts\n */\n containsText: (texts) => {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.not.containsText(expected), texts);\n },\n /**\n * Returns true if the actual direct texts of all PageNodes managed by PageElementGroup currently do not equal\n * the expected direct texts.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param directTexts the expected direct texts supposed not to equal the actual direct texts\n */\n hasDirectText: (directTexts) => {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.not.hasDirectText(expected), directTexts);\n },\n /**\n * Returns true if all PageNodes managed by PageElementGroup currently do not have any direct text.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param filterMask can be used to skip the invocation of the `hasAnyDirectText` function for some or all managed\n * PageNodes\n */\n hasAnyDirectText: (filterMask) => {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.not.hasAnyDirectText(filter), filterMask, true);\n },\n /**\n * Returns true if the actual direct texts of all PageNodes managed by PageElementGroup currently do not contain\n * the expected direct texts.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param directTexts the expected direct texts supposed not to be contained in the actual direct texts\n */\n containsDirectText: (directTexts) => {\n return this._node.eachCheck(isIElementNode, ({ node, expected }) => node.currently.not.containsDirectText(expected), directTexts);\n },\n };\n }", "title": "" }, { "docid": "72129fde957b1c27d4c122b3e59ec6c7", "score": "0.47108456", "text": "function grabAllTextNodes(node, allText) {\n var\n childNodes = node.childNodes,\n length = childNodes.length,\n subnode,\n nodeType;\n while (length--) {\n subnode = childNodes[length];\n nodeType = subnode.nodeType;\n // parse emoji only in text nodes\n if (nodeType === 3) {\n // collect them to process emoji later\n allText.push(subnode);\n }\n // ignore all nodes that are not type 1, that are svg, or that\n // should not be parsed as script, style, and others\n else if (nodeType === 1 && !('ownerSVGElement' in subnode) &&\n !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) {\n grabAllTextNodes(subnode, allText);\n }\n }\n return allText;\n }", "title": "" }, { "docid": "2570107675b5a4ef228ed11d35f9aee3", "score": "0.46502557", "text": "function text$1(node) {\n\t\tvar data = node.data || {};\n\n\t\tif (\n\t\t\town$7.call(data, 'hName') ||\n\t\t\town$7.call(data, 'hProperties') ||\n\t\t\town$7.call(data, 'hChildren')\n\t\t) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn 'value' in node\n\t}", "title": "" }, { "docid": "2ec9a48ac4faa3c61f10df6d392e7bfc", "score": "0.46207485", "text": "hasAnyText(filterMask) {\n return this._node.eachCheck(isIElementNode, ({ node, filter }) => node.currently.hasAnyText(filter), filterMask, true);\n }", "title": "" }, { "docid": "36486160776d444141393003b0e43eab", "score": "0.45870382", "text": "function getTextNodes() {\n var nodes = [];\n var walker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, null);\n var node = walker.nextNode();\n while (node) {\n var parentNode = node.parentNode;\n var parentTagName = parentNode.tagName;\n if (parentTagName !== \"SCRIPT\" && parentTagName !== \"STYLE\" && parentTagName !== \"TITLE\") {\n nodes.push(node);\n }\n node = walker.nextNode();\n }\n return nodes;\n }", "title": "" }, { "docid": "1fdd3a17ce087883f9aed4e0cfbde451", "score": "0.45768684", "text": "function forEachTextNodes($elements_, callbackFn_){\r\n\t\t\r\n\t\tif(typeof $elements_ === \"undefined\" || $elements_ instanceof $ == false){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(typeof callbackFn_ !== \"function\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Iterate over all items in the stack\r\n\t\tvar $tmp = $elements_.each(function(){\r\n\t\t\t\r\n\t\t\tvar $this = $(this);\r\n\t\t\t\r\n\t\t\t// Get all text nodes of this element (not recursive!)\r\n\t\t\tvar $nodes = $this.contents().filter(function(){\r\n\t\t\t\tif(this.nodeType == 3){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// Iterate over that text nodes and call callback\r\n\t\t\t$nodes.each(function(){\r\n\t\t\t\t\r\n\t\t\t\tcallbackFn_(this);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t});\r\n\t\treturn true;\r\n\t\t\r\n\t}", "title": "" }, { "docid": "1231d0702076f81627c0aaba1d96c76d", "score": "0.45690078", "text": "function pageCheck() {\n //get the data from the current page\n const pageData = data[\"page-\" + counter]\n\n //title\n //text shadow css\n if (pageData.title) {\n d3.select('.title')\n .html(pageData.title)\n .attr('class', 'title active')\n } else {\n d3.select('.title')\n .attr('class', 'title hidden')\n }\n //text data\n if (pageData.text || pageData.summary) {\n d3.select('.summary')\n .attr('class', 'summary active')\n .attr('id', 'text' + counter)\n .html(pageData.summary)\n .append('div')\n .attr('class', 'text')\n .html(pageData.text)\n if(counter == 27) {\n //loop through references\n d3.select('.summary')\n .attr('class', 'summary active')\n .attr('id', 'text' + counter)\n .html(pageData.summary)\n pageData.text.forEach((item) => {\n d3.select('.summary')\n .append('div')\n .attr('class', 'text')\n .html(item)\n })\n }\n } else {\n d3.select('.summary')\n .attr('class', 'summary hidden')\n }\n //image data\n if (pageData.image) {\n d3.select('.image')\n .attr('class', 'image active')\n .attr('id', 'image' + counter)\n d3.select('img')\n .attr('src', pageData.image)\n } else {\n d3.select('.image')\n .attr('class', 'image hidden')\n }\n //annotation data\n if (pageData.annotation) {\n d3.select('.annotation')\n .html(pageData.annotation)\n .attr('id', 'annotation' + counter)\n .attr('class', 'annotation active')\n } else {\n d3.select('.annotation')\n .attr('class', 'annotation hidden')\n }\n //button data\n if (pageData.button) {\n if (pageData.leftButtontext) {\n d3.select('#left-button')\n .html(pageData.leftButtontext)\n .attr('class', 'button active')\n }\n if (pageData.rightButtontext) {\n d3.select('#right-button')\n .html(pageData.rightButtontext)\n .attr('class', 'button active')\n }\n } else {\n d3.select('#left-button')\n .attr('class', 'button hidden')\n d3.select('#right-button')\n .attr('class', 'button hidden')\n }\n //beccs diagrams\n if (pageData.diagramVisible) {\n if (diagramElement.hasChildNodes()) {\n diagramElement.removeChild(diagramElement.childNodes[0])\n }\n if (pageData.diagramVisible == 1) {\n d3.select('.diagram')\n .attr('class', 'diagram active')\n .node()\n .append(beccs)\n } else if (pageData.diagramVisible == 2) {\n d3.select('.diagram')\n .attr('class', 'diagram active')\n .node()\n .append(beccs_static);\n } else if (pageData.diagramVisible == 3) {\n d3.select('.diagram')\n .attr('class', 'diagram active')\n .node()\n .append(carbon);\n } else if (pageData.diagramVisible == 4) {\n d3.select('.diagram')\n .attr('class', 'diagram active')\n .node()\n .append(missing);\n }\n } else {\n if (diagramElement.hasChildNodes()) {\n diagramElement.removeChild(diagramElement.childNodes[0])\n }\n d3.select('.diagram')\n .attr('class', 'diagram hidden')\n }\n //SQUARE\n if (pageData.square) {\n if (squareElement.hasChildNodes()) {\n squareElement.removeChild(squareElement.childNodes[0])\n }\n\n d3.select('.square-container')\n .attr('class', 'square-container active')\n .append('svg')\n .attr('class', 'square-canvas active')\n .append('rect')\n .attr('fill', '#F2F2F2')\n .attr('width', squareDimension)\n .attr('height', squareDimension)\n\n d3.select('.square-canvas')\n .append('text')\n .attr('class', 'square-text')\n .text('16%')\n .attr('fill', 'black')\n .attr('font-size', '30px')\n .attr('y', 40)\n .attr('x', 20)\n\n } else {\n d3.select('.square-container')\n .attr('class', 'square-container hidden')\n }\n //land visual\n if (pageData.landVisible) {\n if (pageData.landVisible == 1) {\n //delete previous land visual\n if (landElement.hasChildNodes()) {\n landElement.removeChild(landElement.childNodes[0])\n }\n d3.select('.land-visual')\n .attr('class', 'land-visual active')\n .node()\n .append(land_visual_1);\n } else if (pageData.landVisible == 2) {\n //delete previous land visual\n if (landElement.hasChildNodes()) {\n landElement.removeChild(landElement.childNodes[0])\n }\n d3.select('.land-visual')\n .attr('class', 'land-visual active')\n .node()\n .append(land_visual_2);\n }\n }\n else {\n //remove this svg when on other pages so that when I return to that svg it renders correctly\n if (landElement.hasChildNodes()) {\n landElement.removeChild(landElement.childNodes[0])\n }\n d3.select('.land-visual')\n .attr('class', 'land-visual hidden')\n }\n //chart data\n if (pageData.graphVisible) {\n d3.select('.graph-center')\n .attr('class', 'graph-center active')\n //first, filter data by historic if necessary and set up variables for graph\n var yScaledata = (pageData.historicOnly) ? (response.filter(d => d.Entity == 'historic')) : response;\n var xScaledata = [new Date(pageData.filterAxisstart, 0, 1), new Date(pageData.filterAxisend, 0, 1)]\n var lineData = response.filter(d => d.numericYear < parseInt(pageData.filterLineend) && d.numericYear > parseInt(pageData.filterLinestart));\n var dataNest = Array.from(\n d3.group(lineData, d => d.Entity), ([key, value]) => ({ key, value })\n );\n drawGraph(xScaledata, yScaledata, dataNest)\n } else {\n d3.select('.graph-center')\n .attr('class', 'graph-center hidden')\n }\n if (pageData.hover) {\n var div =\n d3.select(\".tooltip\")\n .append(\"div\")\n .attr(\"class\", \"hoverText\")\n .style(\"opacity\", 0);\n\n // setup svg & add group\n let hover = d3.select('.tooltip')\n .on(\"mouseover\", function (event) {\n div.transition()\n .duration(200)\n .style(\"opacity\", 1);\n div.html(pageData.hoverText)\n .style(\"left\", (300) + \"px\")\n .style(\"top\", (150) + \"px\")\n .style(\"position\", \"absolute\");\n })\n .on(\"mouseout\", function (d) {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n } else {\n svg.selectAll('.hoverText').remove();\n }\n if(pageData['percent-1']) {\n var percent_counter = 0\n while(percent_counter < 10) {\n d3.select('#container')\n .append('div')\n .attr('class', 'human active')\n .attr('id', 'human-percent-' + percent_counter)\n percent_counter++\n }\n d3.select('.human-text')\n .attr('class', 'human-text active')\n } else {\n d3.selectAll('.human')\n .attr('class', 'human hidden')\n d3.select('.human-text')\n .attr('class', 'human-text hidden')\n }\n if(pageData['percent-2']) {\n var percent_counter = 0\n while(percent_counter < 10) {\n d3.select('#container')\n .append('div')\n .attr('class', 'land active')\n .attr('id', 'land-percent-' + percent_counter)\n percent_counter++\n }\n d3.select('.land-text')\n .attr('class', 'land-text active')\n } else {\n d3.selectAll('.land')\n .attr('class', 'land hidden')\n d3.select('.land-text')\n .attr('class', 'land-text hidden')\n }\n }", "title": "" }, { "docid": "397d6bbc5c2c69eb6cdde37fa2f47fdb", "score": "0.45510632", "text": "performSearch(text) {\n let anyMatches = false;\n const searchTokens = text.toLowerCase().trim().split(' ');\n\n this.elements.forEach((el) => (anyMatches = el.performSearch(searchTokens) || anyMatches));\n\n if (anyMatches) {\n this.noMatches.hide();\n } else {\n this.noMatches.show();\n }\n }", "title": "" }, { "docid": "1aa062262d7cd0b1383e487c5a0e92e4", "score": "0.45437163", "text": "get text() {\n if (this.childCount === 0) {\n return \"\";\n }\n let builder = \"\";\n for (let i = 0; i < this.childCount; i++) {\n builder += this.getChild(i).text;\n }\n return builder.toString();\n }", "title": "" }, { "docid": "79e7dc67399807ba7fde648c62ba2866", "score": "0.4541488", "text": "async function testTextContains(driver, xpath, text, timeout = config.TIMEOUT) {\n return waitForCondition(driver)(\n `testTextContains ${xpath} ${text}`,\n async function(driver) {\n try {\n await driver.findElement(By.tagName(\"body\"));\n elem = await driver.findElement(By.xpath(xpath));\n if (elem == null) return false;\n let v = await elem.getText();\n return v && v.indexOf(text) > -1;\n } catch (err) {\n // console.log(\n // \"ignoring error in testTextContains for xpath = \" +\n // xpath +\n // \" text = \" +\n // text,\n // err.toString().split(\"\\n\")[0]\n // );\n }\n },\n timeout\n );\n}", "title": "" }, { "docid": "995e29de39b1571a8c357e063eec1bc5", "score": "0.45192707", "text": "function getTextNodes() {\n var nodes = [];\n \n var treeWalker = document.createTreeWalker(\n document.body,\n NodeFilter.SHOW_TEXT,\n { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },\n false\n );\n \n while(treeWalker.nextNode()) {\n var parentNode = treeWalker.currentNode.parentNode;\n var parentTagName = parentNode.tagName;\n if (parentTagName !== \"SCRIPT\" && parentTagName !== \"STYLE\" && parentTagName !== \"TITLE\") {\n nodes.push(treeWalker.currentNode);\n }\n }\n \n return nodes;\n }", "title": "" }, { "docid": "b0d84c9548f06c82df4ffb63325d8bc6", "score": "0.44984603", "text": "function elementHasText(element) {\n elementTypesWithText = [DocumentApp.ElementType.BODY_SECTION,DocumentApp.ElementType.EQUATION,DocumentApp.ElementType.EQUATION_FUNCTION,\n DocumentApp.ElementType.FOOTER_SECTION,DocumentApp.ElementType.FOOTNOTE_SECTION,DocumentApp.ElementType.HEADER_SECTION,\n DocumentApp.ElementType.LIST_ITEM,DocumentApp.ElementType.PARAGRAPH,DocumentApp.ElementType.TABLE,\n DocumentApp.ElementType.TABLE_CELL,DocumentApp.ElementType.TABLE_OF_CONTENTS,DocumentApp.ElementType.TABLE_ROW,\n DocumentApp.ElementType.TEXT]\n return (elementTypesWithText.indexOf(element.getType()) > -1)\n}", "title": "" }, { "docid": "401cdd2dee47c23522ea4111ea7657a8", "score": "0.44853613", "text": "async function checkForResults (vars, page) {\n\n page.on('console', consoleObj => console.log(consoleObj.text()));\n\n const type = vars.runData.type;\n // Selectors\n const resultsSelector = vars.resultsSelector;\n const noResultsSelector = vars.noResultsSelector;\n const noResultsText = vars.noResultsText;\n\n let resultsStartTime = Date.now()\n console.log('start looking for result:', Date().toString());\n\n // wait for results to load\n let err = null;\n let resultsElem = page.waitForSelector(\n resultsSelector,\n { 'timeout': 120000 }\n );\n let noResultsElem = null;\n\n // The two pages have two different html structures\n if (type === 'cp') {\n noResultsElem = page.waitForSelector(noResultsSelector,\n { 'timeout': 120000 });\n } else {\n noResultsElem = page.waitFor(\n function (noResultsSelector, noResultsText) {\n let elem = document.querySelector(noResultsSelector)\n if (!!elem) {\n let text = elem.innerText;\n let hasText = text === noResultsText;\n if (hasText) {\n return elem;\n } else {\n return false;\n }\n } else {\n return false;\n }\n },\n {},\n noResultsSelector, noResultsText\n );\n }\n\n let foundSomeResults = false;\n let foundNoResults = false;\n try {\n await Promise.race([resultsElem, noResultsElem])\n .then(function(value) {\n console.log('race value:', value._remoteObject.description);\n foundSomeResults = value._remoteObject.description.indexOf(resultsSelector) >= 0;\n foundNoResults = !foundSomeResults;\n console.log('results found?', foundSomeResults);\n console.log('no results found?', foundNoResults);\n });\n } catch (anError) {\n console.log('no results or non-results elements found');\n throw anError;\n }\n\n let endTime = Date.now();\n let elapsed = endTime - resultsStartTime;\n console.log('Time elapsed to find results:', elapsed, '(seconds:', elapsed/1000 + ')');\n \n console.log(3);\n\n if (foundNoResults) {\n return false;\n } else {\n return true;\n }\n\n}", "title": "" }, { "docid": "d41a85312780c9fcff4b13a923d5ef4a", "score": "0.44845656", "text": "function appendAccessibleTextFromSubtree(node, isLabel) {\n var styles,\n $node = $(node),\n doWalkChildren = true,\n hasNewline,\n hasExtraSpace;\n\n node = $node[0];\n\n if (node.nodeType === TEXT_NODE) {\n // Text node: we append the text contents\n appendText(node.nodeValue);\n return;\n }\n\n if (node.nodeType !== ELEMENT_NODE) {\n return; // Not text or an element, we don't care about it\n }\n\n // Element -- check for special requirements based on element markup\n styles = window.getComputedStyle(node);\n\n // Non-label processing:\n // 1) Visibility checks -- we don't do this for labels because even invisible labels should be spoken, it's a\n // common technique to hide labels but have useful text for screen readers\n // 2) ARIA labels and descriptions: don't use if already inside a label, in order to avoid infinite recursion\n // since labels could ultimately point in a circle.\n if (!isLabel && !appendNonLabelText($node, styles)) {\n return;\n }\n\n // Add characters to break up paragraphs (before block)\n\n hasNewline = styles.display !== 'inline';\n if (hasNewline) {\n textBuffer = textBuffer.trim();\n appendBlockSeparator();\n }\n else {\n hasExtraSpace = parseFloat(styles.paddingRight) || parseFloat(styles.marginRight);\n }\n\n doWalkChildren = appendTextEquivAndValue(node, $node, doWalkChildren);\n\n if (node.localName === 'iframe' && node.src && urls.isCrossOrigin(node.src)) {\n // Don't try to access the nested document of cross origin iframes\n return;\n }\n\n if (doWalkChildren) {\n // Recursively add text from children (both elements and text nodes)\n $node.contents().each(function () {\n appendAccessibleTextFromSubtree(this, isLabel);\n });\n }\n\n if (hasNewline) {\n textBuffer = textBuffer.trim();\n appendBlockSeparator(); // Add characters to break up paragraphs (after block)\n }\n else if (hasExtraSpace) {\n appendText(' ');\n }\n }", "title": "" }, { "docid": "64328a886f1c2f138360a79f63479507", "score": "0.44724816", "text": "function text(node) {\n var data = node.data || {};\n\n if (own.call(data, 'hName') || own.call(data, 'hProperties') || own.call(data, 'hChildren')) {\n return false;\n }\n\n return 'value' in node;\n}", "title": "" }, { "docid": "97a0cac078f2831b5acf3ce3a80a70d9", "score": "0.44426128", "text": "function getTextNodes() {\n var nodes = [];\n var walker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, null);\n var node = walker.nextNode();\n while (node) {\n nodes.push(node);\n node = walker.nextNode();\n }\n return nodes;\n}", "title": "" }, { "docid": "91b513b0d144ae2baaad7a88f2797ceb", "score": "0.44329444", "text": "static textEquals(text) {\n let times = 1;\n const prepareText = (str = '') => str.trim();\n\n const compareText = (finder) => () => Condition.getText(finder).then(\n (elText) => {\n if (times > 3) {\n log.warn('Expected that ', elText, ' be equal to: ', text, ' tries: ', times);\n }\n times += 1;\n return R.equals(prepareText(elText), prepareText(text));\n }\n );\n\n return (finder) =>\n Condition.compose(Condition.present(finder), compareText(finder));\n }", "title": "" }, { "docid": "a881321fb90446180e5178883a956b2f", "score": "0.44233316", "text": "searchTextNode(element) {\n // Text Nodes Array\n let textNodes = []\n\n // Loop Element's children\n $(element).contents().each((index, node) => {\n // If element is text node\n if (node.nodeName == \"#text\") {\n // if text node isn't whitespace push node to textNodes Array or Who Cares?!\n node.textContent != \" \" ? textNodes.push(node) : null\n }\n // Else if there is other node\n else {\n // Search other node for text nodes again\n textNodes = textNodes.concat(this.searchTextNode(node))\n }\n })\n // And return all textNodes\n return textNodes\n }", "title": "" }, { "docid": "a8b503119e61cb54ab9674cc141282fb", "score": "0.44205546", "text": "function grabAllTextNodes(node, allText) {\r\n var\r\n childNodes = node.childNodes,\r\n length = childNodes.length,\r\n subnode,\r\n nodeType;\r\n while (length--) {\r\n subnode = childNodes[length];\r\n nodeType = subnode.nodeType;\r\n // parse emoji only in text nodes\r\n if (nodeType === 3) {\r\n // collect them to process emoji later\r\n allText.push(subnode);\r\n }\r\n // ignore all nodes that are not type 1 or that\r\n // should not be parsed as script, style, and others\r\n else if (nodeType === 1 && !shouldntBeParsed.test(subnode.nodeName)) {\r\n grabAllTextNodes(subnode, allText);\r\n }\r\n }\r\n return allText;\r\n }", "title": "" }, { "docid": "d96c40cfacf6ac1751c04560e69d1246", "score": "0.4403825", "text": "function tspanInClassContainsText(className) {\n var elements = document.getElementsByClassName(className);\n var i;\n for (i = 0; i < elements.length; i++) {\n var tspans = elements.item(i).getElementsByTagName(\"tspan\");\n if (tspans.length > 0 && typeof tspans[0].innerHTML != \"undefined\" && tspans[0] != \"\") {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "951c66ad0cc645bc8d2b716e05c8043f", "score": "0.43939126", "text": "function text(node) {\n var data = node.data || {}\n\n if (\n own.call(data, 'hName') ||\n own.call(data, 'hProperties') ||\n own.call(data, 'hChildren')\n ) {\n return false\n }\n\n return 'value' in node\n}", "title": "" }, { "docid": "d88a85400bb06616de1ecc87517d13bb", "score": "0.4363979", "text": "function check_text_in_body(aDocument, aText) {\n if (typeof aDocument == \"object\") {\n return get_element_by_text(aDocument, aText) != null;\n }\n return aDocument.includes(aText);\n}", "title": "" }, { "docid": "034d22d61881bcbf3e8431ed2290ff35", "score": "0.43627092", "text": "function allText(element) {\n var text = [];\n Loop(element.childNodes, function(node) {\n if (node.nodeType == 3) text.push(node);\n if (node.nodeType == 1) text = text.concat(allText(node));\n });\n return text;\n } // replace global", "title": "" }, { "docid": "0c5bcd5f81a10f331c8bf0c2f53c16c2", "score": "0.4350056", "text": "function TEXT(DOMElements = [], innerText = false, text = \"\"){\n\tif(text !== \"\"){\n\t\t// If the user wants to set the innerHTML Of DOMElements passed as the argument.\n\n\t\tif(NodeList.prototype.isPrototypeOf(DOMElements) || HTMLCollection.prototype.isPrototypeOf(DOMElements)){\n\t\t\tfor(let i = 0;i<DOMElements.length;i++){\n\t\t\t\tif(innerText === true)\n\t\t\t\t\tDOMElements[i].innerText = text;\n\t\t\t\telse\n\t\t\t\t\tDOMElements[i].textContent = text;\n\t\t\t}\n\t\t}\n\t\telse if(isElement(DOMElements)){\n\t\t\t// If the DOMElements argument is just one single DOM Element.\n\n\t\t\t(innerText===true)?DOMElements.innerText = text:DOMElements.textContent=text;\n\t\t}\n\t\telse{\n\t\t\tthrow new Error(\"Expected a NodeList, HTMLCollection or a DOM Element.\");\n\t\t}\n\t}\n\telse{\n\t\t// If the user wants to get the innerHTML of DOMElements passed as the argument.\n\n\t\tif(NodeList.prototype.isPrototypeOf(DOMElements) || HTMLCollection.prototype.isPrototypeOf(DOMElements)){\n\n\t\t\tlet textList = [];\t// This would be the returned. An array of HTMLs.\n\n\t\t\tfor(let i = 0;i<DOMElements.length;i++){\n\t\t\t\ttextList.push((innerText === true)?DOMElements[i].innerText:DOMElements[i].textContent);\n\t\t\t}\n\n\t\t\treturn textList;\n\t\t}\n\t\telse if(isElement(DOMElements)){\n\t\t\t// If the DOMElements argument is just one single DOM Element.\n\n\t\t\treturn (innerText === true)?DOMElements.innerText:DOMElements.textContent;\n\t\t}\n\t\telse{\n\t\t\tthrow new Error(\"Expected a NodeList, HTMLCollection or a DOM Element.\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "093042574487d87d56773864f06896da", "score": "0.43463695", "text": "function text(node) {\n var data = node.data || {}\n\n if (\n own.call(data, 'hName') ||\n own.call(data, 'hProperties') ||\n own.call(data, 'hChildren')\n ) {\n return false\n }\n\n return 'value' in node\n}", "title": "" }, { "docid": "632d1c4e3552d738d5f74431a46752d2", "score": "0.43420264", "text": "function verifyText(locator, expected, callback) {\n try {\n expectVisible(locator, function () {\n browser.wait(function () {\n return locator.getText();\n\n }, 10000).then(function (actual) {\n expect(actual === expected);\n callback();\n });\n })\n } catch (e) {\n expect(false);\n console.log(e);\n callback();\n }\n}", "title": "" }, { "docid": "3d6269c6712fa45f7195f44dd54bdf81", "score": "0.43407553", "text": "function getText(locator, callback) {\n try {\n expectVisible(locator, function () {\n browser.wait(function () {\n return locator.getText();\n }, 8000).then(function (text) {\n callback(text);\n });\n });\n } catch (e) {\n expect(false);\n console.log(e);\n callback();\n }\n}", "title": "" }, { "docid": "f0f785b8319cf6eef9e3efb50ad546c8", "score": "0.43394554", "text": "function addTextContainer(result){\r\n var node;\r\n var wrapper; //a wrapper element for the text node.\r\n var pointer; //the next sibling of the text node.\r\n for (var i = 0; i < result.childNodes.length; i++) {\r\n node = result.childNodes[i];\r\n if (node.nodeType === Node.TEXT_NODE) {\r\n pointer = node.nextSibling;\r\n wrapper = document.createElement('p');\r\n wrapper.appendChild(node);\r\n wrapper.style.display = 'none';\r\n pointer == null ? result.appendChild(wrapper) : result.insertBefore(wrapper, pointer);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fea7bae63adc27e3c19184035f76bb3c", "score": "0.43377918", "text": "function getAllTextNodes(elem) {\r\n $(elem).contents().filter(function () {\r\n return this.nodeType == Node.TEXT_NODE;\r\n });\r\n }", "title": "" }, { "docid": "d2e4a98bfdfb4da8c9b779813bd7650b", "score": "0.43228245", "text": "function getAllTextNodes(element) {\n return Array.from(element.childNodes).filter(\n node => (node.nodeType == Node.TEXT_NODE && node.textContent.length >= 1));\n}", "title": "" }, { "docid": "c3849cbefe769484c512e6e8081324c0", "score": "0.431593", "text": "function isSearchResultPage(){\n const title = document.getElementById('futHeaderTitle');\n return title && title.innerHTML == 'Search Results';\n }", "title": "" }, { "docid": "9eb428c81a15179245cde534a25b6cf2", "score": "0.43069685", "text": "function findTextNodeRelative(left, startNode) {\r\n\t\t\t\t\tvar walker, lastInlineElement;\r\n\r\n\t\t\t\t\tstartNode = startNode || container;\r\n\t\t\t\t\twalker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);\r\n\r\n\t\t\t\t\t// Walk left until we hit a text node we can move to or a block/br/img\r\n\t\t\t\t\twhile (node = walker[left ? 'prev' : 'next']()) {\r\n\t\t\t\t\t\t// Found text node that has a length\r\n\t\t\t\t\t\tif (node.nodeType === 3 && node.nodeValue.length > 0) {\r\n\t\t\t\t\t\t\tcontainer = node;\r\n\t\t\t\t\t\t\toffset = left ? node.nodeValue.length : 0;\r\n\t\t\t\t\t\t\tnormalized = true;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Break if we find a block or a BR/IMG/INPUT etc\r\n\t\t\t\t\t\tif (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlastInlineElement = node;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Only fetch the last inline element when in caret mode for now\r\n\t\t\t\t\tif (collapsed && lastInlineElement) {\r\n\t\t\t\t\t\tcontainer = lastInlineElement;\r\n\t\t\t\t\t\tnormalized = true;\r\n\t\t\t\t\t\toffset = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "9eb428c81a15179245cde534a25b6cf2", "score": "0.43069685", "text": "function findTextNodeRelative(left, startNode) {\r\n\t\t\t\t\tvar walker, lastInlineElement;\r\n\r\n\t\t\t\t\tstartNode = startNode || container;\r\n\t\t\t\t\twalker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);\r\n\r\n\t\t\t\t\t// Walk left until we hit a text node we can move to or a block/br/img\r\n\t\t\t\t\twhile (node = walker[left ? 'prev' : 'next']()) {\r\n\t\t\t\t\t\t// Found text node that has a length\r\n\t\t\t\t\t\tif (node.nodeType === 3 && node.nodeValue.length > 0) {\r\n\t\t\t\t\t\t\tcontainer = node;\r\n\t\t\t\t\t\t\toffset = left ? node.nodeValue.length : 0;\r\n\t\t\t\t\t\t\tnormalized = true;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Break if we find a block or a BR/IMG/INPUT etc\r\n\t\t\t\t\t\tif (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlastInlineElement = node;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Only fetch the last inline element when in caret mode for now\r\n\t\t\t\t\tif (collapsed && lastInlineElement) {\r\n\t\t\t\t\t\tcontainer = lastInlineElement;\r\n\t\t\t\t\t\tnormalized = true;\r\n\t\t\t\t\t\toffset = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "4080d1199ac91ee10454f9e2640e423a", "score": "0.42984876", "text": "async hasRenderedChildren(node, subject) {\n const children = await node.children;\n for (const child of children.toArray() || []) {\n const shouldRenderChild = this.targetAudience.shouldRenderScore(child.simplifiedTargetAudiences);\n const hasRenderedComment = async () => await this.childHasRenderedComment(child, subject);\n const hasRenderedLabel = async () => await this.hasRenderedLabel(child, subject);\n const rendersSomething = async () => await hasRenderedComment() || await hasRenderedLabel();\n const hasRenderedChild = async () => await this.hasRenderedChildren(child, subject);\n\n if ((shouldRenderChild && await rendersSomething()) || await hasRenderedChild()) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "24d9a0e31fec232260058c4dcad72ff1", "score": "0.42530212", "text": "_computeShowing(roverTextVisible, serverTextVisible, loadingTextVisible) {\n return roverTextVisible || serverTextVisible || loadingTextVisible;\n // return false;\n }", "title": "" }, { "docid": "033483863bce94ed762afccab3e9b91a", "score": "0.42419988", "text": "function checkEltText (id, text) {\n\tvar err = (getElt(id).textContent != text);\n\n\tif (err) {\n\t\tnotice(\"Test failure: Element text \" + id + \" != \" + text);\n\t}\n\treturn (err);\n}", "title": "" }, { "docid": "b3087d172ca2e18b9e4e9f0695f812e4", "score": "0.42306295", "text": "function getAllTexts() {\n var result = query({\n Return: {\n Hashes: true,\n Entries: true,\n Stautus: true,\n GetMask: HC.GetMask.All,\n StatusMask: HC.Status.Live + HC.Status.Deleted + HC.Status.Modified + HC.Status.Rejected\n },\n Constrain: {\n EntryTypes: [\"holoText\"]\n }\n });\n debug(result);\n return 0;\n}", "title": "" }, { "docid": "122ae070cfcae09d9c064eed8420f3d0", "score": "0.42238322", "text": "allEnabledChildrenCheckedOrIndeterminate() {\n return this.children.every((child) => {\n if (child.checked === INDETERMINATE) {\n return child.allEnabledChildrenCheckedOrIndeterminate()\n }\n\n return child.checked === true || child.getDisabled()\n })\n }", "title": "" }, { "docid": "8c051df81dd79e5a0bed650420c18846", "score": "0.42137748", "text": "function updateTextVisibility() {\n text.attr(\"visibility\", function(d) {\n var textWidth = this.getBoundingClientRect().width;\n var boxWidth = this.parentNode.querySelector(\".rect\").getBoundingClientRect().width;\n return (textWidth <= boxWidth) ? \"visible\" : \"hidden\";\n });\n }", "title": "" }, { "docid": "965ac8d49cef2ab056c1398213b50306", "score": "0.42088887", "text": "text (text) {\n // act as getter\n if (text === undefined) {\n var children = this.node.childNodes\n var firstLine = 0\n text = ''\n\n for (var i = 0, len = children.length; i < len; ++i) {\n // skip textPaths - they are no lines\n if (children[i].nodeName === 'textPath') {\n if (i === 0) firstLine = 1\n continue\n }\n\n // add newline if its not the first child and newLined is set to true\n if (i !== firstLine && children[i].nodeType !== 3 && Object(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_0__[\"adopt\"])(children[i]).dom.newLined === true) {\n text += '\\n'\n }\n\n // add content of this node\n text += children[i].textContent\n }\n\n return text\n }\n\n // remove existing content\n this.clear().build(true)\n\n if (typeof text === 'function') {\n // call block\n text.call(this, this)\n } else {\n // store text and make sure text is not blank\n text = text.split('\\n')\n\n // build new lines\n for (var j = 0, jl = text.length; j < jl; j++) {\n this.tspan(text[j]).newLine()\n }\n }\n\n // disable build mode and rebuild lines\n return this.build(false).rebuild()\n }", "title": "" }, { "docid": "c7cb447397708d5724af078cbcedf2a9", "score": "0.4206068", "text": "static getPagedTextGroups(tg, pages, pageHeight) {\n const rv = [];\n let i = 0;\n if (tg.pagination === SmoTextGroup.paginations.ONCE) {\n rv.push(tg);\n return rv;\n }\n for (i = 0; i < pages; ++i) {\n const ix = i;\n const nblocks = [];\n // deep copy the blocks so the page offsets don't bleed into\n // original.\n tg.textBlocks.forEach((block) => {\n const nscoreText = new SmoScoreText(block.text);\n nblocks.push({\n text: nscoreText, position: block.position\n });\n });\n const params = {};\n SmoTextGroup.attributes.forEach((attr) => {\n if (attr !== 'textBlocks') {\n params[attr] = tg[attr];\n }\n });\n params.blocks = nblocks;\n const ngroup = new SmoTextGroup(params);\n ngroup.textBlocks.forEach((block) => {\n const xx = block.text;\n xx.classes = 'score-text ' + xx.attrs.id;\n xx.text = xx.text.replace('###', ix + 1); /// page number\n xx.text = xx.text.replace('@@@', pages); /// page number\n xx.y += pageHeight * ix;\n });\n rv.push(ngroup);\n }\n return rv;\n }", "title": "" }, { "docid": "bd54139333db6e9ecf99a9f4bb3f8355", "score": "0.41941065", "text": "function stepF(element, data, isNameFromContent, isProcessRefTraversal){\n\t\tvar accumulatedText = \"\";\n\n\t\tvar exclusions = \".ANDI508-overlay,script,noscript,iframe\";\n\n\t\tvar node, beforePseudo, afterPseudo;\n\t\tvar nameFromContent_roles = \"[role=button],[role=cell],[role=checkbox],[role=columnheader],[role=gridcell],[role=heading],[role=link],[role=menuitem],[role=menuitemcheckbox],[role=menuitemradio],[role=option],[role=radio],[role=row],[role=rowgroup],[role=rowheader],[role=switch],[role=tab],[role=tooltip],[role=tree],[role=treeitem]\";\n\t\tvar nameFromContent_tags = \"label,button,a,th,td,h1,h2,h3,h4,h5,h6\";\n\n\t\tif(!data) //create data object if not passed\n\t\t\tdata = {};\n\n\t\tif(!isNameFromContent) //determine name from content unless passed\n\t\t\tisNameFromContent = $(element).isSemantically(nameFromContent_roles, nameFromContent_tags);\n\n\t\t//get CSS ::before content\n\t\tlookForPseudoContent(\"before\", element, data);\n\n\t\t//Loop through this element's child nodes\n\t\tfor(var z=0; z<element.childNodes.length; z++){\n\t\t\tnode = element.childNodes[z];\n\t\t\tif($(node).attr(\"aria-hidden\") !== \"true\"){//this node is not hidden\n\t\t\t\t//TODO: the following line prevents a node from being traversed more than once\n\t\t\t\t//if(node.nodeType === 1 && (!isProcessRefTraversal || !hasNodeBeenTraversed(node))){//element node\n\t\t\t\tif(node.nodeType === 1){//element node\n\t\t\t\t\tif(root != node && $(node).is(\"select\")){\n\t\t\t\t\t\t//loop through selected options to accumulate text\n\t\t\t\t\t\t$(node).find(\"option:selected\").each(function(){\n\t\t\t\t\t\t\tif(this.childNodes.length)\n\t\t\t\t\t\t\t\taccumulatedText += AndiData.addComp(data, \"innerText\", stepG(this.childNodes[0], data));\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse if(!$(node).is(exclusions) && $(node).is(\":shown\")){\n\t\t\t\t\t\tvar subtreeData;\n\t\t\t\t\t\tif(isNameFromContent || $(node).isSemantically(nameFromContent_roles, nameFromContent_tags)){\n\t\t\t\t\t\t\t//Recurse through subtree\n\t\t\t\t\t\t\tsubtreeData = {};\n\n\t\t\t\t\t\t\tif(!isProcessRefTraversal && calcSubtreeName( stepB(node, subtreeData) ) ); //aria-labelledby\n\t\t\t\t\t\t\telse if(calcSubtreeName( stepC(node, subtreeData) ) ); //aria-label\n\t\t\t\t\t\t\telse if(calcSubtreeName( stepD(node, subtreeData, true) ) ); //native markup\n\t\t\t\t\t\t\telse if(root != node && calcSubtreeName( stepE(node, subtreeData) ) ); //embedded control\n\t\t\t\t\t\t\telse if(root != node && calcSubtreeName( stepF(node, subtreeData, true, isProcessRefTraversal), true) ); //name from content\n\t\t\t\t\t\t\telse if(calcSubtreeName( stepI(node, subtreeData, true) ) ); //title attribute\n\t\t\t\t\t\t\telse if(calcSubtreeName( stepJ(node, subtreeData) ) ); //placeholder\n\n\t\t\t\t\t\t\tpushSubtreeData(data, subtreeData, node);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{//not a name from content element\n\t\t\t\t\t\t\tsubtreeData = {};\n\t\t\t\t\t\t\taccumulatedText += stepF(node, subtreeData, false, isProcessRefTraversal);\n\t\t\t\t\t\t\tif(accumulatedText !== \"\" && andiUtility.isBlockElement(node))\n\t\t\t\t\t\t\t\taccumulatedText += \" \"; //add extra space after block elements\n\t\t\t\t\t\t\tpushSubtreeData(data, subtreeData, node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(node.nodeType === 3){//text node\n\t\t\t\t\taccumulatedText += AndiData.addComp(data, \"innerText\", stepG(node, data));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//get CSS ::after content\n\t\tlookForPseudoContent(\"after\", element, data);\n\n\t\treturn accumulatedText;\n\n\t\tfunction calcSubtreeName(result, checkForBlockLevelElement){\n\t\t\tif(result)\n\t\t\t\taccumulatedText += result;\n\t\t\tif(checkForBlockLevelElement && accumulatedText !== \"\" && andiUtility.isBlockElement(node))\n\t\t\t\taccumulatedText += \" \"; //add extra space after block elements\n\t\t\treturn !!result;\n\t\t}\n\n\t\tfunction pushSubtreeData(data, subtreeData, node){\n\t\t\tif(!$.isEmptyObject(subtreeData)){\n\t\t\t\tAndiData.grab_semantics(node, subtreeData);\n\t\t\t\tif(!data.subtree)//create subtree\n\t\t\t\t\tdata.subtree = [];\n\t\t\t\tdata.subtree.push(subtreeData);\n\t\t\t}\n\t\t}\n\n\t\t//This function checks for pseudo element content and accumulates text and adds a component to the data object\n\t\tfunction lookForPseudoContent(pseudo, element, data){\n\t\t\tvar pseudoObject = andiUtility.getPseudoContent(pseudo, element);\n\t\t\tif(pseudoObject){\n\t\t\t\taccumulatedText += pseudoObject[0];\n\t\t\t\tAndiData.addComp(data, \"::\"+pseudo, pseudoObject[1]);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "77d5ab6830ad6e3f46402930580d80f7", "score": "0.4190828", "text": "function text$1(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "b70854788724b345754783294b601888", "score": "0.4190051", "text": "async next_page() {\n // let s = \"//span[substring(@class,string-length(@class) -string-length('__button-next-icon') +1) = '__button-next-icon']\";\n // const [next_page_link] = await this.page.$x(s, {timeout: 2000});\n\n let next_page_link = await this.page.$('[jsaction=\"pane.paginationSection.nextPage\"] span', {timeout: 10000});\n if (!next_page_link) {\n return false;\n }\n await next_page_link.click();\n\n // because google maps loads all location results dynamically, its hard to check when\n // results have been updated\n // as a quick hack, we will wait until the last title of the last search\n // differs from the last result in the dom\n\n let last_title_last_result = this.results[this.keyword][this.page_num-1].results.slice(-1)[0].title;\n\n this.logger.info(`Waiting until new last serp title differs from: \"${last_title_last_result}\"`);\n\n await this.page.waitForFunction((last_title) => {\n const res = document.querySelectorAll('.section-result .section-result-title span');\n return res[res.length-1].innerHTML !== last_title;\n }, {timeout: 7000}, this.results[this.keyword][this.page_num-1].results.slice(-1)[0].title);\n\n return true;\n }", "title": "" }, { "docid": "7910ff8c48d7cab1065a584d47331f8a", "score": "0.41772836", "text": "function ɵɵstaticContentQuery(directiveIndex, predicate, descend, read) {\n contentQueryInternal(getTView(), getLView(), predicate, descend, read, true, getPreviousOrParentTNode(), directiveIndex);\n}", "title": "" }, { "docid": "dbcc7b2661ea3eef571a6baef8672a4d", "score": "0.417164", "text": "function evaluateTextTypes(elem) {\n getCoordinates(elem);\n // get elem content\n let content = elem.value;\n console.log(content);\n // show an indicator\n if (content.trim() === '') {\n inputIsFailed();\n return false;\n } else if (content.trim() !== '') {\n inputIsOk();\n return true;\n }\n }", "title": "" }, { "docid": "79114e0234181ad7b9aebf21b641d644", "score": "0.41611293", "text": "async function getElText(page, selector) {\n\treturn await page.evaluate((selector) => {\n\t\treturn document.querySelector(selector).innerText\n\t}, selector);\n}", "title": "" }, { "docid": "4d004ef92d9e18cb19627fbf1c27a0c0", "score": "0.41570184", "text": "get not() {\n return {\n /**\n * Waits for all PageNodes managed by PageElementGroup not to exist.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param opts includes a `filterMask` which can be used to skip the invocation of the `exists` function for\n * some or all managed PageNodes and the `timeout` within which the condition is expected to be met\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n exists: (opts = {}) => {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.not.exists(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n },\n /**\n * Waits for all PageNodes managed by PageElementGroup not to be visible.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param opts includes a `filterMask` which can be used to skip the invocation of the `isVisible` function for\n * some or all managed PageNodes and the `timeout` within which the condition is expected to be met\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n isVisible: (opts = {}) => {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.not.isVisible(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n },\n /**\n * Waits for all PageNodes managed by PageElementGroup not to be enabled.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param opts includes a `filterMask` which can be used to skip the invocation of the `isEnabled` function for\n * some or all managed PageNodes and the `timeout` within which the condition is expected to be met\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n isEnabled: (opts = {}) => {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.not.isEnabled(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n },\n /**\n * Waits for the actual texts of all PageNodes managed by PageElementGroup not to equal the expected texts.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param texts the expected texts supposed not to equal the actual texts\n * @param opts includes the `timeout` within which the condition is expected to be met and the `interval` used\n * to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n hasText: (texts, opts) => {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.not.hasText(expected, opts), texts);\n },\n /**\n * Waits for all PageNodes managed by PageElementGroup not to have any text.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param opts includes a `filterMask` which can be used to skip the invocation of the `hasAnyText` function for\n * some or all managed PageNodes, the `timeout` within which the condition is expected to be met and the\n * `interval` used to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n hasAnyText: (opts = {}) => {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.not.hasAnyText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n },\n /**\n * Waits for the actual texts of all PageNodes managed by PageElementGroup not to contain the expected texts.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * @param texts the expected texts supposed not to be contained in the actual texts\n * @param opts includes the `timeout` within which the condition is expected to be met and the `interval` used\n * to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n containsText: (texts, opts) => {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.not.containsText(expected, opts), texts);\n },\n /**\n * Waits for the actual direct texts of all PageNodes managed by PageElementGroup not to equal the expected\n * direct texts.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param directTexts the expected direct texts not supposed to equal the actual direct texts\n * @param opts includes the `timeout` within which the condition is expected to be met and the `interval` used\n * to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n hasDirectText: (directTexts, opts) => {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.not.hasDirectText(expected, opts), directTexts);\n },\n /**\n * Waits for all PageNodes managed by PageElementGroup not to have any direct text.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param opts includes a `filterMask` which can be used to skip the invocation of the `hasAnyDirectText` function\n * for some or all managed PageNodes, the `timeout` within which the condition is expected to be met and the\n * `interval` used to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n hasAnyDirectText: (opts = {}) => {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(isIElementNode, ({ node, filter }) => node.wait.not.hasAnyDirectText(Object.assign({ filterMask: filter }, otherOpts)), filterMask, true);\n },\n /**\n * Waits for the actual direct texts of all PageNodes managed by PageElementGroup not to contain the expected\n * direct texts.\n *\n * Throws an error if the condition is not met within a specific timeout.\n *\n * A direct text is a text that resides on the level directly below the selected HTML element.\n * It does not include any text of the HTML element's nested children HTML elements.\n *\n * @param directTexts the expected direct texts supposed not to be contained in the actual direct texts\n * @param opts includes the `timeout` within which the condition is expected to be met and the `interval` used\n * to check it\n *\n * If no `timeout` is specified, a PageElement's default timeout is used.\n * If no `interval` is specified, a PageElement's default interval is used.\n *\n * @returns this (an instance of PageElementGroup)\n */\n containsDirectText: (directTexts, opts) => {\n return this._node.eachWait(isIElementNode, ({ node, expected }) => node.wait.not.containsDirectText(expected, opts), directTexts);\n },\n };\n }", "title": "" }, { "docid": "bc9bd16292159ad889c5ae52219df445", "score": "0.414992", "text": "function text(node) {\n return node && node.type === 'text';\n}", "title": "" }, { "docid": "7c9cbcf3754e0df8cf3ae243e4472fb0", "score": "0.41463566", "text": "get textContent() {\n return this.node.textContent;\n }", "title": "" }, { "docid": "136ea63ad3e6de9a8c4809f8a7a010e1", "score": "0.41340905", "text": "function text(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "307e69ae2bcdac39041c6d931a7071c2", "score": "0.4132639", "text": "function getNodes(text) {\n const parsed = Markdown.deserialize(text);\n const rendered = Markdown.serialize(parsed);\n const reparsed = Markdown.deserialize(rendered);\n return reparsed.document.nodes;\n}", "title": "" }, { "docid": "3754c1f1cdfaf358e9b9007257f6a35a", "score": "0.41312337", "text": "function isVisibleSearchResult(item) {\n const isVisible = WF.completedVisible() || !item.isWithinCompleted();\n return item.data.search_result && isVisible\n }", "title": "" }, { "docid": "d939df68bf90f28b3e1dd40118cf1fe3", "score": "0.41276336", "text": "function checkDescendant({ actualNode }, nodeName) {\n\tvar candidate = actualNode.querySelector(nodeName.toLowerCase());\n\tif (candidate) {\n\t\treturn text.accessibleText(candidate);\n\t}\n\n\treturn '';\n}", "title": "" }, { "docid": "049147572dff2656cd7c80f0152b3848", "score": "0.41184536", "text": "function ɵɵstaticContentQuery(directiveIndex, predicate, descend, read) {\n contentQueryInternal(getLView(), predicate, descend, read, true, getPreviousOrParentTNode(), directiveIndex);\n}", "title": "" } ]
579a1e5254184828fde68d3d037e4636
Range of concurrent lobbies (min range is 0, max range is 7).
[ { "docid": "e190b575541da6956722debf5a8e6a0d", "score": "0.0", "text": "function init() {\n // After loading, ChannelServer\n}", "title": "" } ]
[ { "docid": "273aeed8bd292ed0d1d20f010fc26071", "score": "0.5801684", "text": "function rangeCompany(n) {\n return new Array(n);\n }", "title": "" }, { "docid": "11ad35e5e4709df1fe0d714f4fb9f31b", "score": "0.56165564", "text": "__range(min, max) {\n let results = []\n for (let i = min; i <= max; i++) {\n results.push(i)\n }\n return results\n }", "title": "" }, { "docid": "b622d714848ce33bc09aaa2826c68df2", "score": "0.5524827", "text": "function jrange(board) {\n var a = [];\n for (var i=0;i<12;i++) {\n a.push(i);\n }\n return a;\n}", "title": "" }, { "docid": "68d85ede1ddab00b5fa94b8d43989878", "score": "0.5278558", "text": "function rob(nums) {\n const val = function (start, obj) {\n if (start >= nums.length) {\n return 0;\n } else {\n let max = 0;\n\n for (let i = start; i < nums.length; i++) {\n let c = nums[i];\n if (!(i + 2 in obj)) {\n obj[i + 2] = val(i + 2, obj);\n }\n\n max = max > c + obj[i + 2] ? max : c + obj[i + 2];\n }\n\n return max;\n }\n };\n\n return val(0, {});\n}", "title": "" }, { "docid": "73ebc8615d7f5d2d58a62d3cca3777d9", "score": "0.5257399", "text": "get numIdleWorkers() {\n return this.m_availableWorkers.length;\n }", "title": "" }, { "docid": "73ebc8615d7f5d2d58a62d3cca3777d9", "score": "0.5257399", "text": "get numIdleWorkers() {\n return this.m_availableWorkers.length;\n }", "title": "" }, { "docid": "edafbaac36450ef845d9512294bf8861", "score": "0.5247774", "text": "function Interval(min, max) {\n const a = min + 1\n const b = max + 1\n\n // what is used \n return new Promise(resolve => {\n const random = Math.random() + a + b\n resolve(random) \n })\n}", "title": "" }, { "docid": "473c9f17a4591146d00262474f7a2c5f", "score": "0.524713", "text": "function randomizeRange(connections) {\n // Processes if user has more than 50 connections\n if (connections._total > 50) {\n // Selects random range of 50 connections\n var randomMax = Math.floor((Math.random() * connections._total) + 50);\n // Get connection data\n getConnectionData(randomMax);\n } else {\n console.log('User has less than 50 connections. Aborting');\n }\n}", "title": "" }, { "docid": "40a277c5501769875726d370183f883b", "score": "0.52362645", "text": "function bornCount(){\n return Math.max(minBornCount, baseBornCount - score/scorePerOne);\n}", "title": "" }, { "docid": "dab288487a0c8ca69065909e39b15aed", "score": "0.52201205", "text": "function range(a, b){\n var r = [];\n for (var i = a; i <= b; i++){\n r.push(i);\n }\n return r;\n }", "title": "" }, { "docid": "d260c2c9cd3f8266c0f59c78e2c0c0ed", "score": "0.52195287", "text": "function range_limit(a){\n for(i=0;i<=a;i++){\n console.log(i)\n } \n}", "title": "" }, { "docid": "58b1338239b5aad34eb6078c8b3a6185", "score": "0.52130884", "text": "function rocketLaunch(launchFn){\nfor(var i = 10; i > 0; i--) {\n\tconsole.log(i, \"...\")\n}\n\tlaunchFn();\n}", "title": "" }, { "docid": "7a03cb42a29893e8107b1018e6653988", "score": "0.52008224", "text": "getPeopleInFloors(people) {\n let peopleInFloors = Array(13).fill(0);\n let peopleOutsideElevator = people.filter(person => !person.in_elevator);\n for (let i = 0; i <= 11; i++) {\n for (const person of peopleOutsideElevator) {\n if (person.start_floor === i-1) {\n peopleInFloors[i]++;\n }\n }\n }\n return peopleInFloors;\n }", "title": "" }, { "docid": "e90bfd7b3b33bd0a4afb180fa85b5c70", "score": "0.5188825", "text": "function charact(min) {\n return range(100, min);\n}", "title": "" }, { "docid": "79371a12cc60df2f954677babc620911", "score": "0.5162005", "text": "constructor (name, min, max, defaultIndex = 0, description = \"\") {\r\n\t\tlet states = []\r\n\r\n\t\tfor (let i = min; i < max + 1; ++i) {\r\n\t\t\tstates.push(i)\r\n\t\t}\r\n\r\n\t\tsuper(name, states, defaultIndex, description)\r\n\t}", "title": "" }, { "docid": "c1348f5fd7afdc7b89cf35f2f17f08fe", "score": "0.51230794", "text": "constructor(concurrency = Infinity) {\n this.concurrency = concurrency;\n }", "title": "" }, { "docid": "db34b96790bd71f336cd3eed169f5c35", "score": "0.5122927", "text": "function rangeConstrict( num ){\n //max1 == number of colors\n //max2 == given spec, possible maximum of url stringtoint given <2048 chars\n //http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n\n var min1 = 1,\n max1 = 61,\n min2 = 1,\n max2 = 1638;\n\n var num1 = (num - min1) / (max1 - min1);\n var num2 = (num1 * (max2 - min2)) + min2;\n\n //golden ratio is .6...\n //this evenly distributes the numbers b/c most will not\n //be anywhere near 1638\n num2 += 0.618033988749895;\n return Math.abs( Math.round( num2 %= max1 ) );\n}", "title": "" }, { "docid": "1a515fc3cf303da75aa8bbfca32f6796", "score": "0.512036", "text": "static get concurrency() {\n return 1\n }", "title": "" }, { "docid": "5c5c5f2b48de3b4cbe7cfa1900a0680d", "score": "0.5113076", "text": "function generateGirlsNumbers () {\n return Math.floor(Math.random() * 11) + 1;\n }", "title": "" }, { "docid": "b065152a1dc3491e376789a48d7cd312", "score": "0.5104701", "text": "function range (min, max) {\n\n}", "title": "" }, { "docid": "b1dc3a1c1979aae0fde9124e6e5421fd", "score": "0.5082016", "text": "range (min, max) {\n\t\treturn Math.floor(this.next() * (max - min)) + min;\n\t}", "title": "" }, { "docid": "63460d12bfa81fff9c519ef1cd6c43d0", "score": "0.50681233", "text": "function startingNrOfCoins() {\n return (Math.floor(Math.random() * 20) + 10);\n}", "title": "" }, { "docid": "0f15b4b0c902c31082127f0f1d496465", "score": "0.50665134", "text": "function range(min, max) {\n const arr = [];\n for (var i = min; i < max; i++) {\n arr.push(i);\n }\n return arr;\n }", "title": "" }, { "docid": "02991321d7789643d2a699d9b3ff7ada", "score": "0.5063059", "text": "function bigbooster(){\r\n let previouscps = finalcps; \r\n isBoosted = true; \r\n finalcps *= boosterval;\r\n checkfinalcps();\r\n\r\n var i = 0;\r\n var id = setInterval(now,1000);\r\n function now(){\r\n if(i == 15){\r\n isBoosted = false;\r\n checkfinalcps();\r\n clearInterval(id); \r\n }else{\r\n i++;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "55adc4259c8bbd23131941f5ba1b58f6", "score": "0.5060464", "text": "function range( n ) {\n var list = [];\n for ( var i = 1; i <= n; i++ ) {\n list.push( i );\n }\n return list;\n}", "title": "" }, { "docid": "2202efd74d4fe3853180280f0f5285c8", "score": "0.50555074", "text": "function getRange() {\n let numberArray = [];\n\n //sets parameters for the table from 1 to 100\n for (let i = 1; i <= 100; i++){\n numberArray.push(i);\n }\n return numberArray;\n}", "title": "" }, { "docid": "7dee4e10cdc9035f1c54362c68909466", "score": "0.50450206", "text": "function calcMinChips(bet = account.bet){\n let values = Object.values(chipValues);\n let len = values.length\n let numChips = [];\n for(let i = 0; i<len; i++){\n numChips[i] = Math.floor(bet/values[i]);\n bet = bet%values[i];\n }\n return numChips;\n}", "title": "" }, { "docid": "a811f62cc7fb0635b4c7fe817d05bfa6", "score": "0.5041208", "text": "static get concurrency () {\n return 1\n }", "title": "" }, { "docid": "a811f62cc7fb0635b4c7fe817d05bfa6", "score": "0.5041208", "text": "static get concurrency () {\n return 1\n }", "title": "" }, { "docid": "93dd73e245b90f35310c45f5bc687d81", "score": "0.5037237", "text": "function range(a, b, x) {\n let arr = []\n if (x < 0) {\n for (let i = a; i >= b; i += x){\n arr.push(i)\n }\n } else {\n for (let i = a; i <= b; i += x){\n arr.push(i)\n }\n }\n return arr\n}", "title": "" }, { "docid": "9c73a1412ab0f0d51038b1c21ab53250", "score": "0.5033522", "text": "function createConstantIntervals(retries, interval) {\n const res = []\n for (let i = 0; i < retries; i++) {\n res.push(interval)\n }\n return res\n}", "title": "" }, { "docid": "f41d5dc8035d1c83ce0d58860d4e836e", "score": "0.5004294", "text": "function multiplesOfSix(min=0, max=600, inc=6){\n while(min < max){\n console.log(min)\n min += inc;\n }\n \n}", "title": "" }, { "docid": "553040ba70fefe1c1a5afd0bdaa4267b", "score": "0.50008315", "text": "function correr() {\n const min = 5\n const max = 15\n return Math.round(Math.random() * (max-min) + min)\n}", "title": "" }, { "docid": "73e01e13a5702899ed7c49b8821e61a2", "score": "0.49995795", "text": "function range(start, end) {\n let nums = [];\n // for (let i = 0; i < end; i++ , start++) {\n // group[i] = start;\n // }\n for (let i = start; i <= end; i++) {\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "844e289fba9855a136f98daf2dc415b6", "score": "0.49972", "text": "function Range() {}", "title": "" }, { "docid": "f35751cb346abd6cf76780ba26515903", "score": "0.4991709", "text": "static get maxBonds() {\n return {\n 'H': 1,\n 'C': 4,\n 'N': 3,\n 'O': 2,\n 'P': 3,\n 'S': 2,\n 'B': 3,\n 'F': 1,\n 'I': 1,\n 'Cl': 1,\n 'Br': 1\n };\n }", "title": "" }, { "docid": "99d8914189a28961ac198a54b18906d9", "score": "0.49822795", "text": "function _createBricksPerHostArray(maxBricksPerHost) {\n var arr = [];\n for (var i = 1; i <= maxBricksPerHost; i++) {\n arr.push(i);\n }\n return arr;\n }", "title": "" }, { "docid": "953d4592c3e7117e32ce001b30834607", "score": "0.49781662", "text": "randomRange() {\n let random = Math.floor(Math.random() * 3);\n switch (random) {\n case 0:\n return this.gotHit();\n break;\n case 1:\n return this.gotPowerup();\n break;\n case 2:\n return this.addCoin();\n break;\n }\n }", "title": "" }, { "docid": "77cf6829974ba1470af746dbffdab9a6", "score": "0.4974524", "text": "function range (n){\n\t\tvar array = [];\n\t\t\n\t\tfor(var i = 0; i < n; i++){\n\t\t\tarray.push(i);\n\t\t}\n\t\t\n\t\treturn array;\n\t}", "title": "" }, { "docid": "164aa2124d16371cb3c6e7ad85dbc02c", "score": "0.49741548", "text": "function range(n) {\n var range = [];\n for (var i = 1; i <= n; i++) range.push(i);\n return range;\n}", "title": "" }, { "docid": "449a8f657625b882f30d422f7bac7df8", "score": "0.49732804", "text": "function getReachableCells(cellule, mp){\n\tvar cellules_accessibles = accessible(cellule, mp);\n\tvar cellules_accessibles_2 = [];\n\tfor (var cell:var dist in cellules_accessibles){\n\t\tpush(cellules_accessibles_2, cell);\n\t}\n return cellules_accessibles_2;\n}", "title": "" }, { "docid": "57ebf8f23c591042ef0611682d6c0ee3", "score": "0.49611723", "text": "function range(min, max) {\n var arr = [];\n for (var i = min; i < max; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "ef7274c7273e81ebb0bb3b937a14a4ef", "score": "0.4946913", "text": "function getRetryLimit() {\n return 5;\n}", "title": "" }, { "docid": "09bbf744a6741a4c485ad294180f4ecc", "score": "0.4945476", "text": "function numberOfWaysToClimb(n) {\n\treturn Number;\n}", "title": "" }, { "docid": "7de76b5d1c9092f652608125208e4d20", "score": "0.49372634", "text": "function getInterval() {\n\t// linear function f(x)=-7x+750\n\treturn 750-(7*speed);\n}", "title": "" }, { "docid": "e1a285603b43280df8b514d0974d32ba", "score": "0.49372485", "text": "function rob(vals) {\n if (vals.length == 0) {\n return 0\n }\n if (vals.length == 1) {\n return vals[0]\n }\n if (vals.length == 2) {\n return Math.max(vals[0], vals[1])\n }\n // Initialize memoization\n let memo = []\n // Initialize base cases\n memo[vals.length-1] = vals[vals.length-1]\n memo[vals.length-2] = Math.max(vals[vals.length-2], vals[vals.length-1])\n for (let i = vals.length-3; i >=0; i--) {\n memo[i] = Math.max(vals[i]+memo[i+2], memo[i+1])\n }\n return memo[0]\n}", "title": "" }, { "docid": "3f5c3b8a26049cd3eacbfd7ebd0ca95f", "score": "0.49347025", "text": "function range(n) {\n return [...Array(n).keys()];\n}", "title": "" }, { "docid": "e920f60943e1696b6c5ff98fd6e08caf", "score": "0.49303833", "text": "startGameIntervals() {\n\t\treturn [\n\t\t\t// Increase Age over time\n\t\t\tsetInterval(this.updateAge.bind(this), 30000),\n\t\t\t// Increase Metrics over time\n\t\t\tsetInterval(this.increaseMetrics.bind(this), 15000),\n\t\t\t// Update Metrics\n\t\t\tsetInterval(this.updateMetrics.bind(this), 100),\n\t\t\t// Check morph age\n\t\t\tsetInterval(this.checkMorphAge.bind(this), 100),\n\t\t\t// Check metrics\n\t\t\tsetInterval(this.checkHealth.bind(this), 2000),\n\t\t];\n\t}", "title": "" }, { "docid": "ea1940c9889251082ddd7131e2562c26", "score": "0.49254137", "text": "get activeRange() {\n const activeRange = this.findRangeForSituation()\n return activeRange && this.toRange(activeRange)\n }", "title": "" }, { "docid": "743bec27d8838a43a1f4f20515b027be", "score": "0.4920597", "text": "function createNonRecRange(max, min) {\n var range = []\n for (var i = Math.round(min); i <= Math.round(max); i++) {\n range.push(i)\n }\n return function() {\n range = shuffle(range)\n int = range.pop()\n return int\n }\n}", "title": "" }, { "docid": "678a05da24f530ee602465d139c2cdc3", "score": "0.4913869", "text": "function minApprovals () { return 2 * Math.ceil(peer.addrList.size / 3) + 1 } // Implies >=3 nodes needed", "title": "" }, { "docid": "882d02c8db2ab733eb0ab24fa2363949", "score": "0.4913616", "text": "function range(x) { return [...Array(x).keys()] }", "title": "" }, { "docid": "6f51495877425442a88dc3238eb103dd", "score": "0.49087086", "text": "function range(min, max){\n return Math.random() * (min - max) + min\n}", "title": "" }, { "docid": "4d4d9426414dee012981f0e967963212", "score": "0.49028543", "text": "function getAllWins(x){\n\tvar playersPicks = getPlayersPicks();\n\tvar totalWins = 0;\n\tvar step;\n\t//20 is the max number of weeks\n\tfor (step=0;step<20;step++){\n\t\tvar temp2 = 1+ getRightArr(step).indexOf(playersPicks[x][step]);\n\t\tif(temp2 ==1){\n\t\t\ttotalWins = totalWins +1;\n\t\t}\n\t}\n\treturn totalWins;\n}", "title": "" }, { "docid": "4757469f1d3a5c7b36034cbb74703910", "score": "0.49022412", "text": "function lower_bound(i) {return car(i);}", "title": "" }, { "docid": "5db7d8d73cd1a476db5ac62faaa80f27", "score": "0.49012616", "text": "function top10EconomicalBowlers(matchList,deliveriesList)\n{\n var id2015=matchList.filter(match=> match.season == 2015).map(match=>match.id);\n var max= Math.max.apply(null, id2015);\n var min= Math.min.apply(null, id2015);\n return economicalBowlers(deliveriesList,max,min)\n}", "title": "" }, { "docid": "ad26f265cf5059490be20d29a042a0e4", "score": "0.48915982", "text": "static get ROWS() { return 10; }", "title": "" }, { "docid": "57c5c58794171a2e1c0414f6087119c4", "score": "0.4890927", "text": "function upDownRange() {\n\t\t\treturn 10;\n\t\t}", "title": "" }, { "docid": "4786945435ca4d69cfd51397a0fcc89f", "score": "0.48903388", "text": "function makeBombs(n){\n for(var b = 1; b <= numBombs; b += 1){\n bombsArray.push(randomizer(bombLimits));\n }\n}", "title": "" }, { "docid": "09d8ad8e71fc7012d458bcf14e726589", "score": "0.48887724", "text": "range () {\n\n let n = 0;\n let elect = this.head;\n\n while (elect) {\n elect = elect.next;\n n += 1;\n }\n\n return n;\n\n }", "title": "" }, { "docid": "5739a5c202c16e61f19bf3c4a15ced1d", "score": "0.48887268", "text": "function range(min, max) {\n var r = [], i;\n for (i = min; i < max; i++) {\n r.push(i);\n }\n return r;\n}", "title": "" }, { "docid": "5564868ba4650c3db303a05854bb30a2", "score": "0.4884144", "text": "function makeRange(max, min, gap) {\n if (max === min) return console.error(\"Range must be more than 1\");\n var prev = null\n return function getRandomNonConsecutiveInt() {\n var int = getRandomInt(max, min)\n return (\n prev !== int ?\n prev = int :\n getRandomNonConsecutiveInt()\n )\n }\n}", "title": "" }, { "docid": "340cdb55422dfea279b35a51fbd2a6e5", "score": "0.48768935", "text": "function AutoRangeDigitals () {\n let pens = printTrend.pens.filter(x=>x.type == 1 && x.rangeAuto);\n console.log({digitalPens: pens});\n console.log(pens.length);\n if (pens.length > 0){\n let maxRange = (2 * pens.length) + 1;\n if (maxRange < 7) maxRange = 7;\n let i = 0;\n for (let pen of pens){\n pen.min = -1 - (2*i);\n pen.max = pen.min + maxRange;\n i += 1;\n console.log(i);\n console.log(pen.min);\n console.log(pen.max);\n }\n }\n}", "title": "" }, { "docid": "4924309d21320a15c91eab2cb0acfe9b", "score": "0.48757178", "text": "function range(m,n)\n{\n var a = [];\n for(var i=m;i<=n;i++) a.push(i);\n return a;\n}", "title": "" }, { "docid": "843cf653aa1fcb18a29cbd82f6df1365", "score": "0.4869792", "text": "function makeIntervalMap () {\n var fromMin = 0;\n var fromMax = 1;\n var toMin = 0;\n var toMax = 1;\n var clamp = false;\n var ease;\n var chain = {\n to: function ( l, h ) { toMin = l; toMax = h; return chain; },\n toMin: function ( v ) { toMin = v; return chain; },\n toMax: function ( v ) { toMax = v; return chain; },\n from: function ( l, h ) { fromMin = l; fromMax = h; return chain; },\n fromMin: function ( v ) { fromMin = v; return chain; },\n fromMax: function ( v ) { fromMax = v; return chain; },\n ease: function ( fn ) { ease = fn; return chain; },\n clamp: function ( v ) { clamp = arguments.length > 0 ? v : true; return chain; },\n map: function ( v ) { return W.map( v, fromMin, fromMax, toMin, toMax, clamp, ease ); }\n };\n return chain;\n}", "title": "" }, { "docid": "ca17c4121fbb496e9b03009e2d654b0f", "score": "0.48692104", "text": "function extraRunsConceeded(matchList,deliveriesList)\n{\n var id2016=matchList.filter(id=> id.season == 2016).map(match=>match.id);\n var max= Math.max.apply(null, id2016);\n var min= Math.min.apply(null, id2016);\n return extraRuns(deliveriesList,max,min);\n}", "title": "" }, { "docid": "096ba236c0e5aa5ed340a3b41a022502", "score": "0.4857474", "text": "function createBounds(bits) {\n return {\n min: -1 * Math.pow(2, bits - 1),\n max: Math.pow(2, bits - 1) - 1\n };\n }", "title": "" }, { "docid": "37047a8176a20a71d10894eb31f2831e", "score": "0.4855668", "text": "function circlingSpeed() {\n\t\t\treturn 5;\n\t\t}", "title": "" }, { "docid": "c8a15d0ef4ded4756e99cd93371999d4", "score": "0.48556632", "text": "function powerBallDraw(max, min){ // creates a function that recieves the high and low values required for the random number gen\n var pAssignment = [];\n for(var powerBallCount = 1; powerBallCount <=5; powerBallCount++){// creates the loop to generate all the power ball numbers\n pAssignment [powerBallCount] = Math.random() * (max - min) + min; // creates a variable and has it perform the random number generation and assigns it to the variable\n pAssignment [powerBallCount] = Math.round(pAssignment[powerBallCount]);// rounds the value to the closet hole number\n\n }\n\n return pAssignment;// returns the array of powerball numbers\n\n\n }", "title": "" }, { "docid": "1b8d9e572309bcffeba1c64184e206af", "score": "0.48526645", "text": "function generateRange(min, max, step){\n\n }", "title": "" }, { "docid": "ad5dbb5f90789c4d16096a8b1c40e5eb", "score": "0.48511922", "text": "function RoundRobinPolicy() {\n this.index = 0;\n}", "title": "" }, { "docid": "8c5500fb5fc6c9c7ff8a82f67944a833", "score": "0.484663", "text": "function range(start, count, scheduler) {\n if (start === void 0) {\n start = 0;\n }\n return new Observable_Observable(function (subscriber) {\n if (count === undefined) {\n count = start;\n start = 0;\n }\n var index = 0;\n var current = start;\n if (scheduler) {\n return scheduler.schedule(range_dispatch, 0, {\n index: index, count: count, start: start, subscriber: subscriber\n });\n }\n else {\n do {\n if (index++ >= count) {\n subscriber.complete();\n break;\n }\n subscriber.next(current++);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n }\n return undefined;\n });\n}", "title": "" }, { "docid": "304d988f7eb19e73720106cf99512f89", "score": "0.48421684", "text": "get LowerLimit() {}", "title": "" }, { "docid": "1edc785cc0bccabe1432ec7c83906261", "score": "0.48352498", "text": "function getWinningCombinations() {\n\treturn (WINNING_COMBINATIONS.filter(combination =>\n\t\tcombination.every(index =>\n\t\t\thistory[move][Math.floor(index / BOARD_SIZE)][index % BOARD_SIZE] == turn\n\t\t) ? combination : null\n\t));\n}", "title": "" }, { "docid": "40c215e67e6222385547b95802a71d36", "score": "0.48307422", "text": "function inRange(x){\n\treturn x>= 40 && x<=4000;\n}", "title": "" }, { "docid": "19b8d9613fa2c8b34126c10e719f4bcf", "score": "0.48286355", "text": "function getActiveRange(props) {\n switch (props.accessMetric) {\n case \"num_stops\":\n return d3.ticks(10,75,numBreaks)\n case \"avg_num_routes_per_stop\":\n return d3.ticks(1,2,numBreaks)\n case \"avg_route_frequency\":\n return d3.ticks(45,5,numBreaks)\n case \"avg_accessible_stops\":\n return d3.ticks(50,100,numBreaks)\n }\n}", "title": "" }, { "docid": "3ba73ce248df245c98a892d774dc4ce0", "score": "0.48258942", "text": "function findMinimumAndMaximum(schedule) {\n let min = Number.POSITIVE_INFINITY;\n let max = 0;\n for (let max = 0; i < schedule.length; i++)\n if(schedule >= 3) {\n min >= 3;\n max <= 40;\n }\n \n return [min, max];\n}", "title": "" }, { "docid": "92ba7588c308dc631dd24952f6f01d2d", "score": "0.48193833", "text": "function spawnManyRocks()\r\n{\r\n\tfor (var i = 0; i < 10; i++)\r\n\t{\r\n\t\tspawnRock();\r\n\t}\r\n}", "title": "" }, { "docid": "0a93bc64799dd970280397fa202e7b38", "score": "0.48192656", "text": "function getPossibleNumbers(big, small){\n let numbers = [];\n let bigBucket = big;\n let smallBucket = small;\n let idx = 0\n while(idx < 100){\n if(!numbers.includes(bigBucket)){\n numbers.push(bigBucket);\n }\n \n if(!numbers.includes(smallBucket)){\n numbers.push(smallBucket);\n }\n \n if(smallBucket === small){\n smallBucket = 0;\n }\n \n if(bigBucket === 0){\n bigBucket = big;\n }\n \n let temp = smallBucket;\n smallBucket = Math.min(small, smallBucket + bigBucket); //7\n bigBucket = Math.max(0, bigBucket - (small - temp)); \n \n idx++;\n \n }\n \n return numbers.sort((a, b) => a - b);\n}", "title": "" }, { "docid": "9ecb3a1da184e39029cc8e05979e486b", "score": "0.48189604", "text": "cacheInterval(){this.cachedInterval=this.cachedCurrentMax-this.cachedCurrentMin;}", "title": "" }, { "docid": "4a8758c68f7a09fa8379f9849898f4ea", "score": "0.48164302", "text": "function range (num) {\n return Array.from(Array(num).keys())\n }", "title": "" }, { "docid": "ba1d8eb98444fa9ff5c9548dc5e24a7d", "score": "0.4815815", "text": "function range(min, max) {\n var range = [];\n for(var i = min; i <= max; i++) {\n range.push(i);\n }\n return range;\n}", "title": "" }, { "docid": "60857a46b1834630b55fee416b163940", "score": "0.4813124", "text": "function range(x, y) {\n if (x === y - 2) {\n return [x + 1];\n }\n return [x + 1, range(x + 1, y)].flat();\n}", "title": "" }, { "docid": "4f4ddc2c4697382d6f142bc4ff48fc71", "score": "0.48010886", "text": "function boundary(n){\n return (n >= 20 && n <= 100 || n === 400) ? true : false\n }", "title": "" }, { "docid": "5ef8a0962a10d51bc191ab5aba9cc0fa", "score": "0.47994137", "text": "function getConcurrentLessons(current, all) {\n var cStart = getTimeSinceStart(current.startTime);\n var cEnd = getTimeSinceStart(current.endTime);\n\n var concurrentLessons = [];\n\n for (var time = cStart; time < cEnd; time += 0.01) {\n\n var concurrent = 1;\n var lessons = [current];\n\n for (var i = 0; i < all.length; i++) {\n if (current != all[i]) {\n var tStart = getTimeSinceStart(all[i].startTime);\n var tEnd = getTimeSinceStart(all[i].endTime);\n\n if (tStart < time && tEnd > time) {\n concurrent++;\n lessons.push(all[i]);\n }\n }\n }\n\n if (concurrent > concurrentLessons.length) {\n concurrentLessons = lessons;\n }\n }\n\n return concurrentLessons;\n}", "title": "" }, { "docid": "d9f5453537ebd1429523640698b5e6f3", "score": "0.47940302", "text": "function bestInterval(range, numberTicks) {\n numberTicks = numberTicks || 7;\n var minimum = range / (numberTicks - 1);\n var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));\n var residual = minimum / magnitude;\n var interval;\n // \"nicest\" ranges are 1, 2, 5 or powers of these.\n // for magnitudes below 1, only allow these. \n if (magnitude < 1) {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 2) {\n interval = 5 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.\n // this helps a lot with poor choices for number of ticks. \n else {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 4) {\n interval = 5 * magnitude;\n }\n else if (residual > 3) {\n interval = 4 * magnitude;\n }\n else if (residual > 2) {\n interval = 3 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n\n return interval;\n }", "title": "" }, { "docid": "d9f5453537ebd1429523640698b5e6f3", "score": "0.47940302", "text": "function bestInterval(range, numberTicks) {\n numberTicks = numberTicks || 7;\n var minimum = range / (numberTicks - 1);\n var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));\n var residual = minimum / magnitude;\n var interval;\n // \"nicest\" ranges are 1, 2, 5 or powers of these.\n // for magnitudes below 1, only allow these. \n if (magnitude < 1) {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 2) {\n interval = 5 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.\n // this helps a lot with poor choices for number of ticks. \n else {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 4) {\n interval = 5 * magnitude;\n }\n else if (residual > 3) {\n interval = 4 * magnitude;\n }\n else if (residual > 2) {\n interval = 3 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n\n return interval;\n }", "title": "" }, { "docid": "d9f5453537ebd1429523640698b5e6f3", "score": "0.47940302", "text": "function bestInterval(range, numberTicks) {\n numberTicks = numberTicks || 7;\n var minimum = range / (numberTicks - 1);\n var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));\n var residual = minimum / magnitude;\n var interval;\n // \"nicest\" ranges are 1, 2, 5 or powers of these.\n // for magnitudes below 1, only allow these. \n if (magnitude < 1) {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 2) {\n interval = 5 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.\n // this helps a lot with poor choices for number of ticks. \n else {\n if (residual > 5) {\n interval = 10 * magnitude;\n }\n else if (residual > 4) {\n interval = 5 * magnitude;\n }\n else if (residual > 3) {\n interval = 4 * magnitude;\n }\n else if (residual > 2) {\n interval = 3 * magnitude;\n }\n else if (residual > 1) {\n interval = 2 * magnitude;\n }\n else {\n interval = magnitude;\n }\n }\n\n return interval;\n }", "title": "" }, { "docid": "c392dc787d6e75ee36b8e44bd357a148", "score": "0.47898942", "text": "function allObstacle() {\n\tvar closetOb = -1;\n\tvar minD = 20000;\n\tfor (var i = 0; i < noObstacle; i++) {\n\t\tvar distance = Math.sqrt((obstacleX[i] - realX)*(obstacleX[i] - realX) + (obstacleY[i]- realY)*(obstacleY[i] - realY));\n\t\tif (distance < minD) {\n\t\t\tminD = distance;\n\t\t\tclosetOb = i;\n\t\t}\n\t}\n\tfuck = minD;\n\treturn closetOb;\n}", "title": "" }, { "docid": "bc91e41c7499ab3a0c8150d597f963ef", "score": "0.47828844", "text": "static generateRange(num1, num2) {\n let rangeStart;\n let rangeEnd;\n const range = [];\n\n if (num1 > num2) {\n rangeStart = num2;\n rangeEnd = num1;\n } else {\n rangeStart = num1;\n rangeEnd = num2;\n }\n\n for (let i = rangeStart; i <= rangeEnd; i += 1) range.push(i);\n\n return range;\n }", "title": "" }, { "docid": "fc54f48f766c72b7eb34d07aa6ca4762", "score": "0.4782544", "text": "function xrange(min, max) {\n\n // generate array \n var x = [];\n for (var i = min; i <= max; i++) {\n x.push(i);\n }\n\n // success\n return x;\n \n}", "title": "" }, { "docid": "6cdcd61af7fd689c0d9860ec8fcf5701", "score": "0.47765794", "text": "function randNB(min, max, except) {\n\tvar n = parseInt(Math.random()*1000)%(max-min+1)+min;\n\tif(in_array(n, except)==true) {\n\t\twhile(in_array(n, except)==true) n = parseInt(Math.random()*1000)%(max-min+1)+min;\n\t}\n\treturn n;\n}", "title": "" }, { "docid": "faadb3c4585e7d481cbf1643dbd67d0f", "score": "0.4775907", "text": "function startGame(lobby_code, lobbies, clients) {\n _initGame(lobbies[lobby_code], clients);\n _dealCards(lobby_code);\n\n console.log(`Games TOTAL : ${Object.keys(games).length}`);\n\n return {\n game : _redactGame(games[lobby_code]),\n };\n }", "title": "" }, { "docid": "ba3935b45b4b2236263ed3a0c9a2a00c", "score": "0.47734985", "text": "function getBoundaries(botList = bots) {\n return botList.reduce(\n (tally, bot) => {\n const { x, y, z } = bot;\n if (x < tally.minX) tally.minX = x;\n if (x > tally.maxX) tally.maxX = x;\n if (y < tally.minY) tally.minY = y;\n if (y > tally.maxY) tally.maxY = y;\n if (z < tally.minZ) tally.minZ = z;\n if (z > tally.maxZ) tally.maxZ = z;\n return tally;\n },\n {\n minX: Infinity,\n maxX: -Infinity,\n minY: Infinity,\n maxY: -Infinity,\n minZ: Infinity,\n maxZ: -Infinity,\n },\n );\n}", "title": "" }, { "docid": "22dd94575720a88945aef39fa970f3ea", "score": "0.47728106", "text": "function possibleCombos() {\n var possiblities = max * (max - 1) * (max - 2);\n var factorial = 1 * 2 * 3;\n var sum = possiblities / factorial;\n return formatNumber(sum);\n }", "title": "" }, { "docid": "e2c0410db268bf8f22c973e17f11cfdc", "score": "0.4768876", "text": "function makeTicks(max, maxString, blocking) {\n var ticks = [];\n var interval = (max > 150) ? 30 : ((max > 60) ? 20 : 10);\n var maxVal = max;\n if (!blocking) {\n maxVal = (2 * max) + 1;\n interval *= 2;\n }\n console.log(interval);\n var count = 0;\n\n for (var i = 0; i < maxVal; i = i + interval) {\n if (i != max) {\n ticks[count] = i;\n count++; \n }\n }\n ticks[count] = {v: max, f: maxString};\n console.log(ticks);\n return ticks;\n}", "title": "" }, { "docid": "a42c72b3789fa007e948f1c49bf7632f", "score": "0.47683552", "text": "function hello_range(a){\n for (i=0;i<a;i++) {\n console.log('Hello Masai')\n }\n}", "title": "" }, { "docid": "aa93d8a86a193e53472b2d7845df338d", "score": "0.4762579", "text": "function range(min) {\n var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (max == null) {\n max = min;\n min = 0;\n }\n // Neat little trick from \n // https://stackoverflow.com/questions/3895478/does-javascript-have-a-method-like-range-to-generate-a-range-within-the-supp\n return Array.from(Array(max - min).keys()).map(function (el) {\n return el + min;\n });\n}", "title": "" }, { "docid": "132bb9799023ded96f10d9ad448149e0", "score": "0.47592133", "text": "function lobb(n, m) {\n\treturn ((2 * m + 1) * binomialCoeff(2 * n, m + n)) / (m + n + 1)\n}", "title": "" }, { "docid": "9b4c2f24aebd8a9bd4277e1b28733597", "score": "0.4749499", "text": "function baddie() {\n for (let i = 1; i <= 10; i++) {\n console.log(i);\n }\n\n}", "title": "" }, { "docid": "1f5e9c9e1d8891df6ef237a6a255c3e3", "score": "0.47478575", "text": "get EqualLimits() {}", "title": "" } ]
a39f8b86f0acac66a953076f3675f57c
Helper function used to load a file from the server
[ { "docid": "99b21795bb77d3b5363231b00d625b17", "score": "0.7023334", "text": "function loadFileFromServer(filename) {\r\n return new Promise((resolve, reject) => {\r\n let xmlHttp = new XMLHttpRequest();\r\n\r\n xmlHttp.onreadystatechange = function() {\r\n if (xmlHttp.readyState === XMLHttpRequest.DONE) {\r\n resolve(xmlHttp.responseText);\r\n }\r\n };\r\n\r\n xmlHttp.open(\"GET\", filename, true);\r\n xmlHttp.send();\r\n });\r\n}", "title": "" } ]
[ { "docid": "3120e2c77cc2a870afa9221a17f10897", "score": "0.7064723", "text": "function loadFile(filePath) {\r\n var result = null;\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", filePath, false);\r\n xmlhttp.send();\r\n if (xmlhttp.status === 200) {\r\n result = xmlhttp.responseText;\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "0ee4201fefea2f41f80e1857169b699a", "score": "0.70211875", "text": "function loadFile(filePath) {\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n xmlhttp.send();\n if (xmlhttp.status==200) {\n result = xmlhttp.responseText;\n }\n return result;\n }", "title": "" }, { "docid": "229d10153458c3659d5fd28d1ea8edac", "score": "0.7008359", "text": "_getFileFromServer() {\n $.ajax({\n url: this.config.path + '/' + this.config.language + this.config.extension,\n dataType: 'json',\n async: false,\n success: this._onSuccess.bind(this),\n error: this._onError.bind(this)\n })\n }", "title": "" }, { "docid": "a51a444fa29fe427918f909f530cb488", "score": "0.70079213", "text": "function loadFile(filePath) {\n\tvar result = null;\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.open(\"GET\", filePath, false);\n\txmlhttp.send();\n\tif (xmlhttp.status == 200) {\n\t\tresult = xmlhttp.responseText;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "b5906a813b5623aab7bf2968a49f0707", "score": "0.69756055", "text": "function loadFile(filePath) {\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n xmlhttp.send();\n if (xmlhttp.status==200) {\n result = xmlhttp.responseText;\n }\n return result;\n}", "title": "" }, { "docid": "7f1497cb684dac22eb5553f58159ed04", "score": "0.69276464", "text": "loadFile(path) {\r\n path = this.getAbsoluteDataPath(path);\r\n // Check if a file exists at this path\r\n if (FS_1.FS.existsSync(path)) {\r\n try {\r\n // If it exists, read the contents\r\n const contents = FS_1.FS.readFileSync(path, \"utf8\");\r\n // Return undefined if there are no contents\r\n if (contents.length == 0)\r\n return;\r\n // Parse it to json\r\n const data = JSON.parse(contents);\r\n // Return the data\r\n return data;\r\n }\r\n catch (e) {\r\n // If anything goes wrong, just log an error. TODO: Properly handle these errors\r\n console.error(`Something went wrong while retrieving ${path}:`, e);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5526e7a0a0233c0418964d0066229284", "score": "0.65564334", "text": "async loadFile(path) {\n const buf = await fs_extra_1.readFile(path);\n await this.client.raw(buf.toString());\n }", "title": "" }, { "docid": "adbd8c9fbde36b26c872847c714724af", "score": "0.65454507", "text": "function readFile(serverPort, filename) {\n let url = 'http://localhost:' +\n serverPort + //port number from data.gui\n '/js/' + //url path\n filename + //file name from dat.gui\n '.json'; //extension\n let request = new XMLHttpRequest();\n request.open('GET', url);\n request.responseType = 'text';\n request.send();\n request.onload = () => {\n let data = request.responseText;\n let parsedJSON = JSON.parse(data)\n createGame(parsedJSON);\n }\n}", "title": "" }, { "docid": "07f9ad27b733e347980f1f9ecc260778", "score": "0.64830786", "text": "function loadFile(scriptName) {\n let request = Cc[\"@mozilla.org/xmlextras/xmlhttprequest;1\"].createInstance(Ci.nsIXMLHttpRequest);\n request.open(\"GET\", scriptName, true);\n request.overrideMimeType(\"text/plain\");\n request.send(null);\n \n return request.responseText;\n}", "title": "" }, { "docid": "e5c6b5319b582d5539a73bee8524dd17", "score": "0.6473517", "text": "function _requestFile() {\n\tif (AUTO_IMPORT && _validateURL(HOSTED_FILE)) {\n\t\tfetch(HOSTED_FILE)\n\t\t.then(res => res.json())\n\t\t.then((out) => {\n\t\t\t_mergeSettings(out, ENV_SETTINGS, HOSTED_FILE, AUTO_IMPORT, function(){});\n\t\t})\n\t\t.catch(err => { \t\t\n\t\t\tconsole.log('Environment Marker: Something went wrong when trying to retrieve the file from the URL.');\t\t\n\t\t});\n\t}\n}", "title": "" }, { "docid": "17c70147e52c3304f665b1bdd5283822", "score": "0.6413376", "text": "async function load_init_file(filepath) {\n const u = new URL(filepath);\n return await fetch(u).then(res => res.text()).then(text => text);\n}", "title": "" }, { "docid": "ca1cc01fe85252d2adcb7aa1416964b3", "score": "0.6327457", "text": "function loadFile(fname)\n{\n\t$(\"#statind\").text(\"Loading: \" + fname);\n\t$.ajax({\n\turl : fname,\n\tcache : false,\n\tprocessData : false,\n\tmethod:\t\t'GET',\n\ttype : 'GET',\n\tsuccess : function(data, textStatus, jqXHR){\n\t\tsetEditText(fname, data);\n\t\t$(\"#statind\").text(fname + \" loaded.\");\n\t},\n\n\terror: function (data, textStatus, jqXHR) {\n\t\tconsole.log(\"Error: \" + textStatus);\n\t},\n\n\txhr: function() {\n\t\tvar xhr = new window.XMLHttpRequest();\n\t\txhr.responseType= 'text';\n\t\treturn xhr;\n\t},\n\n\t});\n}", "title": "" }, { "docid": "8eade539369a5d337b9a96695ea6154b", "score": "0.6273908", "text": "function loadTextFileAjaxSync(filePath, mimeType) {\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", filePath, false);\r\n if (mimeType != null) {\r\n if (xmlhttp.overrideMimeType) {\r\n xmlhttp.overrideMimeType(mimeType);\r\n }\r\n }\r\n xmlhttp.send();\r\n if (xmlhttp.status == 200) {\r\n return xmlhttp.responseText;\r\n } else {\r\n return null;\r\n }\r\n}", "title": "" }, { "docid": "74d46f34f09deeff130cecc0f5ebf4cf", "score": "0.6257057", "text": "function ieLoadFile(filePath)\n{\n\ttry\n\t\t{\n\t\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\tvar file = fso.OpenTextFile(filePath,1);\n\t\tvar content = file.ReadAll();\n\t\tfile.Close();\n\t\t}\n\tcatch(e)\n\t\t{\n\t\t//alert(\"Exception while attempting to load\\n\\n\" + e.toString());\n\t\treturn(null);\n\t\t}\n\treturn(content);\n}", "title": "" }, { "docid": "deb3ff8ab7299fa822f8241da361c5c8", "score": "0.6238607", "text": "function loadTextFileAjaxSync(filePath, mimeType)\n{\n var xmlhttp=new XMLHttpRequest();\n xmlhttp.open(\"GET\",filePath,false);\n if (mimeType != null) {\n if (xmlhttp.overrideMimeType) {\n xmlhttp.overrideMimeType(mimeType);\n }\n }\n xmlhttp.send();\n if (xmlhttp.status==200 && xmlhttp.readyState == 4 )\n {\n return xmlhttp.responseText;\n }\n else {\n // TODO Throw exception\n return null;\n }\n}", "title": "" }, { "docid": "809fd5920d7ab3d7e32d696fb8ee71f4", "score": "0.62353194", "text": "function readFile (fullpath){\n\tvar result=\"\";\n\t$.ajax({\n\t\turl: fullpath,\n\t\tasync: false,\n\t\tdataType: \"text\",\n\t\tsuccess: function (data) {\n\t\t\tresult = data;\n\t\t}\n\t});\n\treturn result;\n}", "title": "" }, { "docid": "1bb8f639c529b2783ea31a7282b8978c", "score": "0.6207646", "text": "function loadExternalData() {\n var loadFileParam = $location.search().loadfile;\n if (loadFileParam) {\n // block gui for long calls\n blockGui(true);\n Rest.callOther(\"loadableServerDataFiles\", \"loadFromFile\" + \"/\" + loadFileParam, initFromResponse);\n }\n }", "title": "" }, { "docid": "7057f68ab29158dd4b253cfc01daa859", "score": "0.6205194", "text": "async function fromServer(fileName){\n\t\tconst playlistUrlApiEndpoint = `api/fileAcess?fileName=${fileName}`;\n\t\tconst res = await fetch(playlistUrlApiEndpoint);\n\t\tconsole.log(res);\n\t\treturn res.body;\n\t}", "title": "" }, { "docid": "6731a0f5c99a2cf80c0643afa5ab5ef5", "score": "0.6182726", "text": "function _loadTextFileAjaxSync(filePath, mimeType) {\n\t\tvar xmlhttp=new XMLHttpRequest();\n\t\txmlhttp.open(\"GET\",filePath,false);\n\t\tif (mimeType != null) {\n\t\t\tif (xmlhttp.overrideMimeType) {\n\t\t\t\txmlhttp.overrideMimeType(mimeType);\n\t\t\t}\n\t\t}\n\t\txmlhttp.send();\n\t\t//console.log(xmlhttp);\n\t\tif (xmlhttp.status==200 || xmlhttp.status==0) {\n\t\t\treturn xmlhttp.responseText;\n\t\t} else {\n\t\t\tthrow \"AJAX file load error\";\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "906b755a4c7d528a077a9e9b589a8545", "score": "0.61730254", "text": "function ieLoadFile(filePath)\n{\n\ttry {\n\t\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\tvar file = fso.OpenTextFile(filePath,1);\n\t\tvar content = file.ReadAll();\n\t\tfile.Close();\n\t} catch(ex) {\n\t\t//# alert(\"Exception while attempting to load\\n\\n\" + ex.toString());\n\t\treturn null;\n\t}\n\treturn content;\n}", "title": "" }, { "docid": "3c15f4566f8c0631a70822d5346bf216", "score": "0.6151683", "text": "function read_file(filepath, cb) {\n var param = { fsid: fsid, path: filepath };\n ajax(service_url.read, param, function(err, filecontent, textStatus, jqXHR) {\n if (err) return cb(err);\n if (jqXHR.status != 200) {\n var msg;\n switch (jqXHR.status) {\n case 404:\n msg = lang('s0035'); break;\n case 406:\n msg = lang('s0036'); break;\n case 400:\n msg = lang('s0037'); break;\n default:\n msg = 'Code ' + jqXHR.status +' -- '+ textStatus;\n }\n return cb(new Error(lang('s0038')+ ': '+ filepath+ ', '+ msg));\n }\n var mimetype = jqXHR.getResponseHeader('Content-Type');\n var uptime = jqXHR.getResponseHeader('uptime');\n cb(null, filecontent, uptime, mimetype);\n });\n }", "title": "" }, { "docid": "5ef81a3c3d5ab07ec27238387fd6dbad", "score": "0.6150327", "text": "function http_get(file) \n{\n\tif (window.XMLHttpRequest) \n\t{\n\t\t// IE7+, Firefox, Chrome, Opera, Safari\n\t\tvar request = new XMLHttpRequest();\n\t}\n\telse \n\t{\n\t\t// code for IE6, IE5\n\t\tvar request = new ActiveXObject('Microsoft.XMLHTTP');\n\t}\n\t// load\n\trequest.open('GET', file, false);\n\trequest.send();\n\treturn request.responseText;\n}", "title": "" }, { "docid": "8e7ec4f9a8ed12ee599644ac52a6a97c", "score": "0.61381435", "text": "function loadFileInto(fromFile, whereTo) {\n\n\t// creating a new XMLHttpRequest object\n\tajax = new XMLHttpRequest();\n\n\t// defines the GET/POST method, source, and async value of the AJAX object\n\tajax.open(\"GET\", fromFile, true);\n\n\t// prepares code to do something in response to the AJAX request\n\tajax.onreadystatechange = function() {\n\t\t\n\t\t\tif ((this.readyState == 4) && (this.status == 200)) {\n\t\t\t\tdocument.getElementById(whereTo).innerHTML = this.responseText;\n\t\t\t\t\n\t\t\t} else if ((this.readyState == 4) && (this.status != 200)) {\n\t\t\t\tconsole.log(\"Error: \" + this.responseText);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t} // end ajax.onreadystatechange\n\n\t// now that everything is set, initiate request\n\tajax.send();\n\n}", "title": "" }, { "docid": "4d12db898891e396cc1799bb3b07ee9f", "score": "0.61379933", "text": "function requestContent(filename) {\n $('main').load(filename);\n}", "title": "" }, { "docid": "3ebc29e35e4e0447a357c9c33b888e32", "score": "0.6135016", "text": "function loadFileAJAX(name) {\n var xhr = new XMLHttpRequest(),\n\tokStatus = document.location.protocol === \"file:\" ? 0 : 200;\n var d = new Date();\n //We add the current date to avoid caching of request\n //Murder for development\n xhr.open('GET', name+\"?\"+d.toJSON(), false);\n xhr.send(null);\n return xhr.status == okStatus ? xhr.responseText : xhr.responseText;\n}", "title": "" }, { "docid": "51f1ff0c2d309655787f7f0e083c34fc", "score": "0.61211413", "text": "function loadFile(file){\n\tlet fs = require('fs');\n\tvar data = fs.readFileSync(file);\n\tvar contents = (JSON.parse(data));\n\treturn contents;\n}", "title": "" }, { "docid": "fb2744c0a03883c5d982a5e6dee30e09", "score": "0.61210495", "text": "function loadFromServer(fileName, callback) {\n\tvar fileExts = {xdsl:true,dne:true};\n\tvar format = fileName.replace(/^.*\\.([^.]*)$/, '$1');\n\tif (!fileExts[format]) {\n\t\tformat = \"xdsl\";\n\t}\n\t$.get(fileName, function(data) {\n\t\topenBns.push(new BN({source: data, outputEl: $(\".bnview\"), format: format}));\n\t\tcurrentBn = openBns[openBns.length-1];\n\t\tcurrentBn.fileName = baseName(fileName);\n\t\tdocument.title = baseName(fileName) + \" - \" + titlePostfix;\n\t\t$(\".status\").text(currentBn.nodes.length+\" nodes\");\n\t\tif (callback) callback();\n\t}, \"text\");\n}", "title": "" }, { "docid": "7f65a598cf089ef8610c921615577b61", "score": "0.6112481", "text": "function loadTextFileAjaxSync(filePath, mimeType) {\n\tvar xmlhttp=new XMLHttpRequest();\n\txmlhttp.open(\"GET\",filePath,false);\n\tif (mimeType != null) {\n\t\tif (xmlhttp.overrideMimeType) {\n\t\t\txmlhttp.overrideMimeType(mimeType);\n\t\t}\n\t}\n\txmlhttp.send();\n\tif (xmlhttp.status==200) {\n\t\treturn xmlhttp.responseText;\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "25a9fed3211710c679ad047297bfb37c", "score": "0.6097117", "text": "getFile(filePath, options) {\n console.log('api.getFile: ', filePath);\n return this.sendRequest({\n type: 'loadFile',\n filePath: filePath,\n options: options\n })\n .then(function(fileInfo) {\n return {\n filePath: filePath,\n contents: fileInfo.payload.contents\n }\n })\n .catch(function(errorInfo) {\n return undefined;\n });\n }", "title": "" }, { "docid": "d160b9688c509a5b365b9a59ff82a507", "score": "0.6075635", "text": "function read_file(filename) {\n var file_data = data.load(filename);\n return file_data;\n}", "title": "" }, { "docid": "9488c72f79e2cfe164fbaab99baba883", "score": "0.60738724", "text": "function loadConfiguration(configFile)\n{\n //get config file from server\n var Httpreq = new XMLHttpRequest();\n Httpreq.open(\"GET\",configFile,false);\n Httpreq.send(null);\n\n //return contents of configFile\n return Httpreq.responseText; \n}", "title": "" }, { "docid": "3b11b0bcc7fc6808979495933b329cfb", "score": "0.6071976", "text": "function mozillaLoadFile(filePath)\n{\n\tif(window.Components) {\n\t\ttry {\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\tvar file = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n\t\t\tfile.initWithPath(filePath);\n\t\t\tif(!file.exists())\n\t\t\t\treturn null;\n\t\t\tvar inputStream = Components.classes[\"@mozilla.org/network/file-input-stream;1\"].createInstance(Components.interfaces.nsIFileInputStream);\n\t\t\tinputStream.init(file,0x01,0x04,null);\n\t\t\tvar sInputStream = Components.classes[\"@mozilla.org/scriptableinputstream;1\"].createInstance(Components.interfaces.nsIScriptableInputStream);\n\t\t\tsInputStream.init(inputStream);\n\t\t\tvar contents = sInputStream.read(sInputStream.available());\n\t\t\tsInputStream.close();\n\t\t\tinputStream.close();\n\t\t\treturn contents;\n\t\t} catch(ex) {\n\t\t\t//# alert(\"Exception while attempting to load\\n\\n\" + ex);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "619825f2c4d5822902ec29cb545502f8", "score": "0.60537034", "text": "getFileByServerRelativeUrl(fileRelativeUrl) {\r\n return new File(this, `getFileByServerRelativeUrl('${fileRelativeUrl}')`);\r\n }", "title": "" }, { "docid": "7811676ec2fdab5ad1fdacefd489aebd", "score": "0.6048533", "text": "function mozillaLoadFile(filePath)\n{\n\tif(window.Components) {\n\t\ttry {\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\tvar file = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n\t\t\tfile.initWithPath(filePath);\n\t\t\tif(!file.exists())\n\t\t\t\treturn null;\n\t\t\tvar inputStream = Components.classes[\"@mozilla.org/network/file-input-stream;1\"].createInstance(Components.interfaces.nsIFileInputStream);\n\t\t\tinputStream.init(file,0x01,00004,null);\n\t\t\tvar sInputStream = Components.classes[\"@mozilla.org/scriptableinputstream;1\"].createInstance(Components.interfaces.nsIScriptableInputStream);\n\t\t\tsInputStream.init(inputStream);\n\t\t\tvar contents = sInputStream.read(sInputStream.available());\n\t\t\tsInputStream.close();\n\t\t\tinputStream.close();\n\t\t\treturn contents;\n\t\t} catch(ex) {\n\t\t\treturn ex;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "015f4dfddffb6449758c132b8d8ada67", "score": "0.6043714", "text": "function loadFile(file){\n\tlet fs = require('fs');\n\tlet content = fs.readFileSync(file);\n\tlet obj = JSON.parse(content);\n\treturn obj;\n}", "title": "" }, { "docid": "27605a111562cf0c07b596f6fe55a7c7", "score": "0.6037043", "text": "function load(req, res, next, id) {\n File.get(id)\n .then((file) => {\n req.file = file; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "title": "" }, { "docid": "e55f64e1970aaac6c297a638999d7824", "score": "0.60368645", "text": "function file_read(file, callback=null) {\n $.ajax({\n url: file,\n success: callback\n });\n}", "title": "" }, { "docid": "cc5ec8da44e61af614527ea8fc610f50", "score": "0.60266006", "text": "function load(path, callback, errorCallback) {\n if (path) {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n var status = req.status;\n if (status == 200) {\n // readyState is done, request status ok\n callback(req.responseXML, req.responseText.trim());\n } else if (status >= 400) {\n errorCallback();\n } else if (status == 0) {\n errorCallback();\n }\n }\n };\n req.open('GET', path, true);\n req.send();\n }\n }", "title": "" }, { "docid": "86d60f013f6ae2683e76006e1da5c29e", "score": "0.60139394", "text": "function ajax_load_file(url, callback) {\n if (url.charAt(0) === \"/\") url = \".\" + url\n else if (url.charAt(0) === \".\") url = current_baseuri + url\n\n var nu\n while ((nu = url.replace(/[^\\/]+\\/..\\//, \"./\").replace(\"/./\", \"/\")) !== url) url = nu // resolve\n current_baseuri = (nu.replace(/\\/[^\\/]+$/, \"\") || \".\") + \"/\" // dirname\n current_url = url\n\n console.log(\"LOADING\", url, current_baseuri)\n\n var xmlhttp;\n if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest() }\n else if (window.ActiveXObject) { xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\") }\n if (xmlhttp != null) {\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n callback(xmlhttp.responseText, url)\n }\n }\n xmlhttp.open(\"GET\", url, true)\n xmlhttp.send(null)\n }\n}", "title": "" }, { "docid": "ebb576819fd4c654af1e284d092e961d", "score": "0.6013157", "text": "function loadFile(file){\n\t\tlet fs = require('fs');\n\t\tlet content = fs.readFileSync(file);\n\t\tlet obj = JSON.parse(content);\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "ebf76835dbdf221ba334917df88108fd", "score": "0.6012713", "text": "function testFileServing() {\n var req = request(`http://127.0.0.1:${testPort}/someJSON.json`, {\n timeout: 1000\n }, function(error, response, body) {\n if (error || response.statusCode !== 200) {\n t.fail('Bad request to static server');\n } else {\n t.ok(JSON.parse(body).theFile, 'The right file was server');\n }\n req.abort();\n end();\n });\n }", "title": "" }, { "docid": "3a8e519efc271e2a4c86842e39393767", "score": "0.59909225", "text": "function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}", "title": "" }, { "docid": "381caf2c036a008a78fe1b610e019737", "score": "0.5988649", "text": "function getFileURL() {\n return urlVars['file'];\n}", "title": "" }, { "docid": "50a236a88fc56fa9507dac5d6217b198", "score": "0.5985841", "text": "function getFile(json, url) {\n\n try { \n\treturn fs.readFileSync(\".\" + url.pathname);\n } catch (err) {\n\t//Don't do anything\n\tconsole.log(\"Coudnt read file\" + err);\n }\n}", "title": "" }, { "docid": "a1c64efa6201c2e0b4b675632479288c", "score": "0.5982365", "text": "function mozillaLoadFile(filePath)\n{\n\tif(window.Components)\n\t\ttry\n\t\t\t{\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\tvar file = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n\t\t\tfile.initWithPath(filePath);\n\t\t\tif (!file.exists())\n\t\t\t\treturn(null);\n\t\t\tvar inputStream = Components.classes[\"@mozilla.org/network/file-input-stream;1\"].createInstance(Components.interfaces.nsIFileInputStream);\n\t\t\tinputStream.init(file, 0x01, 00004, null);\n\t\t\tvar sInputStream = Components.classes[\"@mozilla.org/scriptableinputstream;1\"].createInstance(Components.interfaces.nsIScriptableInputStream);\n\t\t\tsInputStream.init(inputStream);\n\t\t\treturn(sInputStream.read(sInputStream.available()));\n\t\t\t}\n\t\tcatch(e)\n\t\t\t{\n\t\t\t//alert(\"Exception while attempting to load\\n\\n\" + e);\n\t\t\treturn(false);\n\t\t\t}\n\treturn(null);\n}", "title": "" }, { "docid": "8d65f6f26e6bcbca0d27461933850508", "score": "0.59744495", "text": "static fromFile(file) {\r\n return file.getItem().then(i => {\r\n const page = new ClientSidePage(extractWebUrl(file.toUrl()), \"\", { Id: i.Id }, true);\r\n return page.configureFrom(file).load();\r\n });\r\n }", "title": "" }, { "docid": "16c271d6a6a2d8c27074b81865540797", "score": "0.5966154", "text": "async function load_init_file(filepath) {\n console.log(\"initfile :\", filepath);\n\n const u = new URL(filepath);\n fetch(u).then(res => res.text()).then(text => {\n try {\n execute(text);\n } catch (exception) {\n console.log(\"commands failed\");\n }\n });\n }", "title": "" }, { "docid": "091065c00e9995a1fb46bd1d4da69a08", "score": "0.596268", "text": "function loadFile(path) {\n if (typeof process !== \"undefined\" && process.versions && !!process.versions.node && require.nodeRequire) {\n var fs = require.nodeRequire('fs');\n var file = fs.readFileSync(path, 'utf8');\n if (file.indexOf('\\uFEFF') === 0)\n return file.substring(1);\n return file;\n }\n else {\n var encoding = \"utf-8\",\n file = new java.io.File(path),\n lineSeparator = java.lang.System.getProperty(\"line.separator\"),\n input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),\n stringBuffer, line,\n content = '';\n try {\n stringBuffer = new java.lang.StringBuffer();\n line = input.readLine();\n if (line && line.length() && line.charAt(0) === 0xfeff)\n line = line.substring(1);\n stringBuffer.append(line);\n while ((line = input.readLine()) !== null) {\n stringBuffer.append(lineSeparator);\n stringBuffer.append(line);\n }\n content = String(stringBuffer.toString());\n }\n finally {\n input.close();\n }\n }\n }", "title": "" }, { "docid": "90a1fc9140b026cb960545ccd58bab42", "score": "0.59534204", "text": "function openFile(_filename) {\r\n try {\r\n var m = fs.readFileSync('./public/maps/' + _filename, 'utf8'); \r\n } catch(e) {\r\n console.log('Error oppening the file:', e.stack);\r\n }\r\n return m;\r\n}", "title": "" }, { "docid": "d73d59046cda296fa03ae0509d37e34d", "score": "0.5952405", "text": "function loadfile() {\n // pop up a file upload dialog\n // when file is received, send to server and populate db with it\n}", "title": "" }, { "docid": "2d42ae24a8fffac4a23cd80e39a38347", "score": "0.59522873", "text": "function loadAndParseFile(filename, settings) {\n\t$.ajax({\n url: filename,\n async: false,\n cache:\t\tsettings.cache,\n contentType:'text/plain;charset='+ settings.encoding,\n dataType: 'text',\n success: function(data, status) {\n \t\t\t\tparseData(data, settings.mode); \n\t\t\t\t\t}\n });\n}", "title": "" }, { "docid": "2d42ae24a8fffac4a23cd80e39a38347", "score": "0.59522873", "text": "function loadAndParseFile(filename, settings) {\n\t$.ajax({\n url: filename,\n async: false,\n cache:\t\tsettings.cache,\n contentType:'text/plain;charset='+ settings.encoding,\n dataType: 'text',\n success: function(data, status) {\n \t\t\t\tparseData(data, settings.mode); \n\t\t\t\t\t}\n });\n}", "title": "" }, { "docid": "d73fc170fb4484256229db645330a880", "score": "0.5942627", "text": "async load () {}", "title": "" }, { "docid": "01b35d4d87d132e3bce57cd91caf247c", "score": "0.59304595", "text": "function getFile(file) {\n fakeAjax(file, function(text) {\n handleResponse(file, text);\n });\n}", "title": "" }, { "docid": "7535587163ca384706763bb86ebd4bbb", "score": "0.5919163", "text": "function load(filename) {\n\t\tlet xmlhttp;\n\t\tif (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari\n\t\t\txmlhttp = new XMLHttpRequest();\n\t\t} else { // code for IE6, IE5\n\t\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\n\t\t// Note: As of Apr 2020, this doesn't work locally with safari anymore, even with CORS protection off\n\t\txmlhttp.onreadystatechange = function() {\n\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\t\tlet q = document.createElement('span');\t// Extra stuff to make IE happy. Fuck IE\n\t\t\t\tq.setAttribute('id', 'loadFile');\t\t//\n\t\t\t\tq.setAttribute('class', 'invisible');\t//\n\t\t\t\tdocument.body.appendChild(q);\t\t\t//\n\t\t\t\tdocument.getElementById(\"loadFile\").innerHTML = '<embed src=\"' + filename + '\" controller=\"1\" autoplay=\"0\" autostart=\"0\"/>';\n\t\t\t\t// Prevents Firefox from audibly playing preloaded SFX\n\t\t\t\tif (navigator.userAgent.indexOf('Firefox') > -1 && navigator.userAgent.indexOf('Seamonkey') == -1) {\n\t\t\t\t\tdocument.getElementById(\"loadFile\").innerHTML = '';\n\t\t\t\t}\n\t\t\t\tconsole.log('Loaded file ' + cow.filesPreloaded + '/173 - ' + filename);\n\t\t\t\tcow.filesPreloaded++;\n\t\t\t\tif (cow.filesPreloaded >= 173) { \n\t\t\t\t\tsetTimeout(function() { cow.preloaderComplete = true; }, 1500);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Prevents some harmless console errors in Firefox\n\t\tconst period = filename.lastIndexOf('.');\n\t\tconst filetype = filename.substring(period + 1);\n\t\tif (filetype == 'opus' || filetype == 'caf') { xmlhttp.overrideMimeType('audio/' + filetype); }\n\n\t\t// Start!\n\t\txmlhttp.open('GET', filename, true);\n\t\txmlhttp.send();\n\t}", "title": "" }, { "docid": "ac65dd3d928f77c6a8148ffe49767205", "score": "0.59140146", "text": "function get_file(url) {\n\tconst request = new XMLHttpRequest()\n\t// This throws a warning about synchronous requests being deprecated\n\trequest.open('GET',url,false)\n\trequest.send()\n\treturn request.responseText\n}", "title": "" }, { "docid": "aa51eb17d16f50d1872cd039878cedc1", "score": "0.59080756", "text": "load() {}", "title": "" }, { "docid": "aa51eb17d16f50d1872cd039878cedc1", "score": "0.59080756", "text": "load() {}", "title": "" }, { "docid": "3366e6adc69f0f6ac51053e825278d5c", "score": "0.59052664", "text": "function loadFile(fn) {\n return new Promise ( (res, rej) => {\n fs.readFile(fn, (err, data) => {\n if (err) {\n rej(err);\n };\n res(data);\n })\n\n })\n}", "title": "" }, { "docid": "463bc086b2db103539f5641e867e8f1b", "score": "0.59029573", "text": "function load_file(url, use_cache) {\n\t\tlet fetch_promise = promise();\n\t\tlet no_cache = split_list(localStorage.getItem('wkof.load_file.nocache') || '');\n\t\tif (no_cache.indexOf(url) >= 0 || no_cache.indexOf('*') >= 0) use_cache = false;\n\t\tif (use_cache === true) {\n\t\t\treturn file_cache_load(url, use_cache).catch(fetch_url);\n\t\t} else {\n\t\t\treturn fetch_url();\n\t\t}\n\n\t\t// Retrieve file from server\n\t\tfunction fetch_url(){\n\t\t\tlet request = new XMLHttpRequest();\n\t\t\trequest.onreadystatechange = process_result;\n\t\t\trequest.open('GET', url, true);\n\t\t\trequest.send();\n\t\t\treturn fetch_promise;\n\t\t}\n\n\t\tfunction process_result(event){\n\t\t\tif (event.target.readyState !== 4) return;\n\t\t\tif (event.target.status >= 400 || event.target.status === 0) return fetch_promise.reject(event.target.status);\n\t\t\tif (use_cache) {\n\t\t\t\tfile_cache_save(url, event.target.response)\n\t\t\t\t.then(fetch_promise.resolve.bind(null,event.target.response));\n\t\t\t} else {\n\t\t\t\tfetch_promise.resolve(event.target.response);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "118dbfe3772c386a6ee68c50ce001a5a", "score": "0.5900376", "text": "function getFile(file) {\n\t//var p = path.resolve(PUBLIC_DIR + file);\n\tput('getFile(\"' + file + '\")...');\n\tvar p = path.resolve(file);\n\t\n\t// Check if inside public dir\n\tif (!p.startsWith(SERVER.PATHS.SHARED)) return ('<html><body>server.getFile(): Path is not shared \"' + p + '\" (\"' + file + '\")</body></html>');\n\t\n\t// Serve file\n\treturn fs.readFileSync(p);\n}", "title": "" }, { "docid": "0cc808ffa2356e3ea7a6dab10136ad21", "score": "0.5894518", "text": "function loadFile (file, callback) {\n var xmlhttp;\n\n if (file == null || file == \"\") {\n\talert(\"You must specify a file to load.\");\n\treturn;\n }\n\n if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();\n // Code for IE7+, Firefox, Chrome, Opera, Safari.\n\n else xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n // Code for IE6, IE5.\n\n // http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp\n xmlhttp.onreadystatechange = function() {\n\t// Note: We cannot check xmlhttp.status != 200 for errors\n\t// because status is not set when loading local files.\n\tif (xmlhttp.readyState == 4) callback(xmlhttp.responseText);\n }\n\n xmlhttp.open(\"GET\", file, false);\n xmlhttp.send();\n}", "title": "" }, { "docid": "6c9415bf28452d839c4d846be658e755", "score": "0.58894396", "text": "function LoadLocalFile(file, idDiv, func){\n $(\"#divClaims\").hide();\n if(idDiv == undefined){\n idDiv = 'divCuerpo';\n } else if(idDiv == ''){\n idDiv = 'divCuerpo'; \n }\n getID(idDiv).innerHTML = LoadingViewHTML();\n var url = 'inc/' + file + \".html\";\n var request = new Request(url, {\n \tmethod: 'GET',\n \t// mode: 'cors',\n \tredirect: 'follow',\n \theaders: new Headers({\n \t\t'Content-Type': 'text/plain'\n \t})\n });\n\n \n fetch(request)\n .then( res => { \n return res.text() \n })\n .then( data => {\n getID(idDiv).innerHTML = data;\n LoadComponentMaterialize();\n if(func != undefined)func();\n \n })\n .catch( err => {\n console.log(err);\n })\n}", "title": "" }, { "docid": "704a4ec660b5eafb002fc41487339f18", "score": "0.5883868", "text": "function getFromLocalFile() {\n resetData();\n\n // Connect to internal server and get data from it\n $.ajax({\n\n // Get from the server the function 'listUsers' result.\n url: \"http://localhost:8080/listUsers\",\n type: \"GET\",\n\n // If the call to the function \"get\" from the URl is succeful, put the data from the local server\n success: function(server_response) {\n\n // If there is response from the server, put the server response into the parameter id 'data'\n if (server_response != \"\") {\n $(\"#data\").append(server_response);\n }\n\n // If there is not response from the server, put \"not OK\" into the parameter id 'data'\n else {\n alert('Not OK');\n }\n }\n });\n}", "title": "" }, { "docid": "22e6684d4dcfa580cd84b11ef2fa45bb", "score": "0.5883817", "text": "function loadFile(filename) {\n var filepath = path.join(__dirname, 'fixtures/cms/' + filename);\n var txtfile = fs.readFileSync(filepath, 'utf-8');\n return txtfile;\n\n}", "title": "" }, { "docid": "ceda4241945d5a40e29be9788c51d4a2", "score": "0.5880285", "text": "function loadFile(socket, path, room, roomFile, fileName){\n\n // debug messages\n if (roomFile[room]){\n console.log(\"New File loaded -> \" + path + \" (was \" \n + roomFile[room] + \") in room \" + room + \"\\n\")\n }\n else{\n console.log(\"New File loaded -> \" + path + \" in room \" + room + \"\\n\") \n }\n\n roomFile[room] = path;\n fs.exists(path, function(exists){\n if (exists){\n fs.readFile(path, function(err, data) {\n if (!err){\n // send the files content to the driver\n socket.emit(\"receive_file\",\n {\n text:unescape(data),\n fileName:fileName\n });\n }\n else{\n console.log(\"[Error] Error reading file during a load (for room \" \n + room + \"); with path \" + path + \"\\n\");\n }\n });\n }else{\n console.log(\"[Error] File to load does not exist (for room \" \n + room + \"); with path \" + path + \"\\n\");\n }\n });\n}", "title": "" }, { "docid": "74a920418129ace873a40ee1862cfc90", "score": "0.58802164", "text": "function loadfile(requestURL, type){\n\t\tvar file = (function(){\n\t\t\t\tvar jsonValue = null;\n\t\t\t\t$.ajax({\n\t\t\t\t\tasync: false,\n\t\t\t\t\turl: requestURL,\n\t\t\t\t\tdataType: type,\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\tjsonValue = data;\n\t\t\t\t\t},\n\t\t\t\t\terror: function(response, errorThrow){\n\t\t\t\t\t\t\t\t\talert(errorThrow);\n\t\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn jsonValue;\n\t\t\t\t})();\n\t\t\n\t\tif(!file) alert('Error!The requested file cannot be opened.');\n\t\t\n\t\treturn file;\n\t}", "title": "" }, { "docid": "d22bc9deea000f96ced927ba18a856f8", "score": "0.58791065", "text": "function localFile(fileName) {\n\treturn fileURLToPath(new URL(fileName, import.meta.url));\n}", "title": "" }, { "docid": "9395a7548ca0f2c3829598ab012e89a8", "score": "0.5878701", "text": "function safeLoadFile(dir) {\r\n\tif (fs.existsSync(dir)) {\r\n\t\tlog(0, 'Loaded: ' + dir);\r\n\t\treturn fs.readFileSync(dir);\r\n\t} else {\r\n\t\tlog(2, 'Unable to load: ' + dir);\r\n\t\treturn '{}';\r\n\t}\r\n}", "title": "" }, { "docid": "cd4b2bf95ec7217e3518df3cea0c1ea4", "score": "0.58768433", "text": "async load( path ) {\n return false;\n }", "title": "" }, { "docid": "8283daf49d08185cbcdfb484b93cadf9", "score": "0.5856429", "text": "function getFile (file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text)\n })\n}", "title": "" }, { "docid": "4940ebc5c77b195056d9c0e0ed9c8c2a", "score": "0.5853477", "text": "function loadFile(file)\r\n{\r\n var ret = \"\";\r\n try {\r\n var f = fso.OpenTextFile(file, 1);\r\n ret = f.ReadAll();\r\n f.Close();\r\n }\r\n catch(e)\r\n {\r\n //WScript.StdOut.WriteLine( e.message + \" \" + file );\r\n }\r\n return ret;\r\n}", "title": "" }, { "docid": "f8c4cac4152cff452f798e80c6f49f35", "score": "0.58344984", "text": "function loadTemplate(filepath, onLoad) {\n const filePath = path.join(__dirname, filepath);\n fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) {\n if (!err) {\n onLoad(data);\n } else {\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "bbcb6b9a52cca09b401b60b45e066b25", "score": "0.5824717", "text": "function loadSoundFile(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function(e) {\n initSound(this.response); // this.response is an ArrayBuffer.\n };\n xhr.send();\n}", "title": "" }, { "docid": "fb6703b84d221dbcddfb82eccdf5bf53", "score": "0.5797715", "text": "function loadFile(file, type) {\n $.ajax({\n url: 'http://jwreading.com/ajax/getMinifiedContent.php',\n data: {file: file, type:type},\n async: false,\n complete: function(data)\n {\n var elements = '';\n $.each(data, function(k,v){\n if(k == 'responseText') {\n el = v.split(\"\\\\r\\\\n\");\n $.each(el, function(key, value){\n if(type === 'css') { elements += value; }\n else { elements += value + ';'; }\n });\n }\n });\n var eval_file = eval(elements);\n var appendString;\n var page_location = 'body';\n if(type === 'lang') { appendString = '<script class=\"lang\">' + eval_file + '</script>'; }\n else if(type === 'js') { appendString = '<script>' + eval_file + '</script>'; }\n else if(type === 'css') { appendString = '<style>' + eval_file + '</style>'; page_location = 'head'; }\n\n if (typeof MSApp !== \"undefined\" && MSApp) {\n MSApp.execUnsafeLocalFunction(function() { $(page_location).append(appendString); });\n } else {\n $(page_location).append(appendString);\n }\n }\n });\n}", "title": "" }, { "docid": "0341d806066fc6ce09572dcf3fb487ba", "score": "0.5796383", "text": "function handleRequest(request, response){\n var content = \"\";\n\n try {\n content = getFile(request.url).toString()\n } catch (e) {\n content = \"404\";\n }\n\n response.setHeader('Content-Type', getContentType(request.url))\n console.log(\"SERVER: Loaded: \" + request.url)\n response.end(content);\n}", "title": "" }, { "docid": "06bba43b1eb4436b85bce621934be5f9", "score": "0.57917124", "text": "getFileByServerRelativePath(fileRelativeUrl) {\r\n return new File(this, `getFileByServerRelativePath(decodedUrl='${fileRelativeUrl}')`);\r\n }", "title": "" }, { "docid": "1cda1c18543c6e119a0f891a8f7aff37", "score": "0.57832456", "text": "function getFile(file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text);\n });\n }", "title": "" }, { "docid": "fdfe1a203cdcd119b72c48858b51285c", "score": "0.578039", "text": "function loadFile(path) {\n if (typeof process !== \"undefined\" && process.versions && !!process.versions.node && require.nodeRequire) {\n var fs = require.nodeRequire('fs');\n var file = fs.readFileSync(path, 'utf8');\n if (file.indexOf('\\uFEFF') === 0)\n return file.substring(1);\n return file;\n }\n else {\n var file = new java.io.File(path),\n lineSeparator = java.lang.System.getProperty(\"line.separator\"),\n input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), 'utf-8')),\n stringBuffer, line;\n try {\n stringBuffer = new java.lang.StringBuffer();\n line = input.readLine();\n if (line && line.length() && line.charAt(0) === 0xfeff)\n line = line.substring(1);\n stringBuffer.append(line);\n while ((line = input.readLine()) !== null) {\n stringBuffer.append(lineSeparator).append(line);\n }\n return String(stringBuffer.toString());\n }\n finally {\n input.close();\n }\n }\n }", "title": "" }, { "docid": "fdfe1a203cdcd119b72c48858b51285c", "score": "0.578039", "text": "function loadFile(path) {\n if (typeof process !== \"undefined\" && process.versions && !!process.versions.node && require.nodeRequire) {\n var fs = require.nodeRequire('fs');\n var file = fs.readFileSync(path, 'utf8');\n if (file.indexOf('\\uFEFF') === 0)\n return file.substring(1);\n return file;\n }\n else {\n var file = new java.io.File(path),\n lineSeparator = java.lang.System.getProperty(\"line.separator\"),\n input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), 'utf-8')),\n stringBuffer, line;\n try {\n stringBuffer = new java.lang.StringBuffer();\n line = input.readLine();\n if (line && line.length() && line.charAt(0) === 0xfeff)\n line = line.substring(1);\n stringBuffer.append(line);\n while ((line = input.readLine()) !== null) {\n stringBuffer.append(lineSeparator).append(line);\n }\n return String(stringBuffer.toString());\n }\n finally {\n input.close();\n }\n }\n }", "title": "" }, { "docid": "b4ca8601290d95927546a02ad776b8be", "score": "0.5779833", "text": "function RemoteFileReader(opt_url) {\n // TODO: Check Browser Suport\n this.url = opt_url;\n}", "title": "" }, { "docid": "5bed9436bc62a48a86f5d878beb20eea", "score": "0.5774197", "text": "loadFile(path, options) {\n\t\treturn this._parseData(path, options);\n\t}", "title": "" }, { "docid": "4beb61a9c2e8b18df005ca325b016c74", "score": "0.57737786", "text": "readFromFile(fileName) {\n const fs = require(\"fs\");\n try {\n const data = fs.readFileSync(\"uploads/\" + fileName, \"utf8\");\n console.log(data);\n return data;\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "21a546675a3591cbfa57c5efab49c709", "score": "0.57650304", "text": "function getJsonFile(filePath) {\n return $.ajax({\n url: 'http://www.friskylingo.com/' + filePath,\n type: 'GET',\n dataType: 'json',\n crossDomain: true\n });\n}", "title": "" }, { "docid": "6c966852b341d3aac1a2abf465e31a5c", "score": "0.5758531", "text": "getFileUrl(path) { return this.engine.getFileUrl(path); }", "title": "" }, { "docid": "71e4700fee3b6aaf5240dc7e7cb99f99", "score": "0.575667", "text": "function load(path, userID) {\n}", "title": "" }, { "docid": "26cb670882bf05189eb4966ec337db50", "score": "0.5754629", "text": "async function load_db_file(filepath) {\n console.log(\"dbfile :\", filepath);\n worker.postMessage({ action: 'open' });\n\n const u = new URL(filepath);\n fetch(u).then(res => res.arrayBuffer()).then(buf => {\n try {\n worker.postMessage({ action: 'open', 'buffer': buf }, [buf]);\n } catch (exception) {\n worker.postMessage({ action: 'open', 'buffer': buf });\n }\n });\n }", "title": "" }, { "docid": "4ad601be0b910950b6d06f64b664cbf2", "score": "0.57532597", "text": "function loadFile(name) {\n\treturn readFileSync(join(__dirname, name), 'utf-8');\n}", "title": "" }, { "docid": "aa367f64b513e35a1b5e4ebe58f02794", "score": "0.5752895", "text": "function loadInternalResource(uri) {\n \tlog.info(\"Loading internal resource from \" + extensionAddress + '/' + uri + '.');\n\n \tvar xhr = new XMLHttpRequest();\n \txhr.open(\"get\", extensionAddress + '/' + uri, false);\n \txhr.send();\n\n \treturn xhr.responseText;\n }", "title": "" }, { "docid": "c5b84d28fe5f4581bc385345a09115d6", "score": "0.57366765", "text": "function getFile(localUrl) {\n let extensionUrl = chrome.extension.getURL(localUrl);\n let xhr = new XMLHttpRequest();\n let response = null;\n\n xhr.open('GET', extensionUrl, false);\n xhr.onload = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n response = xhr.responseText;\n } else {\n console.error(xhr.statusText);\n }\n }\n };\n xhr.onerror = function() {\n console.error(xhr.statusText);\n };\n xhr.send(null);\n return response + '\\n\\n//# sourceURL=polydev' + localUrl;\n }", "title": "" }, { "docid": "0e409491b9e596e0cc2f1940c360aa5a", "score": "0.57324886", "text": "function ajaxGet(file, fn) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", file, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n fn(xhr.responseText);\n }\n };\n xhr.send();\n }", "title": "" }, { "docid": "98111d761cac599dd2cbe4ad8563cf7c", "score": "0.5726164", "text": "function loadFile(ipURL, ipDivId, ipAfterLoadFunction) {\n gvLoadInto = ipDivId;\n if (ipURL.length == 0) {\n document.getElementById(gvLoadInto).innerHTML = \"\";\n return;\n }\n xmlHttp=GetXmlHttpObject();\n if (xmlHttp == null) {\n alert (\"Browser does not support HTTP Request\");\n return;\n }\n //ipURL=ipURL+\"?sid=\"+Math.random();\n\n //alert(ipURL);\n\n //xmlHttp.onreadystatechange = stateChanged2;\n xmlHttp.onreadystatechange = ipAfterLoadFunction;\n xmlHttp.open(\"GET\", ipURL, true);\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "a5c25680ff27fcbb8020eee6aaf409cc", "score": "0.57226247", "text": "function loadfile(url, callback) {\n\tvar callback = callback || function(response) {return response};\n\tvar xhr = getXHR();\n\tif (typeof xhr !== \"undefined\") {\n\t\txhr.open(\"GET\", url, true); // define request arguments\n\t\txhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\"); // set request MIME type\n\t\tif (navigator.appName != \"Microsoft Internet Explorer\" && xhr.overrideMimeType) { // request plain text for any browser except IE\n\t\t\txhr.overrideMimeType(\"text/plain\"); // prevent request header bugs\n\t\t}\n\t\tif (navigator.appName == \"Microsoft Internet Explorer\" || !xhr.addEventListener) { // if IE then use onreadystatechange() instead of addEventListener and .responseText instead of .response\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\tif (xhr.readyState == 4 && (isFileProtocol || xhr.status == 200)) {\n\t\t\t\t\tcallback(xhr.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // should be ok on any other browser\n\t\t\txhr.addEventListener(\"load\", function() {\n\t\t\t\tif (this.readyState == 4 && (isFileProtocol || this.status == 200)) {\n\t\t\t\t\tcallback(this.response);\n\t\t\t\t}\n\t\t\t}, false);\n\t\t}\n\t\ttry {\n\t\t\txhr.send(); // send request to server\n\t\t} catch(err) {\n\t\t\tconsole.log(url + \" not found.\\n\" + err); // log server error\n\t\t\tcallback(\"\"); // return empty -- if no file is found, then nothing will be processed but the script execution won't be stopped\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0046d1de33fe926b21e1baaf02ce7c98", "score": "0.5719474", "text": "loadLocalTLE(id, callback) {\n $.get(\"assets/tle/\" + id + \".txt\", function (data) {\n callback(data.split(\"\\n\"));\n });\n }", "title": "" }, { "docid": "ef8e004e1f70128a4c5642e9ec66d8d8", "score": "0.57067186", "text": "function load(){\n //Lê o arquivo e transforma de volta em um objeto js\n const fileBuffer = fs.readFileSync(contentFilePath, 'utf-8')\n const contentJson = JSON.parse(fileBuffer)\n return contentJson\n}", "title": "" }, { "docid": "a086191355c99bc9c3d460f0de6db2f2", "score": "0.5705626", "text": "function getTextFile(filePath) {\n return $.ajax({\n url: 'http://www.friskylingo.com/' + filePath,\n type: 'GET',\n dataType: 'text',\n crossDomain: true\n });\n}", "title": "" }, { "docid": "97b8a924b078e8a8b3dd216dbdb93d3e", "score": "0.5704208", "text": "function loadFile(file) {\n //explicitly loaded files should start at the beginning\n window.location.hash = '';\n //read file\n var reader = new FileReader();\n reader.onload = function(e) {\n //clear view\n resetData();\n generateMovie(e.target.result);\n }\n if(file) reader.readAsText(file);\n}", "title": "" }, { "docid": "8935549d373ec51147e72b595b5206bb", "score": "0.5684309", "text": "function loadImage(path) {\n var file = Components.classes[\"@mozilla.org/file/local;1\"]\n .createInstance(Components.interfaces.nsILocalFile);\n var fstream = Components.classes[\"@mozilla.org/network/file-input-stream;1\"]\n .createInstance(Components.interfaces.nsIFileInputStream);\n var sstream = Components.classes[\"@mozilla.org/scriptableinputstream;1\"]\n .createInstance(Components.interfaces.nsIScriptableInputStream);\n\n file.initWithPath(path);\n if (!file.exists()) {\n return null;\n }\n\n fstream.init(file, PR_RDONLY, parseInt('0004', 8), null);\n sstream.init(fstream);\n var output = sstream.read(sstream.available());\n sstream.close();\n fstream.close();\n\n return output;\n}", "title": "" }, { "docid": "4018ee74da7cb7e35e59fac1fdf87d9a", "score": "0.5648896", "text": "readPokemonFromFile(fileName) {\n fetch(fileName).then(response => response.text()).then(text => this.getPokemonHelper(text));\n }", "title": "" }, { "docid": "2ed2c5472192dcc4c88e4e520aac6db3", "score": "0.56455725", "text": "function LoadFileJson(filepath) {\n let xmlhttp = new XMLHttpRequest();\n \n // Need to make this async (set to true and then spin wait...)\n xmlhttp.open(\"GET\", filepath, false);\n xmlhttp.send();\n \n return JSON.parse(xmlhttp.responseText);\n}", "title": "" } ]
7e6f3b2d29942f43de34e301df3f3dd5
Create filter function for a query string
[ { "docid": "82c3a2fe46f32bf97aba0e549e6fd61c", "score": "0.64341956", "text": "function createFilterFor(query) {\n return function filterFn(product) {\n return (product.productCode.toLowerCase().indexOf(query.toLowerCase()) !== -1);\n };\n }", "title": "" } ]
[ { "docid": "cd2d4946a32bd51ac6f11c4bf54c3694", "score": "0.7114037", "text": "function queryStringFilter($exceptionHandler, $log, locationSearch, qs) {\n\n\treturn function(input, params) {\n\n\t\tvar paramsType = angular.isArray(params) ? 'array' : typeof params, out = '';\n\n\t\tif (!input) {\n\t\t\t$exceptionHandler('expected an object of key/value pairs');\n\t\t}\n\n if (!params || ['string', 'array', 'object'].indexOf(paramsType) === -1) {\n return input;\n\n } else if (paramsType === 'string') {\n // if params is a string, get a single value from $window.location.search\n out += qs.parse(input)[params];\n\n } else if (paramsType === 'array') {\n // if params is an array, grab only the params that match the array and return an array of those values\n\t\t\tout = [];\n\t\t\tif (params.length > 0) {\n\t\t\t\tangular.forEach(params, function(param) {\n\t\t\t\t\tvar parsed = qs.parse(input);\n\t\t\t\t\tif (typeof param === 'string' && parsed.hasOwnProperty(param)) {\n\t\t\t\t\t\tout.push(parsed[param]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$log.warn('queryStringFilter expected param to be a string');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tangular.forEach(qs.parse(input), function(value, key) {\n\t\t\t\t\tvar obj = {};\n\t\t\t\t\tobj[key] = value;\n\t\t\t\t\tout.push(obj);\n\t\t\t\t});\n\t\t\t}\n\n\t\t} else if (paramsType === 'object') {\n // if params is an object and has properties, return value if prop is true\n // else if params is an empty object return the parsed object\n if (Object.keys(params).length > 0) {\n out = {};\n Object.keys(params).forEach(function(param) {\n if (params[param] && !out.hasOwnProperty(param)) {\n out[param] = params[param];\n }\n });\n } else {\n out = qs.parse(input);\n }\n } else {\n\t\t\tout += locationSearch();\n\t\t}\n\t\treturn out;\n\t};\n}", "title": "" }, { "docid": "f1131ac830fc32eb00c18f397688f872", "score": "0.6958314", "text": "function createFilterFor(query) {\n var lowercaseQuery = query.toLowerCase();\n \n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n \n }", "title": "" }, { "docid": "5ccd3919cf5f4b633a932dc087615b16", "score": "0.68884355", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(volunteer) {\n return (volunteer.value.indexOf(lowercaseQuery) >= 0);\n // return (volunteer.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "155379d5bad782e6daf1d333958e0205", "score": "0.68433934", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(name) {\n return (name.value.indexOf(lowercaseQuery) > -1)\n\n //return (name.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "6c0d3bb81408fd25a44a2c729c74dfe7", "score": "0.6829895", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n var lowerCaserFilterString = angular.lowercase(contact.firstname)\n return (lowerCaserFilterString.indexOf(lowercaseQuery) != -1);\n };\n }", "title": "" }, { "docid": "d6fbcee7568557d58093f5a7b55fc478", "score": "0.6825843", "text": "_createFilterFor(query) {\n \tlet uppercaseQuery = angular.uppercase(query);\n \treturn function filterFn(rate) {\n\t\t\treturn (rate.name.indexOf(uppercaseQuery) === 0);\n \t};\n }", "title": "" }, { "docid": "e30b66c23a39db9a7b77f7f2c9fd41a1", "score": "0.68192476", "text": "function createFilterFor(query) {\n let lowercaseQuery = angular.lowercase(query.replace(/\\s+/g, ''));\n\n return function filterFn(state) {\n return (state.id.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "638a903174186fd1cf7f437c3a6c1da0", "score": "0.6772225", "text": "createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.username.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "348565f543eb8edc1de588cb303fcb59", "score": "0.6762846", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n \n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n \n }", "title": "" }, { "docid": "d5fc97cfec93ea4a2fbf56bda2e9e199", "score": "0.67610943", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) { \n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "3a7219575dd1902935ebf6efff1a75eb", "score": "0.6746404", "text": "function createFilterFor(query) {\n // Convert query substring to lowercase\n var lowercaseQuery = angular.lowercase(query);\n //entityToFilter variable is only used in that function\n return function filterFn(entityToFilter) {\n //.indexOf searches a string for the lowercase query substring\n //True will be returned in case string begins with substring\n //Because in this case index of substring will be equal to 0\n console.log(entityToFilter);\n var entityToFilterVer = entityToFilter['lastVersion'];\n //var entityToFilterLang = entityToFilter[entityToFilterVer]['langcode'];\n var titleObj = entityToFilter[entityToFilterVer]['title'];\n\n //var valueToFilter = entityToFilter[entityToFilterVer]['title'][entityToFilterLang];\n\n for (arrElement in titleObj){\n\n var valueToFilterLowercase = angular.lowercase(titleObj[arrElement]);\n\n //if(entityToFilter['uuid'].indexOf(lowercaseQuery) === 0){\n //indexOf only works with strings, don't forget to convert numbers\n if(valueToFilterLowercase.indexOf(lowercaseQuery) === 0){\n return true;\n }\n\n }\n };\n }", "title": "" }, { "docid": "7f25e7a8cb2e6d61626fa927e78dd504", "score": "0.6740141", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) != -1);\n };\n }", "title": "" }, { "docid": "f0f0971dc46c929eb2324b32ef9dc57f", "score": "0.6738094", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact.username.indexOf(lowercaseQuery) != -1);\n };\n }", "title": "" }, { "docid": "b7e860a199ef20f1b6cc38f9e38674a4", "score": "0.6718533", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) != -1);\n };\n }", "title": "" }, { "docid": "ccd029ba4f387c3b464997b278a4d529", "score": "0.67147404", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(attrName) {\n return attrName.value.indexOf(lowercaseQuery)=== 0;\n };\n }", "title": "" }, { "docid": "321c9046430590ae520fabf5af109c55", "score": "0.67120683", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "cba41d4245ab88fda108d9239b516223", "score": "0.6711602", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) > -1);\n };\n }", "title": "" }, { "docid": "77ca14a7e0aa760978974790d3100f52", "score": "0.67085797", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "5b38ce75c64c0990c69e2402a23f900d", "score": "0.6705699", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "e4cf1bade64696fc4462e3cba0c46fd8", "score": "0.67020977", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.no.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "332d7c44faf2801c3734d27eacc53e96", "score": "0.66975987", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "332d7c44faf2801c3734d27eacc53e96", "score": "0.66975987", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "6c9ed980729d203b43aaf1e37cf8605a", "score": "0.6694908", "text": "filter() {\n const query_object = { ...this.query_string };\n const excluded_fields = ['page', 'limit', 'sort', 'fields'];\n excluded_fields.forEach((element) => {\n delete query_object[element];\n });\n\n let query_str = JSON.stringify(query_object);\n\n // Prefix operator with $ and convert to Object\n query_str = query_str.replace(\n /\\b(lte|gte|gt|lt|eq|cmp)\\b/g,\n (match) => `$${match}`\n );\n\n this.query = this.query.find(JSON.parse(query_str));\n\n return this;\n }", "title": "" }, { "docid": "084c09288a6da86d2494edf56bc6011b", "score": "0.669296", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "1c9b6d66b07bf558a332e3ea13074326", "score": "0.66925776", "text": "function createFilterFor (query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(user) {\n //Create lowercase versions of all searcheable data\n var firstName = angular.lowercase(user.firstname);\n var lastName = angular.lowercase(user.lastname);\n var userName = angular.lowercase(user.username);\n\n // return an array of objects that include the query\n return (firstName.includes(lowercaseQuery) || \n lastName.includes(lowercaseQuery) ||\n userName.includes(lowercaseQuery));\n };\n }", "title": "" }, { "docid": "8e7bc77e64d290ebadf61f3a3518771d", "score": "0.66919136", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(author) {\n return (author.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "2009d6780bb85d84afe2912c777edddd", "score": "0.6690803", "text": "function getFilterParams() {\n var qd = {};\n if (location.search) location.search.substr(1).split(\"&\").forEach(function(item) {\n var s = item.split(\"=\"),\n k = s[0],\n v = s[1] && decodeURIComponent(s[1]); // null-coalescing / short-circuit\n (qd[k] = qd[k] || []).push(v) // null-coalescing / short-circuit\n })\n return qd[\"filters\"];\n }", "title": "" }, { "docid": "3d283ba8bcede4d535240915525a2c22", "score": "0.66797084", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "3d283ba8bcede4d535240915525a2c22", "score": "0.66797084", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "3d283ba8bcede4d535240915525a2c22", "score": "0.66797084", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "3d283ba8bcede4d535240915525a2c22", "score": "0.66797084", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "3d283ba8bcede4d535240915525a2c22", "score": "0.66797084", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "2de976c26c5204a1eeea3bf99c5efe4d", "score": "0.66733205", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "dc22b330027a0527c5975b7ef6f7a2fa", "score": "0.6670952", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "dc22b330027a0527c5975b7ef6f7a2fa", "score": "0.6670952", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "dc22b330027a0527c5975b7ef6f7a2fa", "score": "0.6670952", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "ff9bce034d146dd1221d9c4d26e6c9ee", "score": "0.66698474", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "b8291a2b4cef8abf84bc2a40232ee844", "score": "0.66655046", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "0e952efa51083f6206a3d9d8889941f3", "score": "0.66618204", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "0e952efa51083f6206a3d9d8889941f3", "score": "0.66618204", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "0e952efa51083f6206a3d9d8889941f3", "score": "0.66618204", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "b282b93cc9bb7e8377ff9594268a3afe", "score": "0.6660002", "text": "function createFilterFor(query) {\n\t\t\tvar lowercaseQuery = angular.lowercase(query);\n\t\t\treturn function filterFn(state) {\n\t\t\t\treturn (state.value.indexOf(lowercaseQuery) === 0);\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "7314e0152ad58f1274a62d7389391cb6", "score": "0.66433", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "f9b2862cf2b8e7e3ddcefd7c5a96738e", "score": "0.6642217", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "b2f5face6b26ddf53b8bacbb778c3cd1", "score": "0.6641953", "text": "encodedFilters() {\n return this.$route.query[this.filterParameter] || \"\";\n }", "title": "" }, { "docid": "b477e2a3df6cdb057ed302910c528a4f", "score": "0.6636234", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "b477e2a3df6cdb057ed302910c528a4f", "score": "0.6636234", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "b477e2a3df6cdb057ed302910c528a4f", "score": "0.6636234", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "8dcf5b22571294d2427ff398e403bf15", "score": "0.6630307", "text": "function createFilterFor(query) {\r\n var lowercaseQuery = angular.lowercase(query);\r\n return function filterFn(item) {\r\n return (item.value.indexOf(lowercaseQuery) === 0);\r\n };\r\n }", "title": "" }, { "docid": "edfdb674bc42cf76617026b962c17a75", "score": "0.6627967", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "edfdb674bc42cf76617026b962c17a75", "score": "0.6627967", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "edfdb674bc42cf76617026b962c17a75", "score": "0.6627967", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "d513f7686f69317a688f3c127398ac22", "score": "0.66080487", "text": "encodedFilters() {\n return this.$route.query[this.filterParameter] || ''\n }", "title": "" }, { "docid": "6ecc9de94f2b149875327404804dea77", "score": "0.66041607", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(cliente) {\n return (cliente.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "496f9a3652dc7ab3a23922e1f4c9876d", "score": "0.6601666", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(word) {\n return (angular.lowercase(word).indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "95295f828e89256018a8c0662e3d1b1a", "score": "0.6600448", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(user) {\n return (angular.lowercase(user.name)).indexOf(lowercaseQuery) === 0;\n };\n\n }", "title": "" }, { "docid": "9ffb352dba00fff3a6083dc0dc80365a", "score": "0.66003835", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(student) {\n return (angular.lowercase(student.name).indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "75008df36c77804acfa1e273d6292074", "score": "0.65946466", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n\n return (state.toLowerCase().indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "849a499734bca15f3975dd3b877f2eda", "score": "0.65895206", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(language) {\n return (language.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "615058b9aacd2d2b844431bcb1ee068c", "score": "0.6578128", "text": "function createFilterFor(query) {\n\t\t\tvar lowercaseQuery = angular.lowercase(query);\n\n\t\t\treturn function filterFn(state) {\n\t\t\t\treturn (state.value.indexOf(lowercaseQuery) === 0);\n\t\t\t};\n\n\t\t}", "title": "" }, { "docid": "7a1d291c1d8a162c275518263e1a9997", "score": "0.6569007", "text": "function createFilterFor(query) {\n\t\t\tvar lowercaseQuery = angular.lowercase(query);\n\t\t\treturn function filterFn(item) {\n\t\t\t\treturn (item.name.indexOf(lowercaseQuery) != -1);\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "00666d4468decf6c13a01960ff8bd876", "score": "0.656493", "text": "function createFilterFor(query) {\n var queryIsCardCode = /^\\d+$/.test(query) && query.length === 12;\n\n if (queryIsCardCode) {\n return function cardCodeMatches(customer) {\n for (var i = 0; i < customer.cards.length; i++) {\n if (customer.cards[i].code === query) {\n return true;\n }\n }\n\n return false;\n }\n } else {\n var lowercaseQuery = angular.lowercase(query);\n\n //TODO polish special characters\n return function fullNameMatches(customer) {\n var lowercaseFirstName = angular.lowercase(customer.firstName);\n var lowercaseLastName = angular.lowercase(customer.lastName);\n var lowercaseFullName = lowercaseFirstName + ' ' + lowercaseLastName;\n if (lowercaseFullName.indexOf(lowercaseQuery) === 0) {\n return true;\n }\n\n if (lowercaseLastName.indexOf(lowercaseQuery) === 0) {\n return true;\n }\n\n return false;\n };\n }\n }", "title": "" }, { "docid": "b26ad98ca452de8b6f3d829fa5acd76d", "score": "0.6563711", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (angular.lowercase(item.name).indexOf(lowercaseQuery) >= 0);\n }; \n }", "title": "" }, { "docid": "85b9806be17376490c1e375a5b9170af", "score": "0.65533286", "text": "function createFilterFor(query) {\n var uppercaseQuery = query.toUpperCase();\n\n return function filterFn(state) {\n return (state.namaKecamatan.indexOf(uppercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "758c639dca096b3e45b741caa6fa5c66", "score": "0.6543363", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(city) {\n return (city.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "d820ca327d26575c9e6e3996d04944dd", "score": "0.6534649", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(pokemon) {\n return (pokemon.name.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "f968e4ae69492bd5245d81805d4f7311", "score": "0.65284806", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(vegetable) {\n return (vegetable._lowername.indexOf(lowercaseQuery) === 0);\n // (vegetable._lowertype.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "a4cf64f5c823cac2588170ae8bf7be39", "score": "0.65280885", "text": "function getRequestFilter(filter, startQuery){\n var query = startQuery;\n var index = 0;\n var queryArray = [];\n for(var key in filter){\n if(filter[key] != \"\" && filter[key] != 'null'){\n var object = JSON.parse(filter[key]);\n switch (object.type) {\n case 'text':\n if (object.start) {\n queryArray[index] = key + ' like \\'' + object.value + '%\\'';\n index++;\n }\n if (object.end) {\n queryArray[index] = key + ' like \\'%' + object.value + '\\'';\n index++;\n }\n if (! object.start && !object.end && object.value != '') {\n queryArray[index] = key + ' like \\'' + object.value + '\\'';\n index++;\n }\n break;\n case 'number':\n var result = '';\n if (object.min) {\n result = key + ' > ' + object.min;\n }\n if (object.max) {\n result = key + ' < ' + object.max;\n }\n if (object.min && object.max) {\n result = key + ' > ' + object.min + ' and ' + key + ' < ' + object.max;\n }\n queryArray[index] = result;\n index++;\n break;\n }\n }\n }\n if(index == 0){\n return \"\";\n }\n if(index == 1){\n query += queryArray[0];\n }\n else{\n for(var i=0;i<index;i++){\n if(i == index-1)\n query += queryArray[i];\n else\n query += queryArray[i] + ' and ';\n }\n }\n return query;\n}", "title": "" }, { "docid": "00edb96fe50cb5a507f9446b046eb0b0", "score": "0.65258014", "text": "filterList(queryString) {\n this.doFilter(queryString);\n }", "title": "" }, { "docid": "8fc50beedcd824709b4b11107094341c", "score": "0.65214896", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(state) {\n return (state.nombre.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "fbb1835fb853b9d001377c902f4502ac", "score": "0.6509189", "text": "function createFilterFor(query)\n {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(team) {\n\n return (team._lowername.indexOf(lowercaseQuery) === 0) ||\n (team.id === query.id);\n };\n\n }", "title": "" }, { "docid": "5a0c02f26d6b98b3e804881fce807e30", "score": "0.6507208", "text": "function createFilterForTreatments(query) {\n var lcQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (angular.lowercase(item.name).indexOf(lcQuery) === 0);\n }\n }", "title": "" }, { "docid": "89906b517162a87f089df51309f53487", "score": "0.6500815", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(chord) {\n return\n (chord.title.toLowerCase().indexOf(lowercaseQuery) > -1)\n || (chord.titleEnChar.toLowerCase().indexOf(lowercaseQuery) > -1)\n };\n }", "title": "" }, { "docid": "89906b517162a87f089df51309f53487", "score": "0.6500815", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(chord) {\n return\n (chord.title.toLowerCase().indexOf(lowercaseQuery) > -1)\n || (chord.titleEnChar.toLowerCase().indexOf(lowercaseQuery) > -1)\n };\n }", "title": "" }, { "docid": "1df76cc66dd0711f072ab644fd36f027", "score": "0.64940655", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(skill) {\n return (skill._lowername.indexOf(lowercaseQuery) === 0);\n // (skill._lowertype.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "8902ec82d6ac62fb4bda6e7546c358ac", "score": "0.64723206", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(movie) {\n return (movie.brutLabel.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "ef2f815c0f6e2b00c5bb68e5a254dfa6", "score": "0.64698505", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.name.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "334e07f39ef21446c6eebf0429aced10", "score": "0.6469543", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state._lowername.indexOf(lowercaseQuery) === 0)\n };\n }", "title": "" }, { "docid": "055933faa830dc4e49cd0ff61a587a4f", "score": "0.6465179", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.name.toLowerCase().indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "1a0637a6e4a030ed6b8688a6a31d6304", "score": "0.6459567", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(authority) {\n return (authority._lowername.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "be47d03d60a3744cbd01a4ed2767bff2", "score": "0.6438296", "text": "initializeFilterValuesFromQueryString() {\n this.clearAllFilters()\n\n if (this.encodedFilters) {\n this.currentFilters = JSON.parse(atob(this.encodedFilters))\n\n this.syncFilterValues()\n }\n }", "title": "" }, { "docid": "ca9a097b452dbe45179fa52aaaaab727", "score": "0.6433136", "text": "filter() {\n // sanitize queryParams\n const queryObj = { ...this.queryString };\n const queryExcluded = [\"page\", \"limit\", \"sort\", \"fields\"];\n queryExcluded.forEach((el) => delete queryObj[el]);\n\n let queryStr = JSON.stringify(queryObj);\n queryStr = queryStr.replace(/\\b(gte|gt|lte|lt)\\b/g, (match) => `$${match}`);\n this.query = this.query.find(JSON.parse(queryStr));\n\n return this;\n }", "title": "" }, { "docid": "56cf352b8ef63e4ef973d328de1bb504", "score": "0.64248675", "text": "function createFilterFor(query) {\n\t var lowercaseQuery = angular.lowercase(query);\n\n\t return function filterFn(packageConfig) {\n\t \tlet lcDisplayName = angular.lowercase(packageConfig.displayName);\n\t return (lcDisplayName.indexOf(lowercaseQuery) >= 0 ||\n\t \tpackageConfig.name.indexOf(lowercaseQuery) >= 0);\n\t };\n\n\t }", "title": "" }, { "docid": "e9e8591e25ed844744dfed20aa56d2ae", "score": "0.6421309", "text": "function createFilterFor(query)\n {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(team) {\n\n return (team._lowername.indexOf(lowercaseQuery) === 0) ||\n (team.id === query.id);\n };\n\n }", "title": "" }, { "docid": "7fc193f640506e75c20ab9490a369df3", "score": "0.64200234", "text": "function createFilterForPlayer(query)\n {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(player) {\n\n return (player._lowerFirstName.indexOf(lowercaseQuery) === 0) ||\n (player._lowerLastName.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "7fc193f640506e75c20ab9490a369df3", "score": "0.64200234", "text": "function createFilterForPlayer(query)\n {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(player) {\n\n return (player._lowerFirstName.indexOf(lowercaseQuery) === 0) ||\n (player._lowerLastName.indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "5b668ae11b269cf0e24c3d28a38324de", "score": "0.64181256", "text": "function createFilterFor(query) \n {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(brand) \n {\n return (angular.lowercase(brand.name).indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "782610db8138cf9da65a5135eda21cdb", "score": "0.6405256", "text": "filtering() {\n const queryObj = { ...this.queryString }\n\n const excludedFields = ['page', 'sort', 'limit']\n excludedFields.forEach((el) => delete queryObj[el])\n\n // gte = maior ou igual\n // lte = menor ou igual\n // lt = menor que\n // gt = maior que\n // regex = query de letra\n let queryStr = JSON.stringify(queryObj)\n queryStr = queryStr.replace(\n /\\b(gte|gt|lt|lte|regex)\\b/g,\n (match) => '$' + match\n )\n this.query.find(JSON.parse(queryStr))\n\n return this\n }", "title": "" }, { "docid": "aa668032c94c4b987736af2b0174c8d2", "score": "0.6405199", "text": "function createFilterFor(query) {\r\n return function filterFn(product) {\r\n return (product.productCode.toLowerCase().indexOf(query.toLowerCase()) !== -1);\r\n };\r\n }", "title": "" }, { "docid": "47dce17ecf841d1245c0b11895ac3212", "score": "0.63982826", "text": "createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(label) {\n return (label._lowername.indexOf(lowercaseQuery) != -1);\n };\n\n }", "title": "" }, { "docid": "802f129eb264704737781e470d2ca771", "score": "0.637324", "text": "composeFilterUrl(queryParams) {\n let qPs = {...queryParams};\n let dateKeys = ['date_start', 'date_end'];\n\n let base = '/api/entries/';\n let queryString = '?';\n for (let k in qPs) {\n if (dateKeys.includes(k)) {\n if (qPs[k]) {\n qPs[k] = qPs[k].format('YYYY-MM-DD'); // Date states are never falsy\n } else {\n qPs[k] = \"\"\n }\n }\n if (k === 'category' && qPs[k]) {\n qPs[k] = this.getCategoryName(Number(qPs[k]));\n }\n\n queryString += k + \"=\" + qPs[k] + \"&\";\n }\n queryString = queryString.slice(0, -1);\n let url = base + queryString;\n return url;\n }", "title": "" }, { "docid": "49c0f41b34a343ed2fc739635452b0e0", "score": "0.6373144", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(vegetable) {\n return (vegetable.name.indexOf(lowercaseQuery) === 0)\n };\n\n }", "title": "" }, { "docid": "a5bb890eea8f8f2d2b6e96e51040330a", "score": "0.63665354", "text": "function createFilterForElement(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function (elementList) {\n return (elementList.name.toLowerCase().indexOf(lowercaseQuery) >= 0);\n\n };\n }", "title": "" }, { "docid": "e8702db7b0ceaaed082dcf6dd3b6c5c5", "score": "0.6360224", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(company) {\n return (angular.lowercase(company.name).indexOf(lowercaseQuery) === 0);\n };\n\n }", "title": "" }, { "docid": "55a5e435b5191e3dece80d07437d493b", "score": "0.63539034", "text": "initializeFilterValuesFromQueryString() {\n this.clearAllFilters();\n\n if (this.encodedFilters) {\n this.currentFilters = JSON.parse(atob(this.encodedFilters));\n\n this.syncFilterValues();\n }\n }", "title": "" }, { "docid": "2e222fb13da799d719d525508095693b", "score": "0.63374114", "text": "function createFilterFor(query) {\n return function filterFn(thisClass) {\n var uppercaseQuery = query.toUpperCase();\n pass = (thisClass.toUpperCase().indexOf(uppercaseQuery) === 0);\n thisClass = thisClass.replace(/\\s+/g, '');\n pass = pass || (thisClass.toUpperCase().indexOf(uppercaseQuery) === 0);\n return pass;\n };\n }", "title": "" }, { "docid": "1b5cad33fc91090e00bed9a4d7abd754", "score": "0.6325546", "text": "filter() {\n // mutate the original req.query object in order to exclude some parametres. It is necessary in case some page or sort or limit page filed is sent in req.query.\n //Ex: /api/v1/places?name=\"something\"&coordinates=\"num, num\"\n const queryObj = { ...this.queryString };\n const deleteQueries = [\n 'limit',\n 'page',\n 'sort',\n 'fields'\n ];\n deleteQueries.forEach(el => delete queryObj[el]);\n\n // replace gt, gte, lt, lte - which comes with request object, with $gte, $gt, $lte, $lt to much the mongoose operator\n let queryStr = JSON.stringify(queryObj);\n queryStr = queryStr.replace(\n /\\b(lt|lte|gt|gte)\\b/g,\n match => `$${match}`\n );\n\n //call find mongosse method with the filtred request object here\n this.query = this.query.find(JSON.parse(queryStr));\n\n return this;\n }", "title": "" }, { "docid": "5c4ea10187d8dcbb5f6b7893e9c5ef2e", "score": "0.6323959", "text": "function createFilterFor(query) {\n return function filterFn(role) {\n return (role.RoleNm.indexOf(query) != -1);\n };\n }", "title": "" }, { "docid": "b7a021830fcdf1578727c9e8382f7b7a", "score": "0.63208634", "text": "filter(){\n const queryCopy = {...this.queryString}\n\n // Remove fields from the queryCopy\n const removeFields = ['keyword', 'limit', 'page']\n removeFields.forEach(ele => delete queryCopy[ele])\n\n // Advanced filter for price, ratings, etc\n\n // Convert queryCopy to a string\n let queryString = JSON.stringify(queryCopy)\n\n // Add a $ to the group for Mongo operators\n queryString = queryString.replace(/\\b(gt|gte|lt|lte)\\b/g, match => `$${match}`)\n\n this.query = this.query.find(JSON.parse(queryString))\n return this\n }", "title": "" }, { "docid": "5a13f718f9b8c2b06846a769445ff140", "score": "0.62904596", "text": "function CustomFilterFactory()\n {\n return function(input)\n {\n input = input || \"\";\n input = input.replace(\"likes\",\"loves\");\n return input;\n }\n }", "title": "" } ]
9f879c5d2df1550ad626e2b15616f75b
if you assign the string later also it take type as any let valueEndWithE = (assertionsExample2).endsWith("E"); //as type is any you will not get intellisense , so you need to append string assertions to get intellisense let alternateway = (assertionsExample2 as string).endsWith("E"); Arrow functions
[ { "docid": "9e354391100a3712632e1e6229657624", "score": "0.0", "text": "function normalFunction(normalFunctionparameters) {\n console.log(normalFunctionparameters);\n}", "title": "" } ]
[ { "docid": "2957454fb86a54d2aac1fba4f4713144", "score": "0.62662536", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n //I-character\n //O-test function to compare ending value\n //C-\n //E-\n //I'm going to return a function that converts both values to lowercase and then runs an if statement to compare the values, using length property minus one to get the last character\n return function myEndTest(yourString) {\n yourString = yourString.toLowerCase()\n endsWith = endsWith.toLowerCase()\n if(yourString[yourString.length-1] == endsWith) {\n return true\n } else {\n return false\n }\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "a9bd82e12c6ffdfdf05752d56416b475", "score": "0.6236611", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n \n //return a function, this function takes givenValue\n return function (givenValue){\n //use last character of both. match their case. check if equal.\n return endsWith[endsWith.length-1].toLowerCase() === givenValue[givenValue.length-1].toLowerCase();\n \n };\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "64849fc5ca4da3a34cb5d16daca0c5f4", "score": "0.6172007", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n return function (str){\n \n // Test whether the last index of a string wether upper or lower case is equal to endsWith.\n if(str.charAt(str.length - 1).toUpperCase() === endsWith || str.charAt(str.length - 1).toLowerCase() === endsWith){\n return true;\n } else{\n return false;\n }\n } ; \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "4656cc3b63853f0d2bb4fc93942475a8", "score": "0.61390096", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n //Create a function expression with the argument with string that tests whether string[string.length - 1] === endsWith character\n //when forced to uppercase or string[string.length - 1] === endsWith character when forced to lowercase\n var endsWithExpression = function(string) {\n if(string[string.length - 1] === endsWith.toUpperCase() || string[string.length - 1] === endsWith.toLowerCase()) {\n return true;\n } else {\n return false;\n }\n } \n //Return the endsWithExpression\n return endsWithExpression;\n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "61edac145cf269b89103cdbbcc135ecd", "score": "0.6060801", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n // return a funnction with the parameter of string \n // test whether string ends with the endsWith param\n return function (string){\n if(string[string.length -1].toUpperCase() === endsWith.toUpperCase()){\n return true\n } else {\n return false;\n }\n }\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "e92d716efb9eb791f858dbd2fce29ed0", "score": "0.5871281", "text": "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n return ending => ending.charAt(ending.length - 1).toLowerCase() === endsWith.toLowerCase();\n\n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "6171038270bd0eef84aa19a3f6093c6c", "score": "0.57935673", "text": "function confirmEnding(str, target) \n{\n if(str.endsWith(target))\n {\n return str;\n }\n\n}", "title": "" }, { "docid": "384a91df55184bae121bc309d752de4a", "score": "0.5779192", "text": "function endsWith(x, y, bool){\n x = x.toString();\n return bool ? x.toUpperCase().endsWith(y.toUpperCase()) : x.endsWith(y);\n }", "title": "" }, { "docid": "dbce5d80178f9369a3fab704846caf2c", "score": "0.5721659", "text": "function confirmEnding(str, target) {\n let end = str.endsWith(target);\n return end;\n }", "title": "" }, { "docid": "c5c52e45b31e144240c7fcab0a78e3be", "score": "0.568188", "text": "isEndingWith(value, sub) {\n return this.isString(value) && value.endsWith(sub);\n }", "title": "" }, { "docid": "4b6c1aebee18d224f1d652e4c7ff50aa", "score": "0.5641705", "text": "endsWith(searchString) {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to end with \\`${searchString}\\`, got \\`${value}\\``,\n validator: value => value.endsWith(searchString)\n });\n }", "title": "" }, { "docid": "4bf8398d5f77a32b47b21146fd64cfa0", "score": "0.56014675", "text": "function solution(str, ending){\n return str.endsWith(ending);\n }", "title": "" }, { "docid": "87cf9420335c8ac5fec60bb6b3dbfef9", "score": "0.55039847", "text": "function solution(str, ending){\nif(str.endsWith(ending)) return true\nreturn false\n}", "title": "" }, { "docid": "e5d9c0101b93c637fbcef0a2632a1037", "score": "0.5501143", "text": "function solution(str, ending){\n return str.endsWith(ending)\n}", "title": "" }, { "docid": "4717cb2077f0d19b800edb6868ac1c9b", "score": "0.54818815", "text": "isENotation(value) {\n const eNotationRegex = new RegExp(/e/i);\n\n return eNotationRegex.test(value.toString());\n }", "title": "" }, { "docid": "2ebc22007e60bf1f354a961a8bf8f53c", "score": "0.5435883", "text": "function solution(str, ending){\n return str.endsWith(ending);\n}", "title": "" }, { "docid": "2ebc22007e60bf1f354a961a8bf8f53c", "score": "0.5435883", "text": "function solution(str, ending){\n return str.endsWith(ending);\n}", "title": "" }, { "docid": "952c0ce0a2b81ea35f295338a911d8bf", "score": "0.5392924", "text": "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`);\n console.log(`.substr(2, 3) - ${value.substr(2, 3)}`); // (start-index, length) start at start-index, read for 3 characters \n console.log(`.substring(2, 3) - ${value.substring(2, 3)}`); // (start-index, end-index) start at start-index, up to but not including the end-index\n \n /*\n Other Methods\n - split(string)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "title": "" }, { "docid": "e5133dab7263ba9d9200a2bfa58732ec", "score": "0.5363315", "text": "function solution(str, ending) {\n return str.endsWith(ending);\n}", "title": "" }, { "docid": "3c89324c59b5b2d53a905e12806d808e", "score": "0.53556746", "text": "function endsWithVowel(end){\n var end = end.split('');// can't use let her bc can't be called\n let endNew = end.pop(); // curious why charAt worked but not charCodeAt\n if(endNew === 'a' || endNew === 'e' || endNew === 'i' || endNew === 'o' || endNew === 'u'){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "49569625818654208877a96915564579", "score": "0.5352211", "text": "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`);\n console.log(value.toLowerCase()); //just like in java, returning a string, not changing the value\n console.log(value);\n\n /*\n Other Methods\n - split(string)\n - substr(number, number) //these two are different from each other\n - substring(number, number)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "title": "" }, { "docid": "c4fcb02c908470ef7a203e2d13362b69", "score": "0.5351177", "text": "function endsWith(input, value) {}", "title": "" }, { "docid": "eb1dbfbfd1a2a3b0b156a771798153d7", "score": "0.5348216", "text": "function confirmEnding(str, target) {\n //1. of corse .endsWith() method\n //str = str.endsWith(target);\n //return str\n\n //2. .slice() method\n //return str.slice(str.length - target.length) === target;\n\n //3. usual for loop\n let flag = false;\n //start comparing only if target is shorter, else - false\n //compare from the last char till the first of the target\n for ( let i = target.length-1, j = str.length-1; target.length < str.length && i >= 0; i--, j--){\n if (target[i] == str[j]) { \n flag = true;\n } else {\n flag = false\n break\n }\n }\n\n\n return flag;\n }", "title": "" }, { "docid": "ecaca0c83f428e3bcd9946649730ad73", "score": "0.52590436", "text": "function solution(str, ending){\n // TODO: complete\n return str.endsWith(ending)\n}", "title": "" }, { "docid": "8e4144af5b27a5c864189618c21ad95d", "score": "0.52504236", "text": "function confirmEnding(str, target) {\n \n var end_char=str.substring(str.length-target.length);\n \n if(target===end_char){\n return true;\n }\n \n return false;\n}", "title": "" }, { "docid": "b98f3cb15c2c700b4c9ea39b4ab35a09", "score": "0.52395827", "text": "function test_false_string_case (){ assertFalse( compare.isValue( 'wa', 'Wa', false ) ); }", "title": "" }, { "docid": "f72acd8f8acdf98a5a532c2966f74e65", "score": "0.52365935", "text": "function endsWith(string, char) {\n // YOUR CODE BELOW HERE // \n \n // The .charAt() method will return the chararacter that is at a specfic index. \n // Using .toLowerCase() will mute the case sensistivity of the given strings last character as well as the given character.\n // Strict evaluation using a the comparison operator (===) will determine if the input string ends with the input character.\n return string.charAt(string.length-1).toLowerCase() === char.toLowerCase(); // When the beginsWith function is called it will evaluate to true or false.\n\n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "1d0fbc6912e6ae0842955a38f21c6cb3", "score": "0.5228201", "text": "function confirmEnding(str, target) {\n\n return str.substring(str.length - target.length,str.length) === target\n }", "title": "" }, { "docid": "a784d619be0d5877bedca8aff2884337", "score": "0.5206817", "text": "function confirmEnding(str, target) {\n if (str == null || target == null) {\n return \"Error: No string found\";\n }\n else {\n if (str.substring(str.length - target.length) === target) {\n return true;\n }\n return false;\n }\n }", "title": "" }, { "docid": "824eecf6d467346e06b9497c15fec9ea", "score": "0.52038395", "text": "function confirmEnding(str, target) {\n \n // measure length of target string\n let lenTarget = target.length;\n \n // check end of str using negative indexing on str.slice()\n let strSuffix = str.slice(-lenTarget);\n \n // compare suffix with target\n let result = (target == strSuffix);\n \n return result;\n}", "title": "" }, { "docid": "fda7f04f061c7274563626dd178aee66", "score": "0.5203554", "text": "function end(str, target) {\n // \"Never give up and good luck will find you.\" -- Falcor\n\n var length = target.length;\n var isEqual = target === str.substr(-length);\n return isEqual;\n\n}", "title": "" }, { "docid": "aba2fa6a441cc7b1ada4242da958bbca", "score": "0.5185847", "text": "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`); // index of where the word starts in the string\n console.log(`.substr(2,3) - ${value.substr(2,3)}`) // .substr(start-index, length)\n console.log(`.substring(2,3) - ${value.substring(2,3)}`) // .substring(start-index, end-index)\n // up to, but including the char at end-index\n\n /*\n Other Methods\n - split(string)\n - substr(number, number)\n - substring(number, number)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "title": "" }, { "docid": "dafc00dc38664233ded76f371045b85d", "score": "0.51809704", "text": "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\nif(str.substr(-target.length)===target){\nreturn true\n}\nreturn false\n}", "title": "" }, { "docid": "879625483dcc7c15801dab6d7a6514d6", "score": "0.5168407", "text": "function confirmEnding(str, target) {\n var start = str.length - (target.length);\n //Var for just comparing length of string\n if(str.substr(start, str.length) == target) {\n //Compares end of string with the target string\n return true;\n } else {\n return false;\n }\n \n}", "title": "" }, { "docid": "7416ecffe01cbb2208d496a85bf48447", "score": "0.5165688", "text": "function matchTheEnd(str) {\n let endRegex = /edward$/i;\n return str.match(endRegex);\n}", "title": "" }, { "docid": "1f6757deefe00bfcdaa7d99b6eafd962", "score": "0.51571715", "text": "function confirmEndingF(str, target) {\n\t// return str.slice(str.length - target.length) === target;\n\treturn str.slice(-target.length) === target;\n\n\t// Using regex:\n\t// let reg = new RegExp(target + '$', 'i'); // Ending in target, case insensitive\n\t// return reg.test(str);\n}", "title": "" }, { "docid": "1298c056ede8550a615a9e6310b5c534", "score": "0.5133638", "text": "function confirmEnding(str, target) {\n\t// find the index of the\n\tconst num = target.length;\n\n\t// Solution using if/else statement\n\t// if (str.slice(-num) === target) {\n\t// \treturn true;\n\t// } else {\n\t// \treturn false;\n\t// }\n\n\t// Solution using ternary operator\n\tconsole.log('confirmEnding:', str.substr(-num) === target ? true : false);\n\treturn str.slice(-num) === target ? true : false;\n}", "title": "" }, { "docid": "2dea08a529e402869a2d577cb9763ca6", "score": "0.5133556", "text": "function confirmEnding(str, target) {\n str = str.substr(str.length - target.length);\n if (str === target) {\n console.log('yes')\n return true;\n }else {\n console.log('no')\n return false;\n }\n}", "title": "" }, { "docid": "d55780f55d835bb57ed1a3ec57218ba9", "score": "0.5124571", "text": "function confirmEnding(str, target) {\n return new RegExp(target + \"$\").test(str);\n}", "title": "" }, { "docid": "fcb69c2b63b733891895382422d07a2f", "score": "0.5123881", "text": "function r(e){return\"string\"==typeof e}", "title": "" }, { "docid": "fcb69c2b63b733891895382422d07a2f", "score": "0.5123881", "text": "function r(e){return\"string\"==typeof e}", "title": "" }, { "docid": "dcd48547a26008dc947bfa202d76ba5b", "score": "0.51191247", "text": "function confirmEnding(str, target) {\n str = str.split(\" \").pop();\n let slicepoint = str.length - target.length;\n str = str.slice(slicepoint);\n if (str === target) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e257471fd489276fbfbf50ef00d515b4", "score": "0.5105047", "text": "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n var strArray = str.split(' ');\n var newStr = strArray.join('');\n console.log(str.substring(str.length - target.length));\n var test = str.substring(str.length - target.length);\n// console.log(strArray[strArray.length-1]);\n// var targetArray = target.split('');\n// if(strArray[strArray.length - 1] === target){\n// return true;\n// } else if(newStr[newStr.length-1] === target) {\n// return true;\n// } else {\n// return false;\n// }\n if(test === target){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "def158793c5638ac833576f32f67924a", "score": "0.5104475", "text": "static assertion(type, assertionType) {\r\n return (writer) => {\r\n writeValue(writer, type);\r\n writer.spaceIfLastNot().write(\"as \");\r\n writeValue(writer, assertionType);\r\n };\r\n }", "title": "" }, { "docid": "07e2bb2e57278f071fb93914ee3943ea", "score": "0.5099194", "text": "function confirmEnding(str, target) {\n // console.log(str.length);\n // console.log(str.substring(1,3));\n // console.log(str.substring(str.length - 1));\n // console.log(target.length);\n // console.log(str.substring(str.length - target.length));\n\n let lastChar = str.substring(str.length - target.length);\n if(lastChar === target) {\n return true\n } else {\n return false\n }\n \n // return str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "168f129952b55f9ad915c878d77c1a7a", "score": "0.5063106", "text": "function confirmEnding(str, target) {\n return RegExp(target + '$').test(str); // Just like saying '/target$/.test(str)'\n}", "title": "" }, { "docid": "168f129952b55f9ad915c878d77c1a7a", "score": "0.5063106", "text": "function confirmEnding(str, target) {\n return RegExp(target + '$').test(str); // Just like saying '/target$/.test(str)'\n}", "title": "" }, { "docid": "5c37f29fca93601dca192b5775783497", "score": "0.5037155", "text": "function marks2ndFunction(string) {\n console.log(string.toUpperCase());// use the toUpperCase() method on the string data type\n}", "title": "" }, { "docid": "d0bf41379a3e3c68f0a7a2535ba7a43d", "score": "0.5029592", "text": "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n\n const strEnding = str.slice(str.length - target.length)\n\n if (strEnding === target){\n return true\n }\n else {\n return false\n }\n\n return strEnding;\n}", "title": "" }, { "docid": "0c5e02b0a277787ce0dbe2e99abf8550", "score": "0.5020309", "text": "function xStrEndsWith( s, end )\r\n{\r\n if( !xStr(s,end) ) return false;\r\n var l = s.length;\r\n var r = l - end.length;\r\n if( r > 0 ) return s.substring( r, l ) == end;\r\n return s == end;\r\n}", "title": "" }, { "docid": "d7e451ad631112161b712b8e4a9ba5a0", "score": "0.50176847", "text": "function endOther(string1, string2){\n string1 = string1.toLowerCase();\n string2 = string2.toLowerCase();\n if(string1.endsWith(string2) || string2.endsWith(string1)){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "d03b0bdf06f7ace60c61374e3bfb3d76", "score": "0.5015265", "text": "function endWithSlash(str) {\n return S.endsWith(str, \"/\");\n }", "title": "" }, { "docid": "1387323b2cfe4529c31cf2972bb111b2", "score": "0.500093", "text": "function endsWith(str, suffix) {\n if (str === null || suffix === null)\n return false;\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }", "title": "" }, { "docid": "2f5f7457a9bcdaef97e6dbf550cea9f9", "score": "0.49989474", "text": "function confirmEnding(str, target) {\n\n let tarL = target.length;\n let strL = str.length;\n let strF = str.slice(strL - tarL, strL)\n\n if (strF === target) {\n return true\n } else {\n return false\n }\n return strF\n}", "title": "" }, { "docid": "5faf517dacb98a5596d8c1b8fea8205c", "score": "0.4994792", "text": "function confirmEnding(str, target) {\n let exist=str.lastIndexOf(target);\n if (exist!=-1){\n let slice = str.slice(exist);\n console.log(slice);\n if(slice==target){\n return true;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "fa13c73022d6e3aa416987deed7fbf72", "score": "0.4985591", "text": "function end(str, target) {\n return (str.substr(-target.length) === target);\n}", "title": "" }, { "docid": "7148934cc8adeb85e942fcc9f0e517bd", "score": "0.49832946", "text": "function testStartsEndsWith(callback)\n{\n\ttesting.assert('pepito'.startsWith('pe'), 'Failed to match using startsWith()', callback);\n\ttesting.assert(!'pepito'.startsWith('po'), 'Invalid match using startsWith()', callback);\n\ttesting.assert('pepito'.endsWith('to'), 'Failed to match using endsWith()', callback);\n\ttesting.assert(!'pepito'.startsWith('po'), 'Invalid match using endsWith()', callback);\n\ttesting.success(callback);\n}", "title": "" }, { "docid": "58fff8aff6f4f5987cb9fb32d2360f40", "score": "0.4981456", "text": "function endsWithAny(str, arr)\n{\n found = false;\n arr.forEach(function(ii) {\n if (str.endsWith(ii))\n {\n found = true;\n }\n });\n return found;\n}", "title": "" }, { "docid": "1dbdd076a33fdd92d2151d4fa9d0b6c3", "score": "0.4975683", "text": "function Exact() {\r\n}", "title": "" }, { "docid": "c1e6d3277e13260cb998c8be5df266bf", "score": "0.49699518", "text": "maybeParseAssertion() {\n if (this.eat('^')) {\n return { type: 'Assertion', subtype: '^' };\n }\n if (this.eat('$')) {\n return { type: 'Assertion', subtype: '$' };\n }\n\n const look2 = this.source.slice(this.position, this.position + 2);\n if (look2 === '\\\\b') {\n this.position += 2;\n return { type: 'Assertion', subtype: 'b' };\n }\n if (look2 === '\\\\B') {\n this.position += 2;\n return { type: 'Assertion', subtype: 'B' };\n }\n\n const look3 = this.source.slice(this.position, this.position + 3);\n if (look3 === '(?=') {\n this.position += 3;\n const d = this.parseDisjunction();\n this.expect(')');\n return {\n type: 'Assertion',\n subtype: '?=',\n Disjunction: d,\n };\n }\n if (look3 === '(?!') {\n this.position += 3;\n const d = this.parseDisjunction();\n this.expect(')');\n return {\n type: 'Assertion',\n subtype: '?!',\n Disjunction: d,\n };\n }\n\n const look4 = this.source.slice(this.position, this.position + 4);\n if (look4 === '(?<=') {\n this.position += 4;\n const d = this.parseDisjunction();\n this.expect(')');\n return {\n type: 'Assertion',\n subtype: '?<=',\n Disjunction: d,\n };\n }\n if (look4 === '(?<!') {\n this.position += 4;\n const d = this.parseDisjunction();\n this.expect(')');\n return {\n type: 'Assertion',\n subtype: '?<!',\n Disjunction: d,\n };\n }\n\n return undefined;\n }", "title": "" }, { "docid": "a5cf9bac1ff22a1a833720fe3852a8ec", "score": "0.4969253", "text": "function exOh(str)\n{\n // Function code goes here\n // Don't forget to return something!\n}", "title": "" }, { "docid": "8b9b5e748a599f45a1195d8c13d9b88a", "score": "0.49688148", "text": "function funcInEqualOperator(val){\r\n if(val != '12'){\r\n return \"It is not Equal\";\r\n }\r\n return \"Equal\";\r\n}", "title": "" }, { "docid": "0aba25d830996d679ca6749f46b7ffb4", "score": "0.4936611", "text": "ExactType() { \n switch (`${typeof this.Expected}`) {\n case 'number': \n case 'string':\n return this.ExactValue()\n break; \n case 'object': \n return this.ArrayLength()\n break; \n default: \n return `Unexpected data type ${typeof this.Expected} found, this program can only handle strings, numbers, and arrays`\n }\n }", "title": "" }, { "docid": "10a869a376a116976a4875e8d64e25ad", "score": "0.49347368", "text": "function confirmEnding(str, target){\n return str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "2f0d4dc1cb5e12bcc9d787e2f40559a7", "score": "0.49324703", "text": "function confirmEnding(str, target) \n{\n return str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "d61bc9ede2674faf1ef921d3610d1bbd", "score": "0.49307683", "text": "function test1(val){\nconst trueValue=\"Ashu\";\n\n if(val){\nconst trueValue= \"Vishal Singh\"; \nconsole.log(trueValue);\n }else{\nconsole.log(trueValue);\n \n }\n}", "title": "" }, { "docid": "a29a712b0593bd1f6f93465a8aeb5912", "score": "0.49295276", "text": "function confirmEnding(str, target) {\n var targetLength = target.length;\n\tvar ending = str.substring(str.length-targetLength);\n return ending === target;\n}", "title": "" }, { "docid": "a869f6b3731af3cc8969e1671b7c9f2f", "score": "0.49276426", "text": "function confirmEnding(str, target) {\n const lastChar = str[str.length - 1];\n\n if (lastChar.toLowerCase() === target.toLowerCase()) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "1bf30432cbd4b7d23b10c6ebd4716c8a", "score": "0.4908631", "text": "function endsWith(str, suffix) {\n\t str = toString(str);\n\t suffix = toString(suffix);\n\n\t return str.indexOf(suffix, str.length - suffix.length) !== -1;\n\t }", "title": "" }, { "docid": "cff8cc0d32fbbe8e2ba75b81c16592b1", "score": "0.49067882", "text": "function endingMatches(word, endingType) {\n let endingPos = endingType.substring(2);\n let endingSyllables = parseInt(endingType.substring(0,1), 10);\n\n let matchesPos = false;\n let matchesSyllables;\n\n switch (endingPos) {\n case 'verb': matchesPos = rita.isVerb(word); break;\n case 'adj' : matchesPos = rita.isAdjective(word); break;\n case 'noun': matchesPos = rita.isNoun(word); break;\n case 'adv' : matchesPos = rita.isAdverb(word); break;\n }\n\n matchesSyllables = rita.getSyllables(word).split(\"/\").length === endingSyllables;\n\n return matchesPos && matchesSyllables;\n}", "title": "" }, { "docid": "ab6a8eead85bf515bd7c2a5b4f06d3a0", "score": "0.49059784", "text": "function confirmEnding(str, target) {\n //substring method is used to extract characters from a string and has two arguements.\n //The first argument is a number that determines which index to start the extraction and the second is optional which determines where to end the extraction.\n //when you only use one argument it will use that number to extract from that index and on.\n\n //to obtain the index of where to start the extraction we need to know the length of the string and the target.\n\n //when you subtract the length of the target from the length of the string it will give you the substring we need to be tested.\n\n var first = str.length;\n console.log(str.length);\n\n var second = target.length;\n console.log(target.length);\n\n var difference = first - second;\n console.log(first - second);\n\n if (str.substring(difference) === target) {\n console.log(true);\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "80cefb6e32deb35f28e09906aa670e96", "score": "0.4905396", "text": "function endsWith(str, end) {\n var tr = str;\n\n if (str.toLowerCase().endsWith(end)) {\n tr = str.slice(0, -2);\n }\n\n return tr;\n}", "title": "" }, { "docid": "e8a1c7ce25b2e0093cb95cb072a42ba3", "score": "0.49009025", "text": "function confirmEnding(str, target) {\n var strToArray = str.split(\" \");\n strToArray = strToArray.reverse();\n if (strToArray.length == 1){\n strToArray = strToArray[0].split(\"\").reverse();\n if (strToArray[0].substring(0, target.length) == target) {\n return true;\n } else return false;\n }\n else if(strToArray[0].split(\"\").reverse().join(\"\").substring(0, target.length) === target.split(\"\").reverse().join(\"\")){\n return true;\n }\n else return false;\n}", "title": "" }, { "docid": "f7d9bb8fb95017d97244104687be0116", "score": "0.48924583", "text": "function confirmEnding(str, target) {\n\treturn str.lastIndexOf(target) === str.length - target.length;\n}", "title": "" }, { "docid": "0112f93d6f5de4aec8d47ec0b707ad0c", "score": "0.48861587", "text": "function confirmEnding (str, target) {\n let lastStr = str.slice(str.length - target.length, str.length)\n\n if (lastStr === target) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "7873b69bc682cba6e5f30fb34c5147dd", "score": "0.48732316", "text": "getFuncEnd() {\n if (this.node.type === 'SoakedFunctionApplication') {\n let questionMarkTokenIndex = this.indexOfSourceTokenAfterSourceTokenIndex(\n this.fn.outerEndTokenIndex, SourceType.EXISTENCE);\n let questionMarkToken = this.sourceTokenAtIndex(questionMarkTokenIndex);\n return questionMarkToken.end;\n } else {\n return this.fn.outerEnd;\n }\n }", "title": "" }, { "docid": "e2773cb09747e29193be26c76a6bbbbf", "score": "0.48672488", "text": "getStrToEol() {\n throw new Error('this method should be impelemented in subclass');\n }", "title": "" }, { "docid": "f818148fca95d553069a57662e885432", "score": "0.48642945", "text": "function evalTest(assert) {\n let evalVar; \n if (assert.type === 'equal') evalVar = 'to.equal'; \n if (assert.type === 'notequal') evalVar = 'to.not.equal'; \n if (assert.type === 'greaterthan') evalVar = 'to.be.above';\n if (assert.type === 'lessthan') evalVar = 'to.be.below';\n const expectation = convertType(assert); \n if (assert.dataType !== 'string') return `${evalVar}(${expectation});${newLine}`;\n return `${evalVar}('${expectation}');${newLine}`;\n}", "title": "" }, { "docid": "2da62051f42ccaf74599e8aeca4f79cd", "score": "0.48573637", "text": "toBe(assertation){\n if(assertation == this.val){\n this.print_success(assertation)\n return true;\n } else{\n this.print_fail(assertation);\n return false;\n }\n }", "title": "" }, { "docid": "a01d6d18e3c02e315af5cbfe194d2353", "score": "0.48569745", "text": "function EndsWith(str, suffix) {\n\treturn str && String(str).endsWith(suffix);\n}", "title": "" }, { "docid": "c3ade18a14b605a8e7935de000f0f584", "score": "0.4853495", "text": "'$=' ({ attr, value, insensitive }) {\n return attr.endsWith(value)\n }", "title": "" }, { "docid": "586e7a44f6936d591e330588efad63a2", "score": "0.4847359", "text": "myTestFunction1(str){\r\n return str;\r\n\r\n }", "title": "" }, { "docid": "b7c127a0ec93c5bfdc3b211f93fa3e5a", "score": "0.48451853", "text": "function confirmEnding(str, target) {\n var end = \"\";\n for(var i = str.length - target.length; i < str.length; i++) {\n end += str[i];\n }\n return end === target;\n}", "title": "" }, { "docid": "c4a39489f6e7b3a97094873d4713adbb", "score": "0.4841842", "text": "function confirmEnding(str, target) {\n return str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "c4a39489f6e7b3a97094873d4713adbb", "score": "0.4841842", "text": "function confirmEnding(str, target) {\n return str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "44d8ef816b40e8042c8ff99ded08099c", "score": "0.48374975", "text": "function confirmEnding(str, target) {\n\treturn str.slice(str.length - target.length) === target;\n}", "title": "" }, { "docid": "4f13de434e869dcddd201bb0029c9c9a", "score": "0.48115087", "text": "function confirmEnding(str, target) {\n //splitting string into array made of letters\n str = str.split(\"\");\n \n //getting the length of the target and storing in variable\n let targetLength = target.length;\n \n //splicing off everything except the last few letters, #off letters left equals # of letters in target\n str.splice(0, str.length - targetLength);\n //joining letters back into a string\n str = str.join(\"\");\n //comparing tring to target\n if (str == target) {\n return true;\n } else {\n return false;\n }\n \n}", "title": "" }, { "docid": "d7166718303c17f5541d4c5c09e8352e", "score": "0.48091248", "text": "function isEAN(value) {\n return typeof value === 'string' && validator_lib_isEAN__WEBPACK_IMPORTED_MODULE_1___default()(value);\n}", "title": "" }, { "docid": "31abc033d24f1caa9dbfa97df0ae1b64", "score": "0.48088992", "text": "function strEndsWith(input, match) {\n return input.slice(-1 * match.length) === match;\n }", "title": "" }, { "docid": "c6297b645f6475aafb13f4dfc91f2fdb", "score": "0.48030517", "text": "function confirmEnding(str, target)\n{\n\treturn str.charAt(str.length-1) == target;\n}", "title": "" }, { "docid": "f56ffa7e427ed6fc2efcd218d492f9e7", "score": "0.48007956", "text": "function confirmEnding(str, target) {\n str = str.replace(/\\s/g, ''); //remove white space from string\n var targetLength = target.length;\n var start = (str.length) - (target.length);\n if (str.substring(start,str.length+1) === target) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "e308fd941bf1ed16be21356489f8a93b", "score": "0.47984403", "text": "function end(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n var targetLength = target.length,\n stringLength = str.length,\n stringStart = stringLength - targetLength,\n diff = str.substr(stringStart, targetLength);\n \n return diff === target;\n}", "title": "" }, { "docid": "e6515ebd01a978b538c5aa2c914c2b56", "score": "0.47944853", "text": "function endsin (str, suffix) {\n if (str.length < suffix.length) return false\n return (str.slice(-suffix.length) === suffix)\n}", "title": "" }, { "docid": "eea565d2077fc1b320c05ff29b80448f", "score": "0.4779346", "text": "function stringEndsWithValidExtension(stringToCheck, acceptableExtensionsArray, required) {\n\tif (required == false && stringToCheck.length == 0) { return true; }\n\tfor (var i = 0; i < acceptableExtensionsArray.length; i++) {\n\t\tif (stringToCheck.toLowerCase().endsWith(acceptableExtensionsArray[i].toLowerCase())) { return true; }\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "3c693eaa20cf82bd1500d41033a42fbe", "score": "0.47741038", "text": "function isUppercase(string) {\n console.log(string.toUpperCase() === string);\n return;\n}", "title": "" }, { "docid": "688b9a4d42714dcafd8e342d57c2fa5c", "score": "0.4769718", "text": "function nodeEndsWith(n, expectedLastToken, sourceFile) {\n var children = n.getChildren(sourceFile);\n if (children.length) {\n var last = ts.lastOrUndefined(children);\n if (last.kind === expectedLastToken) {\n return true;\n }\n else if (last.kind === 23 /* SemicolonToken */ && children.length !== 1) {\n return children[children.length - 2].kind === expectedLastToken;\n }\n }\n return false;\n }", "title": "" }, { "docid": "4ca44bc8a1d49512d720b5db4b07044e", "score": "0.4768519", "text": "function confirmEnding1(str, target) {\n \n //Using index approach \n let startpoint=str.length - target.length;\n\n if(startpoint<0) return false;\n else{\n if(str.substr(startpoint) == target ) return true;\n }\n return false;\n}", "title": "" }, { "docid": "1ca32df043725eacba5dce283d3535de", "score": "0.47680548", "text": "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n sub = str.substr(str.length-target.length);\n if (sub == target) {\n return true;\n }\n else {\n return false;\n }\n return str;\n}", "title": "" }, { "docid": "b2b16da4ba3a16dcb3c9b005e3a06898", "score": "0.47654775", "text": "function confirmEnding(str, target) {\n let indexCompare = str.length - target.length;\n let slicedStr = str.slice(indexCompare, str.length);\n if (target == slicedStr) return true;\n else return false;\n}", "title": "" }, { "docid": "f08eed20db4b7c8356379447ce528198", "score": "0.4759119", "text": "function endsWith(a, b) {\n if (a.length < b.length) { return false; }\n return a.substring(a.length - b.length) == b;\n }", "title": "" }, { "docid": "14b8506f3ac0b72d810b6c239963ab03", "score": "0.4756394", "text": "function syntaxTL_ECMA6() {\n let greet=`Hola`;\n let greetbackTick=`\\`Hola \\` there`;\n console.log(greet);\n console.log(greetbackTick);\n console.log(typeof(greet));\n console.log(greet.length);\n}", "title": "" } ]
61d08282ebcd245fd9b76720c988952f
ver 2.0 starts here
[ { "docid": "28d2fac6316b79011d6d2a18e6ad43d0", "score": "0.0", "text": "function restrictDelimeter(address)\n\t\t{\n\t\t var str = trimAll(document.getElementById(address).value);\n\t\t\tfor(var i=0;i<str.length;i++)\n\t\t\t { \n\t\t\t if(str.charAt(i)== '~')\n\t\t\t {\n\t\t\t alert(' ~ is not allowed in address field.');\n\t\t\t document.getElementById(address).value ='';\n\t\t\t document.getElementById(address).focus();\n\t\t\t\t return false;\n\t\t\t }\n\t\t\t \n\t\t\t } \n\t\t }", "title": "" } ]
[ { "docid": "04db2bf4378e221bf34f73a324e7938e", "score": "0.70173025", "text": "get __version__(){return __version__;}", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.6873635", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.6873635", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "9604cbfae112f7ea827ced07342efbd3", "score": "0.68450516", "text": "static get version() {\n return 2;\n }", "title": "" }, { "docid": "611bd1ddc1b2b74bc9fbd7ea511e2bd6", "score": "0.6578935", "text": "function getVersion(){return _VERSION}", "title": "" }, { "docid": "cfdadd06066316a8eb035d9ccf9a4fe5", "score": "0.65010965", "text": "function Version() {}", "title": "" }, { "docid": "4f41c833b689b472c7441a59dcd9c097", "score": "0.6229918", "text": "function getVersion() {\n\treturn 12;\n}", "title": "" }, { "docid": "faca6bd75b08b75917100c9e1448882f", "score": "0.61571974", "text": "function getVersion(){return _config2.default.version}", "title": "" }, { "docid": "47002c0a9016cf81548ac82d227705d6", "score": "0.610155", "text": "function setversion() {\n}", "title": "" }, { "docid": "5d1e31781c54d196e6af0fccaed4edb2", "score": "0.60701746", "text": "function libraryVersion() {\r\n return \"1.3.2\";\r\n}", "title": "" }, { "docid": "f26ce6d5f0aedcf98ebdc96d22c8299d", "score": "0.5982369", "text": "function libraryVersion() {\n return \"1.1.3\";\n}", "title": "" }, { "docid": "1c7d6b60314bd7bae7643dbfa4493d2f", "score": "0.597072", "text": "function libraryVersion() {\r\n return \"1.4.4\";\r\n}", "title": "" }, { "docid": "1c7d6b60314bd7bae7643dbfa4493d2f", "score": "0.597072", "text": "function libraryVersion() {\r\n return \"1.4.4\";\r\n}", "title": "" }, { "docid": "1c7d6b60314bd7bae7643dbfa4493d2f", "score": "0.597072", "text": "function libraryVersion() {\r\n return \"1.4.4\";\r\n}", "title": "" }, { "docid": "2e79fc1fb1f9e0a1769d40acd086404a", "score": "0.57808924", "text": "function getVersion() {\n return '5.2.0';\n}", "title": "" }, { "docid": "431236fff477fd7ae4364fa17720edf4", "score": "0.5765166", "text": "function siteVersion() {\n\treturn \"1.0.0\";\n}", "title": "" }, { "docid": "98588303d48a91cc6de878b4aaf65e53", "score": "0.5764267", "text": "function wrap_getVersion()\r\n{\r\n return getVersion();\r\n}", "title": "" }, { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.5755003", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.5734967", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "782838d7821ec335c1ebcd7dbfb3a4f0", "score": "0.56448144", "text": "isVersion2() {\n return this.cooperativeWorkVersion() === 2\n }", "title": "" }, { "docid": "263f4691b10d3edfe354470550a92f39", "score": "0.5607385", "text": "version()\n {\n return current_version;\n }", "title": "" }, { "docid": "10a457b69fc29a88619659f051375f5f", "score": "0.55787927", "text": "_checkVersion() {\n if (this.provider && this.provider.request) {\n this.version = 'new'\n } else {\n this.version = 'old'\n }\n }", "title": "" }, { "docid": "6f09360fade27b02c80fe853447a6a18", "score": "0.55697286", "text": "function AddonInternal() {\n}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5563817", "text": "initialize () {}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5563817", "text": "initialize () {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5557635", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5557635", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5557635", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5557635", "text": "initialize() {}", "title": "" }, { "docid": "d14c42ef054242d19ecf3004add739e1", "score": "0.5532492", "text": "function getVersion() {\n return \"3.0.0.3\";\n}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.55264574", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5510435", "text": "init() { }", "title": "" }, { "docid": "21e3f202f91b68c56898488e1259bce5", "score": "0.5490665", "text": "function SERPTools() {\n}", "title": "" }, { "docid": "cf566b3f40d899be581d3fd20dd72a50", "score": "0.5486505", "text": "function VeroldComponent() {\n }", "title": "" }, { "docid": "7315b85e2b1e8ca5ca549e896c9c0ec4", "score": "0.5467186", "text": "function $_info() {}", "title": "" }, { "docid": "f6f257a05045b6dfa4f626e282b51129", "score": "0.54622746", "text": "_getCurrentVersion () {\n return this.currentVersion\n }", "title": "" }, { "docid": "dfc6f295c9dd468fee7a123badbb6c9b", "score": "0.5456329", "text": "initialize()\n {\n }", "title": "" }, { "docid": "c128f9ff4658c2004743759a79fc6ea7", "score": "0.5442722", "text": "get version(){ return this.m_version; }", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.5385498", "text": "initialize() {\n\n }", "title": "" }, { "docid": "fac07c85a504be6da2740af0ea4c9643", "score": "0.53434074", "text": "version(p_sVersion) {\n if (!p_sVersion) return p_sVersion;\n\n version = p_sVersion;\n }", "title": "" }, { "docid": "050d7c5b621a84441675939dd0c3d707", "score": "0.5342677", "text": "init() {\n }", "title": "" }, { "docid": "050d7c5b621a84441675939dd0c3d707", "score": "0.5342677", "text": "init() {\n }", "title": "" }, { "docid": "050d7c5b621a84441675939dd0c3d707", "score": "0.5342677", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.5342401", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.5342401", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.5342401", "text": "init() {\n }", "title": "" }, { "docid": "449680f9b7d74596bdbcd895a9d406df", "score": "0.53393424", "text": "function getVersion(){\n return _version;\n }", "title": "" }, { "docid": "449680f9b7d74596bdbcd895a9d406df", "score": "0.53393424", "text": "function getVersion(){\n return _version;\n }", "title": "" }, { "docid": "eb32a7c6fa430aedcefdf271e557b077", "score": "0.53227353", "text": "uspec() {\n }", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.5317988", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "df9f2ec10a63714630083b386d9cc886", "score": "0.5305209", "text": "function _init() {\n \n }", "title": "" }, { "docid": "beff6224845143b836925b1bf8d2ff37", "score": "0.5300121", "text": "init ()\n {\n }", "title": "" }, { "docid": "1283eba0c58262263ab897b24f0b2385", "score": "0.5298689", "text": "function init() {\n\n }", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.52930564", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "df2a5437751f57bc93aac469e30d472b", "score": "0.5287017", "text": "function init() {\n \n }", "title": "" }, { "docid": "60148fca6ef5c2f8aea4fbea0d244174", "score": "0.5280881", "text": "function init()\n {\n }", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.52766746", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "cef5a4ae3d94df78aa3f6a15ec621a3a", "score": "0.52749306", "text": "init() {\r\n\r\n }", "title": "" }, { "docid": "03cca946895dc3bf6ef1402a12276880", "score": "0.52723515", "text": "_setupSrc () { }", "title": "" }, { "docid": "1c15b63cf65f6d8b0853e2b9a1ba4f6e", "score": "0.5263976", "text": "function hc(){}", "title": "" }, { "docid": "592be24e037cc9aaec2b6ae072fd0e2a", "score": "0.5260217", "text": "function v(done) {\n done('version', { version: info.version });\n}", "title": "" }, { "docid": "8c866f7d118465e6b7b7ec01e882378c", "score": "0.5259095", "text": "_init() {\n\n }", "title": "" }, { "docid": "031b5b8c4ecb32c02cee2c0feeb2c326", "score": "0.52576053", "text": "function init() {\n \n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5256584", "text": "init() {}", "title": "" }, { "docid": "0a02217f9e8dca6cb704c6fa8fac22f2", "score": "0.52448374", "text": "function get2(){___jdce_logger(\"/build/elm.js\", 347);}", "title": "" }, { "docid": "9001681ca364cedf7dc13d421b352785", "score": "0.52433044", "text": "function ogs_version()\r\n{\r\n\tvar nr = parseInt(ogs.load('version'),10);\r\n\treturn (Math.floor(nr / 10000)) + '.' + (Math.floor(nr / 100) % 100) + ' - Rev #' + (nr % 100);\r\n}", "title": "" }, { "docid": "049b8d452993fc2891cdeb0d39276be3", "score": "0.5238198", "text": "function avataxHelper() {}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.52365345", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.52365345", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.52365345", "text": "ready() { }", "title": "" }, { "docid": "320da633160e0c3a7607b830c8878593", "score": "0.5220608", "text": "function init(){\r\n\t\t\t\r\n\r\n\t\t}", "title": "" }, { "docid": "ac1980884b3fb0c22fc5b8175daafad2", "score": "0.5218389", "text": "version() {\n return '';\n }", "title": "" }, { "docid": "de58938241555d2fc66b4ec8e0928f02", "score": "0.5212336", "text": "init() {\n }", "title": "" }, { "docid": "1b91ef39833b0cd6df7a729573354cc3", "score": "0.5210974", "text": "function init() {\n\t//TODO\n}", "title": "" }, { "docid": "332a3d9a7ab828394bd1449fc4d8b3db", "score": "0.52090794", "text": "initialize() {\n //\n }", "title": "" }, { "docid": "910c7dab37c966cce745b41a9caac21e", "score": "0.5205723", "text": "function TomatoUtils() {}", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.52046186", "text": "init() {\n\n }", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.52046186", "text": "init() {\n\n }", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.52046186", "text": "init() {\n\n }", "title": "" }, { "docid": "12fdef010e3098bcbbe86de71108bca8", "score": "0.5189617", "text": "function main() { \r\n\t\tif (plugin) {\r\n\t\t\ttestPlayerVersion();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmatchVersions();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "12fdef010e3098bcbbe86de71108bca8", "score": "0.5189617", "text": "function main() { \r\n\t\tif (plugin) {\r\n\t\t\ttestPlayerVersion();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmatchVersions();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "12fdef010e3098bcbbe86de71108bca8", "score": "0.5189617", "text": "function main() { \r\n\t\tif (plugin) {\r\n\t\t\ttestPlayerVersion();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmatchVersions();\r\n\t\t}\r\n\t}", "title": "" } ]
fef843f6179f34e7963d2796fa589f83
Attempts to deserialize a value to a valid date object. This is different from parsing in that deserialize should only accept nonambiguous, localeindependent formats (e.g. a ISO 8601 string). The default implementation does not allow any deserialization, it simply checks that the given value is already a valid date object or null. The `` will call this
[ { "docid": "3d1a5f3f430bb1dda24507050a700da7", "score": "0.7723661", "text": "deserialize(value) {\n if (value == null || this.isDateInstance(value) && this.isValid(value)) {\n return value;\n }\n return this.invalid();\n }", "title": "" } ]
[ { "docid": "f4a8293e2556ac8c1c1c7824ef2689dc", "score": "0.82582587", "text": "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "title": "" }, { "docid": "f4a8293e2556ac8c1c1c7824ef2689dc", "score": "0.82582587", "text": "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "title": "" }, { "docid": "f4a8293e2556ac8c1c1c7824ef2689dc", "score": "0.82582587", "text": "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "title": "" }, { "docid": "90df52c96d31b782f070417991aff0f4", "score": "0.7231128", "text": "parseValue(value) {\n if (value === null || value === undefined) {\n return null;\n }\n\n if (value === 'number' || value instanceof Date) {\n return value;\n }\n\n if (typeof value === 'string') {\n return new Date(value);\n }\n\n throw new TypeError(\n `DateTime cannot be serialized from non string, non numeric, or non Date type ${value}`\n );\n }", "title": "" }, { "docid": "26a9c0e9b0139c4a2986f7d930ff116e", "score": "0.7211976", "text": "static load(value) {\n if (typeof value === 'string') {\n var parts = value.split(\"-\");\n return new Date(parts[0], parseInt(parts[1])-1, parts[2])\n }\n \n if (typeof value === 'number') {\n return new Date(value);\n }\n\n if (!(value instanceof Date) && value !== null) {\n throw new TypeError(typeof value + \" can't be coerced into Date\");\n }\n\n return value;\n }", "title": "" }, { "docid": "592eeada08daf592a6876e2037f37866", "score": "0.7132151", "text": "function parseDate(value) {\n if (value instanceof Date) {\n return _elm_lang$core$Native_Json.succeed(value);\n } else {\n return _elm_lang$core$Native_Json.fail('Expected a Date, but did not find one');\n }\n }", "title": "" }, { "docid": "1c356772937375105cdacd047b59e652", "score": "0.693502", "text": "__parseValue(value) {\n return coerceDate(value);\n }", "title": "" }, { "docid": "825b592f994fcc1c644091b10877c510", "score": "0.67741644", "text": "function _asDate(value) {\n if (is(value, \"Date\")) {\n return value;\n }\n try {\n // casting to string detects breaks on values such as null\n return new Date(value.toString());\n } catch (e) {\n // Really? We just make up a date?\n return new Date();\n }\n}", "title": "" }, { "docid": "8547a5a46d7ce1cbca4c7901970a9111", "score": "0.6761054", "text": "function parse(value) {\n return null !== value ? new Date(value) : value\n}", "title": "" }, { "docid": "63653fd18a3066db0385a1ade3d30d2b", "score": "0.65829927", "text": "function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }", "title": "" }, { "docid": "63653fd18a3066db0385a1ade3d30d2b", "score": "0.65829927", "text": "function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }", "title": "" }, { "docid": "63653fd18a3066db0385a1ade3d30d2b", "score": "0.65829927", "text": "function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }", "title": "" }, { "docid": "63653fd18a3066db0385a1ade3d30d2b", "score": "0.65829927", "text": "function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }", "title": "" }, { "docid": "63653fd18a3066db0385a1ade3d30d2b", "score": "0.65829927", "text": "function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }", "title": "" }, { "docid": "985208a20ac547f8e3e31fa73f5ef125", "score": "0.6404158", "text": "function parseDate(value) {\n if (value) {\n var date = new Date(value);\n if (!isNaN(date)) {\n return date;\n }\n }\n return value;\n }", "title": "" }, { "docid": "b4c3f2280f58296aff438568ac5a0614", "score": "0.6396314", "text": "function parseValue(value, dateFormat, localization) {\n if (!isNil_1.default(value) && !isNil_1.default(dateFormat)) {\n var date = moment_1.default(value, dateFormat);\n if (date.isValid()) {\n date.locale(localization);\n return date;\n }\n }\n}", "title": "" }, { "docid": "30c243a35edf6b48c8403897ab294a54", "score": "0.628937", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map(val => +val);\n return createDate(y, m - 1, d);\n }\n\n const parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n let match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n const date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n\n return date;\n}", "title": "" }, { "docid": "6ec1e695e3387a0f798b1f5dfff8e8b0", "score": "0.6282904", "text": "function validateDate(value, format, locale, origValue) {\n const date = parseDate(value, format, locale);\n return date !== undefined ? date : origValue;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.62813777", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.62813777", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.620072", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "9faa501f096dd74e4569f32792e40ae5", "score": "0.6158141", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "9faa501f096dd74e4569f32792e40ae5", "score": "0.6158141", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "9faa501f096dd74e4569f32792e40ae5", "score": "0.6158141", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "9faa501f096dd74e4569f32792e40ae5", "score": "0.6158141", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "9faa501f096dd74e4569f32792e40ae5", "score": "0.6158141", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "ca42aa315c7a660cc9472e9a36a94dc5", "score": "0.613458", "text": "parseValue(value) {\n\t\tconsole.log('parsing date');\n\t\treturn new Date(value) \n\t}", "title": "" }, { "docid": "00efa9e605433632bd35e903c751339c", "score": "0.6097633", "text": "function parseDate(viewValue) {\r\n if (!viewValue) {\r\n ngModel.$setValidity('date', true);\r\n return null;\r\n } else if (angular.isDate(viewValue)) {\r\n ngModel.$setValidity('date', true);\r\n return viewValue;\r\n } else if (angular.isString(viewValue)) {\r\n var date = new Date(viewValue);\r\n if (isNaN(date)) {\r\n ngModel.$setValidity('date', false);\r\n return undefined;\r\n } else {\r\n ngModel.$setValidity('date', true);\r\n return date;\r\n }\r\n } else {\r\n ngModel.$setValidity('date', false);\r\n return undefined;\r\n }\r\n }", "title": "" }, { "docid": "c770d5074455b5d9fb9799c03d076c38", "score": "0.60735905", "text": "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "title": "" }, { "docid": "1118c1d90cc78bc53257c48fd88f5193", "score": "0.6063872", "text": "serialize(value) {\n if (value === null || value === undefined) {\n return null;\n }\n\n if (typeof value === 'number' || value instanceof Date) {\n return value;\n }\n\n if (typeof value === 'string') {\n return new Date(value);\n }\n\n throw new TypeError(\n `DateTime cannot be serialized from non string, non numeric, or non Date type ${value}`\n );\n }", "title": "" }, { "docid": "e67f13e9c8e761e233aa711a5c8b3b44", "score": "0.6053616", "text": "function parseValue(value, dateFormat) {\n if (!_.isNil(value) && !_.isNil(dateFormat)) {\n var date = moment(value, dateFormat);\n if (date.isValid()) {\n return date;\n }\n }\n}", "title": "" }, { "docid": "c9dce7c44d0ccec147f3c1a0e890cbaa", "score": "0.589242", "text": "function isDate() {\n return makeValidator({\n test: (value, state) => {\n var _a;\n if (!(value instanceof Date)) {\n if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {\n if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)\n return pushError(state, `Unbound coercion result`);\n let coercion;\n if (typeof value === `string` && iso8601RegExp.test(value)) {\n coercion = new Date(value);\n }\n else {\n let timestamp;\n if (typeof value === `string`) {\n let val;\n try {\n val = JSON.parse(value);\n }\n catch (_b) { }\n if (typeof val === `number`) {\n timestamp = val;\n }\n }\n else if (typeof value === `number`) {\n timestamp = value;\n }\n if (typeof timestamp !== `undefined`) {\n if (Number.isSafeInteger(timestamp) || !Number.isSafeInteger(timestamp * 1000)) {\n coercion = new Date(timestamp * 1000);\n }\n else {\n return pushError(state, `Received a timestamp that can't be safely represented by the runtime (${value})`);\n }\n }\n }\n if (typeof coercion !== `undefined`) {\n state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]);\n return true;\n }\n }\n return pushError(state, `Expected a date (got ${getPrintable(value)})`);\n }\n return true;\n },\n });\n}", "title": "" }, { "docid": "93bfa38f3bfdc0d7a695ce080a84a2b1", "score": "0.5891493", "text": "__serialize(value) {\n return coerceDate(value);\n }", "title": "" }, { "docid": "fe0b837b9035f5601241eca145d0b413", "score": "0.5888166", "text": "function toDate(value) {\n\treturn typeof value === 'number' ? value : Date.parse(value);\n}", "title": "" }, { "docid": "9db477baac6f0b60c23af1f86f641035", "score": "0.58254063", "text": "function anyToDate(value) {\r\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"](value)) {\r\n // TODO maybe don't create a new Date ?\r\n return new Date(value);\r\n }\r\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](value)) {\r\n return new Date(value);\r\n }\r\n else {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](num)) {\r\n return new Date(value);\r\n }\r\n else {\r\n return new Date(num);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a48390b1804a5dba4157570efbef395f", "score": "0.580321", "text": "function dateParser(value, format, culture) {\r\n if(Globalize.findClosestCulture(format)) {\r\n culture = format;\r\n format = undefined;\r\n }\r\n var cf = Globalize.findClosestCulture(culture).calendars.standard, pattern = cf.patterns.d;\r\n if(format) {\r\n if(format.length <= 1) {\r\n pattern = parseShortPattern(format, cf.patterns);\r\n } else {\r\n pattern = format;\r\n }\r\n } else {\r\n pattern = cf.patterns.d;\r\n }\r\n var wijInputDate = new wijInputDateImpl({\r\n });\r\n var _formatter = new wijDateTextFormatter(wijInputDate, pattern, true);\r\n if(hasEraYear(_formatter.descriptors)) {\r\n return parseEraDate(value, _formatter, cf);\r\n } else {\r\n return Globalize.parseDate(value, pattern, culture);\r\n }\r\n }", "title": "" }, { "docid": "b5216c3f3747355f181d41f91692a7a0", "score": "0.579782", "text": "function isdate(value) {\n return value && Object.prototype.toString.call(value) == '[object Date]';\n }", "title": "" }, { "docid": "d4cf4e421d4bd9e4b604a011560f5aee", "score": "0.57641387", "text": "function toDate(value, options) {\n if (typeof options === 'string')\n options = { formatString: options };\n var _a = Object.assign({ formatString: 'yyyy-MM-dd HH:mm:ss', defaultValue: new Date(NaN) }, options), formatString = _a.formatString, defaultValue = _a.defaultValue;\n if (value == null) {\n return defaultValue;\n }\n if (value instanceof Date) {\n return value;\n }\n if (typeof value === 'number' || (typeof value === 'string' && /[0-9]{10,13}/.test(value))) {\n return new Date(+value);\n }\n var tryDate = dateFns.parseISO(value);\n if (isNaN(tryDate)) {\n tryDate = dateFns.parse(value, formatString, new Date());\n }\n return isNaN(tryDate) ? defaultValue : tryDate;\n }", "title": "" }, { "docid": "d8f1004c4cc911e091d736c3860d2964", "score": "0.57026815", "text": "function isDate(value) {\n if (value instanceof Date) {\n return true;\n }\n else if (isString(value)) {\n // test whether this string contains a date\n const match = ASPDateRegex.exec(value);\n if (match) {\n return true;\n }\n else if (!isNaN(Date.parse(value))) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "d8f1004c4cc911e091d736c3860d2964", "score": "0.57026815", "text": "function isDate(value) {\n if (value instanceof Date) {\n return true;\n }\n else if (isString(value)) {\n // test whether this string contains a date\n const match = ASPDateRegex.exec(value);\n if (match) {\n return true;\n }\n else if (!isNaN(Date.parse(value))) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "2c72f775411d8c54e2ac8de66798085d", "score": "0.5701012", "text": "function isDate(value) {\r\n return getType(value) === \"[object Date]\";\r\n}", "title": "" }, { "docid": "909efd2eefea15bb9992693c12e95cc5", "score": "0.56247777", "text": "function dateReviver(key, value) {\n if (isStringDate(value)) {\n return new Date(value);\n } else {\n \treturn value;\n }\n}", "title": "" }, { "docid": "bc9a0d3015a73c417bb5682b814a83c7", "score": "0.5615599", "text": "function toDate(value, options) {\n if (typeof options === 'string')\n options = { formatString: options };\n const { formatString, defaultValue } = {\n formatString: 'yyyy-MM-dd HH:mm:ss',\n defaultValue: new Date(NaN),\n ...options\n };\n if (value == null) {\n return defaultValue;\n }\n if (value instanceof Date) {\n return value;\n }\n if (typeof value === 'number' || (typeof value === 'string' && /[0-9]{10,13}/.test(value))) {\n return new Date(+value);\n }\n let tryDate = parseISO(value);\n if (isNaN(tryDate)) {\n tryDate = parse(value, formatString, new Date());\n }\n return isNaN(tryDate) ? defaultValue : tryDate;\n}", "title": "" }, { "docid": "90b8ee4bdea0e9d367d6f33d56e17859", "score": "0.5548975", "text": "static assertDateString(value) {\n Assertions.assertString(value);\n\n if (isNaN(Date.parse(value))) {\n throw new Error(`: \"${value}\" is not a valid date string`);\n }\n }", "title": "" }, { "docid": "4fb8ce49d6844fc08d2ecf105ae02189", "score": "0.5525497", "text": "dateFormatter(value, options={}) {\n var val, temp, valid, parsed, formatted, errors = []\n\n value = adjustElixirDateTime(value);\n\n val = Formatters.stringFormatter(value, options)\n if (!val.valid)\n return val\n\n // Do not generate format errors if not required by String formatter\n // when value is empty.\n if (_.isEmpty(value)) {\n return {\n valid: true,\n parsed: value,\n formatted: value,\n errors: []\n }\n }\n\n options = _.merge({}, {format: 'full-date'}, options)\n temp = this.parseDate(val.parsed)\n valid = temp.isValid()\n if (valid) {\n // store parsed value as just the date portion.\n parsed = temp.format('YYYY-MM-DD')\n if (options.format == 'month-year')\n formatted = temp.format(this.monthYearFormat)\n else\n formatted = temp.format(this.monthDayYearFormat)\n } else {\n errors.push('invalid date')\n formatted = value\n parsed = null\n }\n return {\n valid,\n parsed,\n formatted,\n errors\n }\n }", "title": "" }, { "docid": "bce4866cd7b0dfc96282cd5b2361afae", "score": "0.54993206", "text": "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "title": "" }, { "docid": "bce4866cd7b0dfc96282cd5b2361afae", "score": "0.54993206", "text": "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "title": "" }, { "docid": "bce4866cd7b0dfc96282cd5b2361afae", "score": "0.54993206", "text": "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "title": "" }, { "docid": "897a54896f9f64fd433687a623786dfe", "score": "0.5483727", "text": "function isDate(val) {\n return (isValue(val) &&\n val.constructor &&\n val.constructor === Date);\n}", "title": "" }, { "docid": "426dd8373078e4ac97d3a8c5fd24fda6", "score": "0.5457891", "text": "function isDate(value) {\n return lookup(value) === 'date';\n}", "title": "" }, { "docid": "9323f5a5c03312a3e356a2e80583ea20", "score": "0.54558015", "text": "_isValidValue(value) {\n return !value || this._dateAdapter.isValid(value);\n }", "title": "" }, { "docid": "c15ad722d134c04d12dd2f8868e2d47c", "score": "0.5455455", "text": "function parseDateTimeFromString(value) {\r\n if (!value) {\r\n return null;\r\n }\r\n var _a = value.split(' '), dateStr = _a[0], timeStr = _a[1];\r\n if (!dateStr) {\r\n return null;\r\n }\r\n var fields = dateStr.split('-').map(function (f) { return parseInt(f, 10); });\r\n if (fields.filter(function (f) { return !isNaN(f); }).length !== 3) {\r\n return null;\r\n }\r\n var year = fields[0], month = fields[1], day = fields[2];\r\n var date = new Date(year, month - 1, day);\r\n if (date.getFullYear() !== year ||\r\n date.getMonth() !== month - 1 ||\r\n date.getDate() !== day) {\r\n // date was not parsed as expected so must have been invalid\r\n return null;\r\n }\r\n if (!timeStr || timeStr === '00:00:00') {\r\n return date;\r\n }\r\n var _b = timeStr.split(':').map(function (part) { return parseInt(part, 10); }), hours = _b[0], minutes = _b[1], seconds = _b[2];\r\n if (hours >= 0 && hours < 24) {\r\n date.setHours(hours);\r\n }\r\n if (minutes >= 0 && minutes < 60) {\r\n date.setMinutes(minutes);\r\n }\r\n if (seconds >= 0 && seconds < 60) {\r\n date.setSeconds(seconds);\r\n }\r\n return date;\r\n}", "title": "" }, { "docid": "6f8833c5ed6fef39199cda2d17547c6c", "score": "0.5450862", "text": "function dateReviver(key, value) {\n var parts = void 0;\n\n if (typeof value === 'string') {\n // eslint-disable-next-line max-len\n parts = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d*))?(Z|([+-])(\\d{2}):(\\d{2}))$/.exec(value);\n\n if (parts) {\n return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4], +parts[5], +parts[6], +(parts[7] || 0)));\n }\n }\n\n return value;\n }", "title": "" }, { "docid": "6f8833c5ed6fef39199cda2d17547c6c", "score": "0.5450862", "text": "function dateReviver(key, value) {\n var parts = void 0;\n\n if (typeof value === 'string') {\n // eslint-disable-next-line max-len\n parts = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d*))?(Z|([+-])(\\d{2}):(\\d{2}))$/.exec(value);\n\n if (parts) {\n return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4], +parts[5], +parts[6], +(parts[7] || 0)));\n }\n }\n\n return value;\n }", "title": "" }, { "docid": "465f10b5bf24e62d2398043ce1ff84ce", "score": "0.5442268", "text": "function isDate( value ){\n\t\treturn value instanceof Date;\n\t}", "title": "" }, { "docid": "b74a4ecd9ce8480b722e612e87f0ee4d", "score": "0.5438346", "text": "function isDate(value) {\n if (value==\"\") return false;\n\n var pos = value.indexOf(\"/\");\n if (pos == -1) return false;\n var d = parseInt(value.substring(0,pos));\n value = value.substring(pos+1, 999);\n pos = value.indexOf(\"/\");\n if (pos==-1) return false;\n var m = parseInt(value.substring(0,pos));\n value = value.substring(pos+1, 999);\n var y = parseInt(value);\n if (isNaN(d)) return false;\n if (isNaN(m)) return false;\n if (isNaN(y)) return false;\n\n var type=navigator.appName;\n if (type==\"Netscape\") var lang = navigator.language;\n else var lang = navigator.userLanguage;\n lang = lang.substr(0,2);\n\n if (lang == \"fr\") var date = new Date(y, m-1, d);\n else var date = new Date(d, m-1, y);\n if (isNaN(date)) return false;\n return true;\n }", "title": "" }, { "docid": "1bc39869f14092eca92dd3b29000a8d3", "score": "0.5410345", "text": "function deserializeValue(value) {\n try {\n return value\n ? value == 'true' || (value == 'false'\n ? false\n : value == 'null'\n ? null\n : +value + '' == value\n ? +value\n : /^[[{]/.test(value)\n ? JSON.parse(value)\n : value)\n : value;\n } catch (e) {\n return value;\n }\n}", "title": "" }, { "docid": "121c74b2fb7f2efed1a1e441a75d73a7", "score": "0.5402716", "text": "fromString(value) {\n this.fromJSON(JSON.parse(value));\n }", "title": "" }, { "docid": "121c74b2fb7f2efed1a1e441a75d73a7", "score": "0.5402716", "text": "fromString(value) {\n this.fromJSON(JSON.parse(value));\n }", "title": "" }, { "docid": "a4ab58edc5fd069eff8f9a0417786b2f", "score": "0.53970194", "text": "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "title": "" }, { "docid": "d5bd7156aa313371872595049478aa3d", "score": "0.5389096", "text": "function deserializeValue(value) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n } catch (e) {\n return value;\n }\n }", "title": "" }, { "docid": "293b40c357dcb99e6a4ed1fe1969f52f", "score": "0.53846633", "text": "serialize(value) {\n\t\treturn new Date(value) \n\t}", "title": "" }, { "docid": "ca21de961778e026d23646d52af4ccfd", "score": "0.5376963", "text": "function deserializeValue(value) {\n\t try {\n\t return value ?\n\t value == \"true\" ||\n\t ( value == \"false\" ? false :\n\t value == \"null\" ? null :\n\t +value + \"\" == value ? +value :\n\t /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n\t value )\n\t : value\n\t } catch(e) {\n\t return value\n\t }\n\t }", "title": "" }, { "docid": "ca21de961778e026d23646d52af4ccfd", "score": "0.5376963", "text": "function deserializeValue(value) {\n\t try {\n\t return value ?\n\t value == \"true\" ||\n\t ( value == \"false\" ? false :\n\t value == \"null\" ? null :\n\t +value + \"\" == value ? +value :\n\t /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n\t value )\n\t : value\n\t } catch(e) {\n\t return value\n\t }\n\t }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "c1318556615ebfa8c6a7adca6d395404", "score": "0.5373276", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "89152de5307b864cf70cf4622109611a", "score": "0.5371426", "text": "function deserializeValue(value) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n } catch (e) {\n return value;\n }\n }", "title": "" }, { "docid": "5313be305a78de76f4a40616348638d0", "score": "0.5334219", "text": "serialize(value) {\n return new Date(value);\n }", "title": "" }, { "docid": "d094c7fb6ebca05c74ab454e28d8d88d", "score": "0.5329985", "text": "function parseDataFromRfc2822(value) {\n return Date.parse(value);\n}", "title": "" }, { "docid": "a9955749185702e566f6d022887dd287", "score": "0.53072333", "text": "function isDate(v) {\n return !isUndefined(v) && !isNull(v) && v.constructor === Date && isInteger(v.getTime());\n}", "title": "" }, { "docid": "f7f324a7d5d822be523abd04cf14f832", "score": "0.53065085", "text": "static parseDate(date) {\n if (!(date instanceof Date ||\n date instanceof moment__default[\"default\"] ||\n typeof date === \"string\" && new RegExp(`^(?:${ISO8601_DATE_TIME})$`).test(date) ||\n Array.isArray(date) && date.length && !date.some((value) => typeof value !== \"number\" || isNaN(value)))) {\n return null;\n }\n try {\n let parsedDate;\n if (Array.isArray(date)) {\n const [year, month = 0, day = 1] = date;\n if (month >= 0 && month <= 11 && day > 0 && day <= 31) {\n parsedDate = moment__default[\"default\"](Date.UTC(year, month || 0, day || 1));\n }\n else {\n return null;\n }\n }\n else {\n parsedDate = moment__default[\"default\"](date);\n }\n return parsedDate.isValid() ? parsedDate.toDate() : null;\n }\n catch (err) {\n return null;\n }\n }", "title": "" }, { "docid": "35b29067809f7e9ba53e80e95373a553", "score": "0.5299363", "text": "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "a5ffcacd705ac65f6081be5b13ba18ce", "score": "0.5294976", "text": "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "a5ffcacd705ac65f6081be5b13ba18ce", "score": "0.5294976", "text": "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "86ac00f9bb6142dcf45ec4390c45e213", "score": "0.52890635", "text": "function deserializeValue(value) {\n\t var num\n\t try {\n\t return value ?\n\t value == \"true\" ||\n\t ( value == \"false\" ? false :\n\t value == \"null\" ? null :\n\t !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n\t /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n\t value )\n\t : value\n\t } catch(e) {\n\t return value\n\t }\n\t }", "title": "" }, { "docid": "00ff51914d4c5435f405ade64d66fa69", "score": "0.52830064", "text": "loadValue(value) {\n if (value && value != -1) {\n if (this.usetimezone) {\n this.dd = new Date(value * 1000).getDate();\n this.mm = new Date(value * 1000).getMonth() + 1;\n this.yyyy = new Date(value * 1000).getFullYear();\n }\n else {\n this.dd = new Date(value * 1000).getUTCDate();\n this.mm = new Date(value * 1000).getUTCMonth() + 1;\n this.yyyy = new Date(value * 1000).getUTCFullYear();\n }\n }\n else {\n this.dd = 0;\n this.mm = 0;\n this.yyyy = 0;\n }\n }", "title": "" }, { "docid": "b5663485b88fd46286c004a4f10f602a", "score": "0.5279691", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "b5663485b88fd46286c004a4f10f602a", "score": "0.5279691", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "13f7050a4be1fa96649ff99249d89666", "score": "0.5274528", "text": "function value2date(val) {\n if (isNaN(val)) {\n const split = val.split(/[-/]/); // split with - or /\n return new Date(Date.UTC(split[0], split[1] - 1, split[2], 12));\n } else {\n // excel date in number since January 1, 1970\n return new Date((val - (25567 + 2))*86400*1000); // ... +2 because it works better than +1 !\n }\n}", "title": "" }, { "docid": "2f729305f351383704c2b62fe8d7913a", "score": "0.5271923", "text": "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "0dd1a3ef2d84a9956fb033cae7e2dac9", "score": "0.5271872", "text": "static fromString (s) {\n var parts = s.split('-')\n if (parts.length != 3) {\n return null\n }\n try {\n var year = parseInt(parts[0])\n var month = parseInt(parts[1])\n var day = parseInt(parts[2])\n return new DateValue(year, month, day)\n } catch (err) {\n return null\n }\n }", "title": "" }, { "docid": "ab50d025c4a2d4b60517e0e6918872d6", "score": "0.5270337", "text": "function parseDate(val) {\n var preferEuro=(arguments.length==2)?arguments[1]:false;\n generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');\n monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');\n dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');\n var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');\n var d=null;\n for (var i=0; i<checkList.length; i++) {\n var l=window[checkList[i]];\n for (var j=0; j<l.length; j++) {\n d=getDateFromFormat(val,l[j]);\n if (d!=0) { return new Date(d); }\n }\n }\n return null;\n }", "title": "" }, { "docid": "95f6d087b1bd52f51c2b0e5da71e574b", "score": "0.5269598", "text": "function parseDate$1 (date, format$1) {\n if (typeof date !== 'string') {\n return isValid(date) ? date : null;\n }\n\n var parsed = parse(date, format$1, new Date());\n\n // if date is not valid or the formatted output after parsing does not match\n // the string value passed in (avoids overflows)\n if (!isValid(parsed) || format(parsed, format$1) !== date) {\n return null;\n }\n\n return parsed;\n}", "title": "" }, { "docid": "95f6d087b1bd52f51c2b0e5da71e574b", "score": "0.5269598", "text": "function parseDate$1 (date, format$1) {\n if (typeof date !== 'string') {\n return isValid(date) ? date : null;\n }\n\n var parsed = parse(date, format$1, new Date());\n\n // if date is not valid or the formatted output after parsing does not match\n // the string value passed in (avoids overflows)\n if (!isValid(parsed) || format(parsed, format$1) !== date) {\n return null;\n }\n\n return parsed;\n}", "title": "" }, { "docid": "c41ce6768b8ada469d519d97bcc8ca15", "score": "0.52682257", "text": "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "title": "" }, { "docid": "6e578ac247c097fc9dfc2cb7ab761c11", "score": "0.5267159", "text": "function reviver( key, value ) {\n if( typeof value === 'string' && dateFormat.test( value ) ) {\n return moment( value ).toDate();\n }\n\n return value;\n}", "title": "" }, { "docid": "4d5bde7c95a7999b2656a6841c0009ce", "score": "0.5261411", "text": "function toDate(v) {\n var date = isDate(v) ? v : new Date(v);\n var time = date.getTime();\n var isValid = isPresent(v) && isInteger(time);\n\n return isValid ? date : null;\n}", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.52506906", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" } ]
9203f8254cc342a4833053eda9d7ec72
Use the double // to create a new comment Build a Bear Declaring new function named 'buildABear' with the paramaters (name, age, fur, clothes, specialPower)
[ { "docid": "803f47e3b50f667486ef79d153c17e9b", "score": "0.74811053", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n//Declaring a variable named greeting with a string data type containing interpolation\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n//Declaring a variable named demographics with an array data type.\n var demographics = [name, age];\n//Declaring a variable named powerSaying with a string data type containing concatenation\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n//Declaring a variable named builtBear with an object data type.\n var builtBear = {\n//A key-value pair with a key value of basicInfo and pair value of demographics\n basicInfo: demographics,\n//A key-value pair with a key value of clothes and pair value of fur\n clothes: clothes,\n//A key-value pair with a key value of exterior and pair value of fur\n exterior: fur,\n//A key-value pair with a key value of cost and pair value of 49.99\n cost: 49.99,\n//A key-value pair with a key value of sayings and an array pair value\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n//A key-value pair with a key value of isCuddly and pair value of true\n isCuddly: true,\n };\n//The execution of the function is stopped. builtBear is returned to the function caller\n return builtBear\n}", "title": "" } ]
[ { "docid": "2d73de519a90df8809204919f20de122", "score": "0.790561", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n // create function called buildABear with arguments name, age, fur, clothes, and SpecialPower\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n // assign a string to var greeting including dynamic name value\n var demographics = [name, age];\n // assign array of name and age to var demographics\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n // assign string to var powerSaying including dynamic specialPower value\n var builtBear = {\n basicInfo: demographics,\n clothes: clothes,\n exterior: fur,\n cost: 49.99,\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n isCuddly: true,\n };\n // create object with keys basicInfo, clothes, exterior, cost, sayings, & isCuddly\n return builtBear\n} // return defined builtBear object w/ values", "title": "" }, { "docid": "225d1d01f736c366e5498bf3c9bfc4cc", "score": "0.77616036", "text": "function buildABear(name, age, fur, clothes, specialPower) { // This function, titled buildABear, takes in the following variables as parameters.\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`; // This greeting variable combines the name parameter with an interpolated string to make a custom message.\n var demographics = [name, age]; // This variable takes the paramter of name and age and saves them as an array.\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\"; // This variable creates a new string by combining the parameter of specialPower with other strings using concatenation.\n var builtBear = { // This variable saves the builtBear object with the following keys on the next line. Each key brings together the previous variables and the following information to creat a bear profile\n basicInfo: demographics,\n clothes: clothes,\n exterior: fur,\n cost: 49.99,\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n isCuddly: true,\n };\n\n return builtBear // This line of code returns the builtBear object as an output. The object itself will output as a built bear profile.\n}", "title": "" }, { "docid": "ccbe9e0f7170f82b8a8ca73179da9821", "score": "0.7746565", "text": "function buildABear(name, age, fur, clothes, specialPower) {//Create a funtion named 'buildABear' that takes 5 parameters: name, age, fur, clothes, specialPower\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;//create a variable named greeting and assign it the value of a string `Hey partner! My name is \"\" - will you be my friend?!` and interpolate that with the parameter 'name'\n var demographics = [name, age];//create a variable named demographics and assign it a value of an array which includes the parameters 'name', and 'age'.\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";//create a variable named powerSaying and assign it a value of a string \"Did you know that I can \"\" ?\" and concatenate with the parameter 'specialPower'\n var builtBear = {//create an object named builtBear\n basicInfo: demographics,//create a key named basicInfo and assign it a value of the variable 'demographics'\n clothes: clothes,//create a key named clothes and assign it a value of the parameter 'clothes'\n exterior: fur,//create a key named exterior and assign it a value of the parameter 'fur'\n cost: 49.99,//create a key named cost and assign it a 'number' value of 49.99\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],//create a key named sayings and assign it a value of an array: the array should contain two variables 'greeting' and 'powerSaying', and a string \"Goodnight my Friend!\"\n isCuddly: true,//create a key named isCuddly and assign it a boolean value of 'true'\n };\n\n return builtBear//create a return value for the function that will return, or log, the object named builtBear\n}", "title": "" }, { "docid": "1d8829fabd88acfc1e320c7a8f06b1ce", "score": "0.7738065", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n// Define mutiple variables of function\n\n//Define variable \"greeting\" with an interpolation of name input\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n //Define demographic array for input\n var demographics = [name, age];\n//Define powerSaying string with an concatenation for a specialPower input\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n//Create a builtBear object with 6 key-value pairs\n var builtBear = {\n basicInfo: demographics,\n clothes: clothes,\n exterior: fur,\n cost: 49.99,\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n isCuddly: true,\n };\n// Allow function to assemble above variables/values\n return builtBear\n}", "title": "" }, { "docid": "82fb63fdf6516e87b24afe7b9ac74b7e", "score": "0.75905126", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n // This variable greeting interpolates the bears name\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n // demographics is an array of name and age\n var demographics = [name, age];\n //powerSaying interpolates specialPower into it\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n //builtBear is an object containing basicInfo,clothes,exterior,cost,sayings[array],isCuddly:booleans\n var builtBear = {\n basicInfo: demographics,\n clothes: clothes,\n exterior: fur,\n cost: 49.99,\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n isCuddly: true,\n };\n//returns the object builtBear\n return builtBear\n}", "title": "" }, { "docid": "405e5d2e417c8136757e96f90cc7875c", "score": "0.75724995", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n// Declare a variable \"greeting\" and set it to an interpolated string\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n// Declare a variable \"demographics\" and set it to an array\n var demographics = [name, age];\n// Declare a variable \"powerSaying\" and set it to a concatenated string\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n// Declare an object called \"builtBear\"\n var builtBear = {\n// Create a key \"basicInfo\" assigned to the variable \"demographics\"\n basicInfo: demographics,\n// Create a key \"clothes\" assigned to the parameter \"clothes\"\n clothes: clothes,\n// Create a key \"exterior\" assigned to the parameter \"fur\"\n exterior: fur,\n// Create a key \"cost\" assigned to the value 49.99\n cost: 49.99,\n// Create a key \"sayings\" assigned to an array with 3 elements\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n// // Create a key \"isCuddly\" assigned to the value \"true\"\n isCuddly: true,\n };\n// Return the value of the \"builtBear\" object\n return builtBear\n}", "title": "" }, { "docid": "c8ac5cda1e76e947134e168f263829bb", "score": "0.7546034", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n//Declare a variable called greeting that is assigned to a string that uses interpolation to include the name argument\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n//Declare a variable called demographics that is assigned to an array that includes the name and age arguements\n var demographics = [name, age];\n//Declare a variable called powerSaying that is assigned to a string that uses concatenation to include the specialPower argument\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n//Declare a variable called builtBear that is assigned to an object with the following key/value pairs:\n//basicInfo, assigned to the demographics variable\n//clothes, assigned to the clothes argument\n//exterior, assigned to the fur argument\n//cost, assigned to the value 49.99\n//sayings, assigned to an array that includes the greetings argument, the powerSaying argument, and the string \"Goodnight my friend!\"\n//isCuddly, assigned to the value true\n var builtBear = {\n basicInfo: demographics,\n clothes: clothes,\n exterior: fur,\n cost: 49.99,\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n isCuddly: true,\n };\n\n//return the builtBear object\n return builtBear\n}", "title": "" }, { "docid": "719c83fb97e21d0fceb9f17979d1b204", "score": "0.7450779", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n //we have defined the first variable and assigned it at string using interpolation to insert the first perameter in the array.\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n // the second variable we have assigned to the first two perameters of the function.\n var demographics = [name, age];\n //this variable is assigned to a string using concatenation to insert the \"specialPower\" perameter.\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n //this variable is assigned to an object with 4 key-value pairs.\n var builtBear = {\n //this k-v-p pair calls the demographics variable which calls the first two perameters of the function.\n basicInfo: demographics,\n //this k-v-p is assigned to the 3rd position of the function peerameter array\n clothes: clothes,\n //this k-v-p is assigned to the 2nd position of the function peerameter array\n exterior: fur,\n //this k-v-p is assigned to an int value.\n cost: 49.99,\n //this key-value pair is assigned to an array that calls two variables and prints a string.\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n //this key value pair is assigned to a boolean.\n isCuddly: true,\n };\n//this line will print the function \"builtBear\"\n return builtBear\n}", "title": "" }, { "docid": "f794ead0d99b39265ff8266b88335b4a", "score": "0.7436357", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n// In this line, the variable greeting is being declared with an interpolation\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`\n//Variable demographics is being declared with two an array containing two arguments from above\n var demographics = [name, age]\n// A variable powerSaying is being declared with a string containing a concatenation\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\"\n// An object literal named builtBear is being\n var builtBear = {\n// this line has a key-value pair named basicInfo with a demographics variable\n basicInfo: demographics,\n// This line has a key-value pair named clothes with a clothes variable\n clothes: clothes,\n// This ilne has a key-value pair named exterior with a fur variable\n exterior: fur,\n// This line has a key-value pair named cost with an integer variable\n cost: 49.99,\n// This key-value pair, sayings is set as an array containing strings and other variables\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n//A boolean named isCuddly is set as true\n isCuddly: true,\n }\n//This line is asking to print/call the builtBear variable\n return builtBear\n}", "title": "" }, { "docid": "4e9cdf3f450087a53acb0057f3ca5f7a", "score": "0.6275615", "text": "function buildBaumSweet(/* Arguments here */) {\n // Your code here\n}", "title": "" }, { "docid": "ef5e539d832c57ae7d536da946237f12", "score": "0.596431", "text": "_buildInfo(parameters, area, windPower){\n let info = new BuildInfo(parameters);\n\n info.build.end = this.endOfBuild(info);\n\n let avgWindPowerDensityAt100 = windPower / area;\n if(area == 0)\n avgWindPowerDensityAt100 = 0;\n\n let avgWindPowerDensity = avgWindPowerDensityAt100 * 1.25; //integral over rotor coef @todo\n\n let percentile90WindPowerDensity = avgWindPowerDensity * 2.2;\n\n //src : https://en.wikipedia.org/wiki/Belwind (offshore, @95m :/)\n const maxWindTurbinePerSquareMeter = this.density.at(info.build.begin); //todo : check for onshore\n\n const rotorRadius = 49.5;//General Electric: 2.5XLe\n\n let count = area * maxWindTurbinePerSquareMeter;\n\n\n\n let section = count * rotorRadius * rotorRadius * 3.14; //m2\n\n let initNameplate\n = section * percentile90WindPowerDensity\n * this.efficiency.at(info.build.begin);\n // console.log(initNameplate / count * 1e-6);\n //\n // console.log('N ' + initNameplate * 1e-6);\n\n // console.log('Nameplate / item (MW) ', initNameplate/count * 1e-6);\n\n info.nameplate = new Yearly.Raw(initNameplate);\n info.nameplate.unit = 'N';\n\n\n info.build.co2 = 0; // C / Wh\n info.build.cost = this._buildCost(parameters, area);\n\n\n info.perYear.cost = this.perYear.cost.at(info.build.end) * initNameplate;\n info.avgCapacityFactor = 0.229; //todo : do a real computation ?\n\n return info;\n }", "title": "" }, { "docid": "81ff94f06b064129eb6c6b6cd623f29f", "score": "0.5795711", "text": "function ComplexityBuilder()\n{\n\tthis.StartLine = 0;\n\tthis.FunctionName = \"\";\n\t// The content of the method containing certain line.\n\tthis.MethodContent = \"\";\n\n\tthis.report = function()\n\t{\n\t\t// console.log(\n\t\t// (\n\t\t// \t\"{0}(): {1} ~ {2}\\n\" +\n\t\t// \t\"============\\n\" +\n\t\t// \t\t\"MethodContent: {3}\\n\"\n\t\t// \t)\n\t\t// \t.format(this.FunctionName, this.StartLine, this.EndLine, this.MethodContent)\n\t\t// );\n\t\tconsole.log(this.FunctionName);\n\t}\n}", "title": "" }, { "docid": "beebe58db254c5954f1a33a081a472d1", "score": "0.579117", "text": "function betterCarFactory({brand = \"vw\", year = \"1990\"} = {}) {\n console.log(`brand=${brand}; year=${year}`);\n}", "title": "" }, { "docid": "67d4db9c2fa753b9a975ba3960b5d674", "score": "0.5759322", "text": "function makeBuilding(name, height) {\n\treturn {\n\t\tname: name,\n\t\theight: height,\n\n\t\tintroduce: function() {\n\t\t\tconsole.log(`The ${this.name} is ${this.height}m tall.`);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "51cca078f61c00220f11adea34688799", "score": "0.5717114", "text": "function/*(currentYear, age) {\n\treturn currentYear - age;\n};*/\n\n//**************************************************\n\n//The SECOND part of a function literal is the functions \"name.\" \n//The name of the function can be used to call the function.\n//The name may also play an important part in both the development\n//and debugging processes. \n\n//In the example above, the function is said to be \"anonymous.\" \n//The same function can be written with\n//the name \"calcBirthYear\", as illustrated below:\n\n\n//*****************e.g.****************************\n\n/*function */calcBirthYear /*(currentYear, age) {\n return currentYear - age;\n}*/\n\n//**************************************************\n\n\n//The THIRD part of a function is the \"parameters.\"\n//The parameters are wrapped in parenthesis, and separated by\n//commas if there are multiple parameters. These will be defined\n//as the variables of the function.\n\n//*****************e.g.****************************\n\n/*function calcBirthYear */(currentYear, age)/* {\n return currentYear - age;\n}*/\n\n//**************************************************\n\n//The FOURTH part of a function are the statements, swaddled by {}.\n//These are the statements that will be executed when the function\n//is called.\n\n//*****************e.g.****************************\n\n/*function calcBirthYear (currentYear, age)*/ {\n return currentYear - age;\n}", "title": "" }, { "docid": "bb58f4952a22fdbaa3483fa384c32f1a", "score": "0.5694842", "text": "function buildConstruct() {}", "title": "" }, { "docid": "42c38bbd904ff058cd0ec6a26abd64ba", "score": "0.567087", "text": "function carMaker(/* code here */) {\n /* code here */\n}", "title": "" }, { "docid": "afd8230fcee451304434a19a75d1c637", "score": "0.56309974", "text": "function buildDemo()\n {\n\t \n }", "title": "" }, { "docid": "67ecc58a140d746186180d37e1d0f5aa", "score": "0.56176835", "text": "function createAdder (a) { // <- this is \"buster\" and takes \"smedley\"\n console.log('building an adder for: ' + a)\n return {\n smedley: 6754,\n buster: function (b) {\n return a + b\n },\n add: function (b) {\n return b + a\n },\n subtract: function (b) {\n return b - a\n },\n multiply: function (b) {\n return b * a\n },\n changeIt: function (b) {\n return a = b\n },\n nameOfFavoritePasta: 'Fusili'\n }\n}", "title": "" }, { "docid": "837f1b3a3d1b25e87324bcc8f32c922a", "score": "0.5617487", "text": "buildFunction(body) {\n // eslint-disable-next-line no-new-func\n return Function('\"use strict\";' + body);\n }", "title": "" }, { "docid": "30bbf19d75750c63f490538f99d9d11c", "score": "0.55906475", "text": "function Builder() {\n\n}", "title": "" }, { "docid": "927bfec2338b660c656c41e77f2a17df", "score": "0.55803174", "text": "function ComplexityBuilder()\n{\n\tthis.StartLine = 0;\n\tthis.EndLine = 0;\n\tthis.FunctionName = \"\";\n\t// Count the max number of conditions within an if statement in a function\n\tthis.MaxConditions = 0;\n\t// Method includes more than 100 LOC\n\tthis.LongMethod = false;\n\t// Number of if statements/loops + 1\n\tthis.SimpleCyclomaticComplexity = 0;\n\t\n\tthis.report = function()\n\t{\n\t\tconsole.log(\n\t\t (\n\t\t \t\"{0}(): {1}\\n\" +\n\t\t \t\"============\\n\" +\n\t\t\t \"MaxConditions: {2}\\t\" +\n\t\t\t \"LongMethod: {3}\\t\" +\n\t\t\t \"SimpleCyclomaticComplexity: {4}\\n\\n\"\n\t\t\t)\n\t\t\t.format(this.FunctionName, this.StartLine,\n\t\t\t\t this.MaxConditions, this.LongMethod,\n\t\t\t\t this.SimpleCyclomaticComplexity)\n\t\t);\n\t}\n}", "title": "" }, { "docid": "ce72fe65e7bdef0e4cf95a290bba405e", "score": "0.555674", "text": "constructor(name, hood, colour, food, power) {\n this.name = name; \n this.hood = hood; \n this.colour = colour;\n this.food = food;\n this.power = power;\n }", "title": "" }, { "docid": "f7b199ac0cdb82d6a5c30f20ae8d075f", "score": "0.55496085", "text": "function MealBuilder(){\n}", "title": "" }, { "docid": "44f8e5d6834b20a1255f7e001e38e2f0", "score": "0.552101", "text": "function createMadLib( info ){\n console.log( info );\n return info.name1 + ' had a problem. She had a wonderful ' + info.occupation + ' named ' + info.name2 + '.'\n + ' But ' + info.name2 + ' had a distaste for babies. Everytime they saw ' + info.name1 + '\\'s child '\n + ' they yelled, \"Heck You\" ' + info.name1 + ' decided to have a ' + info.infinitive_verb\n + ' with ' + info.name2 + ' in order to facilitate good communication. '\n + ' After a long ' + info.infinitive_verb + ', they both worked out their differences and can '\n + ' resume their lives ' + info.adverb + '.';\n}", "title": "" }, { "docid": "77f3674670e6254950cfde43bcbbf02e", "score": "0.5508331", "text": "constructor(name,age, color, legs, superPower) {\n this.name = name;\n this.age = age;\n this.color = color;\n this.legs = legs;\n this.superPower = superPower;\n }", "title": "" }, { "docid": "b717863379a1130a655a3433e5f5ba77", "score": "0.5445463", "text": "function buildMainCharacter(name, age, pronouns) {\n // Create character object\n var character = {\n // Create 3 key:value pairs with the values corresponding to the\n // Arguments provided in the function\n name: name,\n age: age,\n pronouns: pronouns\n }\n // Return the character object\n return character;\n}", "title": "" }, { "docid": "b74fe93da955b0da35b572ee156ce547", "score": "0.5350692", "text": "constructor(name, quirkyFact, yob) {\n this.name = name;\n this.quirkyFact = quirkyFact;\n this.yob = yob;\n }", "title": "" }, { "docid": "39f567826d52e48df94febd5b84f57e0", "score": "0.53442246", "text": "function makeName() { // enter the arguments between the parenthesis\n return // what should be returned?\n}", "title": "" }, { "docid": "e5e6b347ecc92d1fb445ffab3dfef13d", "score": "0.53154564", "text": "function madlib(name, adjective, verb, verb){\n\tvar oBrotherQuote = \"Well \" + name + \", I figured it should be the one with the capacity for \" + adjective + \" thought. But if that ain't the consensus \" + verb + \", then hell, let's put it to a \" + verb + \".\";\n\treturn oBrotherQuote;\n}", "title": "" }, { "docid": "f7241c50d05e34de9b0c10b075ad77cb", "score": "0.53027135", "text": "description() {\n return `${this.name}'s special ability is \"Fire Ball\" : for ${this.cost} mana, ${this.name} uses his arcane powers to invoke a ball of flame and throw it to his ennemy, dealing ${this.specialdmg} damages!`;\n }", "title": "" }, { "docid": "f725e8474bacff0e613735ebf33d03f5", "score": "0.52948594", "text": "function caller() {\n\t\tvar source = gov.green.awards;\n\t\tpopulator(source, 'trophies', '#trophies', 'trophy');\n\t\tpopulator(source, 'ribbons', '#ribbons', 'ribbon');\n\t}", "title": "" }, { "docid": "03929d9df998c571e946edde7a63249c", "score": "0.5292347", "text": "function madlib(parameter1, parameter2, parameter3, parameter4){\n\treturn parameter1 + \" makes \" + parameter2 + \" stupid \" + parameter3 + \" \" + parameter4 + \", yo!\";\n}", "title": "" }, { "docid": "19219130b9df3e648742eeee871946bd", "score": "0.5273141", "text": "function makeABaby(mom, dad){\n // FILL\n //This function will use the one defined bellow currently returning a default\n return {name:\"Emma\"}\n}", "title": "" }, { "docid": "11da729fbc6754914c973fe7386ba04f", "score": "0.52639973", "text": "function Builder() {}", "title": "" }, { "docid": "11da729fbc6754914c973fe7386ba04f", "score": "0.52639973", "text": "function Builder() {}", "title": "" }, { "docid": "11da729fbc6754914c973fe7386ba04f", "score": "0.52639973", "text": "function Builder() {}", "title": "" }, { "docid": "12d24ee61b080ef1127547dc73550cd0", "score": "0.52573985", "text": "function B19() {}", "title": "" }, { "docid": "e7cbab9becadbff29e9f09a35f901d61", "score": "0.52557534", "text": "function Programmer(name, position, age, language) {\n// Initialization\n\n\n}", "title": "" }, { "docid": "12aea852fdcab4fc30ca06865cc461b9", "score": "0.52527636", "text": "function baby(name, skinColor, age, weight)\n{\n this.name=name;\n this.skinColor=skinColor;\n this.age=age;\n this.weight=weight;\n}", "title": "" }, { "docid": "29947d048c5543bd56d7f6aff9152d4d", "score": "0.5249452", "text": "function ComplexityBuilder()\n{\n\tthis.StartLine = 0;\n\tthis.FunctionName = \"\";\n\t// The number of parameters for functions\n\t//this.ParameterCount = 0,\n\t// Number of if statements/loops + 1\n\t//this.SimpleCyclomaticComplexity = 0;\n\t// The max depth of scopes (nested ifs, loops, etc)\n\t//this.MaxNestingDepth = 0;\n\t// The max number of conditions if one decision statement.\n\tthis.MaxConditions = 0;\n\n\tthis.ImportStatements=0;\n\n\tthis.Loc=0;\n\n\tthis.reportMaxConditions = function()\n\t{\n\t\t//ParameterCount=arguments.length;\n\t\t/*console.log(\n\t\t (\n\t\t \t\"{0}(): {1}\\n\" +\n\t\t \t\"============\\n\" +\n\t\t\t \"SimpleCyclomaticComplexity: {2}\\t\" +\n\t\t\t\t\"MaxNestingDepth: {3}\\t\" +\n\t\t\t\t\"MaxConditions: {4}\\t\" +\n\t\t\t\t\"ImportStatements: {5}\\t\"+\n\t\t\t\t\"Parameters: {6}\\t\" +\n\t\t\t\t\"LOC: {7}\\n\\n\"\n\t\t\t)\n\t\t\t.format(this.FunctionName, this.StartLine,\n\t\t\t\t this.SimpleCyclomaticComplexity, this.MaxNestingDepth,\n\t\t\t this.MaxConditions, this.ImportStatements, this.ParameterCount, this.Loc)\n\t\t);*/\n\n\t\t\t\tconsole.log(\n\t\t (\n\t\t\t\t\"\\nMethod Name: {0}(): \" + \"Maximum conditions: {1}\"\n\t\t\t)\n\t\t\t.format(this.FunctionName, this.MaxConditions)\n\t\t);\n\t\t\t\n\t}\n\n\t\tthis.reportLongMethods = function()\n\t{\n\t\t\n\t\t\tif (this.Loc>30)\n\t\t\t{\n\t\t\tconsole.log(\n\t\t (\n\t\t \t\"\\nLong Method Name: {0}(): \" + \"Lines Of Code: {1}\"\n\t\t\t)\n\t\t\t.format(this.FunctionName, this.Loc)\n\t\t);\n\t\t\t}\t\n\n\t}\n}", "title": "" }, { "docid": "7ce66bdcae7a43ae6552c32012ec98f9", "score": "0.5245171", "text": "constructor(name) {\n this.name = name\n this.dust = 10\n this.clothes = {dresses: ['Iris']}\n this.disposition = 'Good natured'\n this.humanWards = []\n }", "title": "" }, { "docid": "29775391c80ac8e475f03d99fe820fdd", "score": "0.5223439", "text": "function makeCar(){\r\n // TODO: Your code here\r\n }", "title": "" }, { "docid": "dee0e67dbb1271353fae07c4036cd2e1", "score": "0.52144104", "text": "function $build(name, attrs) {\n return new Strophe.Builder(name, attrs);\n }", "title": "" }, { "docid": "20c8c1a158958fa171353009482e4300", "score": "0.5208638", "text": "function FunctionBuilder()\n{\n\tthis.StartLine = 0;\n\tthis.EndLine = 0;\n\tthis.bigo = -1;\n\tthis.FunctionName = \"\";\n\t// The number of parameters for functions\n\tthis.ParameterCount = 0,\n\t// Number of if statements/loops + 1\n\tthis.SimpleCyclomaticComplexity = 0;\n\t// The max depth of scopes (nested ifs, loops, etc)\n\tthis.MaxNestingDepth = 0;\n\t// The max number of conditions if one decision statement.\n\tthis.MaxConditions = 0;\n\n\tthis.report = function()\n\t{\n\t\tlet printer = colors.green;\n\t\tif(Fails(this))\n\t\t\tprinter = colors.red;\n\n\t\tconsole.log(\n\t\t (printer(\n\t\t \t`{0}(): {1}-{2}\n\t\t \t============\n\t\t \tSimpleCyclomaticComplexity: {3}\\t\n\t\t\tMaxNestingDepth: {4}\\t\n\t\t\tMaxConditions: {5}\\t\n\t\t\tParameters: {6}\\t \n\t\t\tLong Method(>100 line): {7}\\t\n\t\t\tBig-O: {8}\\n\\n`\n\t\t\t))\n\t\t\t.format(this.FunctionName, this.StartLine, this.EndLine,\n\t\t\t\t this.SimpleCyclomaticComplexity, this.MaxNestingDepth,\n\t\t\t this.MaxConditions, this.ParameterCount, this.EndLine-this.StartLine>100, this.bigo)\n\t\t);\n\t}\n}", "title": "" }, { "docid": "54ea63efdfd4140e1c71174a961934cb", "score": "0.5205326", "text": "function madlib (word1, word2, word3, word4){\n\tlet hero = \"Hi! you look \" + word1 + \" your breath smells \" + word2 + \" you have nice \" + word3 + \"your feet are\" + word4\n\treturn hero\n}", "title": "" }, { "docid": "55279fef82cb5d23221c2939261aec78", "score": "0.51988065", "text": "function oblic(){\n /*\n * // *this is oblic*\n * //\n * // _this is oblic_\n * //\n * // with some description\n */\n }", "title": "" }, { "docid": "fdc10164095ba53c6e44ae4f743f8d9c", "score": "0.5198609", "text": "function Bulldog() {}", "title": "" }, { "docid": "b56916d9cf8a8be6bc423876f60a2bbc", "score": "0.5189283", "text": "function Building() {\n\tthis.Name = \"Lemonade Stand\";\n\tthis.Cost = 10;\n\tthis.PerSec = 1;\n\t\n\tthis.Name = \"Ice Lolly Stand\";\n\tthis.Cost = 100;\n\tthis.PerSec = 5;\t\n}", "title": "" }, { "docid": "6d013cccf996302a73806951806b2dc7", "score": "0.51753986", "text": "function introduce(name, age, address, hobby) {\n\n return (\"Nama saya \" + name + \", umur saya \" + age + \" tahun, alamat saya di \" + address + \", dan saya punya hobbi yaitu \" + hobby);\n\n}", "title": "" }, { "docid": "472437b0089cd995da8bfc3f6e367e3f", "score": "0.51563686", "text": "function buildHouse ({floors = 1, color = 'red', walls = 'brick'} = {}){\n return `Your house has ${floors} floor(s) with ${color} ${walls} walls.`;\n}", "title": "" }, { "docid": "d17ad6355e8fc3da97e9cf790679129c", "score": "0.5155629", "text": "function showName(fName,lName){\n var nameIntro = \"Your name is \";\n function makeFullName(){\n return nameIntro + fName + ' ' + lName;\n }\n return makeFullName();\n}", "title": "" }, { "docid": "881eecf4797bd077b28fafc0f86f7799", "score": "0.51534516", "text": "constructor(\n name,\n gender,\n age,\n type,\n weight,\n hasAntlers = false,\n leftAntlerLength = 0,\n rightAntlerLength = 0\n ) {\n this.id = Math.random()\n this.name = name\n this.gender = gender\n this.age = age\n this.type = type\n this.weight = weight\n this.antlers = {\n left: leftAntlerLength,\n right: rightAntlerLength\n };\n }", "title": "" }, { "docid": "7fb906f3d4e713265ff14c885b17655b", "score": "0.5150768", "text": "function Burner(){\n\t;\n}", "title": "" }, { "docid": "a331a7dfe9bd139df1cd659eedecaa02", "score": "0.5143392", "text": "function fullName(Allison, Sharpe) { //Executes function for full name\n console.log((\"Allison, Sharpe\")); //Displays full name to the console\n return fullName; //Returns to function\n\n } //Closing curly brace for function", "title": "" }, { "docid": "a58f2c08caa62b6c7b0305306499961d", "score": "0.5139882", "text": "function Building1(name, numbFloors) {\n this.name = name;\n this.numbFloors = numbFloors;\n\n this.getNumbFloors = function() {\n return this.numbFloors;\n };\n this.setNumbFloors = function(numb) {\n return (this.numbFloors = numb);\n };\n}", "title": "" }, { "docid": "d7ea5dc63fc2be8b0018f923b37529f8", "score": "0.5136223", "text": "function Builder(){}", "title": "" }, { "docid": "b0ed6a9de2b731e55b4944be246b7c3c", "score": "0.5121987", "text": "function Building(floors) {\n this.what = \"Building\";\n this.floors = floors;\n}", "title": "" }, { "docid": "25a2965a982f9f5c09ff73d39424364d", "score": "0.5114992", "text": "function merhaba (adim) {\n // Write your code here!!!\n}", "title": "" }, { "docid": "141635bf2b406452e6f3c8a79a178551", "score": "0.51013386", "text": "function Building(bldgName, stAddress, city, state, zip, country, purchasePrice,\n purchaseDate, improvements, closingCosts, terminalCap, bldgSize) {\n this.bldgName = bldgName; // simple name\n this.stAddress = stAddress; // street address\n this.city = city;\n this.state = state;\n this.zip = zip;\n this.country = country;\n this.purchasePrice = purchasePrice; // price paid for the property\n this.purchaseDate = purchaseDate; // date of purchase\n this.improvements = improvements; // cost of improvements, repairs and other necessary capital investments\n this.closingCosts = closingCosts; // property closing costs \n this.terminalCap = terminalCap; // cap rate to calculate potential sale price \n this.bldgSize = bldgSize; // size in SF\n}", "title": "" }, { "docid": "022951bc890a5071996aae19acd28cf4", "score": "0.5097044", "text": "function $build(name, attrs) { return new Strophe.Builder(name, attrs); }", "title": "" }, { "docid": "01d0af6d109555ce52d5c0ad41f86be8", "score": "0.5087478", "text": "function rocketConstruct(varname,name,description,type,range,cash,scientists,resources){\n this.varname = varname;\n this.name = name;\n this.description = description;\n this.type = type;\n //rocket capabilities\n this.range = range;\n //cost breakdown\n this.cash = cash;\n this.scientists = scientists;\n this.resources = resources;\n}", "title": "" }, { "docid": "db45a6aac3b2edfdd97aa62bbc798e95", "score": "0.5086277", "text": "function whatKindOfCar(car){ // declaring a function \n \n return 'I like your ' + car; // code block of the whatKindOfCar function\n}", "title": "" }, { "docid": "e0d6ad9f7a58408cf2fd0f0dac9e63ce", "score": "0.5081756", "text": "function wish({greet,name}) {\n return `${greet}!!!! ${name}`;\n}", "title": "" }, { "docid": "8559338e7d068f66553d82258c33ba36", "score": "0.5078888", "text": "birds(){\n // method body\n }", "title": "" }, { "docid": "b0310ff06c1497451df41fbb34407133", "score": "0.5070138", "text": "function wow(name,fan){\n return fan(name)\n}", "title": "" }, { "docid": "a90f20e0e7576c1323171f00fb3c33c2", "score": "0.5067527", "text": "function driverlicence(passed) {\n if(passed) {\n let name = 'lucas' // let and const create a block scop\n const age = 1995\n return '${name} can now drive, he was born in ${age}' // lucas can now drive, he was born in 1995\n }\n return '${name} can now drive, he\\'s was born in ${age}' // Error !!!!\n}", "title": "" }, { "docid": "404627e8c6c87938b5f7bdf22a51288c", "score": "0.506335", "text": "function sanDiegoZoo() {\n const birds = 'tweet tweet tweet';\n const lizards = '*blink*';\n\n const cage1 = () => {\n const lions = 'ROAR!!!!';\n }\n const cage2 = () => {\n const gorillas = '*heavy grunting*';\n }\n const cage3 = () => {\n const pandas = '*sleeping*';\n }\n const water = () => {\n const coral = '*exists*';\n const tank1 = () => {\n const fishes = '*gulp gulp*';\n }\n const tank2 = () => {\n const sharks = '*jaws music*'\n }\n }\n\n}", "title": "" }, { "docid": "abcd36756fa01b57aa4fa5445dbe58bd", "score": "0.50625485", "text": "function readthis(){defalt(); build(); localn(); }", "title": "" }, { "docid": "8bfc498f77e8458868519cd66eaaf697", "score": "0.5062264", "text": "function buildPerson(fname, lname, age) {\n\treturn {\n\t\tfirstname: fname,\n\t\tlastname: lname,\n\t\tage: age\n\t};\n}", "title": "" }, { "docid": "987ce39656d0c24f7a64bb1e7b19af8d", "score": "0.50612503", "text": "function mrBaggins(string){\n //'string' is the optional parameter\n //parameters are named so it's clear what needs to be passed through the function\n console.log(\"Hello!\" + \" \" + \"Lovely day in the Shire innit?\");\n }", "title": "" }, { "docid": "844b3162b661373d4ff8a8155d48cb57", "score": "0.50573117", "text": "function madlib(word1, word2, word3, word4){\n return \"Learning to code is very \" + (word1) + \"and I really \" + (word2) +\n \"learning. \" + (word3) + \"it can be difficult at \" + (word4)\n}", "title": "" }, { "docid": "a069590970d43882e28a3681ed5a107a", "score": "0.5056484", "text": "constructor(name,yearbirth,job,olympicGames,Medals) {// in the constructor, we need to repeat the variabels form the super class,and we need to write them exactly the same way, and only then add whatever variabels that we want to add\r\n super(name,yearbirth,job)// now actually the super() keyword calls the variabels from the super class\r\n this.olympicGames=olympicGames\r\n this.Medals=Medals\r\n }", "title": "" }, { "docid": "52235d6df7076ec1d12d536dd44c5820", "score": "0.5049698", "text": "function carFactory(options = { brand: \"vw\", year: 1999}) {\n console.log(`brand=${options.brand}; year=${options.year}`);\n}", "title": "" }, { "docid": "ffd1173b692d8303865d010da0a13dd3", "score": "0.50421447", "text": "function madlib(nam, sub) {\n console.log(nam + \" \" + \"favorite subject in school is\" + \" \" + sub)\n}", "title": "" }, { "docid": "a6fc309435805d9e8e3a9a721865385b", "score": "0.5034202", "text": "function Elf(name, age, weapon, isMagician, elfType) {\n this.name = name;\n this.age = age;\n this.weapon = weapon;\n this.isMagician = isMagician;\n this.elfType = elfType;\n}", "title": "" }, { "docid": "f4857a51c273e8d5595bb997b4d0ad79", "score": "0.5029552", "text": "function bookDoctor() {}", "title": "" }, { "docid": "23560831a4c276cebedb540c642d124c", "score": "0.50258917", "text": "function rotw() { } // tag for name, should not be called\\", "title": "" }, { "docid": "dfcb8d242797204b30b07566a5d13abc", "score": "0.50206417", "text": "function myInfo(param1, param2){\n function myName(param1) {\n return param1 + ' ';\n }\n function myAge(param2) {\n return param2;\n }\n var num = Math.round(Math.random()*10);\n var x = myName(param1);\n var y = myAge(param2);\n \n return x + (y + num).toString();\n}", "title": "" }, { "docid": "7572d458d72bf65a54115346d39c1f86", "score": "0.50204587", "text": "function Breadcrumps() {\n\n}", "title": "" }, { "docid": "c66d0e4aee8808120eb2f9992f80b50a", "score": "0.5018958", "text": "constructor(\r\n objective,\r\n oxyLvl,\r\n launchDateDay,\r\n launchDateMonth,\r\n launchDateYear,\r\n spacecraft,\r\n numOfAstronauts\r\n ){ //substantiate\r\n this.objective = objective;\r\n this.oxyLvl = oxyLvl;\r\n this.launchDateDay = launchDateDay;\r\n this.launchDateMonth = launchDateMonth;\r\n this.launchDateYear = launchDateYear;\r\n this.spacecraft = spacecraft;\r\n this.numOfAstronauts = numOfAstronauts;\r\n }", "title": "" }, { "docid": "9f81c35f087355ee619ddbfb71349c33", "score": "0.50189424", "text": "function makeBuilder(n, r) {\n var ec = roomEnergyCapacity(r); /* Effective energy capacity */\n /* Assume at least 300 capacity */\n if (300 > ec || !roomHasType(r, \"truck\")) {\n ec = 300;\n }\n\n /* Make an array to hold the appropriate amount of body */\n var ba = new Array(4 * Math.floor(ec / 250));\n for (var i = 0; i < ba.length; i += 4) {\n ba[i] = CARRY;\n ba[i + 1] = MOVE;\n ba[i + 2] = WORK;\n ba[i + 3] = MOVE;\n }\n\n return spawnCreep(r, n, ba, \"builder\");\n}", "title": "" }, { "docid": "0ab7bb23175e28610fe73cb0a2a39567", "score": "0.50093895", "text": "function Drink() {}", "title": "" }, { "docid": "58692acb70afeb16afbf2ca50887cc1c", "score": "0.50075054", "text": "function makeName (app) {\n let number = app.getArgument(NUMBER_ARGUMENT);\n let color = app.getArgument(COLOR_ARGUMENT);\n let cost = app.getArgument(COST_ARGUMENT);\n let duration = app.getArgument(DURATION_ARGUMENT);\n console.log('-----COST-----:' + JSON.stringify(cost));\n console.log('-----DURATION------:' + JSON.stringify(duration));\n app.tell('Alright, your silly name is ' +\n color + ' ' + number +\n '! It will cost you ' + cost.amount + ' ' + cost.currency + ' over a period of ' + duration.amount + ' ' + duration.unit + '. That is all. No soup for you! Have a good day.');\n \n app.tell('Ok, we will transfer <X> amount on a weekly basis until you have reached your goal. Thank you for using Save to buy.');\n }", "title": "" }, { "docid": "90389a76f5a4ce357be93f1a2ec267e7", "score": "0.5003913", "text": "constructor(make, model, year){\n //3 arguments created \n this.make = make;\n this.model = model;\n this.year = year;\n }", "title": "" }, { "docid": "edec53c03daa01762b26c1b502b65b05", "score": "0.49982613", "text": "function Dwarf(name, age, weapon, isMagician) {\n this.name = name;\n this.age = age;\n this.weapon = weapon;\n this.isMagician = isMagician;\n}", "title": "" }, { "docid": "4ba1800034210c97db4467e37e157a87", "score": "0.49981174", "text": "function library() {\n if (wisdom >= libraryCost) {\n wisdom -= libraryCost\n libraryCost *= 3\n libraryBuilt++\n auto += 50\n setStage()\n draw()\n console.log(libraryBuilt)\n } else {\n alert(\"earn more wisdom\")\n }\n setMeaning()\n}", "title": "" }, { "docid": "ca030d7ddef0e4e6a1b390b544fa8d14", "score": "0.49969295", "text": "function generateCar(givenName, givenSpeed) {\n this.cName = givenName;\n this.cSpeed = givenSpeed;\n this.run = function () {\n console.log(`${this.cName} is running`);\n }\n this.compareSpeedWithAudi = function () {\n console.log(`This is slower than Audi with speed difference ${this.cSpeed - 80}`);\n }\n}", "title": "" }, { "docid": "16e26a3f0d4875e77eb50c38340ac235", "score": "0.49966902", "text": "function buyFarmer() {\n // This time, you are going to do most of the coding.\n // \tIt shoud be pretty similar to the buyApple() function.\n //\tGood luck!\n}", "title": "" }, { "docid": "532b1f558a0597fb6f80a0c6eb6ecfc7", "score": "0.4993161", "text": "function $build(name, attrs) {\n return new Strophe.Builder(name, attrs);\n }", "title": "" }, { "docid": "fcd8e227307e605a097ef9dca7738cdf", "score": "0.49908674", "text": "constructor(name = \"Annoymous\", age = 0) {\n ;(this.name = name), (this.age = age)\n }", "title": "" }, { "docid": "40098e38ad7db64f447e96c160854593", "score": "0.49904072", "text": "function createBeer() {\n return \"love beer\";\n}", "title": "" }, { "docid": "bd2087f0dada246b2c356b2cb522be78", "score": "0.4984098", "text": "function eatFood (firstName, lastName, food){\n var special = \"everyday for breakfast\";\n return myFullName + \" eats \" + food + \" \" + special; \n}", "title": "" }, { "docid": "29da7149332257288a06818129ba711a", "score": "0.49816218", "text": "function makeMcFlys(fname){\n this.fname = fname;\n this.lname = 'McFly';\n}", "title": "" }, { "docid": "0b58932f476e979759d465a43989f11e", "score": "0.49797574", "text": "function build(brand) {\n return new Builder(brand);\n}", "title": "" }, { "docid": "4c1ea78d778fc7556b74a417f1e75309", "score": "0.49754864", "text": "function Bevy() {}", "title": "" }, { "docid": "2aae2a9943e9e0d5dc34a82ae1ca5c94", "score": "0.4967244", "text": "function important({name, age, surname, job, yearOfBirth}) {\n return `${name} ${age} ${surname} ${job} ${yearOfBirth} `;\n}", "title": "" }, { "docid": "6e71c75f7e4a62f67e6506b209a2dc88", "score": "0.4964611", "text": "function WLogoBuilder() {\n // Do Nothing\n }", "title": "" }, { "docid": "fb19f71e8657a8048c7e2d11fac0e6e7", "score": "0.49637297", "text": "function AstBuilder() {\n}", "title": "" }, { "docid": "195f0c736bec5a54f67100be670864e9", "score": "0.4959859", "text": "constructor (name) {\r\n this.name = name;\r\n this.Members=new Array(0);\r\n document.write(`Building \"Zoo ${name}\"...<br>`);\r\n }", "title": "" } ]
c699ae9eded9c3d48c2f8b66ddb1dedb
create book object and add to array
[ { "docid": "7999c2ba9f260a86ab4e4c1be85383f5", "score": "0.6213644", "text": "function addBookToShelf(bookTitle, bookAuthor, bookDescr, bookImg, bookIsbn) {\n const newBook = new Book(bookTitle, bookAuthor, bookDescr, bookImg, bookIsbn);\n tempShelf.unshift(newBook);\n }", "title": "" } ]
[ { "docid": "8374ef7add1bc05825f4c9a6cc2115c3", "score": "0.7691684", "text": "function createBook() {\n let newTitle = document.getElementById(\"title\").value;\n let newAuthor = document.getElementById(\"author\").value;\n let newPages = document.getElementById(\"pages\").value;\n let newRead = document.getElementById(\"read\").value;\n const newBook = new Book(newTitle, newAuthor, newPages, newRead);\n //adds book to myLib arr\n newBook.pushToLib();\n\n render();\n}", "title": "" }, { "docid": "458621253f69ac968ff29b87e91fb68a", "score": "0.75702554", "text": "function storeBook(){\n var title = document.getElementById('Title').value.toLowerCase();\n var author = document.getElementById('Author').value.toLowerCase();\n var pages = document.getElementById('Pages').value;\n var published = document.getElementById('Published').value;\n\n //test to read sure so the getting values from the form\n console.log(title, author, pages, published);\n\n //create a new book\n let newBook = new Book(title, author, pages, published);\n console.log(newBook);\n //push the book aka object to the library array\n library.push(newBook);\n\n //log out the library array to make the new book is being pushed\n console.log(newBook);\n\n //log out the library array to make the new book is being pushed\n console.log(library)\n //function to display book\n displayBook();\n}", "title": "" }, { "docid": "d30b01382fe731fa9e427b1ffc937c2e", "score": "0.7449432", "text": "function populateArray() {\r\n addBookToLibrary(new book('Crime and Punishment', 'Fiodor Dostoïevski',576, '0'));\r\n addBookToLibrary(new book('The Hobbit', 'J. R. R. Tolkien', 310, '1'));\r\n addBookToLibrary(new book('Americanah','Chimamanda Ngozi Adichie', 496, '0'));\r\n addBookToLibrary(new book('Fundamentals of Wavelets', 'Goswami, Jaideva', 228, '1'));\r\n addBookToLibrary(new book('Data Smart', 'Foreman, John', 235, '0'));\r\n addBookToLibrary(new book('Superfreakonomics', 'Dubner, Stephen', 179, '0'));\r\n addBookToLibrary(new book('Orientalism', 'Said, Edward', 197, '0'))\r\n}", "title": "" }, { "docid": "df25a770e7dddddc75c7c123d0f1166f", "score": "0.7422435", "text": "function addBookToLibrary() {\n const title = document.querySelector('.title').value;\n const author = document.querySelector('.author').value;\n const pages = document.querySelector('.pages').value;\n const read = (document.querySelector('.read').checked ? 'read' : 'not read');\n const book = new Book(title, author, pages, read);\n\n myLibrary.push(book);\n}", "title": "" }, { "docid": "e626534ef427b7a930ac078bfd64e9c2", "score": "0.73912764", "text": "function createBook(title, author, genre, rating, year, numPages, imgSrc, description) {\n\tvar bookObj = {\n\t\tid: countID(),\n\t\ttitle: title,\n\t\tauthor: author,\n\t\tgenre: genre,\n\t\trating: rating,\n\t\tyear: year,\n\t\tnumPages: numPages,\n\t\tcurrentNumPages: 0,\n\t\tsrc: imgSrc,\n\t\tdescription: description\n\t};\n\tbooks.push(bookObj);\n}", "title": "" }, { "docid": "2642134341794a39bca2ee743872c986", "score": "0.7380528", "text": "function addBookToLibrary(obj) {\n myLibrary.push(obj);\n}", "title": "" }, { "docid": "c720bc307aa6c647ae082e94e751ee61", "score": "0.73361367", "text": "function addBookToLibrary(title, author, pages) {\n\tlet book = new Book(title, author, pages);\n\tmyLibrary.push(book);\n}", "title": "" }, { "docid": "94863b4e5f4fda4b3585d39ef61b9651", "score": "0.72800905", "text": "function addBookToLibrary(newBook){\n myLibrary.push(newBook);\n}", "title": "" }, { "docid": "d68ad5f9fc54c50159f0fcb65fd48509", "score": "0.7212936", "text": "function addBook(){\n let form = document.getElementById('form-data');\n let formData= new FormData(form);\n let title=formData.get(\"title\");\n let author=formData.get(\"author\");\n let pages=formData.get(\"pages\");\n let read=formData.get(\"read\");\n\n // add new book to the library Array\n library.push(Book(title,author,pages,read));\n // update the display of the library\n displayLibrary();\n\n // clear the book form to take new entry\n clearForm();\n }", "title": "" }, { "docid": "929359838c0f3926534cbe0967259f8e", "score": "0.72077215", "text": "function addBookToLibrary() {\n add.addEventListener('click',()=>{\n const name = document.getElementById('name').value\n const author=document.getElementById('author').value\n const pages=document.getElementById('pages').value\n const read=document.getElementById('read').checked \n const newBook= new Book(name,author,pages,read)\n myLibrary.push(newBook)\n loopThrough(myLibrary)\n savetoLocal()\n })\n}", "title": "" }, { "docid": "eb3e204812525a5654f6a6ce5fa4dad4", "score": "0.7188622", "text": "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "title": "" }, { "docid": "eb3e204812525a5654f6a6ce5fa4dad4", "score": "0.7188622", "text": "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "title": "" }, { "docid": "d70101609926868c057760f3f6240b0e", "score": "0.7172528", "text": "function createBookArrays(){ \n var bookObjectArray = myBooks.books;\n for (var i=0; i<bookObjectArray.length; i+=slidesize) {\n bookData.push(bookObjectArray.slice(i,i+slidesize));\n }\n }", "title": "" }, { "docid": "bd15108fb52936e92a08ef3b4937e08a", "score": "0.7170552", "text": "static addBookToStore(book){\n const book1 = new Book(\n 'Quality Health', \n 'LivingStone',\n 'health', \n 'RTEY$%^U&*', \n 'a book about health', \n false\n )\n library.push(book1);\n const storedBooks = library;\n storedBooks.forEach((book, index) => {\n var lastItem = book.length - 1;\n console.log(`Name: ${book.title} ---- Author: ${book.author} --- Category: ${book.category}`)\n });\n \n \n\n }", "title": "" }, { "docid": "73bea77ca760d5556e773aa4919ac961", "score": "0.70935714", "text": "function addBookToLibrary(book) {\n\tmyLibrary.push(book);\n}", "title": "" }, { "docid": "e1b8b6ef7ef32af0af1b783ae8c54aa6", "score": "0.7064233", "text": "function addBookToLibrary() {\n book = \"\";\n myLibrary.push(book);\n}", "title": "" }, { "docid": "c053105a6b3fadc55cd9e66d6f5e4187", "score": "0.69978607", "text": "function createBookArrays(myBooks){\n\t\t\t\t\tvar bookObjectArray = myBooks.books;\n\t\t\t\t\tfor (var i=0; i<bookObjectArray.length; i+=slidesize) {\n\t\t\t\t\t\t\t bookData.push(bookObjectArray.slice(i,i+slidesize));\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "b396f67df3c6aa34f6c637750c4a5b69", "score": "0.6997548", "text": "function addBookToLibrary(title, author, pages, read) {\n\tconst book = new Book(title, author, pages, read);\n\tmyLibrary.push(book);\n\tcreateBookElement(book);\n\tlocalStorage.setItem('bookList', JSON.stringify(myLibrary));\n}", "title": "" }, { "docid": "8471527dbb74abacc14a2fcafe077ce1", "score": "0.6944006", "text": "function addBookToLibrary() {\n\tconst title = document.getElementById('form-title').value;\n\tconst author = document.getElementById('form-author').value;\n\tconst pages = document.getElementById('form-pages').value;\n\tconst read = document.getElementById('form-checkbox').checked;\n\tconst newBook = new Book(title, author, pages, read);\n\tmyLibrary.push(newBook);\n\tlibrary.innerHTML = '';\n\tshowBook();\n}", "title": "" }, { "docid": "13731689eb5c6b940a6455d16aeb7007", "score": "0.6914197", "text": "function addBook(bookObj) {\r\n books.push(bookObj);\r\n // adding to local storage\r\n localStorage.setItem('books', JSON.stringify(books));\r\n}", "title": "" }, { "docid": "cba7c9d5f2f936d423434ae8161c9247", "score": "0.68898076", "text": "function addBookToLibrary(){\n const title = prompt(\"Please enter the title of the book\", \"Robots\");\n const author = prompt(\"Enter author\", \"Issac Asimov\");\n const pages = prompt(\"Enter number of pages\", 150);\n const read = prompt(\"Have you read the book?\", false);\n\n const newBook = new Book(title, author, pages, read);\n myLibrary.push(newBook);\n render(myLibrary);\n}", "title": "" }, { "docid": "75f79a9f65212f70049c7ded42790a19", "score": "0.6867712", "text": "function Book(value) {\n // we didint add the bookshelf here because we will enter its value in the form \n // el ttabo3 is easy and we made it for most the properties here in lab 11 \n // we made if statement (with new method in one line ) for each property in case the book doesnt contain value for any property,so we determined what the values will be for each property \n this.image_url = value.volumeInfo.imageLinks.smallThumbnail ? value.volumeInfo.imageLinks.smallThumbnail : 'https://www.freeiconspng.com/uploads/book-icon--icon-search-engine-6.png';\n this.title = value.volumeInfo.title ? value.volumeInfo.title : 'No book with this title';\n this.author = value.volumeInfo.authors[0] ? value.volumeInfo.authors[0] : 'No books for this author';\n this.description = value.volumeInfo.description ? value.volumeInfo.description : '....';\n this.isbn = value.volumeInfo.industryIdentifiers[0].type + value.volumeInfo.industryIdentifiers[0].identifier ? value.volumeInfo.industryIdentifiers[0].type + value.volumeInfo.industryIdentifiers[0].identifier : '000000'; // industryIdentifiers[0] we put it like this because its array , and this array contains 2 properties (type and identifier) , look at json data to undertand it clearly \n}", "title": "" }, { "docid": "e49e42cd298bb5ce4541c2a4ba78bf70", "score": "0.68519425", "text": "function addBook(id, name, author, price, quantity){\n Books.push([id, name, author, price, quantity]);\n console.log(\"The available books now are: \");\n console.log(Books);\n readline.close();\n}", "title": "" }, { "docid": "157680fbeea45d09b8ec71d20f83a290", "score": "0.6801185", "text": "static addBook(book){\n // the class name, Storage, is used because this is a static method and does not require instantiation. \n const books = Storage.getBooks();\n books.push(book);\n // set local storage with the new book that was just pushed to the array, but it needs to be put in JSON format to be stored in localStorage.\n localStorage.setItem('books', JSON.stringify(books));\n }", "title": "" }, { "docid": "1eaa78eec76983bd1960b6b519ec35fd", "score": "0.6794081", "text": "function addBookToLibrary(event) {\n event.preventDefault();\n form.style.display = 'none';\n newBook = new Book(title, author, pages, read);\n myLibrary.push(newBook);\n setData(); //saves updated array in local storage\n render();\n form.reset();\n console.log(myLibrary);\n}", "title": "" }, { "docid": "12391fd5d8ffe892ef43ac2533765808", "score": "0.6787703", "text": "function addBook(book) {\n ref.push(book)\n}", "title": "" }, { "docid": "cf4d307507da5724cf9d89c8fed0f8d8", "score": "0.67819816", "text": "function addNewBook(state, title, author) {\n const rec = {\n isbn: uuidv4(),\n title: title,\n author: author,\n description: \"\",\n review: \"\",\n link: \"\",\n };\n sendBookSuggestion(rec)\n return state.map((item, i) => i === 3 ? { ...item, books: item.books.concat(rec) } : item);\n}", "title": "" }, { "docid": "b4e92a1ccd8f7b08085a4ccf9b582c3c", "score": "0.6773744", "text": "static addBook(book) {\n //get the books\n const books = Store.getBooks();\n //We want to push on to it\n books.push(book);\n //Then save it to local storage\n localStorage.setItem('books', JSON.stringify(books));\n }", "title": "" }, { "docid": "f725b02bcc97b7358dfcb91b5fef13b8", "score": "0.67617923", "text": "set _book(book) {\n this.novel.push(book);\n }", "title": "" }, { "docid": "4b6b08560db2dffd5ef2bce580ac14f5", "score": "0.67547584", "text": "function booksInLibrary () {\n gLibrary.addBook(gbookOne)\n gLibrary.addBook(gbookTwo)\n gLibrary.addBook(gbookThree)\n gLibrary.addBook(gbookFour)\n gLibrary.addBook(gbookFive)\n gLibrary.addBook(gbookSix)\n gLibrary.addBook(gbookSeven)\n gLibrary.addBook(gbookEight)\n gLibrary.addBook(gbookNine)\n return gLibrary;\n }", "title": "" }, { "docid": "90add05f5cbdda9570d6b73b851ec1c1", "score": "0.67494243", "text": "static addBook(book) {\r\n \r\n // get books from storage\r\n const books = Store.getBooks();\r\n\r\n // add book to end of array\r\n books.push(book);\r\n\r\n // return to localStorage after stringifying\r\n localStorage.setItem(\"books\", JSON.stringify(books));\r\n\r\n }", "title": "" }, { "docid": "b3a0de76e8c163391e5409cc5fee90cc", "score": "0.67377734", "text": "function addBookToLibrary() {\n // generate an id for a new book\n const id = myLibrary.length === 0 ? 1 : myLibrary[myLibrary.length - 1].id + 1;\n // Capture form fields\n const author = document.querySelector('#author').value;\n const title = document.querySelector('#title').value;\n const pages = document.querySelector('#pages').value;\n const read = document.querySelector('#read').checked;\n // ensure that form fields is not empty\n if (author === '' || title === '' || pages === '' || pages == 0) {\n formValid.style.display = 'block'\n setTimeout(() => {\n formValid.style.display = 'none'\n }, 3000)\n return;\n }\n // create new instance from Book constructor\n const book = new Book(id, title, author, pages, read)\n // clear form fields\n form.reset();\n myLibrary.push(book)\n // Save myLibrary array in the browser local storage\n localStorage.setItem('myLib', JSON.stringify(myLibrary))\n displayBooks()\n}", "title": "" }, { "docid": "01d16d48e757d1feab5b9378eeb8e365", "score": "0.6735837", "text": "function addBookToLibrary()\n{\n let author = document.querySelector(\".author\").value;\n let title = document.querySelector(\".title\").value;\n let pages = document.querySelector(\".pages\").value;\n let read = document.querySelector(\".read\").checked;\n let id = Date.now();\n if(!(author&&title&&pages))\n {\n alert(\"Enter all values\");\n }\n else\n {\n\n console.log(author,title,document.querySelector(\".pages\"),read)\n let newBook = new Book(title,author,pages,read,id);\n myLibrary.push(newBook);\n populateStorage(newBook);\n // console.log(newBook);\n // console.log(myLibrary);\n bookDisplay2(author,title,pages,read,id);\n console.log(\"mylibrary after adding\",myLibrary);\n toggle();\n add_image();\n }\n}", "title": "" }, { "docid": "34dfd0af943dccd668833c62e9e62110", "score": "0.6694", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n\tvar newBookName = document.querySelector(\"#newBookName\").value;\n\tvar newBookAuthor = document.querySelector(\"#newBookAuthor\").value;\n\tvar newBookGenre = document.querySelector(\"#newBookGenre\").value;\n\n\tvar newBook = new Book(newBookName, newBookAuthor, newBookGenre);\n\tlibraryBooks.push(newBook);\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n\taddBookToLibraryTable(newBook);\n\n}", "title": "" }, { "docid": "08e063559ca41ee1fe959b777968523c", "score": "0.66629076", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Create a new book based on input fields and add it to the global array.\n\tconst titleInput = document.querySelector(\"#newBookName\");\n const authorInput = document.querySelector(\"#newBookAuthor\");\n\tconst genreInput = document.querySelector(\"#newBookGenre\");\n\n\tconst title = titleInput.value;\n\tconst author = authorInput.value;\n\tconst genre = genreInput.value;\n\n\tconst newBook = new Book(title, author, genre);\n\tlibraryBooks.push(newBook);\n\n\t// Call addBookToLibraryTable properly to add book to the DOM.\n\taddBookToLibraryTable(newBook);\n\t// Reset input field values.\n\ttitleInput.value = \"\";\n\tauthorInput.value = \"\";\n\tgenreInput.value = \"\";\n}", "title": "" }, { "docid": "4e5e38dd4045baaf0d07a012e0572c10", "score": "0.66200954", "text": "static addBook(book) {\n //Get the book via getBook method and assign it to books variable\n const books = Store.getBooks();\n //Push method to push onto localstorage\n books.push(book);\n localStorage.setItem(\"books\", JSON.stringify(books));\n }", "title": "" }, { "docid": "1e6d5b466378dd83adf09a9a47880c7b", "score": "0.66173404", "text": "function addBookToLibrary(event) {\n let newBook = new Book(titleInput.value, authorInput.value, pagesInput.value, document.querySelector('input[name=read]:checked').value);\n library.push(newBook);\n populateStorage();\n render()\n clear();\n event.preventDefault();\n}", "title": "" }, { "docid": "495a98d0aae747d6f3246e6f0efb39f2", "score": "0.65935606", "text": "function addBookToLibrary(greie) {\n myLibrary.push(greie);\n}", "title": "" }, { "docid": "6665eb74ecc5e08520b5355f1d8a885c", "score": "0.65885127", "text": "function createBook () {\n return {\n 'title': 'Libro 1',\n 'subtitle': 'javascript',\n 'author': 'osom author',\n toString: function () {\n return `${this.title} - ${this.subtitle} | ${this.author}`\n }\n }\n}", "title": "" }, { "docid": "6fd1673a95c2f9a7a0a9aa02f923843f", "score": "0.65850484", "text": "function addBook(book) {\n // Temporay Array for holding old books\n let tempAry = [];\n\n // Put old books from local storage in temporary array\n if (localStorage.getItem(\"library\") !== null) {\n JSON.parse(localStorage.getItem(\"library\")).forEach( b => {\n tempAry.push(b);\n });\n };\n\n // Put old books into library array\n tempAry.forEach( b => {\n library.push(b);\n });\n\n // put new book into library\n library.push(book);\n\n // Save library to local storage\n localStorage.setItem(\"library\", JSON.stringify(library));\n\n // Reset both arrays\n tempAry = [];\n library = [];\n}", "title": "" }, { "docid": "e8acbb99665c1125c02757d9ebbb0d00", "score": "0.65831774", "text": "function createBook() {\n\n var title = prompt(\"Give me the title of your book!\");\n var authorN = prompt(\"Who was this book written by?\");\n\n var newBook = [\n {\n name: title,\n author: authorN\n }\n ]\n\n newBook.forEach(function(book, index) {\n console.log(\"The title of my new book is: \" + book.name);\n console.log(\"The writer of my new book is: \" + book.author);\n });\n\n\n }", "title": "" }, { "docid": "e50ca15d2779a3a33f729ea716490d7a", "score": "0.6573582", "text": "function bookStore() {\n var books = {};\n books.store = [];\n books.archive = [];\n books.createandAddBook = createandAddBook;\n books.searchBook = searchBook;\n books.removeBook = removeBook;\n books.updateBook = updateBook;\n books.restoreBook = restoreBook;\n return books;\n}", "title": "" }, { "docid": "b3b907e2dc5c9cdb34ccb342f87717c6", "score": "0.65716493", "text": "function addBook() {\r\n const title = document.getElementById(\"book-name\").value;\r\n const author = document.getElementById(\"book-author\").value;\r\n const isbn = document.getElementById(\"book-isbn\").value;\r\n const dateAdded = new Date().toLocaleString();\r\n const newBook = new book(title, author, isbn, dateAdded);\r\n\r\n UI.addBookToList(newBook);\r\n UI.clearFields();\r\n}", "title": "" }, { "docid": "dc161431895026a4cc5a533476c02e56", "score": "0.6567571", "text": "function addBook() {\n let newTitle = document.querySelector(\"#title\").value;\n let newAuthor = document.querySelector(\"#author\").value;\n let newPages = document.querySelector(\"#pages\").value;\n let newRead = document.querySelector(\"#read\");\n\n if (newRead.checked === true) {\n newRead = true;\n } else {\n newRead = false;\n }\n\n if (newTitle === \"\" || newAuthor === \"\" || newPages === \"\") {\n error();\n } else {\n lib.push(new Book(newTitle, newAuthor, newPages, newRead));\n resetForm();\n closeBox();\n render();\n }\n}", "title": "" }, { "docid": "a7a164accde9dbcddb1a18b4645e8198", "score": "0.65460396", "text": "static addBook(book){\r\n let books = Storage.getBooks();\r\n books.push(book);\r\n localStorage.setItem('books', JSON.stringify(books));\r\n }", "title": "" }, { "docid": "942dbb76106acddc8656d749ba393a99", "score": "0.6518801", "text": "static addBook(book) {\n const storedBooks = Store.retrieveBooks();\n storedBooks.push(book);\n localStorage.setItem('library', JSON.stringify(storedBooks));\n }", "title": "" }, { "docid": "54ff549f0e022901992be5cd1e224d88", "score": "0.65150005", "text": "static addBook(book) {\n\t\tconst books = Store.getBooks();\n\t\tbooks.push(book);\n\t\tlocalStorage.setItem('books',JSON.stringify(books));\n\t}", "title": "" }, { "docid": "cac951190bd2960759861b1555f80480", "score": "0.651149", "text": "static addBooks(book) {\n\t\t// Fetch the books from the local storage\n\t\tconst books = LocalStorage.getBooks();\n\n\t\t// Add the newly added data to the array by PUSHing\n\t\tbooks.push(book);\n\n\t\t// Set the local storage with the newly fetched item\n\t\tlocalStorage.setItem('books', JSON.stringify(books));\n\t}", "title": "" }, { "docid": "20da8a9d93142c7ceed4161c10164c26", "score": "0.6507878", "text": "function Book(title, author, price, section) {\nthis.title = author;\nthis.author = author;\nthis.price = price;\nthis.section = section;\n}", "title": "" }, { "docid": "5960182efa502f85626123c25d188c79", "score": "0.6507141", "text": "constructor(library){\n if (Array.isArray(library[\"list\"])){\n if (library[\"list\"] === []) this._library = library[\"list\"];\n else {\n this._library = library[\"list\"].map(book => new Book(book.title, book.author, book.pages, book.read));\n }\n }\n else this._library = [];\n\n }", "title": "" }, { "docid": "cae08bf4fe92ed718a414905e1025f51", "score": "0.6471885", "text": "function addBookToLibrary(title, author, pagesCount, readCondition) {\n myLibrary.push(new Book(title, author, pagesCount, readCondition));\n storeLibraryLocally();\n}", "title": "" }, { "docid": "0a0f70dd8fdd692c1931f0fa74e0dc70", "score": "0.6470635", "text": "function addBook(){\n $http\n .post('/books',vm.newBook)\n .then(function(response){\n vm.newBook = {}\n $log.info(response)\n getBooks(); //updates array\n\n })\n }", "title": "" }, { "docid": "b24f4f033aeda050a96da756cf225d98", "score": "0.6455582", "text": "function addBookToShelf(bookTitle, bookAuthor, bookDescr, bookImg, bookIsbn) {\n const newBook = new Book(bookTitle, bookAuthor, bookDescr, bookImg, bookIsbn);\n tempShelf.unshift(newBook);\n}", "title": "" }, { "docid": "43955871f848335fcefa98d806e57044", "score": "0.64482623", "text": "function addBook() {\n const completedBook = document.getElementById(COMPLETED_BOOK_CONTAINER_IDNAME);\n const incompletedBook = document.getElementById(INCOMPLETED_BOOK_CONTAINER_IDNAME);\n\n const theBookTitle = document.getElementById(\"inputBookTitle\").value;\n const theBookAuthor = document.getElementById(\"inputBookAuthor\").value;\n const theBookYear = document.getElementById(\"inputBookYear\").value;\n const isCompleted = document.getElementById(\"inputBookIsComplete\").checked;\n const imageCover = document.getElementById(\"cover-img\").value;\n\n const newBookList = makeBookContainer(theBookTitle, theBookAuthor, theBookYear, imageCover, isCompleted);\n\n const bookObject = bookToObject(theBookTitle, theBookAuthor, theBookYear, imageCover, isCompleted);\n newBookList[BOOKID] = bookObject.id;\n theBooks.push(bookObject);\n\n if (theBookTitle !== \"\" && theBookAuthor !== \"\" && theBookYear !== \"\") {\n if (isCompleted) {\n completedBook.append(newBookList);\n } else {\n incompletedBook.append(newBookList);\n }\n } else {\n alert(\"Oops, Anda harus mengisi Form yang diwajibkan!\");\n }\n\n updateBooksData();\n}", "title": "" }, { "docid": "ecf47ca028ccc6bc633b759560833c22", "score": "0.6445742", "text": "function addBookToLibrary () {\n let title = document.getElementById('title')\n let titleVal = title.value\n let author = document.getElementById('author')\n let authorVal = author.value\n let pages = document.getElementById('pages')\n let pagesVal = pages.value\n let readInput = document.getElementById('read')\n let readVal\n if (readInput.checked === true) {\n readVal = true\n } else {\n readVal = false\n }\n myLibrary.push(new Book(titleVal, authorVal, pagesVal, readVal))\n title.value = ''\n author.value = ''\n pages.value = ''\n readInput.checked = false\n render()\n activeForm()\n return myLibrary\n}", "title": "" }, { "docid": "23292bb31ae03c626a2ab8dc66985e25", "score": "0.6438137", "text": "function addBook(event) {\n\t\n\tif (input.value.trim() != \"\") {\n\t\tuid += 1;\n\t\tlet book = {\n\t\t\tname: input.value,\n\t\t\tid: uid\n\t\t};\n\n\t\tbookArr.push(book);\n\t\tlocalStorage.setItem(\"bookArr\", JSON.stringify(bookArr));\n\t\tevent.target.value = \"\";\n\t\tbookArr = JSON.parse(localStorage.getItem(\"bookArr\"));\n\t\tviewBook(bookArr);\n\t}\n}", "title": "" }, { "docid": "d7c3320caf26325d0a882c175499adfb", "score": "0.6413998", "text": "function makeBooks(n) {\n let books = [];\n for (let i = counter; i < counter + n; i++) {\n books.push(new Book(i));\n }\n counter += n;\n return books;\n}", "title": "" }, { "docid": "483fca0145bc4d3ff44d9da486b48b67", "score": "0.63619363", "text": "function newBook(){\n let authorInput = document.getElementById('authorinput').value;\n let bookInput = document.getElementById('bookinput').value; \n let pagesInput = document.getElementById('pagesnumber').value; \n let statusInput = document.getElementById('bookStatus').value;\n return (new Book(authorInput, bookInput, pagesInput, statusInput));\n}", "title": "" }, { "docid": "1d9ad488c78e079b9a3f7bb74c549a52", "score": "0.63174003", "text": "function addSomeBook(e) {\n\n e.preventDefault();\n const newB = {\n \n title : newTitle.value,\n author : newAuthor.value,\n genre : newgenre.value,\n page : newpage.value,\n \n \n\n };\n newBs.push(newB);\n \n e.target.reset();\n list.dispatchEvent(new CustomEvent('itemUpdated'));\n // addSomeBook();\n }", "title": "" }, { "docid": "71d1a370ce3d4df9930abe20cbde0b8e", "score": "0.6310052", "text": "function getNewBook() {\n const formCoverUrl = document.querySelector('#formCoverURL');\n const formName = document.querySelector('#formName');\n const formAuthor = document.querySelector('#formAuthor');\n const formNumOfPages = document.querySelector('#formNumOfPages');\n const formHasRead = document.querySelector('#formHasRead');\n\n const book = new Book(\n formCoverUrl.value,\n formName.value,\n formAuthor.value,\n formNumOfPages.value,\n formHasRead.checked,\n );\n return book;\n}", "title": "" }, { "docid": "3ad32a0c816269e1ffb21c89c25c9b60", "score": "0.6307032", "text": "static addBook(book) {\n // update existing book list in local storage\n let books_list = JSON.parse(localStorage.getItem('books_list'));\n if(books_list) {\n books_list.push(book);\n localStorage.setItem('books_list', JSON.stringify(books_list));\n\n // add to dom\n UI.addToDom(book);\n\n // show alert\n UI.showAlert('success', 'Book Added Successfully!');\n } else {\n let books = [];\n books.push(book);\n localStorage.setItem('books_list', JSON.stringify(books));\n\n // add to dom\n UI.addToDom(book);\n\n // show alert\n UI.showAlert('success', 'Book Added Successfully!');\n }\n\n }", "title": "" }, { "docid": "8de14a9ec39a72f26374de12131bd43c", "score": "0.6298746", "text": "function Book(name, author, type, number) {\n this.name = name;\n this.author = author;\n this.type = type;\n this.no = number;\n}", "title": "" }, { "docid": "651d8b950142ba96d6961d3fed0cf694", "score": "0.6279797", "text": "function Book(name , author , type)\n{\n this.name = name;\n this.author = author;\n this.type = type;\n}", "title": "" }, { "docid": "6698d6de3dbe69e0acfeea56daac5a30", "score": "0.6254923", "text": "static addBookToLS(book){\n const books = this.getBooks();\n\n books.push(book);\n\n localStorage.setItem('books',JSON.stringify(books));\n }", "title": "" }, { "docid": "c4f8f54d17b359cf7089cbec290a8048", "score": "0.6242628", "text": "function addToLibrary(){\n let book = new Book(\n document.getElementById(\"title\").value,\n document.getElementById(\"author\").value,\n document.getElementById(\"pages\").value,\n document.getElementById(\"status\").options[document.getElementById(\"status\").selectedIndex].value\n );\n myLibrary.push(book);\n\n let bookCard = document.createElement(\"div\");\n bookCard.textContent = book.info();\n bookCard.classList.add(\"card\");\n document.getElementById(\"library\").appendChild(bookCard);\n\n let numberOfPages = document.createElement(\"p\");\n numberOfPages.textContent = book.pageNumber();\n bookCard.appendChild(numberOfPages);\n\n let statusbar = document.createElement(\"div\");\n statusbar.classList.add(\"status-bar\");\n statusbar.textContent = book.status;\n statusbar.addEventListener(\"click\", () => {\n book.changeStatus();\n statusbar.textContent = book.status;\n });\n bookCard.appendChild(statusbar);\n\n let deleteButton = document.createElement(\"button\");\n deleteButton.classList.add(\"delete-button\");\n deleteButton.innerText = \"delete\";\n bookCard.appendChild(deleteButton);\n deleteButton.addEventListener(\"click\", () => {\n myLibrary.splice(myLibrary.indexOf(book),1);\n bookCard.style.display = \"none\";\n });\n\n bookForm.style.display = \"none\";\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"author\").value = \"\";\n document.getElementById(\"pages\").value = \"\";\n}", "title": "" }, { "docid": "218d0823231f1b9730ff9421189acd6d", "score": "0.62408066", "text": "function GetBookJson(){\n \n //Creating the Book Object\n var newBook=new Object();\n newBook.Authors=[];\n newBook.Repositories=[] ;\n \n //assigning the given values to the NewBook Object\n newBook.Title=$(\"#inputTitle\").val();\n newBook.Genre=$(\"#selectGenre\").val();\n\n //assigning the authors to the new book object\n var authorsString=$(\"#inputAuthors\").val();\n var authors=authorsString.split(\",\");\n for(var i in authors){\n \n var author=new Object();\n author.Name=authors[i];\n newBook.Authors.push(author);\n }\n \n //Assigning the publisher to the new book Object\n newBook.Publisher=new Object();\n newBook.Publisher.Name=$(\"#inputPublisher\").val();\n newBook.Publisher.Contact=34589739875;\n\n \n \n //Adding editions to the book\n var bookrepo=new Object();\n bookrepo.Edition=$(\"#inputEdition\").val();\n bookrepo.Price=$(\"#inputPrice\").val();\n bookrepo.NumberOfCopies=$(\"#inputCopies\").val();\n\n newBook.Repositories.push(bookrepo);\n\n return newBook;\n \n }", "title": "" }, { "docid": "33d41719471f52eeb94d3fef2003a3f6", "score": "0.62230283", "text": "function createBook(item) {\n const library = document.querySelector('#bookshelf');\n const bookDiv = document.createElement('div');\n const titleDiv = document.createElement('div');\n const authorDiv = document.createElement('div');\n const pagesDiv = document.createElement('div');\n const isRead = document.createElement('button');\n const bottomDiv= document.createElement('div');\n const removeButton = document.createElement('button');\n\n bookDiv.classList.add('book');\n bookDiv.setAttribute('id', myLibrary.indexOf(item));\n \n titleDiv.textContent = item.title;\n bookDiv.appendChild(titleDiv);\n\n authorDiv.textContent = item.author;\n bookDiv.appendChild(authorDiv);\n\n pagesDiv.textContent = item.pages;\n bookDiv.appendChild(pagesDiv);\n\n bottomDiv.classList.add('cardBottom')\n bookDiv.appendChild(bottomDiv)\n\n bottomDiv.appendChild(isRead);\n if (item.read == false) {\n isRead.textContent = 'Not read';\n isRead.setAttribute('id', 'isNotRead');\n } else {\n isRead.textContent = 'Read';\n isRead.setAttribute('id', 'isRead');\n };\n\n removeButton.textContent = 'Remove';\n removeButton.setAttribute('id', 'removeBtn');\n bottomDiv.appendChild(removeButton);\n\n\n library.appendChild(bookDiv);\n\n removeButton.addEventListener('click', ()=> {\n myLibrary.splice(myLibrary.indexOf(item), 1)\n setData();\n render();\n });\n\n isRead.addEventListener('click', ()=> {\n item.read = !item.read;\n setData();\n render();\n });\n}", "title": "" }, { "docid": "8980d50f57451d4365b0f702e3b3cbcb", "score": "0.6206773", "text": "function Controller(model) {\n this.getBook = function() {\n return model.book;\n }\n //function to add to array of objects\n //function to add new Person object to array people and book\n this.createPerson = function (firstName, lastName, email) {\n var person = new Person(firstName, lastName, email);\n model.people.push(person);\n console.log(model.people);\n model.book.push(person);\n };\n\n\n}", "title": "" }, { "docid": "8c6abe489b80a428d68d66d6f0c15c47", "score": "0.6206095", "text": "function add (bookName) {\n\n bookList.push(bookName);\n return bookList;\n \n // Change code above this line\n}", "title": "" }, { "docid": "14ef3f32d9b5d79407d30ee61e069d38", "score": "0.62003005", "text": "function addBook(bookObj) {\n let list = localStorage.getItem('list');\n if (list == null) {\n listObj = [];\n }\n else {\n listObj = JSON.parse(list);\n }\n listObj.push([bookObj.name, bookObj.author, bookObj.type]);\n localStorage.setItem('list', JSON.stringify(listObj));\n}", "title": "" }, { "docid": "6d893a0b235b6a64d9247d425bfbd55a", "score": "0.6190375", "text": "function generateLogbookObject() {\n\tvar logbook = {\"logbook\":[{\n\t\t\"name\":\"\",\n\t\t\"owner\":\"\",\n\t\t\"state\":\"Active\"\n\t}]};\n\n\tvar name = $('#new_logbook_name').val();\n\tvar owner = $('#new_logbook_owner').val();\n\n\t// Set name\n\tlogbook.logbook[0].name = name;\n\n\t// Set owner\n\tlogbook.logbook[0].owner = owner;\n\n\treturn logbook;\n}", "title": "" }, { "docid": "d78c33887d7a09e9f7cf984fb19ef976", "score": "0.61870563", "text": "function book(name, author, numberOfPages, readOrNot) {\r\n this.id = (b.length == 0)? 0 : (b[b.length-1].id) +1;\r\n this.name = name;\r\n\tthis.author = author;\r\n\tthis.numberOfPages = numberOfPages;\r\n\tthis.readOrNot = readOrNot;\r\n}", "title": "" }, { "docid": "22509cef84563a1ad7fb648693276640", "score": "0.6182983", "text": "function GetMyBooks(books){\n var mybooks=[];\n $.each(books,function(index,book){\n var booklength=book.Repositories.length;\n $.each(book.Repositories,function(index,bookedition){\n var addbook=new Object();\n addbook.ID=book.ID;\n addbook.Title=book.Title;\n addbook.Genre=book.Genre;\n addbook.Authors=book.Authors;\n addbook.Publisher=book.Publisher;\n addbook.Edition=bookedition.Edition;\n addbook.Price=bookedition.Price;\n addbook.NumberOfCopies=bookedition.NumberOfCopies;\n\n mybooks.push(addbook);\n });\n });\n return mybooks;\n }", "title": "" }, { "docid": "6624bc702f3b64331095f9c2447cf6ed", "score": "0.61827326", "text": "function createBook(bookTitle, bookAuthor, bookNumberOfPages, bookPublishDate, guid){\n\t//properties\n\tthis.title = bookTitle;\n\tthis.author = bookAuthor;\n\tthis.numberOfPages = bookNumberOfPages;\n\tthis.publishDate = bookPublishDate;\n\tthis.id = \"id-\" + guid;\n}", "title": "" }, { "docid": "2c5c3816ef4b4cb02b20cfc364417385", "score": "0.6181577", "text": "function Book(title, author, pages, read) {\n this.title = title\n this.author = author\n this.pages = pages\n this.read = read \n}", "title": "" }, { "docid": "a08e921820857d913cc8837fe425c31e", "score": "0.6169794", "text": "function newBook(book) {\r\n var bookSplit = book.split(\",\");\r\n var docData = {\r\n CID: bookSplit[0],\r\n Year: bookSplit[1],\r\n Author: bookSplit[2],\r\n BookTitle: bookSplit[3],\r\n Edition: bookSplit[4],\r\n ISBN: bookSplit[5],\r\n Publisher: bookSplit[6],\r\n Lead: bookSplit[7],\r\n LeadName: bookSplit[8],\r\n Notes: bookSplit[9]\r\n };\r\n\r\n db.collection(\"Books\").doc().set(docData).then(function() {\r\n console.log(\"Document successfully written!\");\r\n });\r\n}", "title": "" }, { "docid": "0cfa168b376fac246e888c149dbfe7fd", "score": "0.6160637", "text": "function Book (pages, author) {\r\n this.pages = pages;\r\n this.author = author;\r\n}", "title": "" }, { "docid": "476ba37037126f12d9c8d566d8c14151", "score": "0.61544275", "text": "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "title": "" }, { "docid": "85d2eddd99c75082fa0e47aaa1bcef51", "score": "0.6153432", "text": "function createReview(req, res, book) {\n let thisReview;\n const err = new Error(); // Detete this when you check for errors\n // Create an object to add to the array of reviews for this book.\n // add the object to the array using the push method, just a JS array of reviews\n // save the book and do error checking\n handleError(err, res, 'Could not add Review', 400);\n\n}", "title": "" }, { "docid": "8af50faa6e78bf7ef3053e14d5fef21d", "score": "0.61256826", "text": "constructor() {\n this.indexes = {};\n this.book = [];\n this.vbook = [];\n }", "title": "" }, { "docid": "46612f3ccedf89bdbf3d4a0bccb92f92", "score": "0.61171323", "text": "function addBook() {\n\t// Pull book data from input form\n\tvar book = Alloy.createModel('books', {\n\t\ttitle: $.titleInput.value,\n\t\tauthor: $.titleInput.value\n\t});\n\t\n\tmyBooks.add(book);\n\tbook.save();\n\t\n\t//Close the window\n\t$.addbook.close();\n}", "title": "" }, { "docid": "3fec4d335665363d4a73614dbf0b27a8", "score": "0.6110837", "text": "function add (bookList, bookName) {\n let books = [...bookList];\n\n books.push(bookName);\n return books;\n // Add your code above this line\n}", "title": "" }, { "docid": "7fb17e59d3f9a704ec9da1ba163b4e19", "score": "0.6104319", "text": "function Book(title, author, year){\n this.title = title;\n this.author = author;\n this.year = year;\n}", "title": "" }, { "docid": "36aead45ae1390d90daa8783977b2fcc", "score": "0.6101798", "text": "function Book(title, author) {\r\n this.title = title;\r\n this.author = author;\r\n}", "title": "" }, { "docid": "c93ee6b55de6fd8cbcc92a5009a2d4c4", "score": "0.6100388", "text": "function addBookToLibrary(){\n title = document.getElementById(\"title\").value;\n author = document.getElementById(\"author\").value;\n pages = document.getElementById(\"pages\").value;\n if(document.getElementById(\"read\").checked){\n read = \"True\"\n }else{\n read = \"False\"\n }\n\n if ((title === '') && (author === '') && (pages === '')){\n alert(\"One of your inputs is blank\")\n } else {\n if(isNaN(pages)){\n alert(\"Pages must be a number\")\n }else {\n let newBook = new book(title, author, pages, read)\n // when the html form for an new book is submitted, add the book to mylibary,\n myLibrary.push(newBook)\n // hide new book form\n updateLibrary()\n document.getElementById(\"newBookForm\").style.display = \"none\";\n document.getElementById(\"addNewBookBtn\").style.display = \"inline\";\n }\n }\n}", "title": "" }, { "docid": "d20838b0f0f3cd7a51f6b66198253530", "score": "0.6091267", "text": "function Book(title, author) {\r\n this.title = title;\r\n this.author = author;\r\n}", "title": "" }, { "docid": "195d556a9975a0442d4dd43e70647140", "score": "0.6082694", "text": "function createBook(book) {\n // Create our configuration object to allow us to make a POST request with the correct headers. The body will be the book object we have created and passed to this function as an argument.\n const configurationObject = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify(book)\n }\n // Make the POST request to the server using our configurationObject, adding the new book to our database and return the Promise with .json called on it, which will be the newly created book object from the database.\n return fetch(baseURI, configurationObject)\n .then(function(response){\n return response.json()\n })\n}", "title": "" }, { "docid": "19d5dda5466348fe3d548d241a0446e7", "score": "0.60715014", "text": "function Book(bookDataObj) {\n Object.keys(bookDataObj).forEach(key => {\n this[key] = bookDataObj[key];\n }, this);\n }", "title": "" }, { "docid": "950d5a1e0895e2f7b660223519ce5915", "score": "0.60550576", "text": "function Book (title,author,isbn){\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "title": "" }, { "docid": "3e169ad14ab6381c389ccc6f5270614b", "score": "0.6051585", "text": "function addBoook(event){\n event.preventDefault();\n let bookName=event.target.bookName.value;\n let bookPrice=event.target.bookPrice.value;\n console.log(bookPrice);\n\n let b1=new Book(bookName,bookPrice);\n b1.renderTableContent();\n console.log(books);\n localStorage.setItem('books',JSON.stringify(books));\n}", "title": "" }, { "docid": "5b7b9fa7f50bd0d0f8995bc299b68630", "score": "0.60515195", "text": "function seedBookData() {\n console.info('seeding book data');\n const seedData = [];\n for (let i = 1; i<=10; i++) {\n seedData.push({\n title: 'Harry Potter and the Chamber of Secrets',\n author: 'J.K. Rowling',\n genre: 'fantasy',\n goalPages: '33',\n goalChapters: '3'\n });\n }\n return Book.insertMany(seedData);\n}", "title": "" }, { "docid": "cbfa6a4f295f3aa7073134d41bdda618", "score": "0.6050124", "text": "function createBook(title, author) {\n return {\n title: title,\n author: author,\n getDescription() {\n return `${this.title} was written by ${this.author}.`;\n },\n };\n}", "title": "" }, { "docid": "b0dca280e2d78c19fd9e882bc6194336", "score": "0.6043595", "text": "function Book(title, author, year) {\n this.title = title;\n this.author = author;\n this.year = year;\n}", "title": "" }, { "docid": "6d7476cfc095a7c069c71436b129e2a7", "score": "0.60410285", "text": "function Book(title, bookid, author,pub,city,date,translator,issue, journal, vol, article,url,type,misc,tags,numberofnotes,pages, container,note,isbn,parent,nickname,dateuploaded){\n\tthis.title = title;\n\tthis.bookid = bookid;\n\tthis.author = author;\n\tthis.pub=pub;\n\tthis.city=city;\n\tthis.date=date;\n\tthis.translator=translator;\n\tthis.issue=issue;\n\tthis.journal=journal;\n\tthis.vol=vol;\n\tthis.article=article;\n\tthis.url=url;\n\tthis.type=type;\n\tthis.misc=misc;\n\tthis.tags=tags;\n\tthis.numberofnotes = numberofnotes;\n\tthis.pages=pages; // page count in an article\n\tthis.container=container; // chapter in a book?\n\tthis.note=note;\n\tthis.isbn=isbn;\n\tthis.parent=parent;\n\tthis.nickname=nickname;\n\tthis.dateuploaded = dateuploaded;\n}", "title": "" }, { "docid": "dd427ca6b285a6013e7cdb32122588b9", "score": "0.6034776", "text": "function addBookToLibrary(book, index) {\n myLibrary.splice(index, 0, book);\n}", "title": "" }, { "docid": "997c6a45096e9fbe0b7f585fd994f14d", "score": "0.60270244", "text": "function addBookToLibraryTable(book) {\n\t// Add code here\n\tconst tr = document.createElement('tr');\n\tconst td1 = document.createElement('td');\n\tconst td2 = document.createElement('td');\n\tconst td3 = document.createElement('td');\n\tconst strong = document.createElement('strong');\n\n\tstrong.innerText = book.title;\n\ttd1.innerText = book.bookId;\n\ttd2.appendChild(strong);\n\n\ttr.appendChild(td1);\n\ttr.appendChild(td2);\n\ttr.appendChild(td3);\n\n\tbookTable.children[0].appendChild(tr);\n}", "title": "" }, { "docid": "b839de4d2ef18d2d157e811757303188", "score": "0.60255605", "text": "function Book(title, author, pages, read) {\n\tthis.id = id++\n\tthis.title = title\n\tthis.author = author\n\tthis.pages = pages\n\tthis.read = read\n}", "title": "" }, { "docid": "83bcf23eb37477231818bac99bae03c5", "score": "0.60226905", "text": "addBookToList(book) {\t\n\n\t\t//Get parent element\n\t\tconst list = document.getElementById('book-list');\n\n\t\t//Create tr\n\t\tconst row = document.createElement('tr');\n\n\t\t//Append td's\n\t\trow.innerHTML = `<td>${book.title}</td> \n\t\t<td>${book.author} </td> \n\t\t<td>${book.isbn} </td>\n\t\t<td><a href=\"#\">X</a></td>`;\n\n\t\t//Append tds to tr\n\t\tlist.appendChild(row);\n\n\t}", "title": "" }, { "docid": "7abe5317a53b2c132deef7fd947d049a", "score": "0.60180604", "text": "function addBook(e) {\n e.preventDefault();\n //get form values\n const title = document.querySelector('#title').value;\n const author = document.querySelector('#author').value;\n const isbn = document.querySelector('#isbn').value;\n \n //instantiated ui\n const UI = new Ui();\n const store = new Storage();\n \n if (!title || !author || !isbn) {\n UI.showAlert('Please fill in all the fields','error');\n return;\n }\n //instantiated a book\n const book = new Book(title, author, isbn);\n console.log(book);\n\n \n //add book \n UI.addBookList(book);\n store.addBookToLocalStorage(book);\n // store.getAllBooks();\n //success alert\n UI.showAlert('Good job You have successfully added a new book.','success');\n\n\n //clear fields\n UI.clearFields();\n}", "title": "" }, { "docid": "5ab789ffc0393605cc6be6409dff8e72", "score": "0.60162693", "text": "constructor(book, person) {\n this.book = book;\n this.person = person;\n this.novel = [\n {\n Name: \"A Tale of two cities\",\n Author: \"Charles dickens\",\n Genre: \"Novel\",\n Language: \"English\",\n },\n {\n Name: \"Harry Potter\",\n Author: \"J.K.Rowling\",\n Genre: \"Novel\",\n Language: \"English\",\n },\n ];\n }", "title": "" } ]
4edb7299bf95298a98796b0993034aa7
Handler for onload event
[ { "docid": "0371eacbee837aac9ef89f095ff886c4", "score": "0.0", "text": "function loadHandler() {\n var i;\n\n if (!mutSnowplowState.hasLoaded) {\n mutSnowplowState.hasLoaded = true;\n for (i = 0; i < mutSnowplowState.registeredOnLoadHandlers.length; i++) {\n mutSnowplowState.registeredOnLoadHandlers[i]();\n }\n }\n return true;\n }", "title": "" } ]
[ { "docid": "32f907c6397f73b67804deb2ec153c1a", "score": "0.8040154", "text": "set onload(_onload) {\n\t\t\tonload = _onload;\n\t\t}", "title": "" }, { "docid": "182ccd8b264493bba5c8646c4b3127d5", "score": "0.76339215", "text": "function onloadhandler(e) {\n \t \tconsole.log(e);\n \t }", "title": "" }, { "docid": "14fe510f9b6463a4b6f838be82dd75f8", "score": "0.743387", "text": "function onStored() {\n if (this_.onload) this_.onload();\n }", "title": "" }, { "docid": "c9f5a312ab21d07311f589c080c52dde", "score": "0.7171993", "text": "set onload (loadFn) {\n this.loadFn = loadFn;\n }", "title": "" }, { "docid": "f53b37c7b82def595603aee2069d038a", "score": "0.7111918", "text": "onloadend() {}", "title": "" }, { "docid": "1fc11d2a1c8d5eafbe4e97cba0f22ac9", "score": "0.7088369", "text": "function OnLoadEventHandler() {\n\n}", "title": "" }, { "docid": "7811c45b6c53b1ebd2c8ac08ca34ec10", "score": "0.69485193", "text": "init(...param) {\n if (this.onload) this.onload(...param)\n }", "title": "" }, { "docid": "06204e1217e0d5f786e65f0acdc3b80a", "score": "0.6715481", "text": "function onLoad(evt){\n\t\t\t\tdfd.handleResponse(response);\n\t\t\t}", "title": "" }, { "docid": "06204e1217e0d5f786e65f0acdc3b80a", "score": "0.6715481", "text": "function onLoad(evt){\n\t\t\t\tdfd.handleResponse(response);\n\t\t\t}", "title": "" }, { "docid": "e47ad148549b76b2a5df5b45023789e7", "score": "0.66761345", "text": "loaded() {\n\n }", "title": "" }, { "docid": "d81a2d776f75a2c300039ee161aa4d42", "score": "0.6655312", "text": "loaded() {\n }", "title": "" }, { "docid": "7f3a65c6baa948f5dc6f4332d9a4a527", "score": "0.66256076", "text": "function onLoad(callback) {\n callback();\n }", "title": "" }, { "docid": "6108af00e9fb2314bc27336be707502c", "score": "0.6618741", "text": "function onload_init(){ refresh(); }// End of onload_init()", "title": "" }, { "docid": "c107c2be7c9fb706af591246ba852b64", "score": "0.6591848", "text": "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "title": "" }, { "docid": "59771698ffd6b8b4f53dd9566694eb4d", "score": "0.65609187", "text": "function onLoad(evt) {\n JSProf.LMC(37987, dfd, 'handleResponse').handleResponse(JSProf.LRE(37986, response));\n }", "title": "" }, { "docid": "89bf84f98e6e95183549214a953b8507", "score": "0.65395564", "text": "function startOnLoad() {\n}", "title": "" }, { "docid": "716dcbceddb45aa8fac837938ee94bc0", "score": "0.6489286", "text": "loaded() {\n // Attach custom event handler\n }", "title": "" }, { "docid": "934a6da1df3947b1468c180a5d5d41e4", "score": "0.64867234", "text": "function edgtfOnWindowLoad() {\n }", "title": "" }, { "docid": "934a6da1df3947b1468c180a5d5d41e4", "score": "0.64867234", "text": "function edgtfOnWindowLoad() {\n }", "title": "" }, { "docid": "bfa8c5260d2151d909d3407e044b2736", "score": "0.64784944", "text": "function loaded (){ // this will make the display function happed after the body tag has loaded with the Onload attribute\n display();\n\n}", "title": "" }, { "docid": "9f329eb3cdef10f1a7b7b469f74f767d", "score": "0.6455138", "text": "function onPreload() {\n this.src = attrs.rdDefer;\n element.unbind('load', onPreload);\n element.bind('load', onImgLoad);\n }", "title": "" }, { "docid": "8bcbb3ed6c96e92a6346c2e2d629f137", "score": "0.64450395", "text": "function didload()\r\n{\r\n\treallyLoad();\r\n}", "title": "" }, { "docid": "1b387d83cbcc43606a0d280041cdf65b", "score": "0.64058536", "text": "function handleLoad(_event) {\n let body = document.querySelector(\"body\");\n let button = document.querySelector(\"button\");\n document.addEventListener(\"mousemove\", setInfoBox);\n body.addEventListener(\"click\", logInfo);\n body.addEventListener(\"keyup\", logInfo);\n // Für die Zusatzaufgabe:\n document.addEventListener(\"riseup\", buttonOutput);\n button.addEventListener(\"click\", bubbleFunction);\n }", "title": "" }, { "docid": "82523497dfbea94e922a11dbcedd1f10", "score": "0.6403789", "text": "function handleOnLoad(model)\n\t{\n\t\tconsole.log(\"Object \" + model.urlInfo.name + \" loaded!\");\n\t\tconsole.log('-------------------------------------------');\n\t\t\n\t\tmodel.callback();\n\t}", "title": "" }, { "docid": "d9275e0a417f49bd1db99e1e4654176c", "score": "0.63983434", "text": "function onFileLoaded(event) {\n onFileEvent(event);\n console.log(event.target.result);\n alert('FileReader.result: ' + event.target.fileName + ': ' + event.target.result); \n }", "title": "" }, { "docid": "b71fabf0d980ba46fae377bd43a25d35", "score": "0.63810337", "text": "function _execOnLoad(elem) {\n\tif (elem.nodeType!=1) return;\n\tvar onload = elem.getAttribute(\"onload\");\n\tif (onload) {\n\t\t_utils.execScript(onload,\"index.html\");\n\t}\n\tfor (var i=0; i<elem.childNodes.length; i++) {\n\t\t_execOnLoad(elem.childNodes[i]);\n\t}\n}", "title": "" }, { "docid": "9dfc2aa8202f10afaf8da889717fd6ef", "score": "0.6370716", "text": "function addLoadEvent(func) \n{\n if (window.addEventListener) \n window.addEventListener(\"load\", func, false);\n else if (window.attachEvent)\n window.attachEvent(\"onload\", func);\n}", "title": "" }, { "docid": "8b5b384638f9f1f72e034c6dbe39b583", "score": "0.6367276", "text": "function onPageLoad() {\n\n\t\t// load some code\n\n\t}", "title": "" }, { "docid": "4776e26b7c66e717bdfd25296b74a2f2", "score": "0.6364916", "text": "function add_onload_event (func) {\n //alert(\"loading: \" + func);\n var oldonload = window.onload; \n if (typeof window.onload != 'function') { \n\t window.onload = func; \n } else { \n\t window.onload = function() { \n if (oldonload) { \n oldonload(); \n } \n func(); \n\t } \n } \n}", "title": "" }, { "docid": "84698379fe8eecb6e808ffe0b76109a7", "score": "0.63565445", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "00d4bcbe5ed1052dce3ff13c5593378d", "score": "0.63510245", "text": "function addLoadEvent(f)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n{\r\n\tvar oldOnload = window.onload;\r\n\tif (typeof window.onload!='function')\r\n\t\twindow.onload = f;\r\n\telse\r\n\t{\r\n\t\twindow.onload = function() \r\n\t\t{\r\n\t\t\toldOnload();\r\n\t\t\tf();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "714cff674a71177b961ac9030c458715", "score": "0.6342947", "text": "function _onLoadFunction(){\n}", "title": "" }, { "docid": "d29591e7dfb75c15f4a6c010c66a2b22", "score": "0.6333767", "text": "function edgtfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "d29591e7dfb75c15f4a6c010c66a2b22", "score": "0.6333767", "text": "function edgtfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "d1050cc948611d46d406590d74a4ef09", "score": "0.6328264", "text": "function window_Load(event) {\n\t\tinitGlobals(event);\n\t\tinitChecks(event);\n\t\tinitZoom(event);\n\t\tinitHash(event);\n\t}", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.63279074", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.63279074", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "c146dee0f961819dbb022126649d28d6", "score": "0.6319579", "text": "function check_load_complete ()\n\t\t{\n\t\t\tif ( data.$element.length == data.num_preloaded_images )\n\t\t\t{\n\t\t\t\tdata.options.oncomplete(data.num_preloaded_images);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fb52b00c985adf39d4d6daaf1e6b9c1d", "score": "0.63189816", "text": "function onPageLoad() {\n\n\n\n\t}", "title": "" }, { "docid": "328f0ee656f2b15d6910819814aa2a2d", "score": "0.63063985", "text": "function eltdfOnWindowLoad() {\n }", "title": "" }, { "docid": "2e61b6bd9e484984627990a9653ba629", "score": "0.62589", "text": "function HDXFileLoadedCallback(event) {\n \n // file done loading, read the contents\n HDXProcessFileContents(event.target.result);\n HDXAddCustomTitles();\n}", "title": "" }, { "docid": "9d45818b72f0c49643ea1efb63ae5a2c", "score": "0.6249445", "text": "function loadCompleteHandler(e)\n {\n \t//console.log(\"--DATA LOAD COMPLETE--\");\n \t_middleContainer.hidePreLoader();\n \t_topContainer.hideNextButtonPreLoader();\n \tif(_disableOverlay)_disableOverlay.hide();\n \t// Dispatch load stop event\n \tPubSub.publish(_instance.STOP_LOAD);\n }", "title": "" }, { "docid": "e8abcc427c98539610d4a761f9ac5a68", "score": "0.6240886", "text": "function window_Load(event) {\n\t\tinitGlobals(event);\n\t\tinitLinks(event);\n\t}", "title": "" }, { "docid": "bdc220ae6be128935720c85daea91149", "score": "0.6227111", "text": "onLoad(){\n this.initEventHandlers();\n }", "title": "" }, { "docid": "bccb172261b65b493fb8efce626a9c1a", "score": "0.6211338", "text": "function onLoad() {\n document.documentElement.removeAttribute(\"viewBox\");\n readFrames();\n sozi.events.fire(\"documentready\");\n }", "title": "" }, { "docid": "bccb172261b65b493fb8efce626a9c1a", "score": "0.6211338", "text": "function onLoad() {\n document.documentElement.removeAttribute(\"viewBox\");\n readFrames();\n sozi.events.fire(\"documentready\");\n }", "title": "" }, { "docid": "1a571cf188dafc47f53e4a8ad551530d", "score": "0.6197598", "text": "function onLoad() {\n\t var ctx, promise;\n\t\n\t if (xhr.status >= 200 && xhr.status < 300) {\n\t if (ctx = pl.game.getAudioContext()) {\n\t promise = new _Promise(function (resolveDecoding, rejectDecoding) {\n\t try {\n\t ctx.decodeAudioData(xhr.response, function (_buffer) {\n\t var audio = manager.collect(new AudioBufferRecord(_audio, _buffer));\n\t\n\t resolveDecoding(audio);\n\t // Cache the AudioBuffer to resolve duplicates.\n\t BUFFER_CACHE[fileName] = _buffer;\n\t }, function () {\n\t rejectDecoding(\"Failed to decode ArrayBuffer for \" + fileName + '.');\n\t });\n\t } catch (e) {\n\t rejectDecoding(e);\n\t }\n\t });\n\t\n\t promise.then(resolve)['catch'](reject);\n\t\n\t return promise;\n\t }\n\t } else {\n\t reject(xhr.statusText);\n\t }\n\t\n\t xhr.removeEventListener('load', onLoad);\n\t xhr = null;\n\t }", "title": "" }, { "docid": "1330c19695e5288563860746fd499a1e", "score": "0.6177906", "text": "function onLoad(superOnLoad) {\n superOnLoad();\n}", "title": "" }, { "docid": "ac18911ea55d714e5615130885292637", "score": "0.6175701", "text": "_handleLoadComplete() {\n\n this.status = Loader.STATUS.COMPLETE;\n this.progress = 1;\n this.trigger('complete', {target: this});\n\n }", "title": "" }, { "docid": "0da879ceb43be73e6b80063700a7bc68", "score": "0.61673576", "text": "function handleFileLoad (e) {\n //A sounds has bee preloaded\n createjs.Sound.play(e.src);\n \n }", "title": "" }, { "docid": "05d37732830d6ab3d6e7995c7267935d", "score": "0.61654", "text": "function audioFileLoaded(evt) {\n //console.log(\"🌸🌸🌸 <b>audioFileLoaded()</b> event handler called for audioObj 'loadeddata' event...\")\n //console.log('audioPlayer: audio file is loaded!')\n\n if (evt.currentTarget.id === \"testObj\") {\n //console.log('📌📌 test object loaded... exiting...')\n return;\n } // end if\n\n bAudioFileLoaded = true;\n //console.log('bAudioFileLoaded flag set to true!')\n\n nTrackLength = audioObj.duration;\n //console.log(\"track length set: \"+nTrackLength)\n \n checkingForFileLoadOnPlayEvent();\n \n playNextPlayItem(); // play next play item (if there is any item)\n\n }", "title": "" }, { "docid": "9e8a5110ceeb317e091c3ba38182fe56", "score": "0.6163768", "text": "function onload() {\n\t// fetch a book file\n\tbook = getBook();\n\t// go to page 3 of book\n\tvar page = getBookPage(book, currentPage)\n \trenderPage(page);\n}// JavaScript source code", "title": "" }, { "docid": "4140e1efc0de9bd8b4e77e1513f389e2", "score": "0.61585116", "text": "loadHandler() {\n this.isLoading = false;\n this.isInitialized = true;\n this.isMissing = false;\n this.loaded.emit(true);\n }", "title": "" }, { "docid": "23fc2176f6203a00a4f1afe385a40594", "score": "0.6153673", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function () {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n }", "title": "" }, { "docid": "a1de392e13ce214c09cb9ced43f19c13", "score": "0.61449426", "text": "function runOnLoad(window) {\n\t\t// Listen for one load event before checking the window type\n\t\twindow.addEventListener(\"load\", function runOnce() {\n\t\t\twindow.removeEventListener(\"load\", runOnce, false);\n\t\t\twatcher(window);\n\t\t}, false);\n\t}", "title": "" }, { "docid": "881722c5dac09f6b65a50764d5c881ae", "score": "0.6140163", "text": "function addLoadEvent(func) {\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n var old = window.onload;\n window.onload = function() {\n if (oldonload) {\n old();\n }\n func();\n }\n }\n }", "title": "" }, { "docid": "8d0489129919cb87f5a8957271e294ba", "score": "0.61353576", "text": "function eltdfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "c50b16b31c6b7b56c6a570084b1658ce", "score": "0.61342984", "text": "function pageOnLoad() {\n }", "title": "" }, { "docid": "d775d2e4e15542b7f6c51f200841dd00", "score": "0.6132789", "text": "function ksdAddOnLoadFunc(func) {\n if (window.addEventListener) {\n window.addEventListener('load', func, false);\n } else {\n window.attachEvent('onload', func);\n }\n}", "title": "" }, { "docid": "a1e62b409243e1f3b5f49d95bfee2d6e", "score": "0.611763", "text": "function innerLoadHandler(event) {\n var imgElem = document.createElement('IMG');\n imgElem.setAttribute('alt', ImageParam.alt);\n imgElem.setAttribute('src', event.target.result);\n imgElem.setAttribute('title', file.name);\n imgElem.style.display = ImageParam.display;\n imgElem.style.height = ImageParam.height;\n imgElem.style.margin = ImageParam.margin;\n photoContainer.appendChild(imgElem);\n }", "title": "" }, { "docid": "47643db5da5d56eadc1031ef36202083", "score": "0.6115324", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function () {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n }", "title": "" }, { "docid": "525a04dd7177e403fd3bfb88fb1e14c3", "score": "0.6110533", "text": "function fileComplete(evt) {\n\tvar item = evt.item;\n\tconsole.log(\"Event Callback file loaded \", evt.item.id);\n}", "title": "" }, { "docid": "525a04dd7177e403fd3bfb88fb1e14c3", "score": "0.6110533", "text": "function fileComplete(evt) {\n\tvar item = evt.item;\n\tconsole.log(\"Event Callback file loaded \", evt.item.id);\n}", "title": "" }, { "docid": "7ca4d799a8b37451fcc52e62ef784204", "score": "0.6107078", "text": "function ea_loaded() {\n\tea_has_loaded = true;\n\n\t// Rebroadcast the signal\n\tsignal(window, \"ea_init_done\");\n}", "title": "" }, { "docid": "f72b9432233f5c155418ddb219367c8d", "score": "0.610283", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n }", "title": "" }, { "docid": "aca5785dc2d9d5ca614793b8eb5a0c5c", "score": "0.61001605", "text": "onLoad() {\n \n }", "title": "" }, { "docid": "4f5f34fb8c7d019d628a8663fbe20bb5", "score": "0.6099084", "text": "function load() {\n if (!loaded) {\n loaded = true;\n\n }\n }", "title": "" }, { "docid": "a90877dc475856cdf3021b758d4d6d23", "score": "0.60956573", "text": "function fileComplete(evt) {\n\tvar item = evt.item;\n\t//console.log(\"Event Callback file loaded \", evt.item.id);\n}", "title": "" }, { "docid": "a90877dc475856cdf3021b758d4d6d23", "score": "0.60956573", "text": "function fileComplete(evt) {\n\tvar item = evt.item;\n\t//console.log(\"Event Callback file loaded \", evt.item.id);\n}", "title": "" }, { "docid": "dba4458866fbd4f94a7b369e9f9007e7", "score": "0.6095238", "text": "function loaded() {\n\n // Ensure we process our ready queue before stuff\n // bound to window.load.\n execReady();\n\n isLoaded = 1;\n\n defer(callback);\n }", "title": "" }, { "docid": "b7cc264f5c8bc9fd8a42e028a834552e", "score": "0.6094457", "text": "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\twin.attachEvent(\"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "title": "" }, { "docid": "3d1e92dddd0761df43d47071f3321ef5", "score": "0.609311", "text": "function imageIsLoaded(e) {\n\n}", "title": "" }, { "docid": "445522b5d689abd5004fa553b1258ea5", "score": "0.6082627", "text": "function eltdOnWindowLoad() {\n\n }", "title": "" }, { "docid": "ed29aeece1fa40b75957346a22dbceca", "score": "0.6071798", "text": "function load(){\n\n \n}", "title": "" }, { "docid": "ab3eb8b41f129275098139ff568b8371", "score": "0.606627", "text": "function _handle_load()\r\n\t{\r\n\t\tif (loaded) return;\r\n\t\tloaded = TRUE;\r\n\r\n\t\t_detach(win,LOAD,_handle_load);\r\n\t\t_set_hyperlink_targets();\r\n\t}", "title": "" }, { "docid": "80ba1442976e9ed41ad767e5c5a73c15", "score": "0.6054769", "text": "load() {\r\n\r\n }", "title": "" }, { "docid": "c360cfab8d251ae1fe7ef062fb173eba", "score": "0.60503155", "text": "function addLoadEvent(func) { \n var oldonload = window.onload; \n if (typeof window.onload != 'function') { \n window.onload = func; \n } else { \n window.onload = function() { \n if (oldonload) { \n oldonload(); \n } \n func(); \n } \n } \n }", "title": "" }, { "docid": "b200a819e9873746c0674085264b21db", "score": "0.60496926", "text": "function loaded(src, cb) {\n var image = new Image();\n image.src = src;\n\n if (image.loaded)\n cb();\n else\n image.addEventListener(\"load\", function () {\n cb();\n });\n }", "title": "" }, { "docid": "65f6fca0114b83e9b039d0778de7bd4d", "score": "0.6047274", "text": "function runOnLoad(window) {\n // Listen for one load event before checking the window type\n window.addEventListener(\"load\", function runOnce() {\n window.removeEventListener(\"load\", runOnce, false);\n watcher(window);\n }, false);\n }", "title": "" }, { "docid": "57578eb5e472c96943481648fd033621", "score": "0.60439533", "text": "function agregarEventoLoad(funcion){\n window.addEventListener(\"load\",funcion,false);\n \n}", "title": "" }, { "docid": "72227905de82647b0e8b60c53ebe12da", "score": "0.60435987", "text": "function load() {\n}", "title": "" }, { "docid": "df150a4ccfe3c6b927b7e9a7e6396970", "score": "0.6039124", "text": "function addLoadHandler(funcname) {\n var current = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = funcname;\n } else {\n window.onload = function () {\n if (current) {\n current();\n }\n funcname();\n }\n }\n}", "title": "" }, { "docid": "6c543102d0d3901413ffc678fd521799", "score": "0.60388374", "text": "function handleComplete() {\n\tloaded = true;\n\ttoggleLoader(false);\n\tinitMain();\n}", "title": "" }, { "docid": "6977e2bf371a7cc27590e8a48b115bd8", "score": "0.6015349", "text": "function preloadOnLoad(imgURLs)\r\n{\r\n\taddLoadEvent(preload, imgURLs);\r\n}", "title": "" }, { "docid": "0283e667658897b0dec2660f048831db", "score": "0.6007071", "text": "function addLoadEvent(fn) {\r\n\t\tif (typeof win.addEventListener != UNDEF) {\r\n\t\t\twin.addEventListener(\"load\", fn, false);\r\n\t\t}\r\n\t\telse if (typeof doc.addEventListener != UNDEF) {\r\n\t\t\tdoc.addEventListener(\"load\", fn, false);\r\n\t\t}\r\n\t\telse if (typeof win.attachEvent != UNDEF) {\r\n\t\t\taddListener(win, \"onload\", fn);\r\n\t\t}\r\n\t\telse if (typeof win.onload == \"function\") {\r\n\t\t\tvar fnOld = win.onload;\r\n\t\t\twin.onload = function() {\r\n\t\t\t\tfnOld();\r\n\t\t\t\tfn();\r\n\t\t\t};\r\n\t\t}\r\n\t\telse {\r\n\t\t\twin.onload = fn;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "995f56942ba12eaf6ab88f06cabc7a36", "score": "0.6001638", "text": "function fr_loadend(ev) {\n\tlogevent('FR_LOADEND');\n\n\t// The result is in base64 format\n\t// Strip the file type at the start (\"data:image/png;base64,\")\n\tvar filestring = this.result.split(',')[1];\n\t// Send off the request in JSON format\n\tvar request = {file: filestring};\n\tsend_post(JSON.stringify(request));\n}", "title": "" }, { "docid": "8740853cb7849ccd1a847d939ae7ee80", "score": "0.6000433", "text": "function checkLoadStatus(onload) {\n if (loadCount === resourceCount) {\n // wait 1/2s and execute callback (cheap workaround to ensure everything is loaded)\n if (onload || api.onload) {\n // make sure we clear the timer\n clearTimeout(timerId); // trigger the onload callback\n // we call either the supplied callback (which takes precedence) or the global one\n var callback = onload || api.onload;\n setTimeout(function() {\n callback();\n me.event.publish(me.event.LOADER_COMPLETE);\n }, 300);\n } else throw new Error(\"no load callback defined\");\n } else timerId = setTimeout(function() {\n checkLoadStatus(onload);\n }, 100);\n }", "title": "" }, { "docid": "b37f4021844f03bdcd4619db85ec1f85", "score": "0.5985835", "text": "function loadFinished() {\r\n $('body').triggerHandler('loadfinished');\r\n }", "title": "" }, { "docid": "8818a04718e1fec0341b13683b935ab5", "score": "0.5984944", "text": "addHandlerRender(handler) {\n window.addEventListener('load', handler);\n }", "title": "" }, { "docid": "0f78295795266192eb03ed5e0b9db41e", "score": "0.59802216", "text": "function startOnLoad() {\n\t\t\tgetNewStoryID();\n\t\t\tmakeTableRowClickable();\n\t\t\tretrieveStoryTitlebyID(count);\n\t\t\tretrieveArticleURLbyID(count);\n \t\t\tretrieveStoryTitlebyID(count-1);\n\t\t\tretrieveArticleURLbyID(count-1);\n \t\t\tretrieveStoryTitlebyID(count-2);\n\t\t\tretrieveArticleURLbyID(count-2);\n \t\t\tretrieveStoryTitlebyID(count-3);\n\t\t\tretrieveArticleURLbyID(count-3);\n\t\t\tretrieveStoryTitlebyID(count-4);\n\t\t\tretrieveArticleURLbyID(count-4);\n\n\t\t}", "title": "" }, { "docid": "d8fa281ac75a7932a3b61a82a08a16e3", "score": "0.5978131", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n}", "title": "" }, { "docid": "d8fa281ac75a7932a3b61a82a08a16e3", "score": "0.5978131", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n}", "title": "" }, { "docid": "d8fa281ac75a7932a3b61a82a08a16e3", "score": "0.5978131", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n}", "title": "" }, { "docid": "d8fa281ac75a7932a3b61a82a08a16e3", "score": "0.5978131", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n}", "title": "" }, { "docid": "d8fa281ac75a7932a3b61a82a08a16e3", "score": "0.5978131", "text": "function addLoadEvent(func) {\n var oldonload = window.onload;\n if (typeof window.onload != 'function') {\n window.onload = func;\n } else {\n window.onload = function() {\n if (oldonload) {\n oldonload();\n }\n func();\n }\n }\n}", "title": "" }, { "docid": "06d5e7ffb356040f0954834096d88402", "score": "0.5974158", "text": "function onLoad() {\r\n checkConnection();\r\n\r\n //loadScript();\r\n\r\n //loader();\r\n\r\n //document.addEventListener(\"deviceready\", onDeviceReady, false); \r\n }", "title": "" }, { "docid": "1c50697c2935a5c9a0fdf71e3aba7d43", "score": "0.59705544", "text": "function preLoadCallback(obj) {\n var div = document.getElementById('files');\n var label = obj.url != undefined ? `${obj.url}` : obj.font != undefined ? 'font' : 'unknown preload item';\n var text = document.createTextNode(`loaded: ${label}`);\n div.appendChild(text);\n var br = document.createElement(\"br\");\n div.appendChild(br);\n}", "title": "" }, { "docid": "785e2a49cc1c62a1ca9e015c14795eea", "score": "0.59693825", "text": "onLoad() {\n }", "title": "" }, { "docid": "080d30025d8ed8f3d8ea11bede42ae10", "score": "0.5968188", "text": "function eltdfOnDocumentReady() {\n }", "title": "" }, { "docid": "ae9482a935726895d101e9ef3eff3a77", "score": "0.5965411", "text": "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "title": "" }, { "docid": "ae9482a935726895d101e9ef3eff3a77", "score": "0.5965411", "text": "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "a9e847f7e922ce912a01aa0cff06ddd2", "score": "0.0", "text": "function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;\n }\n }", "title": "" } ]
[ { "docid": "99ccb5862776433d2ec74e9576fe0564", "score": "0.80545896", "text": "function ni(e,t,n){var a={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(a[n],+e)}", "title": "" }, { "docid": "711f074bb99a3aa673cbd30e090d0738", "score": "0.77626663", "text": "function Ki(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.75484014", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.75484014", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "d35e8419b4ea5252a03f05b4e963d403", "score": "0.7375297", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}//! moment.js locale configuration", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198218", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198218", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198218", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170998", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.7128414", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "ac7af0e62ca67c3cded5907f4217c1bf", "score": "0.7122303", "text": "function Qa(e,t,n){var r={mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(r[n],+e)}", "title": "" }, { "docid": "f619fe7c32d9997fd0720a00170897bc", "score": "0.6983041", "text": "function getSetGlobalLocale(key,values){var data;\n// moment.duration._locale = moment._locale = data;\nreturn key&&(data=isUndefined(values)?getLocale(key):defineLocale(key,values))&&(globalLocale=data),globalLocale._abbr}", "title": "" }, { "docid": "4d130ea41d5e4d847737b082b0ef6e38", "score": "0.692689", "text": "function ue(e,t,n,r){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return r?a[n][0]:a[n][1]}//! moment.js locale configuration", "title": "" }, { "docid": "f1307362c66d5698b7eabf78c9623281", "score": "0.6914966", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d3fbfa3239ceea082f45435d9661b7b5", "score": "0.65888834", "text": "function handleLocaleChange(locale) {\n i18n.locale = locale\n moment.locale(locale)\n}", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.6558225", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "c18bbc280ab7aa310d8256fe0054cf7a", "score": "0.649268", "text": "setLocale(momentInstance) {\n if (this.props.locale) {\n momentInstance.locale(this.props.locale.name);\n }\n return momentInstance;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62770087", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "95692ec680e62aa339fff1328a355241", "score": "0.62143844", "text": "get localeText() {\n switch (this._config.locale) {\n case \"fr\" :\n return {\n\t feelsLike: \"Ressenti:\",\n maxToday: \"Max. du jour:\",\n minToday: \"Min. du jour:\",\n windMore: \"Rafales à\",\n }\n default :\n return {\n feelsLike: \"Feels like\",\n maxToday: \"Today's High\",\n minToday: \"Today's Low\",\n windMore: \"Wind gust\",\n }\n }\n }", "title": "" }, { "docid": "4a6f10cf3c829e810d9763057a3eee1b", "score": "0.62017125", "text": "function ApexLocale() {}", "title": "" }, { "docid": "964b814e9555cf556ce599f5fd6f98b5", "score": "0.61968076", "text": "function getSetGlobalLocale (key, values) {\n\t\t var data;\n\t\t if (key) {\n\t\t if (isUndefined(values)) {\n\t\t data = getLocale(key);\n\t\t }\n\t\t else {\n\t\t data = defineLocale(key, values);\n\t\t }\n\t\t\n\t\t if (data) {\n\t\t // moment.duration._locale = moment._locale = data;\n\t\t globalLocale = data;\n\t\t }\n\t\t }\n\t\t\n\t\t return globalLocale._abbr;\n\t\t}", "title": "" }, { "docid": "f5578f4ca2594b9463cdcfda88867a1b", "score": "0.61879694", "text": "function test_automated_locale_switching() {}", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6182556", "text": "function ApexLocale() { }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6182556", "text": "function ApexLocale() { }", "title": "" }, { "docid": "b229aede18b54e3415ef4fe77b418058", "score": "0.6156518", "text": "function getMomentLocaleData(localeCode){return moment.localeData(localeCode)||moment.localeData(\"en\")}", "title": "" }, { "docid": "3c6cc1ca2d0c58e71df7b7c04bf75cdb", "score": "0.6154484", "text": "function load(localeName, callback) {\n if (!localeName || localeName === \"en\") {\n // Default moment is for English. Note that there is no external file for it!\n let moment = require('moment');\n moment.locale('en');\n callback(moment);\n }\n else {\n let moment = require('moment');\n require('moment/locale/' + localeName);\n moment.locale(localeName);\n callback(moment);\n }\n}", "title": "" }, { "docid": "b72a5716b34780008675aafc3129fe1a", "score": "0.6144448", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "2529afb11d1894571496d02dc7eba097", "score": "0.61419016", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n}", "title": "" }, { "docid": "9c0d0ea8dd2f120115abd8f0b67c7bdd", "score": "0.6135917", "text": "function configureGlobalMomentLocale(localeOverride = \"system-default\", weekStart = \"locale\") {\n var _a;\n const obsidianLang = localStorage.getItem(\"language\") || \"en\";\n const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n let momentLocale = langToMomentLocale[obsidianLang];\n if (localeOverride !== \"system-default\") {\n momentLocale = localeOverride;\n }\n else if (systemLang.startsWith(obsidianLang)) {\n // If the system locale is more specific (en-gb vs en), use the system locale.\n momentLocale = systemLang;\n }\n const currentLocale = window.moment.locale(momentLocale);\n console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`);\n overrideGlobalMomentWeekStart(weekStart);\n return currentLocale;\n}", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6096952", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "20c04ccea0a22e09f4c67e63cd045b45", "score": "0.60947174", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
8cd8310a3738cf3cd9c3512e0fb1d30d
Saving Form Settings into variables
[ { "docid": "80a14f1c7c6d3549fa593775b58d9eba", "score": "0.0", "text": "function saveSet() {\n setVaucherID = document.getElementById('setVaucherID').value;\n setDate = document.getElementById('setDate').value;\n setInvoiceNumber = document.getElementById('setInvoiceNumber').value;\n setVendorID = document.getElementById('setVendorID').value;\n setAmount = document.getElementById('setAmount').value;\n setFund = document.getElementById('setFund').value;\n setDeptID = document.getElementById('setDeptID').value;\n setDescription = document.getElementById('setDescription').value;\n n = document.getElementById('rows').value;\n}", "title": "" } ]
[ { "docid": "d853851c77e12e03965a906d2ecf0c5c", "score": "0.6998297", "text": "function doSettings() {\n\n $(\"#name-setting\").val(parseSettings(\"name\"));\n $(\"#grass-target\").val(parseSettings(\"target\"));\n}", "title": "" }, { "docid": "2b44cc4d058b27fc83d731b37a75d5ee", "score": "0.6995214", "text": "function saveSettings() {\n\tvar form = $(\"#settingsForm\");\n\tvar setS = $(\"#sound\", form).val();\n\tvar setV = $(\"#vibration\", form).val();\n\t// delete previous 'sound' & 'vibra'\n\tlocalStorage.removeItem(\"sound\");\n\tlocalStorage.removeItem(\"vibra\");\n\t// set new 'sound' & 'vibra' values\n\tlocalStorage.setItem(\"sound\", \"\"+setS+\"\");\n\tlocalStorage.setItem(\"vibra\", \"\"+setV+\"\");\n\tconsole.log(\"Settings data are saved!\");\n\t//alert('Settings are saved ' +setS+ ' & '+setV, '', 'Info', 'Ok');\n}", "title": "" }, { "docid": "cf85d15ba7e341463289912f5e2b2afa", "score": "0.69327515", "text": "function saveSettings() {\n var nameOnOrOff = $(\"#name-setting\").val();\n var targetCover = $(\"#grass-target\").val();\n var settingsString = nameOnOrOff+\",\"+targetCover;\n localStorage.setItem(\"settings\", settingsString);\n initialise();\n}", "title": "" }, { "docid": "b22a44be6bba9916ca29fdd3323cc973", "score": "0.6794433", "text": "function save_options() {\n\tvar pollIntervalMin = document.getElementById(\"poll_interval_min\");\n\tvar pollIntervalMax = document.getElementById(\"poll_interval_max\");\n\tvar requestTimeout = document.getElementById(\"request_timeout\");\n\tvar filterByKeywords = document.getElementById(\"filter_by_keywords\");\n\tvar keywords = document.getElementById(\"keywords\");\n\tvar popupBgColor = document.getElementById(\"popup_bg_color\");\n\n\tsettings.pollIntervalMin = pollIntervalMin.value;\n\tsettings.pollIntervalMax = pollIntervalMax.value;\n\tsettings.requestTimeout = requestTimeout.value;\n\tsettings.filterByKeywords = filterByKeywords.checked;\n\tsettings.keywords = keywords.value;\n\tsettings.popupBgColor = popupBgColor.value;\n\n\tsaveSettings();\n\tdisplayOptionsSaved();\n}", "title": "" }, { "docid": "0e6a373eec78602bda7da85e449bb246", "score": "0.6724646", "text": "function SaveSettings() {\r\n\tvar fields = document.evaluate('//*[@class=\"SettingsMenu\"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\tfor (var j = 0; j < fields.snapshotLength; j++) {\r\n\t\tif (fields.snapshotItem(j).type == 'text') {\r\n\t\t\tGM_setValue(fields.snapshotItem(j).name, fields.snapshotItem(j).value);\r\n\t\t\tsettings[fields.snapshotItem(j).name][0] = fields.snapshotItem(j).value;\r\n\t\t} else if (fields.snapshotItem(j).type == 'select-one') {\r\n\t\t\tGM_setValue(fields.snapshotItem(j).name, fields.snapshotItem(j).value);\r\n\t\t\tsettings[fields.snapshotItem(j).name][0] = fields.snapshotItem(j).value;\r\n\t\t} else if (fields.snapshotItem(j).type == 'checkbox') {\r\n\t\t\tGM_setValue(fields.snapshotItem(j).name, fields.snapshotItem(j).checked);\r\n\t\t\tsettings[fields.snapshotItem(j).name][0] = fields.snapshotItem(j).checked;\r\n\t\t}\r\n\t}\r\n\tHideSettingsMenu();\r\n\tGetSABnzbdVer();\r\n}", "title": "" }, { "docid": "5c1a3833931ccd7c9acb6481c49ea844", "score": "0.6697349", "text": "function getSettings() {\n settingsData = new FormData(document.querySelector(\".settingsPanel form\"));\n}", "title": "" }, { "docid": "bc71e0b873c370526e127d74651565fc", "score": "0.66778094", "text": "function loadValues()\n\t{\n\t\tvar source, saved, values;\n\t\tsaved = read();\n\t\tsource = Flink.settings;\n\t\tvar values = {\n\t\t\tstart: source.start\n\t\t\t, lang: source.locale.lang\n\t\t};\n\t\tfor (var key in values) {\n\t\t\tif (form.elements[key]) {\n\t\t\t\tform.elements[key].value = values[key];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "bc71e0b873c370526e127d74651565fc", "score": "0.66778094", "text": "function loadValues()\n\t{\n\t\tvar source, saved, values;\n\t\tsaved = read();\n\t\tsource = Flink.settings;\n\t\tvar values = {\n\t\t\tstart: source.start\n\t\t\t, lang: source.locale.lang\n\t\t};\n\t\tfor (var key in values) {\n\t\t\tif (form.elements[key]) {\n\t\t\t\tform.elements[key].value = values[key];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "645b7edf9122f9cebe1a0c36b88fac0b", "score": "0.66116476", "text": "function saveSettings(settings) {\n\tPropertiesService.getDocumentProperties().setProperties(settings);\n adjustFormSubmitTrigger();\n}", "title": "" }, { "docid": "6dbb3af292227b28b8cb49be9a8a7d27", "score": "0.660372", "text": "function applySettings() {\n var $inputElements = $menu.find(\"input\");\n var settings = {};\n\n $.each($inputElements, function(index, element) {\n var $element = $(element);\n var inputType = $element.prop(\"type\").toLowerCase();\n var settingsName = $element.data(\"settings-name\");\n var settingsValue;\n\n switch (inputType) {\n case \"checkbox\":\n settingsValue = $element.prop(\"checked\");\n break;\n case \"text\":\n settingsValue = $element.val();\n break;\n default:\n settingsValue = $element.val();\n break;\n }\n\n settings[settingsName] = settingsValue;\n });\n\n saveSettingsToLocalStorage(settings);\n $menu.hide();\n\n alert(\"You may need to refresh dubtrack to see changes take effect.\");\n }", "title": "" }, { "docid": "643511619ab8e52c9811e9bd21dbc863", "score": "0.65938014", "text": "function store_form_data() {\n\t// loop through all the inputs and get the data\n\t$('#module_form :input').each( function() {\n\t\t/**\n\t\t * @type String The id for this input field\n\t\t */\n\t\tvar fld_id = $(this).attr('id'),\n\t\t\t/**\n\t\t\t * @type String The value for this input field\n\t\t\t */\n\t\t\tfld_val = $(this).val();\n\n\t\tif ($(this).is(':checkbox') && $(this).is(':not(:checked)')) {\n\t\t\tfld_val = 'uncheck';\n\t\t}\n\n\t\tif ($(this).is(':radio') && $(this).is(':not(:checked)')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (fld_id && fld_val) {\n\t\t\tlocalStorage[fld_id] = fld_val;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4950260b72d43e720487d32704217622", "score": "0.65829444", "text": "function setValue() {\n currentTime = localStorage.getItem('time');\n currentPhoto = localStorage.getItem('photo');\n currentTheme = localStorage.getItem('themes');\n currentHide = localStorage.getItem('hideCorrect');\n\n timeForm.value = currentTime;\n photoForm.value = currentPhoto;\n themeForm.value = currentTheme;\n hideForm.value = currentHide;\n}", "title": "" }, { "docid": "e270fdce010aabb31a3569ea60728bf7", "score": "0.6540205", "text": "function loadSettings() {\n $('textarea.text-box9a').val(localStorage.plannerInput9a);\n $('textarea.text-box10a').val(localStorage.plannerInput10a);\n $('textarea.text-box11a').val(localStorage.plannerInput11a);\n $('textarea.text-box12p').val(localStorage.plannerInput12p);\n $('textarea.text-box1p').val(localStorage.plannerInput1p);\n $('textarea.text-box2p').val(localStorage.plannerInput2p);\n $('textarea.text-box3p').val(localStorage.plannerInput3p);\n $('textarea.text-box4p').val(localStorage.plannerInput4p);\n $('textarea.text-box5p').val(localStorage.plannerInput5p);\n\n}", "title": "" }, { "docid": "a25b6365662804cf0b8f9c82711e990c", "score": "0.6539826", "text": "function saveSettings() {\n if( UserProfile.suportsLocalStorage() ) {\n localStorage[ 'gravityEnabled' ] = settings.gravityEnabled;\n localStorage[ 'depthEnabled' ] = settings.depthEnabled;\n localStorage[ 'turbinesEnabled' ] = settings.turbinesEnabled;\n localStorage[ 'infectionEnabled' ] = settings.infectionEnabled;\n }\n }", "title": "" }, { "docid": "f35931282807abef7a6be715681b3f7b", "score": "0.6530223", "text": "function saveValues() {\r\n voyeurWidth = $('#voyeur_width').attr('value');\r\n voyeurHeight = $('#voyeur_height').attr('value');\r\n voyeurTool = $('#voyeur_tool').val();\r\n removeFuncWords = $('#remove_func_words').attr('checked');\r\n}", "title": "" }, { "docid": "31d1eae716c278db313fad25b4a592e2", "score": "0.649125", "text": "function saveSettings() {\n\tlocalStorage.setItem('settings', JSON.stringify(Settings));\n}", "title": "" }, { "docid": "a429734aa54ec88730d7647fe3c623f0", "score": "0.6454019", "text": "function form_save(form) {\r\n var validator = $(form).kendoValidator().data(\"kendoValidator\");\r\n if (validator.validate()) {\r\n // save the values of the inputs\r\n $(form).find(\"input\").each(function () {\r\n var value = '';\r\n if ($(this).is(':radio') || $(this).is(':checkbox')) {\r\n if (this.checked) value = this.checked;\r\n }\r\n else value = this.value;\r\n\r\n window.localStorage.setItem(this.name, value);\r\n });\r\n // AW5.app.navigate(\"#:back\");\r\n \r\n // save the values of the drop down\r\n $(form).find(\"select\").each(function () {\r\n window.localStorage.setItem(this.name, $(this).val());\r\n });\r\n }\r\n }", "title": "" }, { "docid": "aaf58bc111a6e8bd5cbfbc28576b8e78", "score": "0.64321834", "text": "function setSettings(settings) {\r\n\r\n // user settings\r\n if (settings.user_settings) {\r\n let userPhoto = settings.user_settings.picture_filename;\r\n let isDuplicateToMail = settings.user_settings.duplicate_to_mail === true;\r\n let isAllowNewsletters = settings.user_settings.allow_newsletters === true;\r\n $('#firstname').val(settings.user_settings.f_name);\r\n $('#lastname').val(settings.user_settings.l_name);\r\n $('#duplicate-mail').prop('checked', isDuplicateToMail);\r\n $('#allow-newsletters').prop('checked', isAllowNewsletters);\r\n $('#pic-preview-user').prop('src', 'Content/images/user_pictures/' + userPhoto);\r\n }\r\n\r\n // system settings\r\n if (settings.system_settings) {\r\n let systemQuestionsLimit = settings.system_settings.daily_questions_limit;\r\n let systemStatisticsInterval = settings.system_settings.statistics_interval;\r\n $('#questions-limit').val(systemQuestionsLimit);\r\n $('#companies-stat').val(systemStatisticsInterval);\r\n }\r\n\r\n // company settings\r\n if (settings.company_settings) {\r\n let companySpecialties = settings.company_settings.company_specialties.split(' ');\r\n let companyLogo = settings.company_settings.logo_filename;\r\n $('#company-description').val(settings.company_settings.company_description);\r\n\r\n if (settings.allowed_specialties && $('#specialties').length > 0) {\r\n setSpecialties(settings.allowed_specialties);\r\n }\r\n\r\n $('input[name=\"specialties\"]').each(function () {\r\n if (companySpecialties.indexOf($(this).val()) > -1) {\r\n $(this).attr('checked', true);\r\n }\r\n });\r\n\r\n $('#pic-preview-company').prop('src', 'Content/images/companies_logos/' + companyLogo);\r\n }\r\n}", "title": "" }, { "docid": "e4c8ca9e538eec2f59b3d67d7519e3d9", "score": "0.6423813", "text": "function saveSettings() {\n // debug('Saved');\n localStorage.setItem('autoTrimpSettings', JSON.stringify(autoTrimpSettings));\n}", "title": "" }, { "docid": "3967867b8189c72e8e80632383fc91bb", "score": "0.6408797", "text": "function saveSettings(server, server_client, erp_server, dev_user, dev_pass) {\n global.pimon_config.server = server;\n global.pimon_config.server_client = server_client;\n global.pimon_config.erp_server = erp_server;\n global.pimon_config.dev_user = dev_user;\n global.pimon_config.dev_pass = dev_pass;\n\n global.localStorage.server = server;\n global.localStorage.server_client = server_client;\n global.localStorage.erp_server = erp_server;\n global.localStorage.dev_user = dev_user;\n global.localStorage.dev_pass = dev_pass;\n }", "title": "" }, { "docid": "f84041a42ebeaa768e575dafb8328104", "score": "0.6396356", "text": "function loadSettings() {\n return {\n outputLocation: document.getElementById('output-folder').value,\n edgeMargin: document.getElementById('edge-margin').value,\n pageMargin: document.getElementById('page-margin').value,\n boxSize: document.getElementById('box-size').value,\n imgMaxWidth: document.getElementById('image-max-width').value,\n imgMaxHeight: document.getElementById('image-max-height').value,\n colorMode: document.getElementById('color-mode-selector').value,\n colorCount: document.getElementById('color-count-limit').value,\n darkColor: document.getElementById('dark-color').value,\n lightColor: document.getElementById('light-color').value,\n lineColor: document.getElementById('grid-color').value, // Color of the grid.\n breakColor: document.getElementById('break-color').value, // Value of light vs dark squares.\n fillOpacity: document.getElementById('opacity-level').value, // Opacity of the boxes.\n };\n}", "title": "" }, { "docid": "9e6399b4620b43b5bb2095567555c9ee", "score": "0.6385561", "text": "function submitSetting() {\n const values = {};\n const timerL = document.getElementById('timerL').value;\n values.timerL = timerL;\n\n const breakL = document.getElementById('breakL').value;\n values.breakL = breakL;\n\n const SULB = document.getElementById('SULB').value;\n values.SULB = SULB;\n\n const longbreakL = document.getElementById('longbreakL').value;\n values.longbreakL = longbreakL;\n\n // input validation\n if (checkInputs(values)) {\n setSettings(values);\n }\n}", "title": "" }, { "docid": "da406da1ed9cc260d4b012c9135c04d1", "score": "0.63806826", "text": "function saveSettings() {\n var translationSettings = gatherOptions();\n var consentSettings = JSON.parse(Cookie.get(self.props.cookieConsentName));\n\n // update all cookies required for (google-)translation\n //\n consentSettings.analysis = translationSettings.analysis;\n consentSettings.personalization = translationSettings.personalization;\n\n Cookie.set(\n self.props.cookieConsentName,\n JSON.stringify(consentSettings),\n self.props.cookieStorageDays,\n self.props.cookieSameSite,\n self.props.cookieDomain,\n self.props.cookieSecure\n );\n Cookie.set(\n self.props.cookieName,\n JSON.stringify(translationSettings),\n self.props.cookieStorageDays,\n self.props.cookieSameSite,\n self.props.cookieDomain,\n self.props.cookieSecure\n );\n self.$modal.modal('hide');\n }", "title": "" }, { "docid": "81ce2501ac2e5d9dfdee547e26334fb4", "score": "0.63746434", "text": "function setSettings() {\n\t\t$(\"#number_input\").val(localStorage.days);\n\n\t\t$(\"#settings_save\").click(function () {\n\t\t\tlocalStorage.days = $(\"#number_input\").val();\n\t\t\tajax.loadSettings();\n\t\t});\n\t}", "title": "" }, { "docid": "12a0770f9a225d6e57428530820522f8", "score": "0.637203", "text": "function save_options() {\n\tlocalStorage['MagicInputs_defaultPreset']=(JSON.stringify(window.sts));\n\t$('changed').fadeOut();\n\twindow.onbeforeunload=null;\n\talert(window.miText['saved']);\n}", "title": "" }, { "docid": "eec24f1388284da9d6667d725efe5850", "score": "0.6329706", "text": "function saveOptions(e) {\n\t\n\te.preventDefault()\n\tdocument.querySelector(\"#err\").innerHTML = \"\"\n\tdocument.querySelector(\"#ok\").innerHTML = \"\"\n\n\tconst settings = {\n\t\tserver: document.querySelector(\"#server\").value,\n\t\ttoken: document.querySelector(\"#token\").value,\n\t\tsendUrl: document.querySelector(\"#sendUrl\").checked,\n\t\tsendContents: document.querySelector(\"#sendContents\").checked\n\t}\n\tstore.set(settings)\n\t\t.then(() => {\n\t\t\tconsole.log(\"Settings saved\")\n\t\t\tdocument.querySelector(\"#ok\").textContent = `Settings saved.`\n\n\t\t})\n\t\t.catch(error =>{\n\t\t\tdocument.querySelector(\"#err\").textContent = `storage.local.set failed: ${error}`\n\t\t\tconsole.log(\"Problem saving settings:\", error)\n\t\t})\n\n}", "title": "" }, { "docid": "9c9dcc7774f7c0de7f23271f01282518", "score": "0.6320722", "text": "function onSaveSettings() {\n var originalUseExternalStorage = settings.useExternalStorage\n settings.useExternalStorage = document.getElementById(\"inputUseExternalStorage\").checked\n settings.depth = parseInt(document.getElementById(\"inputDepth\").value)\n settings.numberOfChildren = parseInt(document.getElementById(\"inputNumberOfChildren\").value)\n settings.keyLength = parseInt(document.getElementById(\"inputKeyLength\").value)\n settings.valueLength = parseInt(document.getElementById(\"inputValueLength\").value)\n settings.validCodePointsOnly = document.getElementById(\"inputValidCodePointsOnly\").checked\n settings.minCodePoint = document.getElementById(\"inputMinCodePoint\").value\n settings.maxCodePoint = document.getElementById(\"inputMaxCodePoint\").value\n // Hide\n showHideSettings(false)\n\n if (originalUseExternalStorage != settings.useExternalStorage) {\n // Recreate soup if storage type changed\n setupSoup(true)\n }\n}", "title": "" }, { "docid": "29fe534ce9803dae17f2048aa1c0faed", "score": "0.6299163", "text": "function storeSettings() { \n localStorage.setItem(\"storedSettingsWidth\", currentSettings.width);\n localStorage.setItem(\"storedSettingsHeight\", currentSettings.height);\n localStorage.setItem(\"storedSettingsMines\", currentSettings.mines);\n}", "title": "" }, { "docid": "a3d7c0bd177364d02ee87cd9f413bcb8", "score": "0.6287298", "text": "function populateSettings() {\n addKeywordForm();\n editKeywordForm();\n deleteKeywordForm();\n // changeSourcesForm();\n amountToDisplayForm();\n // runTimesForm();\n showGoogleFeed();\n addGoogleFeed();\n removeGoogleFeed();\n}", "title": "" }, { "docid": "d608ccaa7b634e7eeffe3952abeb99f9", "score": "0.62871706", "text": "function save_options() {\n\n var config = new Object;\n\n\n if ($(\"input[name='downloadm']:checked\").val() == 'transmission') {\n config.transmission=true;\n } \n else if ($(\"input[@name='downloadm']:checked\").val() == 'utorrent') {\n config.utorrent=true;\n }\n else {\n config.download=true;\n }\n\n config.min_size = parseInt( $(\"#min_size\").val() );\n config.max_size = parseInt( $(\"#max_size\").val() );\n config.torrent_pref = $(\"#torrent_pref\").val();\n\n config.domain = $(\"#domain\").val();\n config.country = $(\"#domain option:selected\").text();\n\n config.transmission_host = $(\"#transmission_host\").val();\n\n config.utorrent_host = $(\"#utorrent_host\").val();\n config.utorrent_port = $(\"#utorrent_port\").val();\n config.utorrent_user = $(\"#utorrent_user\").val();\n config.utorrent_pass = $(\"#utorrent_pass\").val();\n\n window.localStorage.clear();\n localStorage.setItem('config', JSON.stringify(config));\n \n status(\"Opciones grabadas!\",\"success\");\n\n}", "title": "" }, { "docid": "53cb792b36d2db26c9b2e8f2477359dc", "score": "0.6278221", "text": "function saveGeneralTabSettings() {\n\n\t// save the scan settings\n\tif (document.pageScanSettings.scanRadioButtons[0].checked) {\n\t\tlocalStorage[Constants.applicationSettings.pageScan] = Constants.pageScanSettings.scanAll;\n\t} else {\n\t\tlocalStorage[Constants.applicationSettings.pageScan] = Constants.pageScanSettings.scanManual;\n\t}\n\n\t// save the keyword settings\n\tlocalStorage[Constants.applicationSettings.highlightKeywords] = document.keywordSettings.highlightChekbox.checked;\n\tlocalStorage[Constants.applicationSettings.clickOnKeywords] = document.keywordSettings.clickOnKeywordsChekbox.checked;\n}", "title": "" }, { "docid": "570aba6b2e099c515d3776688156c958", "score": "0.6272248", "text": "function getSettings() {\n\tvar settings = PropertiesService.getDocumentProperties().getProperties();\n\t\n\t// get a list of text field items in the form\n\tvar form = FormApp.getActiveForm();\n\tvar textItems = form.getItems(FormApp.ItemType.TEXT);\n\t\n\tsettings.textItems = [];\n\t\n\ttextItems.forEach(function(textItem) {\n\t\tsettings.textItems.push({\n\t\t\ttitle: textItem.getTitle(),\n\t\t\tid: textItem.getId()\n\t\t});\n\t});\n\treturn settings;\n}", "title": "" }, { "docid": "fdac844026b24bdf3367097289aac46d", "score": "0.6256022", "text": "function saveTab() {//function to put move data from form to currentConfig\n event.preventDefault()\n if (document.getElementById('configFile').value == '' ){\n alert('The config file name is required for saving tabs.')\n };\n var configForms = document.getElementsByTagName('form');\n var lastAnswer;\n for (var f = 0; f < configForms.length; f++){//get the form data\n if (configForms[f].getAttribute('id') !== null ) {\n var formInputs = configForms[f].elements;\n //cycle through the form and get the info\n for (i = 0; i < formInputs.length; i++) {\n let inpType = formInputs[i].type;\n let prop = formInputs[i].name; //this is the key to the key/value pair\n //skip unchecked radio and checkbox entries\n if (inpType == \"radio\" && formInputs[i].checked == false) {\n continue;\n }\n //skip the submit buttons\n else if (inpType == \"submit\") {\n continue;\n }\n //add all non-blank entries to currentConfig\n else if (formInputs[i].value != \"\" && inpType != \"checkbox\") {\n currentConfig[prop] = formInputs[i].value;\n }\n //collect all checkbox options\n if (inpType == \"checkbox\") {\n if (prop !== lastAnswer) {\n currentConfig[prop] = \"\";\n };\n if (formInputs[i].checked == true) {\n currentConfig[prop] = currentConfig[prop].concat(formInputs[i].value.toString(), \",\");\n }\n //what was I doing here...\n if (currentConfig[prop] == undefined || currentConfig[prop] == null) {\n currentConfig[prop] = formInputs[i].value.toString().concat(',');\n }\n };\n if (inpType == \"select-one\"){\n var sel = Array.apply(null, formInputs[i].options).find(option => option.selected === true).value;\n if (sel != '') {currentConfig[prop] = sel}\n }\n lastAnswer = prop;\n }//end 2nd for loop\n }//end if\n }//end first forloop\n localStorage.setItem(currentConfig['project.configFile'].toString(), JSON.stringify(currentConfig));\n console.dir(currentConfig);\n modulesToCurrentConfig();\n}", "title": "" }, { "docid": "36b3f56b3e80e020b6b45ff18ce4a1e4", "score": "0.62489307", "text": "function saveSettings() {\n var settings = {\n url: $('#config-webtoon-url').val(),\n tapToScroll: $('#config-webtoon-tap-to-scroll').is(':checked'),\n autoscroll: $('#config-webtoon-autoscroll').is(':checked'),\n autoscrollRate: $('#config-webtoon-autoscroll-rate').val()\n }\n var currentUrl = localStorage.getItem('config-webtoon-url')\n settings.urlChanged = currentUrl !== settings.url\n localStorage.setItem('config-webtoon-url', settings.url)\n localStorage.setItem('config-webtoon-tap-to-scroll', settings.tapToScroll)\n localStorage.setItem('config-webtoon-autoscroll', settings.autoscroll)\n localStorage.setItem('config-webtoon-autoscroll-rate', settings.autoscrollRate)\n return settings\n}", "title": "" }, { "docid": "d5cd374115bfd7285d538b0a528479f1", "score": "0.62436724", "text": "loadSettings() {\n if (!this.page.configuration.pack) {\n this.page.configuration.reloadPack(() => this.loadSettings());\n return;\n }\n // Clear settings\n this.settingsForm.inputs.clear();\n // Add settings inputs\n this.addSettings(this.page.configuration.settings, this.page.configuration.settingsValues);\n // Set settings form visibility\n this.settingsForm.visible = this.settingsForm.inputs.count > 0;\n }", "title": "" }, { "docid": "5ca6283a2ab20cb3d9de18805993807b", "score": "0.62123656", "text": "function save_options() {\n var host = document.getElementById(\"host\").value;\n var port = document.getElementById(\"port\").value;\n var https = document.getElementById(\"https\").checked;\n var user = document.getElementById(\"user\").value;\n var password = document.getElementById(\"password\").value;\n var apikey = document.getElementById(\"apikey\").value;\n\n localStorage[\"host\"] = host;\n localStorage[\"port\"] = port;\n localStorage[\"https\"] = https;\n localStorage[\"user\"] = user;\n localStorage[\"password\"] = password;\n localStorage[\"apikey\"] = apikey;\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 750);\n}", "title": "" }, { "docid": "7d888a6f29e30251ee659d47f30dc7b1", "score": "0.6187589", "text": "function loadSettings() {\n if (emailPref !== 'false') {\n email.checked = (emailPref === 'true');\n }\n if (profilePref !== 'false') {\n profile.checked = (emailPref === 'true');\n }\n if (timezonePref !== 'false') {\n select.value = localStorage.getItem('timezonePref');\n }\n}", "title": "" }, { "docid": "7ebdffb402735d8a911fad3bed82cba1", "score": "0.6179119", "text": "function saveSettings() {\n const settingsJSON = JSON.stringify(Settings);\n localStorage.setItem(StoreName.Settings, settingsJSON);\n}", "title": "" }, { "docid": "979fb824c17dfb60f04a64fe75d08a79", "score": "0.6167741", "text": "function populateSettingsInputs(s) {\n if (s.hasOwnProperty(\"useExternalStorage\")) document.getElementById(\"inputUseExternalStorage\").checked = s.useExternalStorage\n if (s.hasOwnProperty(\"depth\")) document.getElementById(\"inputDepth\").value = s.depth\n if (s.hasOwnProperty(\"numberOfChildren\")) document.getElementById(\"inputNumberOfChildren\").value = s.numberOfChildren\n if (s.hasOwnProperty(\"keyLength\")) document.getElementById(\"inputKeyLength\").value = s.keyLength\n if (s.hasOwnProperty(\"valueLength\")) document.getElementById(\"inputValueLength\").value = s.valueLength\n if (s.hasOwnProperty(\"validCodePointsOnly\")) document.getElementById(\"inputValidCodePointsOnly\").checked = s.validCodePointsOnly\n if (s.hasOwnProperty(\"minCodePoint\")) document.getElementById(\"inputMinCodePoint\").value = s.minCodePoint\n if (s.hasOwnProperty(\"maxCodePoint\")) document.getElementById(\"inputMaxCodePoint\").value = s.maxCodePoint\n}", "title": "" }, { "docid": "c40f5389b0a9b621fd932f9f27c3f3a4", "score": "0.6164216", "text": "function saveConfiguration(evt) {\r\n\t\t// Disables the input/select fields\r\n\t\tsetDialogInputState(false);\r\n\t\t// Sets configuration variables\r\n\t\tGM_setValue(\"alternateCSS\", $(\"gsconfalternateCSS\").checked);\r\n\t\tGM_setValue(\"fixVideoSize\", $(\"gsconffixVideoSize\").checked);\r\n\t\tGM_setValue(\"fixScrollToVideo\", $(\"gsconffixScrollToVideo\").checked);\r\n\t\tGM_setValue(\"deleteNodes\", $(\"gsconfdeleteNodes\").checked);\r\n\t\tGM_setValue(\"playlistAutoplay\", $(\"gsconfplaylistAutoplay\").checked);\r\n\t\tGM_setValue(\"playerWmode\", $(\"gsconfplayerWmode\").checked);\r\n\t\tGM_setValue(\"hideVideo\", $(\"gsconfhideVideo\").checked);\r\n\t\t// Reloads page and script\r\n\t\twindow.location.reload();\r\n\t}", "title": "" }, { "docid": "d1bccfdd7291e7a18fbfdaea866a34a7", "score": "0.6155774", "text": "function save_settings() {\n globals.settings.zonelist = document.getElementById('zonelist').value;\n chrome.storage.local.set(globals.settings, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "title": "" }, { "docid": "231dbf79111dd5b0136b047b186eec93", "score": "0.6151955", "text": "function save_options() {\n\t\n\t\tlocalStorage[\"user\"] = document.getElementById(\"user\").value;\n\t localStorage[\"api\"] = document.getElementById(\"api\").value;\n\t localStorage[\"rss\"] = document.getElementById(\"rss\").value;\n\t localStorage[\"nsfw\"] = document.getElementById(\"nsfw\").checked;\n \t localStorage[\"m18\"] = document.getElementById(\"m18\").checked;\n \t localStorage[\"v21\"] = document.getElementById(\"v21\").checked;\n \t \n \t alert(localStorage.v21);\n \t \n\t localStorage.saved = 1;\n\t \n\t // Update status to let user know options were saved.\n \t\tvar status = document.getElementById(\"status\");\n \t\tstatus.innerHTML = \"<h3 style='margin:50px 0 0 480px'>Opciones guardadas</h3>\";\n \t\tsetTimeout(function() {\n \t\tstatus.innerHTML = \"\";\n \t\t}, 10000);\n\t}", "title": "" }, { "docid": "522fbeb7084589a4dbcdb2ebd628fba9", "score": "0.61498535", "text": "function send_settings() {\n let config = Array.prototype.reduce.call(\n $('#bg_settings :input'),\n function (values, el) {\n if ($(el).data('type') === 'float') {\n values[el.name] = parseFloat(el.value);\n } else if (el.type === 'checkbox') {\n values[el.name] = el.checked;\n } else {\n if (!isNaN(parseInt(el.value))) {\n values[el.name] = parseInt(el.value);\n } else {\n values[el.name] = el.value;\n }\n }\n return values;\n },\n {});\n bgConfigure(config);\n startTracking();\n}", "title": "" }, { "docid": "6f64c17652eabc05093500743f6be7b6", "score": "0.61382", "text": "async saveSettings() {\n writeJSON( SETTINGS_FILE, this.settings, { spaces: 2 } )\n }", "title": "" }, { "docid": "73ba33c073705ab9341cd0f7c32cf57c", "score": "0.6135393", "text": "function restore_options() {\n var host = localStorage[\"host\"];\n var port = localStorage[\"port\"];\n var https = localStorage[\"https\"] === \"true\";\n var user = localStorage[\"user\"];\n var password = localStorage[\"password\"];\n var apikey = localStorage[\"apikey\"];\n if (host) {\n document.getElementById(\"host\").value = host;\n }\n if (port) {\n document.getElementById(\"port\").value = port;\n }\n document.getElementById(\"host\").checked = https;\n if (user) {\n document.getElementById(\"user\").value = user;\n }\n if (password) {\n document.getElementById(\"password\").value = password;\n }\n if (apikey) {\n document.getElementById(\"apikey\").value = apikey;\n }\n document.querySelector(\"#save\").addEventListener(\"click\", save_options);\n}", "title": "" }, { "docid": "ddd9a4e5adc51f7e990c3f4b84deb0c2", "score": "0.60970414", "text": "function saveSettings(meta){var settingStorage=new StorageSettings();var setting=new Settings(meta);setting.refresh();settingStorage.update(setting.hash(),setting);}", "title": "" }, { "docid": "a0a6fa902a394640631fe5c373b0d15f", "score": "0.6087573", "text": "function populateStorage() {\n localStorage.setItem('time', timeForm.value);\n localStorage.setItem('photo', photoForm.value);\n localStorage.setItem('themes', themeForm.value);\n localStorage.setItem('hideCorrect', hideForm.value);\n setValue();\n}", "title": "" }, { "docid": "6c2a7d5ae5437b6a2aa16297352f7aa0", "score": "0.60786587", "text": "function save_options() {\n var intColor = document.getElementById(\"int-color\").value;\n var floatColor = document.getElementById(\"float-color\").value;\n var stringColor = document.getElementById(\"string-color\").value;\n var boolColor = document.getElementById(\"bool-color\").value;\n var objectColor = document.getElementById(\"object-color\").value;\n var arrayColor = document.getElementById(\"array-color\").value;\n var nullColor = document.getElementById(\"null-color\").value;\n \n localStorage[\"intColor\"] = intColor;\n localStorage[\"floatColor\"] = floatColor;\n localStorage[\"stringColor\"] = stringColor;\n localStorage[\"boolColor\"] = boolColor;\n localStorage[\"objectColor\"] = objectColor;\n localStorage[\"arrayColor\"] = arrayColor;\n localStorage[\"nullColor\"] = nullColor;\n localStorage[\"cascade\"] = document.getElementById(\"y-cas\").checked;\n localStorage[\"autorun\"] = document.getElementById(\"y-autoR\").checked;\n\n // let user know options were saved.\n alert('options saved!');\n}", "title": "" }, { "docid": "33396bfc1dc0d28e7e4d27d0206ffb64", "score": "0.60777354", "text": "function saveSettings() {\n localStorage.setItem('Client.Setting.LocalEcho', JSON.stringify(localEcho));\n}", "title": "" }, { "docid": "2eca32ab7b1300e06ecf321da82f8537", "score": "0.60699797", "text": "function save() {\n\t\tvar blog = $('#blog').serializeArray();\n\t\tvar theme = $('#theme').serializeArray();\n\t\tvar settings = { \n\t\t\t\tblog: blog ,\n\t\t\t\ttheme: theme\n\t\t\t};\n\t\t\n\t\t$.post( \"action/save-settings.php\" , settings , function( data ) {\n\t\t\tif ( data === \"ok\" ) {\n\t\t\t\twindow.location = ( \"index.php\" );\n\t\t\t} else {\n\t\t\t\talert( \"Error: documento no se ha podido salvar\" );\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a4500a3f2e3d16faf5269212e9ed6695", "score": "0.60693777", "text": "function saveSettings()\n{\n var settings = {\n \"syncTime\": $('#syncTimeDiff').selectedIndex,\n \"chatTextDisplay\": $('#chatTextDisplay').selectedIndex,\n \"settingPlayerSizeSm\": document.getElementById('settingPlayerSizeSm').checked,\n \"settingPlayerSizeLg\": document.getElementById('settingPlayerSizeLg').checked,\n \"settingChatImgSizeSm\": document.getElementById('settingChatImgSizeSm').checked,\n \"settingChatImgSizeMed\": document.getElementById('settingChatImgSizeMed').checked,\n \"settingChatImgSizeLg\": document.getElementById('settingChatImgSizeLg').checked,\n \"showChatImages\": document.getElementById('settingShowChatImages').checked,\n \"showChatVideos\": document.getElementById('settingShowChatVideos').checked,\n \"showNND\": document.getElementById('settingNNDToggle').checked,\n \"showTimestamp\": document.getElementById('settingShowTimestamp').checked,\n \"showTrips\": document.getElementById('settingDisplayTrips').checked,\n \"showChat\": document.getElementById('settingShowChat').checked\n };\n \n localStorage.setItem('userSettings', JSON.stringify(settings));\n alert(\"Saved settings\");\n}", "title": "" }, { "docid": "9943db7fefcf450c461ad1fd18c10909", "score": "0.60647684", "text": "function save_options() {\n let open_new_tab = $(\"#open_new_tab\").is(\":checked\");\n let ms_style_output = $(\"#ms_style_output\").is(\":checked\");\n let limit_num_qtr = $(\"#limit_num_qtr\").is(\":checked\");\n let limit_num_qtr = $(\"#hide_extra\").is(\":checked\");\n chrome.storage.local.set(\n {\n open_new_tab: open_new_tab,\n ms_style_output: ms_style_output,\n limit_num_qtr: limit_num_qtr,\n hide_extra: hide_extra,\n },\n function () {\n chrome.runtime.reload();\n }\n );\n}", "title": "" }, { "docid": "72b76ffb39b021c527c2c04c1bf7bdc4", "score": "0.60647666", "text": "function populateSettingsPage() {\n logger.debug('Loading values in settings page from settings files.');\n Object.keys(Constants.SETTINGS).map(k => {\n addTab(Constants.SETTINGS[k]);\n generateListFromStorage(Constants.SETTINGS[k]);\n });\n}", "title": "" }, { "docid": "968e83f8ea32e83c2f8e76f765a4080c", "score": "0.6061509", "text": "function saveConfigs() {\n for (var key in configs) {\n if (key == 'density') {\n configs[key] = $('#btn-density').attr('aria-valuenow');\n } else if (key == 'unit') {\n configs[key] = $('#btn-unit').attr('aria-valuenow');\n } else if (key == 'filetype') {\n configs[key] = $('#btn-filetype').attr('aria-valuenow');\n } else if (key == 'saveLabels') {\n configs[key] = $('#ckb-saveLabels').is(':checked');\n } else if (key == 'keepTcpSocket') {\n configs[key] = $('#ckb-keep-tcp-socket').is(':checked');\n } else if (key == 'path') {\n configs[key] = retainEntry\n } else {\n configs[key] = $('#' + key).val();\n }\n }\n\n chrome.storage.local.set(configs, function () {\n $('#settings-window').modal('hide');\n notify('Printer settings changes successfully saved', 'cog', 'info');\n });\n}", "title": "" }, { "docid": "0c9b60f3c0db7a63c0c591ff7d02a574", "score": "0.60594153", "text": "function saveForm(form) {\n with (form) {\n for ( var i = 0; i < elements.length; i++) {\n if (textTypes.indexOf(elements[i].type) >=0 ) {\n setCookie(elements[i].name, elements[i].value, 1, 0, 0);\n }\n }\n }\n}", "title": "" }, { "docid": "9bd07beb0d0ab11cb7de99c95230a2ab", "score": "0.60510623", "text": "function main_saveSettings(){\r\n\r\n\t// Save options in the PSD\r\n\tvar instructionsArray = String(origDocRef.info.instructions).split(INSTRUCTIONS_SPLIT_TOKEN);\r\n\tvar originalInstructions = String(instructionsArray[0]).trim();\r\n\tvar originalSavedSettings = String(instructionsArray[1]).trim();\r\n\r\n\t// Generate JSON\r\n\tvar newSettingsString = JSON.stringify(exportInfo);\r\n\r\n\t// If nothing is changed, don't update the file\r\n\tif ( newSettingsString == originalSavedSettings || !newSettingsString ) return;\r\n\r\n\tLog.notice('Saving settings in METADATA: ' + newSettingsString);\r\n\tvar newInstructionsArray = new Array();\r\n\tnewInstructionsArray.push(originalInstructions);\r\n\tnewInstructionsArray.push(INSTRUCTIONS_SPLIT_TOKEN);\r\n\tnewInstructionsArray.push(newSettingsString);\r\n\tvar newInstructionsString = newInstructionsArray.join(\"\\n\\n\");\r\n\torigDocRef.info.instructions = newInstructionsString;\r\n\r\n}", "title": "" }, { "docid": "fc739b477a5eec07e71065b852f8b6f5", "score": "0.6049723", "text": "function getValues(){\n\tel = document.getElementById(\"repourl\")\n\tset.repoaddress = el.value\n\tel = document.getElementById('repopwd')\n\tset.repopwd = el.value\n\tel = document.getElementById('repodirs')\n\tset.repodirs = el.value\n\tel = document.getElementById(\"s3key\")\n\tset.s3key = el.value\n\tel = document.getElementById(\"s3secret\")\n\tset.s3secret = el.value\n\t//el = document.getElementById('setnames')\n\tcfg.set(setname, set)\n\n}", "title": "" }, { "docid": "ef0bbd395f9cd69f9525b2f47c28818b", "score": "0.6049635", "text": "function SaveSettings()\r\n{\r\n try{\r\n function SaveSett(id)\r\n {\r\n var input = document.getElementById(id);\r\n if (!isNull(input))\r\n {\r\n var val = input.value;\r\n if (isNull(val)) { val = ''; }\r\n val = Trim(val);\r\n \r\n webphone_api.setparameter(id, val);\r\n }\r\n }\r\n \r\n SaveSett('username');\r\n SaveSett('displayname');\r\n SaveSett('proxyaddress');\r\n SaveSett('webrtcserveraddress');\r\n \r\n DisplayStatus('EVENT,Saved');\r\n \r\n } catch(err) { PutToDebugLogException(2, 'live_demo: SaveSettings', err); }\r\n}", "title": "" }, { "docid": "47269ed10c7b59899282679ac1c08235", "score": "0.60393786", "text": "function parseForm() {\n var preferences = {};\n var pref_types = [\"color\", \"flavor\", \"mouthfeel\"]; // should pick these up dynamically, eventually...\n var elements = document.getElementsByClassName('slick-current');\n for (var i = 0; i < elements.length; i++)\n preferences[pref_types[i]] = elements[i].textContent;\n return preferences;\n}", "title": "" }, { "docid": "22e7e5e903db52800ad09cd59b7c8c17", "score": "0.60390127", "text": "function saveSettings()\n{\n\tvar rawTimerMinutes = parseInt(settingsTimer.value);\n\tvar rawTimeoutMinutes = parseInt(settingsTimeout.value);\n\n\tvar timerMinutes = minutesToMilliseconds(arrangeToRange(rawTimerMinutes));\n\tvar timeoutMinutes = minutesToMilliseconds(arrangeToRange(rawTimeoutMinutes));\n\n\tif (!timerIsRunning())\n\t{\n\t\tupdateTimer(timerMinutes);\n\t}\n\n\tlocalStorage['timer-mins'] = timerMinutes;\n\tlocalStorage['timeout-mins'] = timeoutMinutes;\n\n\tplaySaveAnimation();\n}", "title": "" }, { "docid": "66ad7781a8bf5d05bbc3d5e3fe822f22", "score": "0.601523", "text": "function saveSettings() {\n settings = {\n onTop: $('#ontop-check').is(':checked'),\n openLast: $('#last-check').is(':checked'),\n saveWindow: $('#window-check').is(':checked'),\n fullScreen: $('#fullscreen-check').is(':checked'),\n restorePlay: $('#restore-play-check').is(':checked'),\n quickMenu: $('#quick-check').is(':checked'),\n hideNav: $('#nav-check').is(':checked'),\n ytSkipAds: $('#yt-skip-check').is(':checked'),\n amzSkipPreview: $('#amz-preview-check').is(':checked'),\n amzSkipRecap: $('#amz-recap-check').is(':checked'),\n amzNextEpisode: $('#amz-next-check').is(':checked'),\n nfSkipRecap: $('#nf-recap-check').is(':checked'),\n nfNextEpisode: $('#nf-next-check').is(':checked'),\n hlSkipRecap: $('#hl-recap-check').is(':checked'),\n hlNextEpisode: $('#hl-next-check').is(':checked'),\n dpSkipRecap: $('#dp-recap-check').is(':checked'),\n dpNextEpisode: $('#dp-next-check').is(':checked'),\n hmSkipRecap: $('#hm-recap-check').is(':checked'),\n hmNextEpisode: $('#hm-next-check').is(':checked'),\n themeMode: $('#choose-theme input:radio:checked').val(),\n lastStream: settings.lastStream,\n windowSizeLocation: settings.windowSizeLocation\n }\n localStorage.setItem('settings', JSON.stringify(settings))\n\n $('.service-host').each(function () {\n const id = $(this).data('id')\n const result = streamList.find(item => item.id === id)\n result.glyph = $(`#input-glyph-${id}`).val()\n result.active = $(`#check-${id}`).is(':checked')\n result.color = $(`#serv-color-${id}`).val()\n result.bgColor = $(`#serv-bg-${id}`).val()\n result.url = $(`#input-url-${id}`).val()\n })\n localStorage.setItem('streamList', JSON.stringify(streamList))\n\n $('#settings-modal').modal('hide')\n loadServices()\n applyUpdateSettings()\n}", "title": "" }, { "docid": "b734e478f78948d1f46b00791d9a7f3b", "score": "0.6008907", "text": "function saveSettingsToStorage() {\n if (systemSettings.rememberMe === 'checked') {\n localStorage.setItem(strings.STORAGE_KEY, JSON.stringify(systemSettings));\n } else {\n localStorage.removeItem(strings.STORAGE_KEY);\n }\n }", "title": "" }, { "docid": "51ca82379e80d96928eb2274acf0827c", "score": "0.6003005", "text": "function save() {\n // Update stored options\n _.each(BINDINGS, function(combo, name) {\n localStorage[name] = KEYS.getComboString(combo);\n });\n\n success('Options Saved.');\n }", "title": "" }, { "docid": "86f7b45ae16f88000f8bedb1481aa386", "score": "0.6002358", "text": "function loadSettings() {\n let input = localStorage.getItem('keyboard_input');\n settings.keyboard_input = (input === null) ? true : input === 'true';\n let notes = localStorage.getItem('keyboard_notes');\n settings.keyboard_notes = (notes === null) ? true : notes === 'true';\n let arrowNav = localStorage.getItem('arrow_nav');\n settings.arrow_nav = (arrowNav === null) ? true : arrowNav === 'true';\n let quickNav = localStorage.getItem('quick_nav');\n settings.quick_nav = (quickNav === null) ? false : quickNav === 'true';\n let errors = localStorage.getItem('show_errors');\n settings.show_errors = (errors === null) ? true : errors === 'true';\n let removeNotes = localStorage.getItem('auto_remove_notes');\n settings.auto_remove_notes = (removeNotes === null) ? true : removeNotes === 'true';\n}", "title": "" }, { "docid": "69a49652ee77039ded35d9184c589ced", "score": "0.60003245", "text": "function save(callback) {\n // example: select elements with class=value and build settings object\n const obj = {};\n $('.value').each(function () {\n const $this = $(this);\n if (savedSettings.indexOf($this.attr('id')) === -1) return;\n if ($this.hasClass('validate') && $this.hasClass('invalid')) {\n showMessage('Invalid input for ' + $this.attr('id'), _('Error'));\n return;\n }\n if ($this.attr('type') === 'checkbox') {\n obj[$this.attr('id')] = $this.prop('checked');\n } else {\n obj[$this.attr('id')] = $this.val();\n }\n });\n callback(obj);\n}", "title": "" }, { "docid": "eebca8db6b876b92659df2c4a1ba3f2b", "score": "0.5999797", "text": "function save_options() {\n\t\tvar status = document.getElementById('status');\n\t\tvar options = {\n\t\t\treplaceWysiwyg: document.getElementById('replaceWysiwyg').checked,\n\t\t\tfontSizeWysiwyg: +document.getElementById('fontSizeWysiwyg').value,\n\t\t\tminHeightWysiwyg: +document.getElementById('minHeightWysiwyg').value,\n\t\t\tmaxHeightWysiwyg: +document.getElementById('maxHeightWysiwyg').value,\n\t\t\texpand: document.getElementById('expand').checked,\n\t\t\tremoveLazyLoading: document.getElementById('removeLazyLoading').checked,\n\t\t\tmyWorkEnhancement: document.getElementById('myWorkEnhancement').checked,\n\t\t\thighlightId: document.getElementById('highlightId').checked,\n\t\t\tshowPullRequestInfo: document.getElementById('showPullRequestInfo').checked,\n\t\t\tshowCopyLinkToClipboard: document.getElementById('showCopyLinkToClipboard').checked,\n\t\t\tshowCopyListOfStories: document.getElementById('showCopyListOfStories').checked,\n\t\t\ttemplateForRelease: document.getElementById('templateForRelease').value,\n\t\t\ttemplateForReview: document.getElementById('templateForReview').value,\n\t\t\ttemplateForBacklog: document.getElementById('templateForBacklog').value,\n\t\t};\n\n\t\tchrome.storage.sync.set({ options: options });\n\n\t\tstatus.textContent = 'Options saved.';\n\t\tsetTimeout(function () {\n\t\t\tstatus.textContent = '';\n\t\t}, 750);\n\t}", "title": "" }, { "docid": "ee688dd28257ef3b611acc71556fefe0", "score": "0.59987676", "text": "function saveNewsSettings() {\r\n\tif (feedPanels[newsMode] != null) {\r\n\t\tstoreSelectedAsUserData(feedPanels[newsMode].id_select1, feedPanels[newsMode].cookie_select1);\r\n\t\tstoreSelectedAsUserData(feedPanels[newsMode].id_select2, feedPanels[newsMode].cookie_select2);\r\n\t}\r\n\tsaveKeyWord();\r\n}", "title": "" }, { "docid": "fb13ba5694b50da53158d16d6bb8216d", "score": "0.59912986", "text": "function get_form_data() {\n\t/**\n\t * @type Int Loop counter\n\t */\n\tvar i = 0,\n\t\t/**\n\t\t * @type String The key for the current LocalStorage entry\n\t\t */\n\t\tkey,\n\t\t/**\n\t\t * @type String The value for the current LocalStorage entry\n\t\t */\n\t\tvalue;\n\n\tfor (i = 0; i < localStorage.length; i++) {\n\t\tkey = localStorage.key(i);\n \tvalue = localStorage[key];\n\n\t\tif ($('#' + key).is(':checkbox, :radio')) {\n\t\t\tif ($('#' + key).val() == value) {\n\t\t\t\t$('#' + key).attr('checked', 'checked');\n\t\t\t} else {\n\t\t\t\t$('#' + key).removeAttr('checked');\n\t\t\t\t//restore the proper value\n\t\t\t\tvalue = $('#' + key).val();\n\t\t\t}\n\t\t}\n\n\t\t$('#' + key).val(value);\n\t}\n\n\t//now that it is loaded, remove localStorage\n\tlocalStorage.clear();\n}", "title": "" }, { "docid": "6bcefc5fcb3b849dd67fd91d4922ef18", "score": "0.59909976", "text": "loadSettings(){\n let template = `<div id=\"settings\">\n\n <div class=\"title\">User Account:</div>\n\n <div id=\"account\">\n <label for=\"user\">Username:</label><input id=\"user\" name=\"user\" placeholder=\"username\"></input>\n <label for=\"pass\">Password:</label><input id=\"pass\" name=\"pass\" type=\"password\" placeholder=\"password\"></input>\n </div>\n\n\n <div class=\"title\">Details:</div>\n\n <div id=\"details\">\n <label for=\"dep\">Department:</label><input id=\"dep\" name=\"dep\" placeholder=\"Department (ITM,IRM,ABA ..)\"></input>\n <label for=\"year\">Year:</label><input id=\"year\" name=\"year\" placeholder=\"Year\"></input>\n <label for=\"group\">Group:</label><input id=\"group\" name=\"group\" placeholder=\"Group\"></input>\n </div>\n\n <div class=\"title\">Default Page:</div>\n <div id=\"default_page\">\n Which default Page should the App load?\n <form>\n <select id=\"defpage\" aria-label=\"Choose the default page for this application\">\n <option value=\"-\">-</option>\n <option value=\"Schedule\">Schedule</option>\n <option value=\"Schedule\">Marks</option>\n <option value=\"Schedule\">Exams</option>\n </select>\n </form>\n </div>\n\n <button id=\"ok\">Save</button>\n <button id=\"reset\">Reset</button>\n \n </div>`\n\n let wrapper = document.querySelector('#wrapper');\n wrapper.innerHTML = template;\n\n this.addEventListeners();\n }", "title": "" }, { "docid": "b0f5c8bb5c09749b64b309658c93ffba", "score": "0.59855014", "text": "_saveSettings(settings = null) {\n if (settings == null) {\n settings = this.settings.toJS();\n }\n ss.set(\"settings_v4\", this._replaceDefaults(\"saving\", settings));\n }", "title": "" }, { "docid": "58f93337b57475aa3619a19d354ddb96", "score": "0.59811324", "text": "function loadForm()\n\t{\n\t\tvar locale = Flink.Locale.say(\"*\");\n\n\t\tFlink.request({\n\t\t\turl: Flink.settings.path.templates + \"/preferences.html\"\n\t\t\t, success: function(response) {\n\t\t\t\tcontent = response;\n\t\t\t\tcontent = Render(locale, content);\t\t\t\t\n\t\t\t\tFlink.Frame.setMain(content);\n\n\t\t\t\t// register form\n\t\t\t\tform = document.getElementById(\"flink-form-preferences\");\n\n\t\t\t\t// load options for select-element\n\t\t\t\tvar elm, options, values = {\n\t\t\t\t\t\"select-element\": Flink.settings.design.elements\n\t\t\t\t\t, \"select-lang\": Flink.settings.locale.langs\n\t\t\t\t\t, \"select-action\": Flink.settings.design.actions\n\t\t\t\t};\n\n\t\t\t\t// load select options\t\n\t\t\t\tfor(var i=0; i<form.elements.length; i++) {\n\t\t\t\t\telm = form.elements[i];\n\t\t\t\t\tif (elm.type===\"select-one\") {\n\t\t\t\t\t\toptions = values[elm.getAttribute(\"data-options\")];\n\t\t\t\t\t\tloadSelect(elm, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// load current values to form\n\t\t\t\tloadValues();\n\n\t\t\t\t// click button reset\n\t\t\t\tdocument.getElementById(\"flink-form-preferences-reset\")\n\t\t\t\t\t.addEventListener(\"click\", function(){\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tlocation.href=location.href;\n\t\t\t\t\t});\n\n\t\t\t\t// click button apply/save\n\t\t\t\tdocument.getElementById(\"flink-form-preferences-apply\")\n\t\t\t\t\t.addEventListener(\"click\", function(){\n\t\t\t\t\t\tsave({\n\t\t\t\t\t\t\tstart: this.form.start.value\n\t\t\t\t\t\t\t, lang: this.form.lang.value\n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "58f93337b57475aa3619a19d354ddb96", "score": "0.59811324", "text": "function loadForm()\n\t{\n\t\tvar locale = Flink.Locale.say(\"*\");\n\n\t\tFlink.request({\n\t\t\turl: Flink.settings.path.templates + \"/preferences.html\"\n\t\t\t, success: function(response) {\n\t\t\t\tcontent = response;\n\t\t\t\tcontent = Render(locale, content);\t\t\t\t\n\t\t\t\tFlink.Frame.setMain(content);\n\n\t\t\t\t// register form\n\t\t\t\tform = document.getElementById(\"flink-form-preferences\");\n\n\t\t\t\t// load options for select-element\n\t\t\t\tvar elm, options, values = {\n\t\t\t\t\t\"select-element\": Flink.settings.design.elements\n\t\t\t\t\t, \"select-lang\": Flink.settings.locale.langs\n\t\t\t\t\t, \"select-action\": Flink.settings.design.actions\n\t\t\t\t};\n\n\t\t\t\t// load select options\t\n\t\t\t\tfor(var i=0; i<form.elements.length; i++) {\n\t\t\t\t\telm = form.elements[i];\n\t\t\t\t\tif (elm.type===\"select-one\") {\n\t\t\t\t\t\toptions = values[elm.getAttribute(\"data-options\")];\n\t\t\t\t\t\tloadSelect(elm, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// load current values to form\n\t\t\t\tloadValues();\n\n\t\t\t\t// click button reset\n\t\t\t\tdocument.getElementById(\"flink-form-preferences-reset\")\n\t\t\t\t\t.addEventListener(\"click\", function(){\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tlocation.href=location.href;\n\t\t\t\t\t});\n\n\t\t\t\t// click button apply/save\n\t\t\t\tdocument.getElementById(\"flink-form-preferences-apply\")\n\t\t\t\t\t.addEventListener(\"click\", function(){\n\t\t\t\t\t\tsave({\n\t\t\t\t\t\t\tstart: this.form.start.value\n\t\t\t\t\t\t\t, lang: this.form.lang.value\n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "259467f8bc96c6e07b1c128206d95bf1", "score": "0.5968411", "text": "function applySavedSettings(){\n turnOnOffModules();\n $('#eamOrg').selectpicker('val', $('#eamOrgSaved').val());\n $('#wrWo').prop('checked', $('#wrWoSaved').is(':checked'));\n $('#assetLocation').val($('#assetLocationSaved').val());\n $('#owningDept').val($('#owningDeptSaved').val());\n applyFilters();\n}", "title": "" }, { "docid": "cffd7c3726e00d231a83fc4612fe473b", "score": "0.5967386", "text": "function saveState() {\n localStorage.setItem(\"savedInput\", inputBox.value);\n localStorage.setItem(\"savedSliderValue\", slider.value);\n}", "title": "" }, { "docid": "78c66f091c0a9eebbcbddf18cac9bac2", "score": "0.596416", "text": "function save_options() {\n var ms_style_output = $('#ms_style_output').is(\":checked\");\n var limit_num_qtr = $('#limit_num_qtr').is(\":checked\");\n chrome.storage.local.set({\n ms_style_output: ms_style_output,\n limit_num_qtr: limit_num_qtr\n }, function() {\n chrome.runtime.reload();\n });\n}", "title": "" }, { "docid": "489604275aae6f63744305a610dc4941", "score": "0.5961634", "text": "function saveSettings(e) {\n e.preventDefault();\n updateRulesFromUI();\n\n var rules_str = JSON.stringify(rules);\n console.log(\"saveSettings, rules: \" + rules_str);\n var options = {\n\trules: rules_str\n }\n browser.storage.local.set(options);\n}", "title": "" }, { "docid": "de8cce6afd5cf3838a664ce7c55693fd", "score": "0.5945193", "text": "function save() {\n\t\t\tvm.successMessage = '';\n\t\t\tvm.errorMessage = '';\n\n\t\t\tAdminAppSettingsFactory.saveSettings(vm.transferInfo).then(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tvm.successMessage = 'Transfer was successful';\n\t\t\t\t\t\tvm.transferInfo.monthlyLimit = '';\n\t\t\t\t\t\tvm.transferInfo.oneTimePointsLimit = '';\n\t\t\t\t\t\tvm.settingsForm.$setPristine();\n\t\t\t\t\t\tvm.settingsForm.$setUntouched();\n\t\t\t\t\t\tgetKarmaLimits();\n\t\t\t\t\t}, function() {\n\t\t\t\t\t\tvm.errorMessage = 'Transfer failed';\n\t\t\t\t\t\tvm.transferInfo.monthlyLimit = '';\n\t\t\t\t\t\tvm.transferInfo.oneTimePointsLimit = '';\n\t\t\t\t\t\tvm.settingsForm.$setPristine();\n\t\t\t\t\t\tgetKarmaLimits();\n\t\t\t\t\t})\n\t\t}", "title": "" }, { "docid": "9f331a3ebd85020702e06d4ec3db7d05", "score": "0.59418", "text": "function saveOptions() {\n if (settings.enableAgentConfiguration && isSSOValid()) {\n var newSettings = getOptionsFormValues();\n saveButton.textContent = chrome.i18n.getMessage('optionsSaving');\n\n settingsHelper.saveSettings(newSettings, function () {\n settings = Object.assign(settings, newSettings);\n setTimeout(function () {\n // Update status to let user know options were saved.\n saveButton.disabled = true;\n saveButton.textContent = chrome.i18n.getMessage('optionsSave');\n ssoError.innerHTML = '';\n }, 500);\n });\n }\n }", "title": "" }, { "docid": "b28fa9ad33f941fa2bf4d68467ce11cb", "score": "0.59326863", "text": "showSettings() {\n this.el.storageSelect.value = this.settings.storage;\n this.el.themeSelect.value = this.settings.theme;\n }", "title": "" }, { "docid": "5d438b0f108f7ea7d3646b87c67d905d", "score": "0.5922908", "text": "function setValues( values ) {\n\t\tsetCheckboxesFromArray( 'enabled', values.enabledTools );\n\t\tsetCheckboxesFromArray( 'phpcs-standards', values.phpcsStandards );\n\t\tsetCheckboxesFromArray( 'phpmd-rulesets', values.phpmdRulesets );\n\t\t$dialog.find( 'input[ name=\"php_location\" ]' ).val( values.PHPLocation );\n\t}", "title": "" }, { "docid": "88b3d68ccbb388a923fa8a1dfb481bc0", "score": "0.5921367", "text": "function save_options() {\n\tvar setter = {};\n\t\n\t checkList.forEach(function(entry){\n\t\t setter[entry] = document.getElementById(entry).checked;\n\t });\n\n\tchrome.storage.sync.set(setter, function() {\n\t\tconsole.log(\"Saved Setting\");\n\t\tchrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\t\t chrome.tabs.sendMessage(tabs[0].id, {resetGazer: true}, function(response) {\n\t\t\tconsole.log(\"Reset Gazer Sent\");\n\t\t });\n\t\t});\n\t });\n\t \n\t \n}", "title": "" }, { "docid": "9d456e033a9658d58f98566c39429364", "score": "0.5916605", "text": "settings() {\n // load the settings into the fields and show\n this.suiteView.displaySettings(false);\n }", "title": "" }, { "docid": "0410d1e616603dccd58fb4bff2bce245", "score": "0.59159863", "text": "function _onSaveSettings() {\n\tfor (var key in _oSettingsMap) {\n\t\tvar setting = _oSettingsMap[key];\n\t\tvar oDataToSendToSDK = {};\n\t\tif (_isSettingHasChanged(setting)) {\n\t\t\tsetting.settingValue = _getUISettingValue(setting);\n\t}\n\t\toDataToSendToSDK[setting.sdkEventDataName] = setting.settingValue;\n\t\tsendEventToSDK(setting.sdkEventName, oDataToSendToSDK);\n\t}\n\t_leaveSettingsPage();\n}", "title": "" }, { "docid": "90f285db77fff4188a8537e68792fce3", "score": "0.59145164", "text": "function getSaved()\n {\n chrome.storage.local.get(['n_inCtrl', 'n_overlay', 'n_last_engine'], function(result) {\n\n // if firsttime and it as options has not been set\n if(result.n_inCtrl == undefined && result.n_overlay == undefined && result.n_last_engine == undefined)\n {\n \n chrome.storage.local.set({n_inCtrl: 'B', n_overlay : 1, n_last_engine: 'inext-ch-google'}, function() {\n \n });\n } else \n\n {\n // set the values \n\n document.getElementById('inCtrl').value = result.n_inCtrl;\n document.getElementById('inOverlay').value = result.n_overlay;\n \n\n\n }\n });\n }", "title": "" }, { "docid": "9b15c4f6e1e7c26521a4466ac436c9c9", "score": "0.58936304", "text": "function submit() {\n if (settings) {\n // mozSettings does not support multiple keys in the cset object\n // with one set() call,\n // see https://bugzilla.mozilla.org/show_bug.cgi?id=779381\n var lock = settings.createLock();\n for (var i = 0; i < fields.length; i++) {\n var input = fields[i];\n var cset = {};\n var key = input.dataset.setting;\n cset[key] = input.value;\n lock.set(cset);\n }\n }\n }", "title": "" }, { "docid": "db321cd590bc8372e0c5aff351fe2f98", "score": "0.58897525", "text": "function save_options(){\n // Save the always active mode selection\n browser.storage.local.set({\n alwaysActive: document.querySelector(\"#always-active\").checked\n });\n\n // Save the timed selections\n browser.storage.local.set({\n start: document.querySelector(\"#start-time\").value\n });\n browser.storage.local.set({\n end: document.querySelector(\"#end-time\").value\n });\n}", "title": "" }, { "docid": "098410c8bc0b08bd94a4a566ce00ab15", "score": "0.58863175", "text": "function input_set() {\n let form_data = get_form_data($(Wizard.settings.elements.form));\n input = $.extend(true, input, form_data);\n\n for (let key in input) {\n if ($.isEmptyObject(input[key])) {\n delete input[key];\n }\n }\n\n // store the input as a cookie if localStorage not available\n if (!window.localStorage) {\n Cookies.set(cookie_name_inputs, JSON.stringify(input));\n } else {\n localStorage.setItem(cookie_name_inputs, JSON.stringify(input));\n }\n }", "title": "" }, { "docid": "ee03e4d18dc804d309d0957a3f3f4c2d", "score": "0.58862364", "text": "function handleSettings() {\n // Show the settings window\n Dialogs.showModalDialogUsingTemplate(Mustache.render(mainDialog, systemSettings), false);\n // Get an instance to register handlers \n var $dlg = $(\".eng1003setting-dialog.instance\");\n $dlg.find(\".dialog-button[data-button-id='cancel']\").on(\"click\", handleCancel);\n $dlg.find(\".dialog-button[data-button-id='ok']\").on(\"click\", handleOk);\n\n // Call the server to populate assignments list.\n populateAssignments();\n \n // Call the server again if the server setting changes.\n $dlg.find('#server').focusout(populateAssignments);\n \n // if the user hits the cancel, this function closes the settings window\n function handleCancel() {\n Dialogs.cancelModalDialogIfOpen(\"eng1003setting-dialog\");\n }\n\n // if the user selects the UPLOAD button, \n function handleOk() {\n // Data validation\n var $dlg = $(\".eng1003setting-dialog.instance\");\n systemSettings.server = $dlg.find(\"#server\").val();\n if (systemSettings.server === '') {\n\n Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, \"ENG1003 Uploader\", strings.SERVER_NOT_FOUND);\n return;\n }\n systemSettings.teamDir = $dlg.find(\"#teamDir\").val();\n if (systemSettings.teamDir === '') {\n\n Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, \"ENG1003 Uploader\", strings.TEAM_NOT_FOUND);\n return;\n }\n systemSettings.userName = $dlg.find(\"#userName\").val();\n if (systemSettings.userName === '') {\n\n Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, \"ENG1003 Uploader\", strings.USER_NOT_FOUND);\n return;\n }\n // No need to show the settings window again\n firstRun = false;\n systemSettings.updateTeamDir = $dlg.find(\"#updateTeamDir:checked\").val();\n systemSettings.updateUserDir = $dlg.find(\"#updateUserDir:checked\").val();\n systemSettings.rememberMe = $dlg.find(\"#rememberMe:checked\").val();\n systemSettings.assignment = $dlg.find(\"#assignment\").val();\n //Save/Remove Settings to Local Storage\n saveSettingsToStorage();\n //Upload the Document\n uploadCurrentDocument();\n //Close the currnet Window\n Dialogs.cancelModalDialogIfOpen(\"eng1003setting-dialog\");\n }\n }", "title": "" }, { "docid": "2a65b7529376fe52e9a1cc08ebd29378", "score": "0.58836037", "text": "function saveUserSettings() {\n let ns = Connector.getNamespace().toLowerCase();\n if (_this.isLocalStorage) {\n let us = JSON.parse(localStorage.userSettings || '{}');\n us[ns] = _this.settings;\n localStorage.userSettings = JSON.stringify(us);\n } else {\n let us = JSON.parse(sessionStorage.userSettings || '{}');\n us[ns] = _this.settings;\n sessionStorage.userSettings = JSON.stringify(us);\n }\n }", "title": "" }, { "docid": "c801be0d2bf911ecee5914625bfb3e70", "score": "0.5881291", "text": "function saveParameters(){\n var newSettings = {\n attributeCount : document.getElementById('attributeCount').value,\n resistanceLevel: document.getElementById('resistanceLevel').value,\n attributeWeightIncrement: document.getElementById('attributeWeightIncrement').value,\n decayTime : document.getElementById('decayTime').value,\n decayTimeMultiplier : document.getElementById('decayTimeMultiplier').value,\n numSampledAttributes : document.getElementById('numSampledAttributes').value\n };\n\n var radios = document.getElementsByName('primingMethod');\n for (var i = 0; i < radios.length; i++) {\n if(radios[i].checked){\n newSettings.primingMethod = radios[i].value;\n }\n }\n\n var radios2 = document.getElementsByName('attributeWeightRep');\n for (var i = 0; i < radios2.length; i++) {\n if(radios2[i].checked){\n newSettings.attributeWeightRep = radios2[i].value;\n }\n }\n\n var radios3 = document.getElementsByName('attributeWeightRep');\n for (var i = 0; i < radios3.length; i++) {\n if(radios3[i].checked){\n newSettings.weightDirstibution = radios3[i].value;\n }\n }\n\n ipcRenderer.send('hideSettings', newSettings);\n}", "title": "" }, { "docid": "cb301fa1c1badfa5b45198fd118af539", "score": "0.5881075", "text": "function saveSettings() {\n var cookieData = JSON.stringify(_settings);\n\n Cookies.set(COOKIENAME, cookieData, { expires: COOKIEEXPIRES });\n }", "title": "" }, { "docid": "ffde28175123d25458b5301aec5efff8", "score": "0.5880676", "text": "function retrieveSettings() {\n\t//set default subreddits\n\t//in firefox not defined item is null not 'undefined' like in chrome -_- \n\tif ('undefined' == typeof localStorage['settings'] || null == localStorage['settings']) {\n\t\tlocalStorage.setItem('settings', JSON.stringify(Settings));\n\t} else {\n\t\tSettings = JSON.parse(localStorage.getItem('settings'));\n\t}\n}", "title": "" }, { "docid": "65f87bfc1b051afc91dd8b9d817a0652", "score": "0.5877134", "text": "function saveForm() {\n\n /*values are read from input*/\n contactBook[idButton].name = inputName.value\n contactBook[idButton].email = inputEmail.value\n contactBook[idButton].phone = inputPhone.value\n contactBook[idButton].address.city = inputAddress.value\n contactBook[idButton].company.name = inputCompany.value\n contactBook[idButton].website = inputWebsite.value\n \n console.log(localStorage.setItem('contact', JSON.stringify(contactBook)));\n window.location.reload(alert(\"Контакт изменен\"))\n }", "title": "" }, { "docid": "d0d0fb41cd1bb40b04ec13e2c6df3570", "score": "0.5874101", "text": "function restore_options() {\n if (! localStorage[\"server\"]) {\n\t document.getElementById(\"server\").value = \"localhost\";\n\t document.getElementById(\"port\").value = \"9123\";\n\t document.getElementById(\"password\").value = \"\";\n\t return;\n }\n \n document.getElementById(\"server\").value = localStorage[\"server\"];\n document.getElementById(\"port\").value = localStorage[\"port\"];\n document.getElementById(\"password\").value = localStorage[\"password\"];\n \n}", "title": "" }, { "docid": "b6b982ab2657e1d0ac6f0f658d16a3f7", "score": "0.58670765", "text": "function displaySettings() {\n let checked = [\"showText\"];\n for (let i = 0; i < checked.length; i++) {\n document.getElementById(checked[i]).checked = store.get(checked[i]);\n }\n let numTxt = [\"text\"];\n for (let i = 0; i < numTxt.length; i++) {\n document.getElementById(numTxt[i]).value = store.get(numTxt[i]);\n }\n}", "title": "" }, { "docid": "45d722b0fe31fec64aecf5691cd2b564", "score": "0.58669955", "text": "function scriptUpdateGuiFromSettings() {\n if (!scriptVariables.displayInitialized) return;\n\n Object.keys(scriptSettings).forEach(function(key,index) {\n if (typeof scriptSettings[key] === 'object') {\n for (let i = 0; i < scriptSettings[key].length; i++) {\n document.getElementById('scriptsetting-'+key+'-'+i)[(typeof scriptSettings[key][i] === \"number\" ? \"value\" : \"checked\")] = scriptSettings[key][i];\n }\n } else {\n document.getElementById('scriptsetting-'+key)[(typeof scriptSettings[key] === \"number\" ? \"value\" : \"checked\")] = scriptSettings[key];\n }\n });\n}", "title": "" }, { "docid": "763bc6d1933bb8b2730b4ce048c20dfd", "score": "0.5866286", "text": "function PresetFormSettings(settings) {\n var self = this;\n self._settings = settings;\n }", "title": "" }, { "docid": "25cd4b7dae125ff38edc7daa4bc7c350", "score": "0.58658916", "text": "function save() {\n\tconst inp = document.getElementById(\"newsetname\")\n\tif (inp.style.display == \"inline\") {\n\t\tsetname = inp.value\n\t}\n\tif (setname) {\n\t\tset.name = setname\n\t\tcfg.set(\"set\", setname)\n\t\tgetValues()\n\t\ttoggle()\n\t\tsetValues()\n\t\tinp.value = \"\"\n\t\tinp.style.display = \"none\"\n\t} else {\n\t\talert(\"Please enter a name for this backup profile\")\n\t\tinp.focus()\n\t}\n}", "title": "" }, { "docid": "cf1c9f89b08d497a4c9d3c4789a8896f", "score": "0.58615154", "text": "function save(callback) {\n // example: select elements with class=value and build settings object\n var obj = {};\n $('.value').each(function () {\n var $this = $(this);\n if ($this.attr('type') === 'checkbox') {\n obj[$this.attr('id')] = $this.prop('checked');\n } else {\n obj[$this.attr('id')] = $this.val();\n }\n });\n if (obj.url.indexOf(\"://\") == -1) {\n obj.url = \"http://\" + obj.url\n }\n if (obj.hostip.indexOf(\"://\") == -1) {\n obj.hostip = \"http://\" + obj.hostip\n }\n callback(obj);\n}", "title": "" }, { "docid": "f87a62ec0d826c7c60f7812f9834e452", "score": "0.58604693", "text": "function getOptimizerSettingsFromForm(){\r\n\t\t//var daysOff = document.forms[0].daysOffForm;\r\n\t\tif ($('input[id=maxDays]').val()!=''){\r\n\t\t\twindow.bidit_globals.g_optimizeData[window.bidit_globals.g_currSemester][\"maxDays\"] = $('input[id=maxDays]').val();\r\n\t\t}\r\n\r\n\t\tif ($('input[id=afterHour]').val()!=''){\r\n\t\t\twindow.bidit_globals.g_optimizeData[window.bidit_globals.g_currSemester][\"minHour\"] = $('input[id=afterHour]').val().toString();\r\n\t\t}\r\n\r\n\t\tif ($('input[id=beforeHour]').val()!=''){\r\n\t\t\twindow.bidit_globals.g_optimizeData[window.bidit_globals.g_currSemester][\"maxHour\"] = $('input[id=beforeHour]').val().toString();\r\n\t\t}\r\n\r\n\t\tif ($('input[id=examsGap]').val()!=''){\r\n\t\t\twindow.bidit_globals.g_optimizeData[window.bidit_globals.g_currSemester][\"examsGap\"] = $('input[id=examsGap]').val();\r\n\t\t}\r\n\r\n\r\n\r\n\t}", "title": "" }, { "docid": "491ddff9db10a0988e8b1ff775d79f09", "score": "0.5853428", "text": "function save_options() {\n\n var client_id = document.getElementById(\"client_id\").value.toString();\n localStorage[\"client_id\"] = client_id+\"\";\n var secret = document.getElementById(\"secret\").value.toString();\n localStorage[\"secret\"] = secret+\"\";\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 950);\n}", "title": "" } ]
fc9681e19860b1d5d824929b1f448930
the consrucer is over here
[ { "docid": "9d293e3a95846ccb6c0e0f22d6dd64be", "score": "0.0", "text": "function BodyComponent(http) {\n this.http = http;\n // get the club id\n // add some videos\n this.equialslideconfigNumber = 1; // Change here for front end control variable\n this.slideConfig = { \"slidesToShow\": this.equialslideconfigNumber, \"slidesToScroll\": this.equialslideconfigNumber, \"autoplay\": true, \"autoplaySpeed\": 4000, \"pauseOnHover\": false, \"variableWidth\": true };\n this.ShowMoreImageSliders = true;\n this.ShowCallToAction = false;\n }", "title": "" } ]
[ { "docid": "532a66db437937b1c5e25179b89b3dcb", "score": "0.58032525", "text": "function _beeswarm() {}", "title": "" }, { "docid": "10d5627078b78749ec09d72a3aae1520", "score": "0.5799039", "text": "function() {\n\t\t//...\n\t}", "title": "" }, { "docid": "a3a03b5748291f6904a18a35932d5ac9", "score": "0.57906574", "text": "colonyEnd() {\n\t}", "title": "" }, { "docid": "692c2ecffddda755b3d35bf7f7cdc31a", "score": "0.5746103", "text": "function Cauldron() {}", "title": "" }, { "docid": "87998730a828ee7f8050af815a4046f3", "score": "0.5564463", "text": "Oiffy () { if (!this.settings.iocccok) this.Eioccc(); this.Fpass(); this.ignoreon(); }", "title": "" }, { "docid": "255592ec516d37740c1bb01fe457cf43", "score": "0.5531879", "text": "function __bRsBIa0_bqDi8hIGe5YJ9Ww(){}", "title": "" }, { "docid": "8aa5feafbdd49ffb33833ce38868c0c7", "score": "0.54974866", "text": "function chaning() {\n\n}", "title": "" }, { "docid": "1c15b63cf65f6d8b0853e2b9a1ba4f6e", "score": "0.5485099", "text": "function hc(){}", "title": "" }, { "docid": "1c15b63cf65f6d8b0853e2b9a1ba4f6e", "score": "0.5485099", "text": "function hc(){}", "title": "" }, { "docid": "79e75f3255ba93f5015a28971728be70", "score": "0.5472459", "text": "prepare() {\n\n\t}", "title": "" }, { "docid": "22495c668e66b783acc5d3fd2919d29d", "score": "0.54282266", "text": "__previnit(){}", "title": "" }, { "docid": "50ade5d3e622801b058d4271f7805030", "score": "0.5330508", "text": "function inizio_gioco() {\n\t\n}", "title": "" }, { "docid": "fd755a0c9044d856b7ad45c88fd886b1", "score": "0.5322288", "text": "function es_isCrushed() {}", "title": "" }, { "docid": "367e9e1c0f4ef7259f8d24067a4b93f0", "score": "0.5290765", "text": "postinit() {}", "title": "" }, { "docid": "f8fa4b30fab5f8cec8a2e6ab2616e2c4", "score": "0.5275092", "text": "function cb() {}", "title": "" }, { "docid": "dff228621940d716f0e7460bf8561881", "score": "0.5253823", "text": "static manages() { return false; }", "title": "" }, { "docid": "84d3aa891f92ad019ffb5cd75d616ce7", "score": "0.5245971", "text": "propagate() { }", "title": "" }, { "docid": "509ce1fdf23355e2b2b98770b8aacec6", "score": "0.5226631", "text": "function doCons () {\n\t\t\tconsole.log('do cons');\n\t\t\tif (head === 'outputs') {\n\t\t\t\tvar pos, i = 0;\n\t\t\t\twhile ((pos = nodeIds.indexOf(head + '-' + i)) > -1) {\n\t\t\t\t\tbuildInputConnections($scope.nodes[pos]);\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbuildInputConnections($scope.nodes[nodeIds.indexOf(head)]);\n\t\t}", "title": "" }, { "docid": "da01933f6cf64c21ae7038a82fba0a17", "score": "0.5177822", "text": "function Se(){}", "title": "" }, { "docid": "34b42e6b63edc9f21c643d3ecc8aa19e", "score": "0.5172162", "text": "function Mechanism() {}", "title": "" }, { "docid": "34b42e6b63edc9f21c643d3ecc8aa19e", "score": "0.5172162", "text": "function Mechanism() {}", "title": "" }, { "docid": "36890dddeeff7a888f47815cf2acb965", "score": "0.5171532", "text": "_consumedBy() {\n throw 'todo';\n }", "title": "" }, { "docid": "26d01f616f6baccfcd7960ea24b0e3c5", "score": "0.5157428", "text": "conclude() {\n //lower count by one\n global.Archivist.setNumContractors(this.room, global.Archivist.getNumContractors(this.room) - 1);\n delete this.memory.generation;\n }", "title": "" }, { "docid": "b2d1de6f9afdf22749b5de03e5531687", "score": "0.5146201", "text": "BCS() { if (this.C) this.PC = this.checkBranch_(this.MP); }", "title": "" }, { "docid": "3aebd98f9e4590985fc8ee500b625ac0", "score": "0.51289284", "text": "function worthless(){}", "title": "" }, { "docid": "d63972b6c215b4730b68eea47d4e6e18", "score": "0.51066434", "text": "function krumo() {\n }", "title": "" }, { "docid": "129a83bac1a9c65d7bb3abea96d3fa92", "score": "0.5102818", "text": "conflicts() {}", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.5092198", "text": "prepare() { }", "title": "" }, { "docid": "782624b76deb27ac70f5629fc14244f2", "score": "0.5058851", "text": "createcarad(data,token){cov_2atr3rujo8.f[4]++;//console.log(\"tokenmodel\"+token);\nconst reflection=(cov_2atr3rujo8.s[16]++,_user.default.reflections.find(reflect=>{cov_2atr3rujo8.f[5]++;cov_2atr3rujo8.s[17]++;return reflect.token===token;}));cov_2atr3rujo8.s[18]++;if(!reflection){cov_2atr3rujo8.b[3][0]++;const reflectioncaraddnotfound=(cov_2atr3rujo8.s[19]++,{\"status\":404,\"message\":\"User not found check please\"});//console.log(\"cccccccccc\"+reflectioncaraddnotfound);\ncov_2atr3rujo8.s[20]++;return reflectioncaraddnotfound;}else{cov_2atr3rujo8.b[3][1]++;//console.log(\"found=\"+reflection.email);\nconst newReflectioncreatecarad=(cov_2atr3rujo8.s[21]++,{id:_uuid.default.v4(),user_id:reflection.id,email:reflection.email,manufacture:data.manufacture,model:data.model,price:parseFloat(data.price),state:data.state,status:(cov_2atr3rujo8.b[4][0]++,data.status)||(cov_2atr3rujo8.b[4][1]++,'available'),created_on:_moment.default.now(),modified_on:_moment.default.now()});cov_2atr3rujo8.s[22]++;this.reflectionscreatecaradd.push(newReflectioncreatecarad);cov_2atr3rujo8.s[23]++;return newReflectioncreatecarad;}}", "title": "" }, { "docid": "e279dd2b220f482c021d75bafe0df782", "score": "0.50523615", "text": "BCC() { if (!this.C) this.PC = this.checkBranch_(this.MP); }", "title": "" }, { "docid": "0ae6771567ab62fe771e51bbccc5a164", "score": "0.5046891", "text": "checkDeadlines() {\n \n }", "title": "" }, { "docid": "e6ba53e5d272bd62b07a3690d1b7ef85", "score": "0.50436497", "text": "function cont(){\n push(arguments);\n consume = true;\n }", "title": "" }, { "docid": "2dd161a07dac88db559d6f376f5de412", "score": "0.5040693", "text": "isBalanced() {\n return;\n }", "title": "" }, { "docid": "2642f67ed3e5037564df9352d3faa6b5", "score": "0.5038007", "text": "function BossGenerate() {\n\t\n}", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.5037864", "text": "function init() { \n \n }", "title": "" }, { "docid": "cd4ef6e3f0298f1f87304b6c47de9e99", "score": "0.50286293", "text": "function isCrushed () {\n }", "title": "" }, { "docid": "20924f7c22a802dfa6011b200bc17b7d", "score": "0.50253737", "text": "function CFsqc0GjlTKl11x0SjZu8g(){}", "title": "" }, { "docid": "b6e812c21d652271d72daf30023defe7", "score": "0.50129426", "text": "function SEA () {}", "title": "" }, { "docid": "5f1e903a374c4d1b645ffa0d1364485f", "score": "0.5011897", "text": "preinit() {}", "title": "" }, { "docid": "ba2bf96cab72cceb44e51667b5470b41", "score": "0.50101703", "text": "prepare() {\n }", "title": "" }, { "docid": "66cc268d101d1c9c287ddf04148c8972", "score": "0.50025755", "text": "function cb_ready(err, cc){\n\t//response has chaincode functions\n //app1.setup(ibc, cc);\n //app2.setup(ibc, cc);\n\t// if the deployed name is blank, then chaincode has not been deployed\n\tif(cc.details.deployed_name === \"\"){\n cc.deploy('init', ['99'], null, cb_deployed);\n \t}\n \telse{\n \t\tconsole.log('chaincode summary file indicates chaincode has been previously deployed');\n cb_deployed();\n\t}\n}", "title": "" }, { "docid": "9b8b2974dc61ffdeddeb022d3df07a20", "score": "0.4998633", "text": "function colisaoBalaoEspinho(){}", "title": "" }, { "docid": "ec50a383c89c429edbd2a01c01a44a6c", "score": "0.4990892", "text": "function logic()\r\n{\t\t\t\t\r\n}", "title": "" }, { "docid": "7482be04b8afeec0d110707e2b5b3ef6", "score": "0.49849132", "text": "function prepareDough() {\n\n}", "title": "" }, { "docid": "17d0417ab813677287884e49870f11c3", "score": "0.49848142", "text": "function _run() {\n \n }", "title": "" }, { "docid": "9118827b6685817932696932a778ec23", "score": "0.49751756", "text": "function blackHole() { }", "title": "" }, { "docid": "7d678a908387d6a25904c3fc4e17f5f5", "score": "0.4971104", "text": "configuring() {}", "title": "" }, { "docid": "ecbeb9e3b4318c5698d92c48fb3f7e5b", "score": "0.49706388", "text": "conductor() {\n this.usePattern('open');\n let emergencyStop = 0;\n while (this.index.articles || this.append.length < 13) {\n this.usePattern('repeat');\n if (emergencyStop > 15) { Logger.log('Emergency stop'); break; }\n emergencyStop += 1;\n }\n // At last, we inserts the result back into the DOM\n $('main').append(this.append);\n }", "title": "" }, { "docid": "4d5f241ae89ee65bd145fe127cef809f", "score": "0.49684486", "text": "finalize() {\n\n\n }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.49655586", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.49655586", "text": "ready() { }", "title": "" }, { "docid": "643d5ef93728fd50526603fcc6f1ccd6", "score": "0.49606878", "text": "function performer(cb) {\n //code goes here\n }", "title": "" }, { "docid": "5a381c91b449ec25bb4e2ed158802105", "score": "0.49599212", "text": "function boss3_final_cannon_update() {\n//Not do anything if arms and heater are not yet broken.\n if (boss3_overall_alive)\n return;\n}", "title": "" }, { "docid": "ac673118e480d0f184c26cdd119ce2ff", "score": "0.4955172", "text": "function Broadphase(){\n this.result = [];\n}", "title": "" }, { "docid": "e17e2e49f84d0d54272cda2d290d89e4", "score": "0.49522424", "text": "warp() {\n // intentionally left blank\n }", "title": "" }, { "docid": "3f426804930ad9b602a7ec72aaace334", "score": "0.4947685", "text": "function Baddy() {}", "title": "" }, { "docid": "6ce2d8291ee66c95056287db2af0d2ae", "score": "0.49422774", "text": "function cc(){Kb.call(this)}", "title": "" }, { "docid": "27dfc04b993977344840c28eabfeaff4", "score": "0.49400923", "text": "sync () {\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49388516", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "cf0e8c3cadb65602323c4187184bcf27", "score": "0.49337614", "text": "function fc(){}", "title": "" }, { "docid": "af798a52c11b0406bedd4b107bfe0593", "score": "0.4917931", "text": "function Nc(){}", "title": "" }, { "docid": "90ddee850d6edea1b646a0092acdef0a", "score": "0.49158436", "text": "function currentColl () {\n\t\tconsole.log(\"currentColl\");\n\t\t\n\t}", "title": "" }, { "docid": "1ae3228d9e19de2d71a1ef549c469726", "score": "0.49133846", "text": "function test_cu_all_stackers_conges() {\n Whoz.cu_all_stackers_conges();\n}", "title": "" }, { "docid": "d3e1e2fb6ad948fd9df155663124aa5c", "score": "0.49130353", "text": "function be(){}", "title": "" }, { "docid": "7ccb5b51bd0a47e22b22e09e7df1e461", "score": "0.49117556", "text": "function dink(c){}", "title": "" }, { "docid": "94d3d74f39231d7112728b8ab0033b38", "score": "0.4907328", "text": "constructor (){\n\n \n }", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.4905081", "text": "started () {}", "title": "" } ]
e068f41785dc9f0ce09761f4240bfcab
Copy the default endpoint definition file
[ { "docid": "3639f9f3138464e0cc81815cbc872bbc", "score": "0.8065645", "text": "async function copyEndpointDefinitionFile() {\r\n const sourceFilePath = path.join(\r\n __dirname,\r\n defaultConfig.endpointDefinitionPath);\r\n const targetFilePath = path.join(\r\n process.cwd(),\r\n defaultConfig.endpointDefinitionPath);\r\n\r\n await fs.copyFile(sourceFilePath, targetFilePath);\r\n}", "title": "" } ]
[ { "docid": "89555a6da6035dba3af3455753fb61ad", "score": "0.5564811", "text": "function main() {\n const input = readFile(process.argv[2]);\n const output = BASE_SWAGGER_DEFINITION;\n\n _.forOwn(input, (val, endpoint) => {\n console.log(`Creating '${endpoint}'...`.blue);\n output.paths[endpoint.split('?')[0]] = generateJson(val, endpoint)\n });\n\n // dumpOutput();\n writeFile(output);\n\n function dumpOutput() {\n console.log(JSON.stringify(output, null, ' ').red);\n console.log(`${Object.keys(output.paths).length - 1} new routes added.`.green);\n }\n}", "title": "" }, { "docid": "f832560b5eeba25df1ff3ae37090551a", "score": "0.5409582", "text": "function generateDefaultConfiguration() {\n\n\t\t// Set up defaul configuration\n\t\tvar pathToThisFile = document.currentScript.src;\n\t\tvar pathWithoutFile = pathToThisFile.match(/(.*)[\\/\\\\]/)[1]||'';\n\t\texlConfig = {\n\t\t\t'root_path': pathWithoutFile+'/',\n\t\t\t'template_path': pathWithoutFile+'/'+'exlTemplates/'\n\t\t};\n\t\treturn exlConfig;\n\n\t}", "title": "" }, { "docid": "137abb8fbdcc883e3bac181022fa4354", "score": "0.54032725", "text": "function generate(src = conf.apiFile, dest = conf.outDir, generateStore = true, unwrapSingleParamMethods = false, swaggerUrlPath = conf.swaggerUrlPath, omitVersion = false) {\n let schema;\n try {\n const content = fs.readFileSync(src);\n schema = JSON.parse(removeEmptyObjectsFromJSONScheme(content.toString()));\n }\n catch (e) {\n if (e instanceof SyntaxError) {\n utils_1.out(`${src} is either not a valid JSON scheme or contains non-printable characters`, utils_1.TermColors.red);\n }\n else\n utils_1.out(`JSON scheme file '${src}' does not exist`, utils_1.TermColors.red);\n utils_1.out(`${e}`);\n return;\n }\n // normalize basePath, strip trailing '/'s\n const basePath = schema.basePath;\n if (typeof basePath === 'string') {\n schema.basePath = basePath.replace(/\\/+$/, '');\n }\n else\n schema.basePath = '';\n recreateDirectories(dest);\n const header = utils_1.processHeader(schema, omitVersion);\n const config = { header, dest, generateStore, unwrapSingleParamMethods };\n generateCommon(path.join(dest, conf.commonDir));\n if (!fs.existsSync(dest))\n fs.mkdirSync(dest);\n const definitions = definitions_1.processDefinitions(schema.definitions, config);\n process_paths_1.processPaths(schema.paths, `http://${schema.host}${swaggerUrlPath}${conf.swaggerFile}`, config, definitions, schema.basePath);\n}", "title": "" }, { "docid": "a1052b8e6a0c6e696ce15da6f9a4cef8", "score": "0.527869", "text": "function loadDefaultSchema() {\n\t\t\tjsonSchema = grunt.file.readJSON('build/tasks/jsonschema-draft-o4.json');\n\t\t\tv.addSchema(jsonSchema);\n\t\t}", "title": "" }, { "docid": "2753405bebab25704ee0dee484b1c22b", "score": "0.52347255", "text": "_writingSampleCode() {\n\n this.fs.copy(\n this.templatePath('sample/src/templates/HelloWorld.hbs'),\n this.destinationPath('src/webparts/templates/HelloWorld.hbs')\n )\n\n }", "title": "" }, { "docid": "097ceb8d4d81ce33f4715012f4ae040c", "score": "0.5223998", "text": "static _createConfig() {\n console.log(\"Copying config file\");\n fs.copySync(\"config.dist.json\", \"config.json\");\n }", "title": "" }, { "docid": "5283cddd30e959553491a106bfb48c77", "score": "0.5159829", "text": "function defaultFile() {\n\tfs.writeFileSync(was.FN, '[]')\n\treturn []\n}", "title": "" }, { "docid": "0885d48c0b78fc5a9ba7d6857afb7ff2", "score": "0.50587106", "text": "function removePolicyToProxyEndpoint(apiProxy){\n fs.readFile(__dirname + '/' +apiProxy+ '/apiproxy/proxies/default.xml', function(err, data) {\n parser.parseString(data, function (err, result) {\n result.ProxyEndpoint.PreFlow[0].Request[0] = {};\n var xml = builder.buildObject(result);\n fs.writeFile(__dirname + '/' +apiProxy+ '/apiproxy/proxies/default.xml', xml, function(err, data){\n if (err) console.log(err);\n console.log(\"Successfully update Proxy configuration\");\n });\n });\n });\n}", "title": "" }, { "docid": "7d02b26e3d8d59c3171977f05623a133", "score": "0.5023829", "text": "static get Endpoint() {\n return require(\"./endpoint\")\n }", "title": "" }, { "docid": "e17957c61f6256465525a835d2cd6060", "score": "0.50225484", "text": "function startFileLoader() {\n var fileLoader = express();\n\n fileLoader.get('/definitions.yaml', function (req, res) {\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n res.header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\n\n res.attachment('./api/swagger/definitions.yaml');\n res.sendFile(path.join(__dirname, 'api/swagger/definitions.yaml'));\n });\n\n fileLoader.listen(port);\n}", "title": "" }, { "docid": "bea7d1aa9ec01d5232111f594e7fb34c", "score": "0.5012641", "text": "async function createConfigFile() {\r\n const configFileContent = ''\r\n + `/**\\n`\r\n + ` * @type {serverConfig}\\n`\r\n + ` */\\n`\r\n + `module.exports = ${JSON.stringify(defaultConfig, null, 4)};\\n`;\r\n const configFilePath = path.join(\r\n process.cwd(),\r\n configResolver.cosmiconfigOptions.searchPlaces[0]);\r\n\r\n await fs.writeFile(configFilePath, configFileContent);\r\n}", "title": "" }, { "docid": "893ea4813a2e90925907cf49fea0cc63", "score": "0.50026566", "text": "function defaultServeFile (res, filePath, reqHeaders) {\n\tconsole.warn('hyperProxy.serveFile was not initialized with options passed to `start()` or by setting `hyperProxy.serveFile = hyperProxy.createFileResponseHandler()` before. Initializing now with default root directory set to ' + process.cwd() + ' and followSymbolicLinks set to true.');\n\tserveFile = createFileResponseHandler({\n\t\tdocumentRoot : process.cwd(),\n\t\tfollowSymbolicLinks: true\n\t});\n\treturn serveFile(res, filePath, reqHeaders);\n}", "title": "" }, { "docid": "4ada696969d324fd17d2095115b32a9b", "score": "0.5001818", "text": "function initDefaultConfig(){\n\tappConfig.defaultPath = `${process.cwd()}/`;\n\tappConfig.listsPath = `${process.cwd()}/lists/`;\n\tappConfig.listsType = \"json\"\n\tfs.writeFileSync(`${process.cwd()}/config.json`, JSON.stringify(appConfig))\n\tsignale.debug('Default Config Applied');\n}", "title": "" }, { "docid": "fdd2c82c1fb28ec5b7829714ffb27dff", "score": "0.4935784", "text": "_backupSPFXConfig() {\n\n // backup default gulp file;\n // Fallback to NodeJS FS Object because otherwise in Yeoman context not possible\n fs.renameSync(\n this.destinationPath('gulpfile.js'),\n this.destinationPath('gulpfile.spfx.js')\n );\n\n }", "title": "" }, { "docid": "f87b1a6731dd65552edd4bead0416d05", "score": "0.48947886", "text": "function copyShortCutsFile() {\n var fs = require('fs');\n var shorts = fs.readFileSync('./app_shortcuts/mappings.json');\n fs.writeFileSync(dataPath + '\\\\mappings.json', shorts);\n}", "title": "" }, { "docid": "ba8172a2f67f999653adcdf38dfc3900", "score": "0.4887632", "text": "_generate() {\n const offlineEndpoint = new OfflineEndpoint()\n\n const fullEndpoint = {\n ...offlineEndpoint,\n ...this.#http,\n }\n\n fullEndpoint.integration = this._getIntegration(this.#http)\n\n if (fullEndpoint.integration === 'AWS') {\n // determine request and response templates or use defaults\n return this._setVmTemplates(fullEndpoint)\n }\n\n return fullEndpoint\n }", "title": "" }, { "docid": "01672f233f478d2b2348bc51b9b2434a", "score": "0.48822492", "text": "_applyCustomConfig() {\n\n this._backupSPFXConfig();\n\n // Copy custom gulp file to\n this.fs.copy(\n this.templatePath('gulpfile.js'),\n this.destinationPath('gulpfile.js')\n );\n\n // Add configuration for static assets.\n this.fs.copy(\n this.templatePath('config/copy-static-assets.json'),\n this.destinationPath('config/copy-static-assets.json')\n );\n\n }", "title": "" }, { "docid": "854e830db9384e019ecfdb51fa7fb3f0", "score": "0.48517367", "text": "_setVmTemplates(fullEndpoint) {\n // determine requestTemplate\n // first check if requestTemplate is set through serverless\n const fep = fullEndpoint\n\n try {\n // determine request template override\n const reqFilename = `${this.#handlerPath}.req.vm`\n\n // check if serverless framework populates the object itself\n if (\n typeof this.#http.request === 'object' &&\n typeof this.#http.request.template === 'object'\n ) {\n const templatesConfig = this.#http.request.template\n\n keys(templatesConfig).forEach((key) => {\n fep.requestTemplates[key] = templatesConfig[key]\n })\n }\n // load request template if exists if not use default from serverless offline\n else if (existsSync(reqFilename)) {\n fep.requestTemplates['application/json'] = readFile(reqFilename)\n } else {\n fep.requestTemplates['application/json'] = defaultRequestTemplate\n }\n\n // determine response template\n const resFilename = `${this.#handlerPath}.res.vm`\n\n fep.responseContentType = getResponseContentType(fep)\n debugLog('Response Content-Type ', fep.responseContentType)\n\n // load response template from http response template, or load file if exists other use default\n if (fep.response && fep.response.template) {\n fep.responses.default.responseTemplates[fep.responseContentType] =\n fep.response.template\n } else if (existsSync(resFilename)) {\n fep.responses.default.responseTemplates[\n fep.responseContentType\n ] = readFile(resFilename)\n } else {\n fep.responses.default.responseTemplates[\n fep.responseContentType\n ] = defaultResponseTemplate\n }\n } catch (err) {\n debugLog(`Error: ${err}`)\n }\n\n return fep\n }", "title": "" }, { "docid": "b26af61a1142f4bb6227aa16e9bb87f0", "score": "0.4838053", "text": "function convertSwagger(source){\n var apiInfo = clone(source,false);\n apiInfo.resources = {};\n for (var p in apiInfo.paths) {\n for (var m in apiInfo.paths[p]) {\n if (m != 'parameters') {\n var sMethod = apiInfo.paths[p][m];\n var ioMethod = {};\n ioMethod.path = p;\n ioMethod.op = m;\n var sMethodUniqueName = (sMethod.operationId ? sMethod.operationId : m+'_'+p).split('/').join('_');\n sMethodUniqueName = sMethodUniqueName.split(' ').join('_'); // TODO {, } and : ?\n var tagName = 'Default';\n if (sMethod.tags && sMethod.tags.length>0) {\n tagName = sMethod.tags[0];\n }\n if (!apiInfo.resources[tagName]) {\n apiInfo.resources[tagName] = {};\n if (apiInfo.tags) {\n for (var t in apiInfo.tags) {\n var tag = apiInfo.tags[t];\n if (tag.name == tagName) {\n apiInfo.resources[tagName].description = tag.description;\n apiInfo.resources[tagName].externalDocs = tag.externalDocs;\n }\n }\n }\n }\n if (!apiInfo.resources[tagName].methods) apiInfo.resources[tagName].methods = {};\n apiInfo.resources[tagName].methods[sMethodUniqueName] = ioMethod;\n }\n }\n }\n delete apiInfo.paths; // to keep size down\n delete apiInfo.definitions; // ditto\n return apiInfo;\n}", "title": "" }, { "docid": "3fe7f143ff8eddaab14da9b3daa79073", "score": "0.4814447", "text": "function generateConfig() {\n var options = {\n \"$schema\": \"./node_modules/ng-swagger-gen/ng-swagger-gen-schema.json\"\n };\n options.swagger = args.swagger ? args.swagger : \"<swagger file>\";\n if (args.output) {\n options.output = args.output;\n }\n var properties = schema.properties;\n for (var propName in properties) {\n var propDef = properties[propName];\n if (propDef.default && !options.hasOwnProperty(propName)) {\n var value = propDef.default;\n if (propDef.type == \"boolean\") {\n value = value === 'true';\n } else if (propDef.type == \"integer\") {\n value = parseInt(value, 10);\n }\n options[propName] = value;\n }\n }\n var json = JSON.stringify(options, null, 2);\n fs.writeFileSync(config, json, {encoding: \"utf8\"});\n console.info(\"Wrote \" + config);\n}", "title": "" }, { "docid": "a6b45aabd360be12430139ce1b751615", "score": "0.47951853", "text": "function generatePublicApiTs() {\n const configFile = path.resolve(__dirname, '../src/ngx-slider/lib/public_api.json');\n const tsFile = path.resolve(__dirname, '../src/ngx-slider/lib/public_api.ts');\n\n const config = JSON.parse(fs.readFileSync(configFile, { encoding: 'utf8' }));\n\n let tsFileContent = '';\n\n for (let exportDef of config.exports) {\n if (exportDef.what instanceof Array) {\n const whats = exportDef.what.join(', ');\n tsFileContent += `export { ${whats} } from '${exportDef.file}';\\n`;\n } else {\n tsFileContent += `export ${exportDef.what} from '${exportDef.file}';\\n`;\n }\n }\n\n fs.writeFileSync(tsFile, tsFileContent, {encoding: 'utf8'});\n}", "title": "" }, { "docid": "00c726f33eaea46a9d5882b87b0ce7d7", "score": "0.47910228", "text": "createConfigFile() {\n const { _ } = this;\n const json = JSON.stringify(STUB_CONFIG, null, 4);\n write(_.configPath, `${ json }\\n`);\n }", "title": "" }, { "docid": "cf33038e8d5a2692a2500271736c471e", "score": "0.47614115", "text": "function sendDefault(req, res) {\n var endpoint,\n splitPath = req.params[0].split('?')[0].split(\"/\"),\n mockPath = mockFileRoot + req.params[0] + '/' + 'default.json',\n mockResponse;\n\n if (splitPath.length > 2)\n endpoint = splitPath[splitPath.length - 2];\n \n try {\n \n res.json(getMock(mockPath))\n } catch (err) {\n console.log(\"something bad happened\", err);\n res.status(500).send(JSON.parse(err));\n }\n}", "title": "" }, { "docid": "fe95a594378328247fbdd31c7551b07e", "score": "0.47325075", "text": "addPayloadEndpoint(opts) {\n if (this.event.payload.endpoints === undefined) {\n this.event.payload.endpoints = [];\n }\n\n if (opts === undefined) {\n opts = {};\n }\n\n // construct the proper structure expected for the endpoint\n let endpoint = {\n endpointId: Utils.defaultIfNullOrEmpty(opts.endpointId, 'dummy-endpoint-001'),\n manufacturerName: Utils.defaultIfNullOrEmpty(opts.manufacturerName, 'ioBroker Group'),\n description: Utils.defaultIfNullOrEmpty(opts.description, 'Device controlled by ioBroker'),\n friendlyName: Utils.defaultIfNullOrEmpty(opts.friendlyName, 'ioBroker Stub Endpoint'),\n displayCategories: Utils.defaultIfNullOrEmpty(opts.displayCategories, ['OTHER']),\n capabilities: this.alexaCapability().concat(Utils.defaultIfNullOrEmpty(opts.capabilities, [])),\n };\n\n if (opts.hasOwnProperty('cookie')) {\n endpoint.cookie = Utils.defaultIfNullOrEmpty('cookie', {});\n }\n\n this.event.payload.endpoints.push(endpoint);\n }", "title": "" }, { "docid": "494ac2362bc3b3683781e8ba39d9eb9f", "score": "0.4707959", "text": "function setup(configDefault) {\n autoSetEnvAndArg(config.schema);\n\n var instance = convict(config.schema);\n var filePath = instance.get('config') ||\n configDefault ||\n '../api-server/config/' + instance.get('env') + '.json';\n \n loadFile(filePath);\n\n var overridesFilePath = instance.get('configOverrides');\n if (overridesFilePath) {\n loadFile(overridesFilePath);\n }\n\n if (!instance.get('env') === 'test') {\n instance.validate();\n }\n return instance; \n\n function loadFile(fPath) {\n if (! fs.existsSync(fPath)) {\n console.error('Could not load config file ' + toString.path(fPath) + ''); // eslint-disable-line no-console\n } else {\n instance.loadFile(fPath);\n }\n }\n}", "title": "" }, { "docid": "420122f5207ba7d5602ef9d2bc73c0ff", "score": "0.46858177", "text": "writing() {\n \n // Copy the templates.\n this.fs.copy(\n this.templatePath('_secret.example.json'),\n this.destinationPath('secret.example.json')\n );\n this.fs.copy(\n this.templatePath('_README.md'),\n this.destinationPath('README.md')\n );\n \n }", "title": "" }, { "docid": "7fcc462c8fb00491ae1095b60d4f2735", "score": "0.46845633", "text": "async function setup() {\n const url = new URL(KALEIDO_REST_GATEWAY_URL);\n url.username = KALEIDO_AUTH_USERNAME;\n url.password = KALEIDO_AUTH_PASSWORD;\n url.pathname = \"/abis\";\n var archive = archiver('zip'); \n archive.directory(\"../contracts\", \"\");\n await archive.finalize();\n let res = await request.post({\n url: url.href,\n qs: {\n compiler: \"0.5\", // Compiler version\n source: CONTRACT_MAIN_SOURCE_FILE, // Name of the file in the directory\n contract: `${CONTRACT_MAIN_SOURCE_FILE}:${CONTRACT_CLASS_NAME}` // Name of the contract in the \n },\n json: true,\n headers: {\n 'content-type': 'multipart/form-data',\n },\n formData: {\n file: {\n value: archive,\n options: {\n filename: 'smartcontract.zip',\n contentType: 'application/zip',\n knownLength: archive.pointer() \n }\n }\n }\n });\n // Log out the built-in Kaleido UI you can use to exercise the contract from a browser\n url.pathname = res.path;\n url.search = '?ui';\n console.log(`Generated REST API: ${url}`);\n console.log(`openapi: ${res.openapi}`);\n\n // Store a singleton swagger client for us to use\n swaggerClient = await Swagger(res.openapi, {\n requestInterceptor: req => {\n req.headers.authorization = `Basic ${Buffer.from(`${KALEIDO_AUTH_USERNAME}:${KALEIDO_AUTH_PASSWORD}`).toString(\"base64\")}`;\n }\n });\n\n // deploy contract\n try {\n let postRes = await swaggerClient.apis.default.constructor_post({\n body: {},\n \"kld-from\": FROM_ADDRESS,\n \"kld-sync\": \"true\"\n });\n console.log(\"Deployed instance: \" + postRes.body.contractAddress);\n contract_instance = postRes.body.contractAddress;\n }\n catch(err) {\n console.log(`${err.response && JSON.stringify(err.response.body)}\\n${err.stack}`);\n }\n}", "title": "" }, { "docid": "b67910659ecede5fbb026697680c5b78", "score": "0.46362844", "text": "constructor() {\n super();\n this.registerAsType(DefaultSenecaFactory.SenecaEndpointDescriptor, SenecaEndpoint_1.SenecaEndpoint);\n }", "title": "" }, { "docid": "89e4579050b8560e4df8258842b4f81e", "score": "0.46275672", "text": "function generateClient(){\n logger.debug(\"Generating angoose client file: \");\n var bundle = new Bundle();\n var client = {};\n bundle.generateClient(client);\n var filename = angoose.config()['client-file'];\n writeToFile(filename, client.source)\n //compressFile(filename, client.source);\n logger.info(\"Generated angoose client file: \", filename);\n return client.source;\n}", "title": "" }, { "docid": "61d1a24c57573294e194f83fd2ee2f41", "score": "0.4621346", "text": "function generateProviderFile(service) {\n getSpec(service.url, '/swagger')\n .then(jsonObj => handleSwaggerResponse(service, jsonObj))\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "c77c5b2fd1de74da601cb4f938ccc6b3", "score": "0.46200323", "text": "function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }", "title": "" }, { "docid": "c77c5b2fd1de74da601cb4f938ccc6b3", "score": "0.46200323", "text": "function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }", "title": "" }, { "docid": "c77c5b2fd1de74da601cb4f938ccc6b3", "score": "0.46200323", "text": "function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }", "title": "" }, { "docid": "c77c5b2fd1de74da601cb4f938ccc6b3", "score": "0.46200323", "text": "function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }", "title": "" }, { "docid": "c77c5b2fd1de74da601cb4f938ccc6b3", "score": "0.46200323", "text": "function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }", "title": "" }, { "docid": "5a3dfd4ce4e2618b3239ea47a0b3ad9e", "score": "0.4616256", "text": "function sendDefault(req, res) {\n var endpoint,\n splitPath = req.params[0].split('?')[0].split(\"/\"),\n mockPath = mockFileRoot + req.params[0] + '/' + 'default.json',\n mockResponse;\n\n if (splitPath.length > 2)\n endpoint = splitPath[splitPath.length - 2];\n\n console.log(endpoint);\n\n try {\n mockResponse = getMock(mockPath);\n setTimeout(function() {\n res.status(200).send(JSON.parse(mockResponse))\n }, 10)\n\n } catch (err) {\n console.log(err);\n res.status(500).send(JSON.parse(err));\n }\n}", "title": "" }, { "docid": "aab079b7df546a80bc7218d203e87631", "score": "0.4612913", "text": "function copyDefaultProfile() {\n\n // Setup sample data for new user\n SampleData.setupFor(userId)\n .then(function getDefaultProfile() {\n return mongoUtils.getEntityById(DEFAULT_USER, USERPROFILE_COL_NAME, DEFAULT_USER, [DEFAULT_GROUP])\n })\n .then(function copyDefaultProfile(err, defaultProfile) {\n console.log('Creating new profile for: ' + userId);\n if (err) {\n sendResponse(res, 'Error while setting up user: ' + err.message, null);\n return;\n }\n defaultProfile._id = userId;\n defaultProfile.owner = userId;\n defaultProfile.group = userId;\n defaultProfile.ingroups = [userId, DEFAULT_GROUP];\n\n _saveOrUpdateUserProfile(defaultProfile)\n .then(_.partial(sendResponse, res))\n .fail(_.partial(sendResponse, res, 'Failed to get UserProfile ' + userId));\n\n })\n }", "title": "" }, { "docid": "1ee820b07cb03ed1bbd0b774a189fa5b", "score": "0.46103692", "text": "function generateProviderFile(service) {\n getSpec(service['url'], service['sub_path'], function(swagger, error) {\n if (error) {\n console.log(error);\n } else {\n handleSwaggerResponse(service, swagger);\n }\n });\n}", "title": "" }, { "docid": "2c49360edd550baf9cf8899f1c5a9b93", "score": "0.45892856", "text": "newSchema() {\n const { ctx } = this;\n if (!this.useModelAsBase && this.isNewFile) {\n if (!this.options.name) {\n this.log.error('Missing schema name: yo labs:schema [name] \\n');\n this.log(this.help());\n process.exit(1);\n }\n const fileName = this.options.name\n .trim()\n .toLowerCase();\n\n const name = fileName.split('-').map((item) => {\n const firstChar = item.substring(0, 1).toUpperCase();\n return `${firstChar}${item.substring(1)}`;\n }).join('');\n\n const [schemaProdDeps, schemaDevDeps, schemaScripts] = template\n .createNewSchema(this, this.newFilePath, {\n importExport: ctx.importExport || true,\n name,\n });\n\n this.deps.prod.push(...schemaProdDeps);\n this.deps.dev.push(...schemaDevDeps);\n Object.assign(this.pkgScripts, schemaScripts);\n }\n }", "title": "" }, { "docid": "8b4e07377cc77a205b8fb80850ed9aba", "score": "0.458821", "text": "save() {\n\n let _this = this;\n\n return new BbPromise(function(resolve) {\n\n // Validate: Check project path is set\n if (!_this._S.config.projectPath) throw new SError('Endpoint could not be saved because no project path has been set on Serverless instance');\n\n // Validate: Check function exists\n if (!SUtils.fileExistsSync(path.join(_this._config.fullPath, 's-function.json'))) {\n throw new SError('Endpoint could not be saved because its function does not exist');\n }\n\n // Check if endpoint exists, and replace it if so\n let functionJson = SUtils.readAndParseJsonSync(path.join(_this._config.fullPath, 's-function.json'));\n let endpoint = null;\n for (let i = 0; i < functionJson.endpoints.length; i++) {\n if (functionJson.endpoints[i].path === _this.path &&\n functionJson.endpoints[i].method === _this.method) {\n endpoint = functionJson.endpoints[i];\n functionJson.endpoints[i] = _this.get();\n }\n }\n\n if (!endpoint) functionJson.endpoints.push(_this.get());\n\n // Save updated function file\n return SUtils.writeFile(path.join(_this._config.fullPath, 's-function.json'), JSON.stringify(functionJson, null, 2))\n .then(resolve);\n });\n }", "title": "" }, { "docid": "37fdee79a8324f7a49a959d46773d51b", "score": "0.45765463", "text": "function customMapping(type, endpoint, method) {\n var path = ''\n switch (endpoint) {\n case 'substitutions-reference':\n // add endpoint\n path += buildPath(endpoint)\n\n // add header if it has one\n if (method.length > 0) path += buildHash('#header-' + method)\n\n break\n\n case 'relay-webhooks':\n if (method === 'retrieve-update-and-delete') {\n path = buildPath(endpoint)\n path += buildHash(\n '#' + endpoint + HASH_SPACE + 'retrieve,-update,-and-delete'\n )\n }\n break\n\n case 'sending-domains':\n if (method === 'retrieve-update-and-delete') {\n path = buildPath(endpoint)\n path += buildHash(\n '#' + endpoint + HASH_SPACE + 'retrieve,-update,-and-delete'\n )\n }\n break\n\n case 'suppression-list':\n if (method === 'bulk-insertupdate') {\n path = buildPath(endpoint)\n path += buildHash(\n '#' + endpoint + HASH_SPACE + 'bulk-insert-update'\n )\n } else if (method === 'retrieve-delete') {\n path = buildPath(endpoint)\n path += buildHash('#' + endpoint + HASH_SPACE + 'retrieve,-delete')\n }\n break\n\n case 'tracking-domains':\n if (method === 'retrieve-update-and-delete') {\n path = buildPath(endpoint)\n path += buildHash(\n '#' + endpoint + HASH_SPACE + 'retrieve,-update,-and-delete'\n )\n }\n break\n }\n\n return path\n }", "title": "" }, { "docid": "fb5b331efcbac29798eeb756cdd19636", "score": "0.45729163", "text": "function setDefaults(definition) {\r\n providerConfig.optionsFactory = definition.options;\r\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\r\n return provider;\r\n }", "title": "" }, { "docid": "b4a5ba7b721f1804c3232abfde7b94c5", "score": "0.45710385", "text": "function Endpoint(props) {\n return __assign({ Type: 'AWS::DMS::Endpoint' }, props);\n }", "title": "" }, { "docid": "8434206759b3c4df2c669edcebaef58e", "score": "0.4570105", "text": "loadDefaultFile () {\n this.file = '.sassdocrc'\n this.tryLoadCurrentFile()\n }", "title": "" }, { "docid": "d766d97bec746485e14c98262fefe544", "score": "0.45612147", "text": "function setEndPoint(serviceUrl){\r\n WSRMProcessor.prototype.endpoint=new Endpoint(serviceUrl);\r\n}", "title": "" }, { "docid": "e1a3f9f43476791259128b0505467759", "score": "0.45475593", "text": "static setDefaultsFromFile(filename = null, namespace = null) {\n NativeFirebaseRemoteConfig.setDefaultsFromFile(filename, namespace);\n }", "title": "" }, { "docid": "6a2048baad8043c873d03c5cccf39701", "score": "0.45415315", "text": "register(incoming, outgoing) {\n\tconst ep = makeEndpoint(incoming);\n\n\tconst id = this._registerOrUpdate(ep);\n\n\tmakeResources(incoming)\n\t .then(value => {\n\t\tep.resources = value;\n\t\tthis._registerOrUpdate(ep);\n\t });\n\n\toutgoing.setOption('Location-Path', ['rd', id]);\n\toutgoing.code = 201; // Created\n }", "title": "" }, { "docid": "0e05fce48bd34e27d8b6ef8d60a44da8", "score": "0.45409486", "text": "function generateService(ctx, fileDesc, sourceInfo, serviceDesc) {\n var _a;\n const { options } = ctx;\n const chunks = [];\n utils_1.maybeAddComment(sourceInfo, chunks, (_a = serviceDesc.options) === null || _a === void 0 ? void 0 : _a.deprecated);\n const maybeTypeVar = options.useContext ? `<${main_1.contextTypeVar}>` : '';\n chunks.push(ts_poet_1.code `export interface ${serviceDesc.name}${maybeTypeVar} {`);\n serviceDesc.method.forEach((methodDesc, index) => {\n var _a;\n const name = options.lowerCaseServiceMethods ? case_1.camelCase(methodDesc.name) : methodDesc.name;\n const info = sourceInfo.lookup(sourceInfo_1.Fields.service.method, index);\n utils_1.maybeAddComment(info, chunks, (_a = methodDesc.options) === null || _a === void 0 ? void 0 : _a.deprecated);\n const params = [];\n if (options.useContext) {\n params.push(ts_poet_1.code `ctx: Context`);\n }\n let inputType = types_1.requestType(ctx, methodDesc);\n // the grpc-web clients auto-`fromPartial` the input before handing off to grpc-web's\n // serde runtime, so it's okay to accept partial results from the client\n if (options.outputClientImpl === 'grpc-web') {\n inputType = ts_poet_1.code `DeepPartial<${inputType}>`;\n }\n params.push(ts_poet_1.code `request: ${inputType}`);\n // Use metadata as last argument for interface only configuration\n if (options.outputClientImpl === 'grpc-web') {\n params.push(ts_poet_1.code `metadata?: grpc.Metadata`);\n }\n else if (options.addGrpcMetadata) {\n const q = options.addNestjsRestParameter ? '' : '?';\n params.push(ts_poet_1.code `metadata${q}: Metadata@grpc`);\n }\n if (options.addNestjsRestParameter) {\n params.push(ts_poet_1.code `...rest: any`);\n }\n // Return observable for interface only configuration, passing returnObservable=true and methodDesc.serverStreaming=true\n let returnType;\n if (options.returnObservable || methodDesc.serverStreaming) {\n returnType = types_1.responseObservable(ctx, methodDesc);\n }\n else {\n returnType = types_1.responsePromise(ctx, methodDesc);\n }\n chunks.push(ts_poet_1.code `${name}(${ts_poet_1.joinCode(params, { on: ',' })}): ${returnType};`);\n // If this is a batch method, auto-generate the singular version of it\n if (options.useContext) {\n const batchMethod = types_1.detectBatchMethod(ctx, fileDesc, serviceDesc, methodDesc);\n if (batchMethod) {\n const name = batchMethod.methodDesc.name.replace('Batch', 'Get');\n chunks.push(ts_poet_1.code `${name}(\n ctx: Context,\n ${utils_1.singular(batchMethod.inputFieldName)}: ${batchMethod.inputType},\n ): Promise<${batchMethod.outputType}>;`);\n }\n }\n });\n chunks.push(ts_poet_1.code `}`);\n return ts_poet_1.joinCode(chunks, { on: '\\n' });\n}", "title": "" }, { "docid": "dbe7886a32861a638cbdc4897690e311", "score": "0.45298132", "text": "async function createServiceEndpointPolicyWithDefinition() {\n const subscriptionId = process.env[\"NETWORK_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"NETWORK_RESOURCE_GROUP\"] || \"rg1\";\n const serviceEndpointPolicyName = \"testPolicy\";\n const parameters = {\n location: \"westus\",\n serviceEndpointPolicyDefinitions: [\n {\n name: \"StorageServiceEndpointPolicyDefinition\",\n description: \"Storage Service EndpointPolicy Definition\",\n service: \"Microsoft.Storage\",\n serviceResources: [\n \"/subscriptions/subid1\",\n \"/subscriptions/subid1/resourceGroups/storageRg\",\n \"/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount\",\n ],\n },\n ],\n };\n const credential = new DefaultAzureCredential();\n const client = new NetworkManagementClient(credential, subscriptionId);\n const result = await client.serviceEndpointPolicies.beginCreateOrUpdateAndWait(\n resourceGroupName,\n serviceEndpointPolicyName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "bf4821a94e677c90ad99e8343efaf21d", "score": "0.4515714", "text": "async function rel() {\n try {\n readYaml(\"swagger.yaml\", async function(err: any, data: any) {\n if (err) {\n console.log(\"Unable To Read the Swagger File\");\n } else {\n swagger = await data;\n try {\n host =\n swagger.schemes[\"0\"] +\n \"://\" +\n swagger.host +\n swagger.basePath +\n \"/\";\n var name = data.info.title;\n name = name.replace(/\\W/g, \"\");\n url = konguri + name + \"/routes\";\n var tags = data.tags != null ? await addtags(data.tags) : [];\n createService(name, host, tags);\n } catch (error) {\n console.log(\n \"Please make sure the Swagger filr contains the following fileds\"\n );\n console.log(\"1.Schemse 2.Host 3.BasePath\");\n }\n }\n });\n } catch (Error) {\n console.log(\"Error While reading the swagger file\");\n }\n}", "title": "" }, { "docid": "4b3ad302eb1a443c231b876a22ac82a4", "score": "0.45094758", "text": "endpointConfiguration(index) {\n return new DataAwsApiGatewayRestApiEndpointConfiguration(this, 'endpoint_configuration', index);\n }", "title": "" }, { "docid": "aace86e7cab1000f140df96fff890cd6", "score": "0.4508345", "text": "function deriveEndpoint(edge, index, ep, conn) {\n return options.deriveEndpoint ? options.deriveEndpoint(edge, index, ep, conn) : options.endpoint ? options.endpoint : ep.type;\n }", "title": "" }, { "docid": "e5c76521556ff64b053e6f457129d4db", "score": "0.45059192", "text": "_initEndpoints() {\n Object.keys(endpoints).forEach((key) => {\n const endpoint = endpoints[key];\n\n Object.defineProperty(this, key, {\n value: endpoint(this),\n });\n });\n }", "title": "" }, { "docid": "715fabf3c4b2e0fa32ab75245274c839", "score": "0.4505563", "text": "function generateFromSwagger() {\n let templates = [\n { \n func: parseEnums, \n template: './templates/enum-template.mustache', \n outputDir: '../src/autogenerated/entities/' \n },\n { \n func: parseClasses, \n template: './templates/class-template.mustache',\n outputDir: '../src/autogenerated/entities/'\n },\n {\n func: parseClients,\n template: './templates/client-template.mustache',\n outputDir: '../src/autogenerated/clients/'\n }\n ];\n\n templates.forEach(type => {\n writeToFile(type.func(), type.template, type.outputDir);\n });\n\n console.log('Done!');\n}", "title": "" }, { "docid": "8000bc686ab962df91eb8bad3669f5c8", "score": "0.45019886", "text": "function createConfigIfNeeded() {\n // console.log(\"CHECKING FOR DOTFILE\");\n if (fs.existsSync(constants.paths.configPath)) {\n return;\n } else {\n // console.log(\"No dotfile found. Creating DEFAULT.\");\n writeJsonFile(constants.paths.configPath, constants.baseConfig);\n }\n}", "title": "" }, { "docid": "8579a27ccf70a61db8f393916d8ea890", "score": "0.44951493", "text": "function addDefaultAssets () {\n // Skip this step on the browser, or if emptyRepo was supplied.\n const isNode = require('detect-node')\n if (!isNode || opts.emptyRepo) {\n return callback(null, true)\n }\n\n const blocks = new BlockService(self._repo)\n const dag = new DagService(blocks)\n\n const initDocsPath = path.join(__dirname, '../../init-files/init-docs')\n const index = __dirname.lastIndexOf('/')\n\n pull(\n pull.values([initDocsPath]),\n pull.asyncMap((val, cb) => {\n glob(path.join(val, '/**/*'), cb)\n }),\n pull.flatten(),\n pull.map((element) => {\n const addPath = element.substring(index + 1, element.length)\n if (fs.statSync(element).isDirectory()) return\n\n return {\n path: addPath,\n content: file(element)\n }\n }),\n pull.filter(Boolean),\n importer(dag),\n pull.through((el) => {\n if (el.path === 'files/init-docs/docs') {\n const hash = mh.toB58String(el.multihash)\n opts.log('to get started, enter:')\n opts.log()\n opts.log(`\\t jsipfs files cat /ipfs/${hash}/readme`)\n opts.log()\n }\n }),\n pull.onEnd((err) => {\n if (err) return callback(err)\n\n callback(null, true)\n })\n )\n }", "title": "" }, { "docid": "e16bee98a7c167ba575070ca0522cf6a", "score": "0.4482203", "text": "function resetConfigFile() {\n fs.writeFileSync(fakeConfigFile, JSON.stringify({\n defaultRegistry: 'jspm',\n strictSSL: true,\n registries: {\n test: {\n handler: 'dont-overwrite-me'\n },\n github: {\n auth: 'dont-overwrite-me'\n }\n }\n }, null, ' '));\n}", "title": "" }, { "docid": "61f2e1117507dc9e4f74f3f61b81fd0a", "score": "0.44556636", "text": "function putStackInstanceFile(metadata, path, endpoint, transform) {\n\n // See if endpoint exists - stack endpoints are a recent innovation.\n if (!endPointTransceiver.serverSupports(endpoint)) {\n warn(\"stacksCannotBeSent\", {path})\n return\n }\n\n // Build the basic body.\n const body = request().fromPathAs(path, \"source\").withEtag(metadata.etag)\n\n // See if we need to transform the contents before sending.\n if (transform) {\n // Replace the substitution value in the file with the IDs on the target\n // system.\n body.replacing(constants.stackInstanceSubstitutionValue,\n `#${metadata.instance.descriptorRepositoryId}-${metadata.instance.repositoryId}`)\n }\n\n return endPointTransceiver[endpoint]([metadata.instance.repositoryId], `?suppressThemeCompile=${shouldSuppressThemeCompile()}`, body).tap(\n results => processPutResultAndEtag(path, results))\n}", "title": "" }, { "docid": "b4b64c288146ddf0535f0a3f65fac86b", "score": "0.44536534", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnDevEndpointPropsFromCloudFormation(resourceProperties);\n const ret = new CfnDevEndpoint(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "ad653f3780efd18ae577ca270a7233e4", "score": "0.44536406", "text": "function FuseDefaultCfg(){\n\t\t\tcallsetservice(\"useDefaultCfg\",\"\",controlfunc);\n\t}", "title": "" }, { "docid": "217fca81e8615c89fee5544391ecf710", "score": "0.4447286", "text": "async function fetchDefinitionsForSchema(filePath, endpoint) {\n const clearAnimateProgress = animateProgress(\n `Fetching data from ${endpoint}`,\n 3,\n );\n\n const response = await fetch(endpoint);\n\n if (response.status < 400) {\n const definitions = await response.json();\n const convertDefinitions = await sw2dts.convert(definitions, {\n widthQuery: true,\n });\n\n // Make the directory if it doesn't exist, especially for first run\n // eslint-disable-next-line\n mkdir('-p', filePath.split('/').slice(0, -1).join('/'));\n\n await sleep(2000);\n clearAnimateProgress();\n logWrite('\\n');\n\n fs.writeFile(\n filePath,\n prettier.format(convertDefinitions, { parser: 'babel' }),\n (error) => {\n if (error) {\n errorWrite(\n `Failed to write type definitions for: ${endpoint}\\n${error}`,\n );\n throw error;\n } else {\n logWrite(`Successfully wrote definitions in ${filePath} ✅`);\n }\n },\n );\n } else {\n const errMsg = `Failed to fetch type definitions for: ${endpoint}`;\n errorWrite(errMsg);\n throw errMsg;\n }\n}", "title": "" }, { "docid": "2cbbc05b98438b41a8034b3ac178c22e", "score": "0.44376636", "text": "set DefaultHDR(value) {}", "title": "" }, { "docid": "e43f25b2c5e8a48531bdd3ec3297df22", "score": "0.4437476", "text": "async function copyTsConfig() {\r\n const sourceFilePath = path.join(\r\n __dirname,\r\n './_tsconfig.json');\r\n const targetFilePath = path.join(\r\n process.cwd(),\r\n './tsconfig.json');\r\n\r\n await fs.copyFile(sourceFilePath, targetFilePath, COPYFILE_EXCL)\r\n .catch(() => {\r\n console.warn(c.yellowBright(`Could not create new 'tsconfig.json' at `\r\n + targetFilePath));\r\n console.warn(`This is probably because you already have an existing tsconfig. I don't `\r\n + `want to risk messing up your build. You should probably add `\r\n + `'openapi-contract-validator-server' to 'tsconfig.json#compilerOptions/types' `\r\n + `manually.`);\r\n });\r\n}", "title": "" }, { "docid": "ff78b5a25eff6369e2a5de3675bb2f1a", "score": "0.44342095", "text": "_populateDefaultConfig() {\n if (this.config.port === undefined)\n  this.config.port = 8000;\n\n if (this.config.enableGZipCompression === undefined)\n this.config.enableGZipCompression = true;\n\n if (this.config.publicDirectory === undefined)\n this.config.publicDirectory = path.join(process.cwd(), 'public');\n\n if (this.config.serveStaticOptions === undefined)\n this.config.serveStaticOptions = {};\n\n if (this.config.templateDirectory === undefined)\n this.config.templateDirectory = path.join(process.cwd(), 'html');\n\n if (this.config.defaultClient === undefined)\n this.config.defaultClient = 'player';\n\n if (this.config.websockets === undefined)\n this.config.websockets = {};\n }", "title": "" }, { "docid": "3f3606270ea29fd46421fbaaad14048e", "score": "0.443013", "text": "function EndpointConfig(props) {\n return __assign({ Type: 'AWS::SageMaker::EndpointConfig' }, props);\n }", "title": "" }, { "docid": "140344bd6830b67d284b1c432a707ca6", "score": "0.4428002", "text": "function Endpoint(props) {\n return __assign({ Type: 'AWS::SageMaker::Endpoint' }, props);\n }", "title": "" }, { "docid": "edf178cc4b40f80c8bc3560970ee3dd5", "score": "0.44250727", "text": "function extendSwagger2(baucisInstance, sw2Root, options) {\t\n\tconsole.log(\" plugin- extendSwagger2()\");\t\n}", "title": "" }, { "docid": "69f3625ad755dce705bef7c5ac5a57fa", "score": "0.44223273", "text": "constructor(configuration) {\n const json = fs.readFileSync(configuration, 'utf8');\n const awsConfig = JSON.parse(json);\n this.endpoint = {};\n this.endpoint.protocol = 'https:';\n this.endpoint.host = `s3.${awsConfig.region}.amazonaws.com`;\n }", "title": "" }, { "docid": "443fa6e6352d261bd747f03691f0a1af", "score": "0.44183195", "text": "function generateProviderFile(service) {\r\n if (option[\"use-local\"] && fs.existsSync(path.join(__dirname, service.path)))\r\n return true;\r\n\r\n getSpec(service['url'], '/swagger', function(swagger, error) {\r\n if (error) console.log(error);\r\n handleSwaggerResponse(service, swagger);\r\n })\r\n}", "title": "" }, { "docid": "f33c8b56f23d36bdbe40a189ddef77fe", "score": "0.43928218", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnEndpointPropsFromCloudFormation(resourceProperties);\n const ret = new CfnEndpoint(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "7114444d56215337704756c248e143a8", "score": "0.43772632", "text": "function createIndexFile(ip) {\n // NOTE: use encodeURIComponent if there are special chars in the url\n const url = `http://${ip}:${port}`;\n\n\n // This file is mostly generated by `ares-generate -t hosted_webapp`\n // but local ip of the dev machine needs to be injected\n const indexFile = `<!DOCTYPE html>\n<html>\n<head>\n\t<script>location.href='${url}';</script>\n</head>\n<body>\n</body>\n</html>\n `;\n\n console.log(`${appName} will point to ${url}`);\n console.log(`Writing ${process.cwd()}${sep}${dir}${sep}${filename}`);\n\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir);\n }\n\n try {\n fs.writeFileSync(`${dir}/${filename}`, indexFile, 'utf8');\n } catch (e) {\n console.error(e.message);\n console.error('index.html was not created');\n process.exit(1);\n }\n console.log('Success!');\n}", "title": "" }, { "docid": "1613890a31c79d41e93924e8c708434a", "score": "0.43596995", "text": "_generateApplicationManifest(\n appPackagePath,\n appTypeName,\n serviceName,\n servicePackageName,\n serviceTypeName\n ) {\n if (this.isAddNewService == false) {\n this.fs.copyTpl(\n this.templatePath(\n \"service/app/appPackage/ApplicationManifest.xml\"\n ),\n this.destinationPath(\n path.join(appPackagePath, \"ApplicationManifest.xml\")\n ),\n {\n appTypeName: appTypeName,\n servicePackage: servicePackageName,\n serviceName: serviceName,\n serviceTypeName: serviceTypeName\n }\n );\n } else {\n this.log(appPackagePath);\n var fs = require(\"fs\");\n var xml2js = require(\"xml2js\");\n var parser = new xml2js.Parser();\n fs.readFile(\n path.join(appPackagePath, \"ApplicationManifest.xml\"),\n function(err, data) {\n parser.parseString(data, function(err, result) {\n if (err) {\n return console.log(err);\n }\n\n var parameterCount =\n result[\"ApplicationManifest\"][\"Parameters\"][0][\n \"Parameter\"\n ].length;\n\n result[\"ApplicationManifest\"][\"Parameters\"][0][\n \"Parameter\"\n ][parameterCount] = {\n $: {\n Name: serviceName + \"_ASPNETCORE_ENVIRONMENT\",\n DefaultValue: \"\"\n }\n };\n\n parameterCount++;\n\n result[\"ApplicationManifest\"][\"Parameters\"][0][\n \"Parameter\"\n ][parameterCount] = {\n $: {\n Name: serviceName + \"_InstanceCount\",\n DefaultValue: \"-1\"\n }\n };\n\n var serviceManifestImportCount =\n result[\"ApplicationManifest\"][\n \"ServiceManifestImport\"\n ].length;\n\n result[\"ApplicationManifest\"][\"ServiceManifestImport\"][\n serviceManifestImportCount\n ] = {\n ServiceManifestRef: [\n {\n $: {\n ServiceManifestName: servicePackageName,\n ServiceManifestVersion: \"1.0.0\"\n },\n ConfigOverrides: [\"\"],\n EnvironmentOverrides: [\n {\n $: {\n CodePackageRef: \"code\"\n },\n EnvironmentVariable: [\n {\n $: {\n Name:\n \"ASPNETCORE_ENVIRONMENT\",\n Value:\n \"[\" +\n serviceName +\n \"_ASPNETCORE_ENVIRONMENT\" +\n \"]\"\n }\n }\n ]\n }\n ]\n }\n ]\n };\n\n var defaultServiceCount =\n result[\"ApplicationManifest\"][\"DefaultServices\"][0][\n \"Service\"\n ].length;\n\n result[\"ApplicationManifest\"][\"DefaultServices\"][0][\n \"Service\"\n ][defaultServiceCount] = {\n $: {\n Name: serviceName,\n ServicePackageActivationMode: \"ExclusiveProcess\"\n },\n StatelessService: [\n {\n $: {\n ServiceTypeName: serviceTypeName,\n InstanceCount:\n \"[\" +\n serviceName +\n \"_InstanceCount\" +\n \"]\"\n },\n SingletonPartition: [\"\"]\n }\n ]\n };\n\n var builder = new xml2js.Builder();\n var xml = builder.buildObject(result);\n fs.writeFile(\n path.join(\n appPackagePath,\n \"ApplicationManifest.xml\"\n ),\n xml,\n function(err) {\n if (err) {\n return console.log(err);\n }\n }\n );\n });\n }\n );\n }\n }", "title": "" }, { "docid": "a647a4793d32867f15ef03778d4d7779", "score": "0.4358889", "text": "get defaultPath () {\n return this._path\n }", "title": "" }, { "docid": "4d77adcb8094e6a0c9d29c4ba9bdc27d", "score": "0.43478233", "text": "function defaults(dst, src) {\n\t getOwnPropertyNames(src).forEach(function(k) {\n\t if (!hasOwnProperty.call(dst, k)) defineProperty(\n\t dst, k, getOwnPropertyDescriptor(src, k)\n\t );\n\t });\n\t return dst;\n\t }", "title": "" }, { "docid": "2e48e5e78f72b06b4b10a2eb72973508", "score": "0.43454152", "text": "function createEmptyApiSpec() {\n return {\n openapi: '3.0.0',\n info: {\n title: 'LoopBack Application',\n version: '1.0.0',\n },\n paths: {},\n servers: [{ url: '/' }],\n };\n}", "title": "" }, { "docid": "26cc482eb5791e7a65e10a35557e392e", "score": "0.43448105", "text": "handle(req, res, next) {\n const self = this;\n const pt = url.parse(req.url).pathname;\n const basename = path.basename(pt);\n let dir = path.join((self.localDir), path.dirname(pt));\n if (!path.isAbsolute(dir))\n dir = path.join(APP_ROOT, dir);\n let file = path.join(dir,\n (self.prefix || '') + basename + (self.suffix || ''));\n let ep;\n\n function tryRequire(filename) {\n if (!self.match ||\n (typeof self.match === 'function' && self.match(filename))) {\n try {\n return require(file);\n } catch (e) {\n return false;\n }\n }\n }\n\n if (!(ep = tryRequire(file))) {\n file = path.join(dir, basename, (self.defaultFile || '_default'));\n if (!(ep = tryRequire(file))) {\n next();\n return;\n }\n }\n\n if (ep && ep instanceof Endpoint) {\n if (typeof self.onExecute === 'function') {\n if (self.onExecute(file, ep, req, res)) {\n res.end();\n return;\n }\n }\n return ep.handle(req, res);\n } else {\n res.writeHead(400, 'You can not access this resource');\n res.end();\n }\n\n }", "title": "" }, { "docid": "0ea22863d1f89bd8074abc1c2a9e2599", "score": "0.43293053", "text": "function getDefaultExportPath() {\r\n var exportPath = String(app.activeDocument.fullName);\r\n exportPath = exportPath.substring(0, exportPath.lastIndexOf('/')) + '/';\r\n return exportPath\r\n}", "title": "" }, { "docid": "b75c907a803fef2a12a4a994f39e1c10", "score": "0.43217117", "text": "function requestLatestConfigFileFromServer(){\n opConfigurationFactory.getOpConfig().success(getOpConfigurationSuccessCallback).error(errorCallback);\n }", "title": "" }, { "docid": "3f273352cce03d1d15960daf3d09d2cf", "score": "0.43199113", "text": "function copyConfig (from, to) {\n from = path.join(__dirname, '..', 'assets/config', from)\n write(to, fs.readFileSync(from, 'utf-8'))\n}", "title": "" }, { "docid": "d9258dac88762cd4eec66159451046e2", "score": "0.43174112", "text": "_setDefaults () {\n this.ext = null\n this.filename = null\n this.optionsPath = null\n this.resourceType = null\n this.pathId = null\n }", "title": "" }, { "docid": "fcca51598f374678acc8043a79553ebf", "score": "0.4314811", "text": "function makeEndpoint(incoming) {\n // Convert CoAP options into { name: value } pairs\n const parameters = incoming.options\n\n\t .filter(option => option.name === 'Uri-Query')\n\n // Convert query options into { name: value } pairs\n\t .map(function(option) {\n\t // Split the option and destructure the resulting array\n\t [name, ...values] = option.value.toString('ASCII').split('=');\n\t return { name: name, value: values.join('=') };\n\t })\n\n // Convert con parameters (if any) into structured ones\n\t .map(function(option) {\n\t if (option.name === 'con') {\n\t\t return { [option.name]: URI.parse(option.value) };\n\t }\n\t return option;\n\t })\n\n // Convert the array of { name: value } pairs into an object\n\t .reduce(function(object, option) {\n\t object[option.name] = option.value;\n\t return object;\n\t }, {});\n\n // Create a default context object\n const endpoint = {\n\tcon: {\n\t scheme: 'coap',\n\t family: incoming.rsinfo.family,\n host: incoming.rsinfo.address,\n\t port: incoming.rsinfo.port,\n\t}\n };\n\n // Assing the endpoint from defaultParameters, overwritten by parameters\n return Object.assign(endpoint, defaultParameters, parameters);\n}", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "c1c1b7b23b8aba97d7aafa617a895526", "score": "0.43098277", "text": "function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }", "title": "" }, { "docid": "7f6af979b537076b80a350029019e5f0", "score": "0.4308557", "text": "generateSharedJS(inFile, outFile) {\n var fn = path.join(this.jt.path, inFile) // file with marker\n var newFN = path.join(this.jt.path, outFile) // actual file to be sent to clients and admins\n try {\n fs.copySync(fn, newFN);\n replace({\n regex: '{{{SERVER_IP}}}',\n replacement: this.ip,\n paths: [newFN],\n recursive: true,\n silent: true,\n });\n replace({\n regex: '{{{SERVER_PORT}}}',\n replacement: this.port,\n paths: [newFN],\n recursive: true,\n silent: true,\n });\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "035a1e57b9c85ef1bf8031d4b2dcdf7c", "score": "0.43049628", "text": "copyConfigFile(context) {\n return __awaiter(this, void 0, void 0, function* () {\n const { driver } = this.options;\n const { metadata, name } = driver;\n const sourcePath = this.getConfigPath();\n const configPath = context.cwd.append(metadata.configName);\n if (!sourcePath) {\n throw new Error(this.tool.msg('errors:configCopySourceMissing'));\n }\n const config = this.loadConfig(sourcePath);\n this.debug('Copying config file to %s', chalk_1.default.cyan(configPath));\n driver.config = config;\n driver.onCopyConfigFile.emit([context, configPath, config]);\n context.addConfigPath(name, configPath);\n return fs_extra_1.default\n .copy(sourcePath.path(), configPath.path(), {\n overwrite: true,\n })\n .then(() => configPath);\n });\n }", "title": "" }, { "docid": "a2c95143af30eaf14671630c377d187f", "score": "0.43037343", "text": "writeContentSrc(newSrc) {\n const root = this.doc.getroot();\n let contentElement = root.find('content');\n if (!contentElement) {\n contentElement = et.SubElement(root, 'content', { src: 'index.html' });\n }\n contentElement.set('original-src', contentElement.get('src'));\n contentElement.set('src', newSrc);\n let navElement = root.find(`allow-navigation[@href='${newSrc}']`);\n if (!navElement) {\n navElement = et.SubElement(root, 'allow-navigation', { href: newSrc });\n }\n }", "title": "" }, { "docid": "9431f266e607e65fc27a9b714f079253", "score": "0.42978862", "text": "_copyInheritedDocs(targetDocComment, sourceDocComment) {\n targetDocComment.summarySection = sourceDocComment.summarySection;\n targetDocComment.remarksBlock = sourceDocComment.remarksBlock;\n targetDocComment.params.clear();\n for (const param of sourceDocComment.params) {\n targetDocComment.params.add(param);\n }\n for (const typeParam of sourceDocComment.typeParams) {\n targetDocComment.typeParams.add(typeParam);\n }\n targetDocComment.returnsBlock = sourceDocComment.returnsBlock;\n targetDocComment.inheritDocTag = undefined;\n }", "title": "" }, { "docid": "9431f266e607e65fc27a9b714f079253", "score": "0.42978862", "text": "_copyInheritedDocs(targetDocComment, sourceDocComment) {\n targetDocComment.summarySection = sourceDocComment.summarySection;\n targetDocComment.remarksBlock = sourceDocComment.remarksBlock;\n targetDocComment.params.clear();\n for (const param of sourceDocComment.params) {\n targetDocComment.params.add(param);\n }\n for (const typeParam of sourceDocComment.typeParams) {\n targetDocComment.typeParams.add(typeParam);\n }\n targetDocComment.returnsBlock = sourceDocComment.returnsBlock;\n targetDocComment.inheritDocTag = undefined;\n }", "title": "" }, { "docid": "2a2e8377510cd69fb728e71b620ac203", "score": "0.42951265", "text": "function defaults(dst, src) {\n getOwnPropertyNames(src).forEach(function(k) {\n if (!hasOwnProperty.call(dst, k)) defineProperty(\n dst, k, getOwnPropertyDescriptor(src, k)\n );\n });\n return dst;\n }", "title": "" }, { "docid": "f00115942e8f620ea78a01c2e529d473", "score": "0.42932943", "text": "function createFileExportConfig(filepathFormatString, pinID, selectedConfig) {\n\t// map viewModel to plain object\n\tvar config = JSON.parse(JSON.stringify(configFileExportTemplate)); // configFileExportTemplate is loaded in OutputDataRecorder with command \"<script type=\"text/javascript\" src=\"js/OutputDataRecorder_configFileExport.js\"></script>\"\n\t\n\tconfig.params.filepath_format = filepathFormatString;\n\tconfig.chain[0].connections[0].outputPinID = pinID;\n\tconfig.chain[0].config = selectedConfig;\n\t\n\treturn config;\n}", "title": "" }, { "docid": "8aac69da572783dfc1aba79c4871909c", "score": "0.42847452", "text": "function addDefaultAssets () {\n // Skip this step on the browser, or if emptyRepo was supplied.\n const isNode = !global.window\n if (!isNode || opts.emptyRepo) {\n return doneImport(null)\n }\n\n const importer = require('ipfs-data-importing')\n const blocks = new IpfsBlocks(repo)\n const dag = new IpfsDagService(blocks)\n\n const initDocsPath = path.join(__dirname, '../init-files/init-docs')\n\n importer.import(initDocsPath, dag, {\n recursive: true\n }, doneImport)\n\n function doneImport (err, stat) {\n if (err) { return callback(err) }\n\n // All finished!\n callback(null, true)\n }\n }", "title": "" }, { "docid": "579d398700512d9fd34eb71102ac47a0", "score": "0.4284581", "text": "function copyToServer(){\n return src(['dist/*.*', 'dist/php/*.php', 'images/*.*', 'ics/*.php', 'pages/*.*', 'errors/*.php', 'user/**/*.*', './index.php'], {\"base\": \".\"})\n .pipe(dest('/opt/lampp/docs/homelibrary'));\n // '/var/www/homelibrary'\n}", "title": "" }, { "docid": "e865665d0adfc32613516aa0579520c6", "score": "0.42845467", "text": "get DefaultHDR() {}", "title": "" }, { "docid": "e2b977259dd26777ac49687f3ef177ae", "score": "0.4283959", "text": "constructor(baseURL = 'http://petstore.swagger.io:80/v2') {\n super(baseURL);\n }", "title": "" }, { "docid": "e980437367d5a408b73dceb4b22967d6", "score": "0.4275284", "text": "function cloneDefinitions() {\n\t var args = listToArray(arguments);\n\t var target = args[0];\n\n\t args.splice(1, args.length - 1).forEach(function (source) {\n\t Object.getOwnPropertyNames(source).forEach(function (propName) {\n\t // If this property already exist in target we delete it first\n\t delete target[propName];\n\t // Define the property with the descriptor from source\n\t Object.defineProperty(target, propName,\n\t Object.getOwnPropertyDescriptor(source, propName));\n\t });\n\t });\n\n\t return target;\n\t }", "title": "" } ]
3b4fee4365c0f119be5a4e89596efc1f
Stops playing the UFO sound.
[ { "docid": "5ba7b2f0b1e04e01b3a0b70f6f33ccce", "score": "0.79874957", "text": "stopUFOSpawnSound() {\n // Right now there's no way of knowing which track is playing so just stop all of them.\n this.aggressiveUfoAudio.stop();\n this.passiveUfoAudio.stop();\n }", "title": "" } ]
[ { "docid": "a4625c8e07481c1e53b80ba2527f9696", "score": "0.767148", "text": "function stopSound() {\n if (source) {\n source.noteOff(0);\n }\n}", "title": "" }, { "docid": "313964aafc91a1c8317d6e6562205f87", "score": "0.73728466", "text": "function stopAudio() {\n if (isBusy()) {\n lastPlayer.stop();\n removeBlurHandler();\n }\n }", "title": "" }, { "docid": "466273545b64090c1cfa4f2b5823c92f", "score": "0.7282048", "text": "function stop() {\n source.stop(0);\n source.disconnect(0);\n playing = false;\n }", "title": "" }, { "docid": "38e7005b2f535928f937441c9f2ce65e", "score": "0.72074795", "text": "function stopSound() {\r\n\tif (aSoundSource) {\r\n\t\taSoundSource.stop(0);\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "b600a87f1d075e9ea9113d6f807f75bc", "score": "0.716883", "text": "stop() {\n this._sound.stop();\n\n // make play icon\n this._target.find(\".toggle-play\")\n .removeClass(\"icon-pause\")\n .addClass(\"icon-play\");\n this._isPlaying = false;\n }", "title": "" }, { "docid": "df2e3c34d15b2be71acdd90fb2883e76", "score": "0.71045524", "text": "stop() {\n if (this.isPlaying()) {\n this._buffer.stop();\n }\n }", "title": "" }, { "docid": "aca161fff1c3366fe0a4958b7902695e", "score": "0.70555335", "text": "function stopAudio() { \n createjs.Sound.stop();\n}", "title": "" }, { "docid": "b376cb5857946b66635dd32ddf0cc449", "score": "0.70554274", "text": "function stop() {\n osc.disconnect(audioContext.destination);\n}", "title": "" }, { "docid": "5e75828eb355bf310d8055fbf983791a", "score": "0.7054675", "text": "function stopAudio() {\r\n mySound.stop();\r\n}", "title": "" }, { "docid": "72f3bc0d58d3132d0c37b229ee1f16d5", "score": "0.70331573", "text": "stop() {\n\t\tthis._isPlaying = false;\n\t\tthis.stopRendering();\n\t}", "title": "" }, { "docid": "b4da0423dba0a61d3b76b329fb1aac52", "score": "0.6995992", "text": "function scene1_stopSound(){\n\n\tstoppeAnimation(\"szene1_sound_rechts\");\n\tstoppeAnimation(\"szene1_sound_links\");\n}", "title": "" }, { "docid": "359e8e4639aa6f3ad05346a62993b266", "score": "0.69806975", "text": "stop() {\n // Stop playing\n this._playing = false;\n }", "title": "" }, { "docid": "9662b8b34dbd72e197b1a9a57abd7b34", "score": "0.69744474", "text": "stop(name){\n if(this.sounds[name]) {\n this.sounds[name].stop();\n } \n }", "title": "" }, { "docid": "733938e254eba61d7ba8f886e5ed2b17", "score": "0.6939263", "text": "stop() {\n this._isPlaying = false,\n this.player.stop();\n\n this._executeCommandForward('stop');\n\n this.emit(EVENTS.STOP);\n this.emitPosition(this.position);\n }", "title": "" }, { "docid": "f50f4833d08f24d50cdc3780ba9dd27d", "score": "0.6935253", "text": "function stop() {\n player.pause();\n player.currentTime = 0;\n \n init();\n }", "title": "" }, { "docid": "6b2a10a7ebbcc97a82e50b102adeb56b", "score": "0.6924999", "text": "function stopSound(e) {\n const color = e.target.value;\n sounds[color].stop();\n }", "title": "" }, { "docid": "0cdb9103444faeb87d86016cbd45c9ca", "score": "0.69159967", "text": "stop() {\n if (this.sound != null) {\n this.source.returnSound(this.sound);\n if (this.started) {\n this.sound.pause();\n this.sound.currentTime = 0;\n this.sound.volume = 1;\n this.sound.muted = false;\n this.sound.removeEventListener(\"ended\", this.endEvent);\n if (this.loadedEvent != null)\n this.sound.removeEventListener(\"loadeddata\", this.loadedEvent);\n }\n this.sound = null;\n this.started = false;\n this._paused = false;\n this.fadePercent = 1;\n const i = Sound.active.indexOf(this);\n if (i >= 0)\n Sound.active.splice(i, 1);\n }\n return this;\n }", "title": "" }, { "docid": "a08c8c1237c405ba11645356eecd47c2", "score": "0.69140524", "text": "function offSound() {\n document.querySelectorAll('audio').forEach(elem => elem.pause());\n }", "title": "" }, { "docid": "461c19906c8a080153e24baa071e434c", "score": "0.6894852", "text": "stop() {\n this.audioElement.pause();\n this.audioElement.currentTime = 0;\n }", "title": "" }, { "docid": "a564382a247b8773214170a160bd665f", "score": "0.68883914", "text": "function stopAudio() {\n song.pause();\n}", "title": "" }, { "docid": "fc4f0cdb686e93891ff2dc068857a765", "score": "0.68861455", "text": "function stopSound(time) {\n gainNode.gain.setTargetAtTime(0, time, 0.015);\n}", "title": "" }, { "docid": "caadf9514e0b651023a0343090a28df6", "score": "0.6873616", "text": "function stopSong() {\n activeSong.currentTime = 0;\n activeSong.pause();\n }", "title": "" }, { "docid": "5e859dc20b9e12f95042e793da3f1c9e", "score": "0.68732584", "text": "function stopSound(sound){\n console.log(\"stopSound() [sound:\"+sound+\"]\");\n if(loaded){\n show(sound,false);\n if(sound == 'rain'){\n playingRain = false;\n bufferRain.stop();\n }else if(sound == 'birds'){\n playingBirds = false;\n bufferBirds.stop();\n }else if(sound == 'thunder'){\n playingThunder = false;\n bufferThunder.stop();\n }else if(sound == 'wolves'){\n playingWolves = false;\n bufferWolves.stop();\n }\n }\n}", "title": "" }, { "docid": "6ace610cb3112b4d5ccd9355dd7c6d54", "score": "0.685787", "text": "function stop(){\n clearInterval(playing);\n }", "title": "" }, { "docid": "06e8b66705a6c1d1631591db12b49d00", "score": "0.68436885", "text": "function stopSound(s) {\n _ch_checkArgs(arguments, 1, \"stopSound(sound)\");\n\n if (! _ch_audioContext) {\n try {\n // Only stop if required to do something\n if (! (s.paused || s.ended)) {\n s.pause();\n s.playing = false;\n }\n } catch (e) {\n // Ignore invalid state error if loading has not succeeded yet\n }\n } else if (s.playing) {\n s.source.stop(0);\n s.playing = false;\n s.source = null;\n }\n}", "title": "" }, { "docid": "0c404d47f24f24ac385884c46a66663a", "score": "0.68366486", "text": "function stopAudio() {\n if (player.src) {\n player.pause();\n if (player.currentTime) player.currentTime = 0;\n }\n}", "title": "" }, { "docid": "1497b450c63e7312b00342ff5b7ecf07", "score": "0.68281317", "text": "function stopPlaying() {\n app.sounds[\"thrust\"].volume(0);\n cleanUpPlanets();\n app.mode = GAMESTATE_LOADED;\n app.drawScene = function() {};\n cancelAnimationFrame(app.animFrame);\n}", "title": "" }, { "docid": "23f46e558bbddc571cf494a3aa2e1d22", "score": "0.6824971", "text": "stopPlaying() {\n this.emit(\"end\");\n this._setSpeaking(false);\n this.piper.stop();\n this.piper.resetPackets();\n }", "title": "" }, { "docid": "6e36bfae72eb8fed644f69af36162c49", "score": "0.68222797", "text": "stop() {\n\t\tthis.isPlaying = false;\n\t\tclearInterval(this.audioScheduleInterval);\n\t\tthis.audioScheduleIndex = 0;\n\t\tif (this.playbackNode !== null) this.playbackNode.stop();\n\t\taudioCtx.close();\n\t\taudioCtx = new window.AudioContext();\n\t}", "title": "" }, { "docid": "3ace51cd692e4e8e9d5735da5dc1ef5b", "score": "0.68188214", "text": "static stop(fx) {\n if (this.sfx[fx] && this.sfx[fx].source) {\n this.sfx[fx].source.stopped = true;\n this.sfx[fx].source.stop();\n }\n }", "title": "" }, { "docid": "95f5baf230b3ffe324441cedf058576c", "score": "0.68142074", "text": "stop() {\n if(this.state.loaded) {\n this.audio.pause();\n this.audio.currentTime = 0;\n }\n }", "title": "" }, { "docid": "2cf62620965c373bf980145b6691d3b0", "score": "0.6813009", "text": "stop(){\n\t\tTone.context.clearTimeout(this._id)\n\t\tthis._players.stopAll('+0.5')\n\t}", "title": "" }, { "docid": "626ead6cacbd8cda05b40adbcc639d5b", "score": "0.67761165", "text": "stop() {\n this.reset();\n this.isPlaying = false;\n this.isPaused = false;\n this.isDone = false;\n }", "title": "" }, { "docid": "0423d21843d8c775f910385a32647493", "score": "0.67675716", "text": "function stop() {\n oscillator.noteOff(0);\n fire('stop');\n}", "title": "" }, { "docid": "8d0aebbe9613bc971cad93abfe93c0a7", "score": "0.67245036", "text": "function stopBattle() {\n if (!sound.paused) {\n sound.pause();\n sound.currentTime = 0;\n }\n document.body.classList.remove(classNameForAction)\n }", "title": "" }, { "docid": "cf28ff96358b2a2157ff790bb3b11500", "score": "0.67142457", "text": "stop(id) {\n var sound = id.key ? id : media.get(\"sounds\", id);\n CONTEXT ? stop_web_audio(sound) : stop_elm_audio(sound);\n console.log('SOUND STOPPED: ' + id);\n }", "title": "" }, { "docid": "40fd340c59045921471b8083377f9310", "score": "0.6712301", "text": "function stopaudio() {\r\n var element = document.querySelector(\".removeaudioplayer\");\r\n element.classList.remove(\"show\");\r\n isPlaying = false;\r\n playSound();\r\n console.log(\"het werkt\")\r\n}", "title": "" }, { "docid": "31361c9ff6c2d498b2c479e7fe04ff80", "score": "0.67076796", "text": "stop() {\n if (!this.isSpeaking)\n return;\n if (window.speechSynthesis)\n window.speechSynthesis.cancel();\n if (this.voxEngine)\n this.voxEngine.stop();\n if (this.onstop)\n this.onstop();\n }", "title": "" }, { "docid": "e2d3788e744a12d3697929c8768ef3de", "score": "0.67002815", "text": "function StopPlay() {\n myAudioApple.pause();\n myAudioApple.currentTime = 0;\n myAudioBanana.pause();\n myAudioBanana.currentTime = 0;\n myAudioBurger.pause();\n myAudioBurger.currentTime = 0;\n myAudioHotdog.pause();\n myAudioHotdog.currentTime = 0;\n myAudioKiwi.pause();\n myAudioKiwi.currentTime = 0;\n myAudioPasta.pause();\n myAudioPasta.currentTime = 0;\n myAudioPizza.pause();\n myAudioPizza.currentTime = 0;\n myAudioSalad.pause();\n myAudioSalad.currentTime = 0;\n myAudioTaco.pause();\n myAudioTaco.currentTime = 0;\n}", "title": "" }, { "docid": "54246ebfdc37f61bb16d7421c178cd5a", "score": "0.6687431", "text": "function stopAudio(){\n patriots.pause();\n patriots.currentTime = 0;\n\n cowboys.pause();\n cowboys.currentTime = 0;\n\n bills.pause();\n bills.currentTime = 0;\n\n rams.pause();\n rams.currentTime = 0;\n\n panthers.pause();\n panthers.currentTime = 0;\n\n dolphins.pause();\n dolphins.currentTime = 0;\n}", "title": "" }, { "docid": "e0d063a61fa2ef4fe1b3729a44aa4718", "score": "0.6685888", "text": "stop () {\n this._reset()\n animationFram.caf(this.rafid)\n this.onStep(1)\n this.onComplete(1)\n }", "title": "" }, { "docid": "f0a919f656e9bfa4adac7ed3d195e376", "score": "0.6685774", "text": "stopSound(soundName: string) {\n io.stopSound(this.socket, soundName);\n }", "title": "" }, { "docid": "6fdc76864f629ea9981c89b34094fbe8", "score": "0.6680759", "text": "stop() {\n if (this.enabled) {\n if (this.audio)\n this.audio.pause();\n else if (this.player)\n this.player.stop();\n }\n }", "title": "" }, { "docid": "5fa377220a0d40694ba9e00bfcda2b6f", "score": "0.66469306", "text": "stopHoverGoBoom(){\r\n this.ufoSound.pause();\r\n }", "title": "" }, { "docid": "f585815ad1a630c627d9b3114753d257", "score": "0.664387", "text": "stop() {\n this.stopMedia(-1);\n }", "title": "" }, { "docid": "e9ef58972c0af1dad066555b55b52992", "score": "0.6633398", "text": "stop() {\n this.log('client called stop()');\n RNFMAudioPlayer.stop();\n }", "title": "" }, { "docid": "8f8d4d0ed53718a8bd402c6a569bc9f9", "score": "0.6633106", "text": "function stopLifelinePassiveSound(){\r\n\ttry{\r\n\t\twindow.GameVariables.LifelinePassiveSound.pause();\r\n\t}\r\n\tcatch(e){\r\n\t\tconsole.log(e);\r\n\t}\r\n}", "title": "" }, { "docid": "20ead07595226d03a1222fe5aca75e63", "score": "0.66259474", "text": "function stop() {\n speechSynthesis.cancel();\n }", "title": "" }, { "docid": "f01db48e20d6139af781153bf97c6c07", "score": "0.6615464", "text": "function stopCurrentSound(){\n\trolledAudioVisualObjects[currentQuestion][\"winnerObject\"][\"audio\"].pause();\n\trolledAudioVisualObjects[currentQuestion][\"winnerObject\"][\"audio\"].currentTime = 0;\n}", "title": "" }, { "docid": "5c5a834dc7345a38972543aaa1aee8ea", "score": "0.6612992", "text": "stop(){\n //console.log('Stopped: ' + this.songArray[0].name);\n this.player.pause();\n this.player.currentTime = 0;\n }", "title": "" }, { "docid": "97dbf4dcab10fd89e5042e501210b053", "score": "0.6594112", "text": "stop(){\n this.isPlaying = false;\n }", "title": "" }, { "docid": "1ad4752942aeafb3782fe6ed08169c62", "score": "0.6544015", "text": "function stopSong(){\n activeSong.currentTime = 0;\n activeSong.pause();\n}", "title": "" }, { "docid": "536805d1200a146041d5134a6d57a2cc", "score": "0.6543055", "text": "stopPlaying() {\n if(this.ended) {\n return;\n }\n this.ended = true;\n if(this.current && this.current.timeout) {\n clearTimeout(this.current.timeout);\n this.current.timeout = null;\n }\n this.current = null;\n if(this.piper) {\n this.piper.stop();\n this.piper.resetPackets();\n }\n\n if(this.secret) {\n for(let i = 0; i < 5; i++) {\n this.sendAudioFrame(SILENCE_FRAME, this.frameSize);\n }\n }\n this.playing = false;\n this.setSpeaking(0);\n\n /**\n * Fired when the voice connection finishes playing a stream\n * @event VoiceConnection#end\n */\n this.emit(\"end\");\n }", "title": "" }, { "docid": "d579b70f7b2aba881b1e35ec27350d2c", "score": "0.6541185", "text": "stopAmbientSound() {\n this.shouldPlayAmbientSound = false;\n }", "title": "" }, { "docid": "8e567feac0be617f48370f2a3e5ac2f4", "score": "0.6536681", "text": "function stop() {\n\tif (sprite.playing) {\n\t reset();\n\t sprite.gotoAndStop(sprite.currentFrame);\n\t}\n}", "title": "" }, { "docid": "1ed60c776897afd00a20410a20e9deb3", "score": "0.652798", "text": "function stopSong(){\r\n activeSong.currentTime = 0;\r\n activeSong.pause();\r\n}", "title": "" }, { "docid": "7ed85f5ec8a8452aa51af41df698d29c", "score": "0.65207875", "text": "stop() {\n if (this.useAudioBuffer)\n this.stopAudioBuffer(this.mc.recBuffer);\n else if (this.mbe && this.mbe.data && this.mbe.data.pause && !this.mbe.data.paused && !this.mbe.data.ended && this.mbe.data.currentTime)\n this.mbe.data.pause();\n }", "title": "" }, { "docid": "bb969066e5fa25873d974ae05e9b421c", "score": "0.65185577", "text": "function stopMusic() {\n traffic.pause();\n loop.pause();\n}", "title": "" }, { "docid": "4980880e093e39b6fbf94694f08d23c0", "score": "0.6506146", "text": "function stopAudio(audioName)\n{\n audioName.pause();\n audioName.load();\n}", "title": "" }, { "docid": "d51774bd152799e450d632a3dbb23404", "score": "0.64959997", "text": "stopSound(sourceNode) {\n if (sourceNode) {\n sourceNode.source.stop();\n if (sourceNode.uuid) {\n this.playingSounds.delete(sourceNode.uuid);\n }\n }\n }", "title": "" }, { "docid": "bfbb5e4c2291d85459ada3528765a9b2", "score": "0.6486589", "text": "function stopSound () {\n stopButton.classList.add('d-none')\n playButton.classList.remove('d-none')\n playbackSlider.disabled = true\n\n sound.stop(0)\n}", "title": "" }, { "docid": "61873cc96cce57ff4cefa199a3e1cef9", "score": "0.64804584", "text": "function stopLifelineActiveSound(){\r\n\ttry{\r\n\t\twindow.GameVariables.LifelineActiveSound.pause();\r\n\t}\r\n\tcatch(e){\r\n\t\tconsole.log(e);\r\n\t}\r\n}", "title": "" }, { "docid": "5611a3871e4ae3a3c5d73d054fd6700c", "score": "0.64777565", "text": "stop(){\n try{\n if(!this.voiceConnection) return;\n this.stopped = true;\n this.voiceConnection.dispatcher.end();\n }catch(e){\n console.log(e);\n }\n }", "title": "" }, { "docid": "c341910f68a556b6e68f66708bfa2384", "score": "0.645899", "text": "static stopSound(name)\n {\n sounds[name].loop = false;\n SoundEngine.pauseSound();\n }", "title": "" }, { "docid": "0c16e107fe4e98646b5afa5fd45a51ef", "score": "0.645766", "text": "function stop() {\n sendRemoteControlRequest(\n 'stop',\n SAP_MUSIC_REMOTE_CONTROL_REQ_STATUS_BOTH\n );\n }", "title": "" }, { "docid": "7cc15fcb6ce8f2659191a2eb060c6387", "score": "0.6441954", "text": "stop(force = false) {\r\n if (this._audioSrc && this._media) {\r\n this._forceStop = force;\r\n this._updateMediaState(MediaStatus.MEDIA_STOPPED);\r\n if (this._media.stop) {\r\n this._media.stop();\r\n // this._media.release();\r\n }\r\n else {\r\n this._media.pause();\r\n this._audioElm.currentTime = 0;\r\n }\r\n this._loopsRemaining = this._totalLoops;\r\n }\r\n }", "title": "" }, { "docid": "9bc606c50b19caad0a856f2967a7f76e", "score": "0.6437885", "text": "function stopShortPassiveSound(){\r\n\ttry{\r\n\t\twindow.GameVariables.ShortPassiveSound.pause();\r\n\t}\r\n\tcatch(e){\r\n\t\tconsole.log(e);\r\n\t}\r\n}", "title": "" }, { "docid": "5ee24d2a378aa24502cfa1d03983bb54", "score": "0.6429082", "text": "stopAudio() {\n if (!this.audio || !this.audio.audio) {\n return;\n }\n\n /*\n * We need to reset the audio button to its initial visual state, but it\n * doesn't have a function to to that -> force ended event and reload.\n */\n const duration = this.audio.audio.duration;\n if (duration > 0 && duration < Number.MAX_SAFE_INTEGER) {\n this.audio.seekTo(duration);\n }\n\n if (this.audio.audio.load) {\n setTimeout(() => {\n this.audio.audio.load();\n }, 100);\n }\n }", "title": "" }, { "docid": "f599ec860f9e652bb30964240ce887cd", "score": "0.64249295", "text": "function stopLongPassiveSound(){\r\n\ttry{\r\n\t\twindow.GameVariables.LongPassiveSound.pause();\r\n\t}\r\n\tcatch(e){\r\n\t\tconsole.log(e);\r\n\t}\r\n}", "title": "" }, { "docid": "e2dfb9a4905618ca7c6dfb69a434b409", "score": "0.6417788", "text": "stop() {\n // Already stopped? Do not continue\n if (!this.isSpeaking)\n return;\n // Stop pumping\n clearTimeout(this.pumpTimer);\n this.isSpeaking = false;\n // Cancel all pending requests\n this.pendingReqs.forEach(r => r.cancel());\n // Kill and dereference any currently playing file\n this.scheduledBuffers.forEach(node => {\n node.stop();\n node.disconnect();\n });\n this.nextBegin = 0;\n this.currentIds = undefined;\n this.currentSettings = undefined;\n this.pendingReqs = [];\n this.scheduledBuffers = [];\n console.debug('VOX STOPPED');\n if (this.onstop)\n this.onstop();\n }", "title": "" }, { "docid": "8bc6e0e57bbc50e6d87bcf0a889f6f23", "score": "0.6410111", "text": "function endGame(){\n\tfor(var i = 0; i < document.getElementsByTagName(\"audio\").length; i++){\n\t var v = document.getElementsByTagName(\"audio\");\n\t if(!v[i].paused && v[i].src!=null && v[i].src!= \"\"){\n\t\tv[i].pause();\n\t\tv[i].currentTime = 0;\n\t }\n\t}\n\t$(\"[data-ui='messages']\").removeClass(\"active\");\n\t$(\"#game img\").hide();\n\tplaying = false;\n\tengine[\"Label\"] = \"Start\";\n\tlabel = game[engine[\"Label\"]];\n\tengine[\"Step\"] = 0;\n\t$(\"section\").hide();\n\t$(\"[data-menu='main']\").show();\n }", "title": "" }, { "docid": "ab34af076bbbf71426499d8d8ee37f0e", "score": "0.6378336", "text": "function killTheSound(myContext) {\n\tsoundCounselor.killSound(myContext);\n\n\ttheStopButton.setAttribute(\"style\",\"display:none;\");\n\tthePlayButton.removeAttribute(\"style\");\n}", "title": "" }, { "docid": "cf3435eadb7db03e3928a3dabfe27b36", "score": "0.6373993", "text": "stopTrack() {\n if (this.#playingTrack != null) {\n this.#playingTrack.pause();\n this.#playingTrack.currentTime = 0;\n this.#playingTrack = null;\n }\n }", "title": "" }, { "docid": "5f7e2e87dd0ba128ef5e3f6fc9a6d7a5", "score": "0.63543284", "text": "stopAudios() {\n // stop the animation\n this.stop()\n\n // stop the audios\n for (var propName in this.audios) {\n if ((this.audios).hasOwnProperty(propName)) {\n if (this.audios[propName].pause) {\n this.audios[propName].pause();\n this.audios[propName].currentTime = 0;\n }\n }\n }\n }", "title": "" }, { "docid": "3f10f9253b2b3072952a524e5bec4853", "score": "0.6316338", "text": "function stopShortActiveSound(){\r\n\ttry{\r\n\t\twindow.GameVariables.ShortActiveSound.pause();\r\n\t}\r\n\tcatch(e){\r\n\t\tconsole.log(e);\r\n\t}\r\n}", "title": "" }, { "docid": "2f52a59add45246bc8d53be287ce5649", "score": "0.6310846", "text": "stopAutoPlay() {\n clearInterval(this.autoPlayInterval);\n }", "title": "" }, { "docid": "ad6bda56327a3b760efcdd9aa9121b81", "score": "0.6305572", "text": "function stopMusic (){\n sounds.forEach(sound => {\n const music = document.getElementById(sound);\n //https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio\n music.pause();\n music.currentTime = 0;\n });\n}", "title": "" }, { "docid": "203b514c795ec8adab31bf8c849d6f67", "score": "0.62925184", "text": "function stopsPlaybackOptions(){\n $(\".question\").click(function(){\n $(\"#mySound\")[0].pause()\n responsiveVoice.cancel();\n });\n}", "title": "" }, { "docid": "bf30e5931fae0545fa42b7358d1c50bd", "score": "0.628743", "text": "function but() {\n if (!soundEnabled) return;\n\n audioBut.pause();\n audioBut.currentTime = 0;\n audioBut.play();\n }", "title": "" }, { "docid": "678eb7b8ea8c6ad28edbfc293ce7b9b9", "score": "0.6286663", "text": "function stopSound(audioID) {\n if (typeof audioID !== \"string\")\n return;\n var sound = document.getElementById(audioID);\n sound.volume = 0;\n //sound.pause();\n //sound.currentTime = 0;\n }", "title": "" }, { "docid": "a59c23fe75ba4bb393fe6867e4fe5bd3", "score": "0.62813", "text": "function stopPlay(){\n\t\tvar thisAnimatedWalker = $(this.parentNode.parentNode).data('walker');\n\n\t\tthisAnimatedWalker.pathAnimator.running ? thisAnimatedWalker.pathAnimator.stop() : thisAnimatedWalker.resume.apply(thisAnimatedWalker);\n\t}", "title": "" }, { "docid": "a4df7dc41c6b11e98cc60d9d9d21d402", "score": "0.62478334", "text": "function StopPlayback() {\n return ATMPlayer.Stop();\n}", "title": "" }, { "docid": "ab4885eb89acf42c9a2c95ca58581293", "score": "0.6237464", "text": "function stopRecognition(){\r\n // TODO \r\n mic.removeClass('animate');\r\n start = false;\r\n }", "title": "" }, { "docid": "462b6e1819a77736658a4de4b6dbd7b4", "score": "0.6217827", "text": "function stopMusic(track) {\n if(typeof(soundManager) !== 'undefined'){\n soundManager.stopAll();\n track = \"\";\n var soundsIDs = soundManager.soundIDs;\n for (i = 0; i < soundsIDs.length; i++) {\n soundManager.destroySound(soundsIDs[i]);\n }\n }\n}", "title": "" }, { "docid": "1d4e1aa25a3801ee95ec66091fefd092", "score": "0.6205651", "text": "function stop() {\r\n if (isOn) {\r\n tstartStop.textContent = \"Start\"\r\n isOn = false;\r\n clearInterval(tinterval);\r\n clearInterval(talertinterval);\r\n ttimer.textContent = \"00 : 00 : 00\";\r\n seconds = 0; minutes = 0; hours = 0;\r\n audio.pause();\r\n audio.currentTime = 0;\r\n console.log(audio.currentTime);\r\n }\r\n}", "title": "" }, { "docid": "c66900a4205e3fd790eadfa2fe4427d5", "score": "0.61995566", "text": "function stopMusic() {\n audio = document.getElementById(\"music-bed\");\n audio.pause();\n }", "title": "" }, { "docid": "c79b289a2c13c39ce3704d1cce054142", "score": "0.61684227", "text": "function stopPlayback(){\n\tmyArchive.stopPlayback();\n}", "title": "" }, { "docid": "83ddd7fce5914265c518e017e81e6972", "score": "0.61666197", "text": "function _stop() {\n soundManager.stopAll();\n return _api;\n }", "title": "" }, { "docid": "286adbe0a6b173ce7db4c5168bba8231", "score": "0.61634", "text": "function audioStop() {\n\tshouldPlayersBeOn = false;\n\tstopLoops();\n\tmaster.amp(0, 0.2, 0);\n\t// experienceDur = 0;\n\tspeechDur = 0;\n\tsilenceDur = 0;\n\t//smoothExperienceDur = 0;\n\tsmoothSpeechDur = 0;\n\tisSchedulerOn = false; \n\taudioProcessorLoop.start();\n\tcontinuousWhispers = false;\n\tconsole.log(\"Scheduler stopped!\");\n}", "title": "" }, { "docid": "254bf274314a57307f0c335fc90086cc", "score": "0.61466813", "text": "function stopPlayer() {\n mediaPlayer.pause();\n mediaPlayer.currentTime = 0;\n}", "title": "" }, { "docid": "470477396fdbd4269db46b094e730a0a", "score": "0.6146315", "text": "function clear_sound() {\r\n\t\tdocument.tickSound.Stop();\r\n\t\tdocument.tick2Sound.Stop();\r\n\t}", "title": "" }, { "docid": "fbcbe97b329f71eab58f8e3ad398ea71", "score": "0.6128124", "text": "removebullet(){\n this.config.sound.stop();\n this.destroy();\n }", "title": "" }, { "docid": "0a3ede0eacdddfb037055a1f3c67b72d", "score": "0.6119736", "text": "function onStop() {\n log('#logs', \"Clicked the stop button\");\n if (detector && detector.isRunning) {\n detector.removeEventListener();\n detector.stop();\n\n }\n baseAudio1.stop();\n baseAudio2.stop();\n angry1.stop();\n angry2.stop();\n sad1.stop();\n sad2.stop();\n happy2.stop();\n happy2.stop();\n\n}", "title": "" }, { "docid": "2aefea83dbc408e42b02089596f4342a", "score": "0.6117147", "text": "stopAudio() {\n if (this.audioContext !== null) {\n this.samples = new Float32Array();\n clearInterval(this.autoUpdateBufferTimer);\n this.audioContext.close();\n this.audioContext = null;\n }\n }", "title": "" }, { "docid": "33975bdf7df00d87bf344c0751a3292b", "score": "0.6110246", "text": "function stop() { \n\tplayer.stopVideo(); \n\tymp_state = \"stopped\";\n\tSendDisplayInfo();\n}", "title": "" }, { "docid": "18fe72986f73561fa8120ac750f0e8b8", "score": "0.61072165", "text": "function stop() {\n clearInterval(timer);\n\n // change the button display\n playButton.innerText = \"Stopping...\";\n playButton.onclick = null;\n\n // fade out master volume...\n line(masterGainNode.gain, null, 0, 1, () => {\n\n // ...then turn off all oscillators and clear `oscMap`\n stopAllNotes();\n\n // change the button display\n playButton.innerText = \"Play\";\n playButton.style.backgroundColor = \"rgb(12, 164, 202)\";\n playButton.onclick = play;\n });\n}", "title": "" }, { "docid": "289f98bc06a05707384f234dac0ab6cc", "score": "0.6099813", "text": "function stopPlayback () {\n spotifyHelper.pause()\n .then( function ( response ) {\n if ( response && ! response.playing ) {\n setPlayerStatusStopped();\n } else {\n // Deal with player errors\n console.error( response );\n }\n });\n }", "title": "" }, { "docid": "44d3e4142df264ec396bb85a87ccf5bd", "score": "0.60931665", "text": "function shutdownReceiver() {\n if (!currentStream) {\n return;\n }\n\n const player = document.getElementById('player');\n player.srcObject = null;\n const tracks = currentStream.getTracks();\n for (let i = 0; i < tracks.length; ++i) {\n tracks[i].stop();\n }\n currentStream = null;\n}", "title": "" }, { "docid": "cf2f7e1a6cca8df0736cff3d0b80c54b", "score": "0.60918623", "text": "function stopAudioAndMic() {\r\n mic.stop();\r\n audPlayer.stop();\r\n}", "title": "" }, { "docid": "b6fbfad8d2456990600b4f085820b5e4", "score": "0.60890234", "text": "function reset() {\n sounds.forEach(function(sound) {\n sound.node.stop(0);\n });\n self.end();\n }", "title": "" } ]
eb19b2c0ab956980e570ca9efd9235f0
Resets all schedules, used during testing
[ { "docid": "42b8d7dce480aca36e864f199af5be77", "score": "0.86935276", "text": "resetSchedule() {\n for (let schedule of this.schedules)\n schedule.resetSchedule();\n }", "title": "" } ]
[ { "docid": "61c293776138d2cfad6548fcf9585670", "score": "0.79682034", "text": "function reset_schedule() {\r\n for (var trainee of trainees) {\r\n trainee.set_empty_schedule_blocks();\r\n }\r\n}", "title": "" }, { "docid": "3233daf0ad5c811a26c78751b920abab", "score": "0.7359139", "text": "_rebuildSchedule() {\n this.off().then(function() {\n for (var i = 0; i < this.schedules; i++) {\n var schedule = this.schedules[i];\n schedule.cancel();\n }\n // Remove the references\n this.schedules = [];\n // Rebuild the schedules\n this._getSchedule();\n\n }.bind(this))\n }", "title": "" }, { "docid": "899cd5662eb04dd75fd7cc17814f1eb7", "score": "0.7283998", "text": "resetSchedule() {\n this._next = this._getNextSchedule();\n this._notify.debug('Set schedule %s to fire next at %s', this.name, new Date(this._next).toISOString());\n }", "title": "" }, { "docid": "6d263036af94e5426f76ac3cc250dd02", "score": "0.72358465", "text": "function resetParameters() {\n data.scheduleData = {};\n data.scheduleDate = null;\n data.scheduleTime = null;\n data.scheduleDateTime = null;\n }", "title": "" }, { "docid": "d7b7f3249e92d3cfb7f5892f7436cba4", "score": "0.7108718", "text": "function resetSimulation() {\n isReset = true;\n createTable();\n updateWeekCounter(0);\n isPaused = false;\n}", "title": "" }, { "docid": "5c314b4c5840b6a4cd430a80db05ee37", "score": "0.70739716", "text": "async function scheduleReset() {\n let reset = new Date();\n reset.setHours(24, 0, 0, 0);\n let t = reset.getTime() - Date.now();\n setTimeout(async function () {\n await usersModel.resetAll();\n scheduleReset();\n }, t);\n }", "title": "" }, { "docid": "3179d31508214af8f766bb019a3fb5a4", "score": "0.6997248", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3179d31508214af8f766bb019a3fb5a4", "score": "0.6997248", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "a217127fee373ea396c83d58fdc42a1c", "score": "0.6996754", "text": "function reset() {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "title": "" }, { "docid": "63cbc0e7d67d9dcb64c5e82067943f78", "score": "0.6961804", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "dda4cf04e9765d477f5ebc083a4a0f05", "score": "0.6953113", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "dda4cf04e9765d477f5ebc083a4a0f05", "score": "0.6953113", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "dda4cf04e9765d477f5ebc083a4a0f05", "score": "0.6953113", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "61569d718305ed74c9745b35cbad7fde", "score": "0.6950573", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "61569d718305ed74c9745b35cbad7fde", "score": "0.6950573", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "cef5b300d13f319fd9d4749c6f949c6b", "score": "0.69190174", "text": "function reset(){\n startTime = new Date();\n savedTime = 0;\n updateWatch(0,0,0);\n}", "title": "" }, { "docid": "1274a3ca94d58f68a089d31ee9b2cc9a", "score": "0.69184804", "text": "resetSimulation()\r\n {\r\n for (var i = 0; i < this.businesses.length; i++)\r\n {\r\n this.businesses[i].resetToSimulationStart();\r\n }\r\n }", "title": "" }, { "docid": "11c739cfd4b54f568f987d84fe7c412b", "score": "0.68971664", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "11c739cfd4b54f568f987d84fe7c412b", "score": "0.68971664", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "cf205ae2d0e6dd387a4f5eb750241f1b", "score": "0.68807924", "text": "reset() {\n this.timeLeft = this.totalTime;\n this.numRuns = 0;\n }", "title": "" }, { "docid": "e954701252b4e2faa95be59ade057586", "score": "0.6870521", "text": "function resetSchedulerState() {\n queue.length = 0;\n has = {};\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3a0ef67acb1e34c0b77de8e654ad0827", "score": "0.68580955", "text": "function resetSchedulerState() {\n index$1 = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "6a7eef9460b22aab0ae2c36a5d96a312", "score": "0.6845464", "text": "function resetSchedulerState () {\n index$1 = queue$1.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "829d7ed5823abfc29dfb547c13272cca", "score": "0.6826722", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "829d7ed5823abfc29dfb547c13272cca", "score": "0.6826722", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "690d69d4728e83268a80284eddd794ce", "score": "0.6818083", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if ('development' !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "690d69d4728e83268a80284eddd794ce", "score": "0.6818083", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if ('development' !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "d10573d734aa4e505cf03bb54401520a", "score": "0.68156344", "text": "function nullifyAllRepeatSettings(){\n nullifyMonthlySettings();\n nullifyWeeklySettings();\n $scope._timeEntity.repeatEndUTC = null;\n $scope._timeEntity.repeatEvery = null;\n $scope._timeEntity.repeatIndefinite = null;\n $scope._timeEntity.repeatTypeHandle = null;\n }", "title": "" }, { "docid": "0d9989d356279757d25ce4545692f1ef", "score": "0.6806046", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if ('production' !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "efb112ee251eb5e4ae76f75456b190b9", "score": "0.68", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if ('development' !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "abc8de86911d805613e4e5143360b4fc", "score": "0.67919827", "text": "function clear() {\n crontab.forEach((element, index) => {\n element.cronJob.stop();\n delete crontab[index].cronJob;\n });\n crontab = [];\n}", "title": "" }, { "docid": "886367ae3c013dba7441d16d6c6accbe", "score": "0.67831576", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "f36041d8223a8edee54d82abe1085795", "score": "0.6781283", "text": "function resetSchedulerState () {\n index = queue$1.length = activatedChildren.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "61da9d6189379d46eb883a10bfd14d1f", "score": "0.6773909", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t if (false) {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.67734057", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.67734057", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.67734057", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "abf09d0cc043b4cee26301928d3c1aff", "score": "0.67685145", "text": "function resetSchedulerState () {\n index = queue$1.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "9658064f510bb576e4e92d46557bd885", "score": "0.6765286", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "371b5b1d2442546e426969740fb8610f", "score": "0.67554086", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t if (true) {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "24e97e313e0b3c250ac9b032cfd18123", "score": "0.67378736", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "24e97e313e0b3c250ac9b032cfd18123", "score": "0.67378736", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "0dac774b8ba52770783a4a430acae332", "score": "0.6733829", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "2e0778b8168b63f2f3814bedde12dc64", "score": "0.67320716", "text": "function resetSchedulerState () {\n queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.6725669", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "93476d9e884d7043dd15f240bb3933e1", "score": "0.6725434", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "2d478158a8324238bfbd69d167d9dccb", "score": "0.6709289", "text": "function reset() {\n allEnemies = [];\n allRocks = [];\n lives.reset();\n level.reset();\n player.reset();\n\n stateMachine.state.change(stateMachine.states.waiting);\n }", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "1a89d46e6f652f144310ba5cf9a11a4f", "score": "0.67069286", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "8c945ecde8a2eefe3165718e1cd21934", "score": "0.6694878", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n waiting = flushing = false;\n }", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.6680414", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" } ]
22624b792405c3d256f4ea642d77f44e
if piece of argument is match in the board, return true, else return false
[ { "docid": "325c10416c748132605e107d2a99c947", "score": "0.6984932", "text": "matchPiece(piece) {\n const isUndefined = typeof this.findPiece(piece) === 'undefined';\n const isEqualPiece = this.findPiece(piece).is(\n Piece.create({\n x: piece.x,\n y: piece.y,\n type: piece.type,\n movable: piece.movable\n })\n );\n\n return (isUndefined || isEqualPiece);\n }", "title": "" } ]
[ { "docid": "718ff3a138ee1fb37922ce1a2c98fc7d", "score": "0.71389955", "text": "function isWinningLine(board){\n for (let i = 0; i < 7; i++){\n for (let j = 1; j < 7; j++){\n const pattern = `${board[j][i]}${board[j][i + 1]}${board[j][i + 2]}${board[j][i + 3]}`;\n if (pattern === \"XXXX\" || pattern === \"OOOO\"){\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "481e479cc8c74f92d34b7bde30016c61", "score": "0.7104125", "text": "testForCheck(board, kingLocation){\n let opponentsTurn = this.state.whoseTurn === 'w' ? 'b' : 'w';\n let opponentsMoves = this.getAllAvailableMoves(opponentsTurn, board, null).moves;\n for (let c = 0; c < 8; c++){\n for (let d = 0; d < 8; d++){\n let arr = opponentsMoves[c][d];\n for (let k = 0; k < arr.length; k++){\n if (arr[k][0] === kingLocation[0] && arr[k][1] === kingLocation[1]){\n return true;\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "f700d7b6277cfc155b22cbb5e41e38ad", "score": "0.6972236", "text": "function rowContainsChar(character, board) {\n return [].concat(board, transpose(board), diagonals(board))\n .some(row => {\n return cellsContainChar(character, row)\n })\n}", "title": "" }, { "docid": "03e83bfa87479cbc83a6461680ac83c3", "score": "0.6958425", "text": "function checkMove(targetBoard) {\n for(i=0;i<targetBoard.length;i++) {\n let row=targetBoard[i].concat();\n row=sliceArr(row);\n for(j=1;j<row.length;j++) {\n if(row[j]===row[j-1]) {return true};\n };\n}\nreturn false;\n}", "title": "" }, { "docid": "1a2b20bc2d128d8d263277848f369354", "score": "0.68613875", "text": "function within_board(x_coord, y_coord)\n\t{\n\t\tvar letters = /^[A-Ha-h]+$/;\n\t\t//alert(\"entered here\");\n\t\t\n\t\t\n\t\tif(x_coord < 1 || x_coord > 8)\n\t\t{\n\t\t\t//alert(\"False number\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(!y_coord.match(letters)) \n\t\t{ \n\t\t\t//alert(\"False letter\");\n\t\t\treturn false; \n\t\t} \n\t\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "0c1ea0188a30da302b264a645bc5731b", "score": "0.68320936", "text": "function verify(board, row, col, num) {\r\n if (rows(board, row, num) &&\r\n columns(board, col, num) &&\r\n box(board, row, col, num)) {\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "de86797a8c2997c6e38b872d92893d0a", "score": "0.67731166", "text": "function checkWin (board, player) {\n const winningPattern = Array(3).fill(player).join('')\n const mapCellToRow = cell => board[cell]\n const mapCombinationsToRow = combination => combination.map(mapCellToRow).join('')\n const isWinningPattern = pattern => pattern === winningPattern\n return combinations.map(mapCombinationsToRow).some(isWinningPattern)\n}", "title": "" }, { "docid": "db30ed5b87e0744b60d31c7938c5c617", "score": "0.6751948", "text": "function checkWin(board,player){\n if ((board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)) {\n return true;\n } \n else {\n return false;\n }\n }", "title": "" }, { "docid": "4033c76ddad518f104617a4c90a3b785", "score": "0.6746496", "text": "function containsPiece(xcord, ycord) {\n if (cells[ycord][xcord] == null) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "084c704904d785bde3e8b4d20c6f57ec", "score": "0.6744931", "text": "function isSolved(board) {\n\n}", "title": "" }, { "docid": "526a18074b7e56b202f390d014afaa9c", "score": "0.6717883", "text": "function processBoard(board, id) {\n\n var winPattern = \"OOO\";\n if (players[id].symbol.localeCompare(\"X\") === 0) {\n winPattern = \"XXX\";\n }\n\n var row1 = board[0] + board[1] + board[2];\n if (row1 == winPattern) {\n return true\n }\n var row2 = board[3] + board[4] + board[5];\n if (row2 == winPattern) {\n return true\n }\n var row3 = board[6] + board[7] + board[8];\n if (row3 == winPattern) {\n return true\n }\n var col1 = board[0] + board[3] + board[6];\n if (col1 == winPattern) {\n return true\n }\n var col2 = board[1] + board[4] + board[7];\n if (col2 == winPattern) {\n return true\n }\n var col3 = board[2] + board[5] + board[8];\n if (col3 == winPattern) {\n return true\n }\n var diag1 = board[0] + board[4] + board[8];\n if (diag1 == winPattern) {\n return true\n }\n var diag2 = board[2] + board[4] + board[6];\n if (diag2 == winPattern) {\n return true\n }\n return false\n\n\n}", "title": "" }, { "docid": "684c6aa92b1bee2212f627ba7dfa2004", "score": "0.66995806", "text": "function checkGoalPoint(x, y, theBoard){\n if(theBoard[x][y] == \".\"){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "b840ed187f5c05faf666e9fcfac68fac", "score": "0.668787", "text": "function isValid(board, r, c, val) \n{\n // Not Repeating in Same Row \n for (var row = 0; row < 9; row++) \n {\n if (board[row][c] == val) \n return false;\n\n }\n\n // Not Repeating in Same Column [Actually Can Combine Both Conditions [Row & Col]]\n for (var col = 0; col < 9; col++) \n {\n if (board[r][col] == val) \n return false;\n }\n\n // Sub-Grid\n var r = r - (r % 3);\n var c = c - (c % 3);\n\n for (var cr = r; cr < r + 3; cr++) \n {\n for (var cc = c; cc < c + 3; cc++) \n {\n if (board[cr][cc] == val) \n {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "b7b3195fe55377b97ebbac201bf922e2", "score": "0.6686943", "text": "function inboardCheck(row, col){\n return (row > board.length - 1 || row < 0 || col > board.length - 1 || col < 0) ? true: false;\n }", "title": "" }, { "docid": "9e88bf51c61f50ba2419a922ae198342", "score": "0.6667059", "text": "function checkBoard(marker) {\n console.log(\"check for winner\", marker); \n let winner = false;\n if (board[0] === marker && board[1] === marker && board[2] === marker){\n winner = true;\n console.log(\"row1\");\n } else if (board[3] === marker && board[4] === marker && board[5] === marker) {\n winner = true;\n console.log(\"row2\");\n } else if (board[6] === marker && board[7] === marker && board[8] === marker) {\n winner = true;\n console.log(\"row3\");\n } else if (board[0] === marker && board[3] === marker && board[6] === marker) {\n winner = true;\n console.log(\"col1\");\n } else if (board[1] === marker && board[4] === marker && board[7] === marker) {\n winner = true;\n console.log(\"col2\");\n } else if (board[2] === marker && board[5] === marker && board[8] === marker) {\n winner = true;\n console.log(\"col3\");\n } else if (board[0] === marker && board[4] === marker && board[8] === marker) {\n winner = true;\n console.log(\"dia1\");\n } else if (board[2] === marker && board[4] === marker && board[6] === marker) {\n winner = true;\n console.log(\"dia2\");\n }\n return winner;\n }", "title": "" }, { "docid": "f215b16bcbc1ab792873673404442716", "score": "0.66489357", "text": "function onBoard (coord) {\r\n if (coord.j >= 19) {\r\n if (coord.j === 19)\r\n return 'bottom'\r\n else\r\n return false\r\n } else if (coord.j < 0) {\r\n if (coord.j === -1)\r\n return 'top'\r\n else\r\n return false\r\n } else if (coord.i >= 15 || coord.i < 0) {\r\n return false\r\n }\r\n\r\n return true\r\n}", "title": "" }, { "docid": "b9e7dada8e9ab2ec9191d4c88e9475aa", "score": "0.6631224", "text": "function pieceOnPath(board, row, col, rowPrev, colPrev) {\n var i;\n if (col === colPrev) {\n if (row > rowPrev) {\n for (i = rowPrev + 1; i <= row; i = i + 1) {\n if (board[i][col] !== '') {\n return true;\n }\n }\n } else {\n for (i = rowPrev - 1; i >= row; i = i - 1) {\n if (board[i][col] !== '') {\n return true;\n }\n }\n }\n } else {\n if (row > rowPrev) {\n for (i = 1; i <= row - rowPrev; i = i + 1) {\n if (col > colPrev) {\n if (board[rowPrev + i][colPrev + i] !== '') {\n return true;\n }\n }\n if (col < colPrev) {\n if (board[rowPrev + i][colPrev - i] !== '') {\n return true;\n }\n }\n }\n } else if (row < rowPrev) {\n for (i = 1; i <= rowPrev - row; i = i + 1) {\n if (col > colPrev) {\n if (board[rowPrev - i][colPrev + i] !== '') {\n return true;\n }\n }\n if (col < colPrev) {\n if (board[rowPrev - i][colPrev - i] !== '') {\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "86fd4ae1b5a7fd1c1bf8b006bf7a34ef", "score": "0.6629988", "text": "function winning(board, player){\n if ((board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "91573c76e3b3cf6f0ad45a19d83e444f", "score": "0.6624929", "text": "function isPossible(board, sr, sc, val) {\n // checking in row\n for (var row = 0; row < 9; row++) {\n if (board[row][sc] == val) {\n return false;\n }\n }\n // checking in coln\n for (var col = 0; col < 9; col++) {\n if (board[sr][col] == val) {\n return false;\n }\n }\n var r = sr - sr % 3;\n var c = sc - sc % 3;\n // checking in square\n for (var cr = r; cr < r + 3; cr++) {\n for (var cc = c; cc < c + 3; cc++) {\n if (board[cr][cc] == val) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "9303fe94261339b439205ec5408461ca", "score": "0.66185504", "text": "function checkWin(board,player){\n if ((board[9] == player && board[10] == player && board[11] == player && board[12] == player && board[13] == player) ||\n (board[14] == player && board[15] == player && board[16] == player && board[17] == player && board[18] == player) ||\n (board[19] == player && board[20] == player && board[21] == player && board[22] == player && board[23] == player) ||\n (board[24] == player && board[25] == player && board[26] == player && board[27] == player && board[28] == player) ||\n (board[29] == player && board[30] == player && board[31] == player && board[32] == player && board[33] == player) ||\n (board[9] == player && board[14] == player && board[19] == player && board[24] == player && board[29] == player) ||\n (board[10] == player && board[15] == player && board[20] == player && board[25] == player && board[30] == player) ||\n (board[11] == player && board[16] == player && board[21] == player && board[26] == player && board[31] == player) ||\n (board[12] == player && board[17] == player && board[22] == player && board[27] == player && board[32] == player) ||\n (board[13] == player && board[18] == player && board[23] == player && board[28] == player && board[33] == player) ||\n (board[9] == player && board[15] == player && board[21] == player && board[27] == player && board[33] == player) ||\n (board[13] == player && board[17] == player && board[21] == player && board[25] == player && board[29] == player)) {\n return true;\n } \n else {\n return false;\n }\n }", "title": "" }, { "docid": "124a1435c0df3c77e5dd2772292dcef0", "score": "0.6617964", "text": "function attacked(board) {\n let last = board[board.length - 1];\n\n\n for (let i = 0; i < (board.length - 1); i++) {\n\n let rowDiff = Math.abs(last-board[i]);\n let colDiff = Math.abs((board.length - 1) - i);\n\n if (last == board[i]){\n return true;\n }\n else if (rowDiff == colDiff) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "1f6663433ee3382b458fb484c1048524", "score": "0.6587662", "text": "function isLegalMove(player, board, x, y, spaces) {\n return [x, y] in allLegalMoves(player, board, spaces);\n}", "title": "" }, { "docid": "296f5d353d8242cb8c1ce71007e2f2d4", "score": "0.6582361", "text": "function checkBlackMove(pieceId, target){\n if(blackPieces[pieceId].options.includes(target) == true)\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "1cc986f7f59461e61136e0c28ec753bf", "score": "0.65722996", "text": "function checkBoard(player){\n\n for(var i=0;i<3;i++){\n for(var b=0;b<3;b++){\n\n if(isClickedBy(i,0,player) && isClickedBy(i,1,player) && isClickedBy(i,2,player)){\n return true;\n }else if(isClickedBy(0,b,player) &&isClickedBy(1,b,player) && isClickedBy(2,b,player)){\n return true;\n }else if(isClickedBy(1,1,player)){\n if(isClickedBy(0,0,player) && isClickedBy(2,2,player)){\n return true;\n }else if(isClickedBy(0,2,player) && isClickedBy(2,0,player)){\n return true;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "66847b2084033289b66822a1bd8cfcd4", "score": "0.6568188", "text": "_checkForWinner(board, player) {\n\n const winningCombos = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n [0, 4, 8],\n [2, 4, 6]\n ];\n\n for (let i = 0; i < winningCombos.length; i++) {\n const [a, b, c] = winningCombos[i];\n if (player === board[a] && player === board[b] && player === board[c]) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "3edf03f4f6ee24034c39ef4a4f8292bd", "score": "0.654563", "text": "function checkBoards(curr, solved) {\r\n for (var i = 0; i < curr.length; i++) {\r\n if (curr[i] != solved[i]) {\r\n return(false);\r\n };\r\n };\r\n return(true);\r\n}", "title": "" }, { "docid": "b78b77cc2834ae3159e7ecfc38bd1bb5", "score": "0.65397197", "text": "isValid( board, turn, move, previous_move ) {\n if( move.start_position == move.end_position ) {\n return false\n }\n else {\n return true\n }\n }", "title": "" }, { "docid": "ccfcba226e2e6bbcfb6528a33e8f12d4", "score": "0.6536809", "text": "function checkFloor(x, y, theBoard){\n if(theBoard[x][y] == \"f\"){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "743c167b1fbf38eb3d9d311ead4dd4d5", "score": "0.6532996", "text": "function winning(board, player) {\n if (\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)\n ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "7edae98905ac1a54bd07ea00f6eddc6f", "score": "0.6532247", "text": "function rows(board, row, num) {\r\n for (let i = 0; i < 9; i++) {\r\n if (board[row][i] == num) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "12fb43b1f0414cea244aaf8ad9ad10e6", "score": "0.65295535", "text": "function winByRow(board, turn) {\n for (let i = 0; i < board.length; i++) {\n for(let j = 0; j < board[i].length; j++) {\n if (board[i][j] === turn && board[i][j+1] === board[i][j] && board[i][j+2] === board[i][j+1] && board[i][j+3] === board[i][j+2]) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "ceb756aac3514eb9c455fad6d8b5ab81", "score": "0.65238976", "text": "checkPiece ( typePiece, row, column ) {\n try {\n return this.boardState[row][column] === typePiece\n } catch {\n return 0\n }\n }", "title": "" }, { "docid": "41fe754bd9c069e8c9ebd798705ab0cf", "score": "0.65170836", "text": "function checkWhiteMove(pieceId, target){\n if(whitePieces[pieceId].options.includes(target) == true)\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "ecab6522adaeb32c4c9c8a122c872120", "score": "0.6508117", "text": "checkColumnWise(cColumn){ \r\n for(var j=0;j<this.state.matrix[0].length;j++){\r\n if(this.state.matrix[j][cColumn] !== this.state.player){\r\n return false;\r\n }\r\n }\r\n return true; \r\n }", "title": "" }, { "docid": "ace5e0c3cb9c2978364bd56f3f3fa031", "score": "0.6505105", "text": "function columns(board, col, num) {\r\n for (let i = 0; i < 9; i++) {\r\n if (board[i][col] == num) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "e736b7baf1dd17dd82b6346109b94205", "score": "0.64873624", "text": "function exposed(theboard, to, x, y ) {\n\n\n\t// If a coord isnt given, the coords of the king are used.\n\tif (!x && !y) {\n\t\tfor (var i = 1; i<=8; i++) {\n\t\t\tfor (var j = 1; j<=8; j++) {\n\t\t\t\tif (theboard[i][j]==(to+'s')) {\n\t\t\t\t\tx = j;\n\t\t\t\t\ty = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar x = parseInt(x);\n\tvar y = parseInt(y);\n\n\n\t// searches every cell\n\tfor (var i = 1; i<=8; i++) {\n\t\tfor (var j = 1; j<=8; j++) {\n\t\t\tif (theboard[i][j][0]==(to=='w'?'d':'w')) {\n\n\t\t\t\t// pawns\n\t\t\t\tif (theboard[i][j]=='dp' && i==y-1 && (j==x+1 || j ==x-1)) return true;\n\t\t\t\tif (theboard[i][j]=='wp' && i==y+1 && (j==x+1 || j ==x-1)) return true;\n\n\t\t\t\t// rooks and queens\n\t\t\t\tvar tempx = j;\n\t\t\t\tvar tempy = i;\n\t\t\t\tif(theboard[i][j][1]=='k' || theboard[i][j][1]=='v') {\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempy++;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempy--;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempx++;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempx = j;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempx--;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\t\t\t\t// bishops and queens\n\t\t\t\tvar tempx = j;\n\t\t\t\tvar tempy = i;\n\t\t\t\tif(theboard[i][j][1]=='f' || theboard[i][j][1]=='v') {\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempy++;\n\t\t\t\t\t\ttempx++;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\ttempx = j;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempy--;\n\t\t\t\t\t\ttempx--;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\ttempx = j;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempx++;\n\t\t\t\t\t\ttempy--;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\ttempx = j;\n\t\t\t\t\twhile (theboard[tempy][tempx]!='u') {\n\t\t\t\t\t\ttempx--;\n\t\t\t\t\t\ttempy++;\n\t\t\t\t\t\tif (tempy==y && tempx==x) return true;\n\t\t\t\t\t\tif (theboard[tempy][tempx]!='b') break;\n\t\t\t\t\t}\n\t\t\t\t\ttempy = i;\n\t\t\t\t\ttempx = j;\n\t\t\t\t}\n\n\t\t\t\t//knights\n\t\t\t\tif(theboard[i][j][1]=='a') {\n\t\t\t\t\tif (x===j+2 && y===i+1) return true;\n\t\t\t\t\tif (x===j+2 && y===i-1) return true;\n\t\t\t\t\tif (x==j+1 && y==i+2) return true;\n\t\t\t\t\tif (x==j+1 && y==i-2) return true;\n\t\t\t\t\tif (x==j-1 && y==i+2) return true;\n\t\t\t\t\tif (x==j-1 && y==i-2) return true;\n\t\t\t\t\tif (x==j-2 && y==i+1) return true;\n\t\t\t\t\tif (x==j-2 && y==i-1) return true;\n\t\t\t\t\t}\n\n\t\t\t\t//kings\n\t\t\t\tif(theboard[i][j][1]=='s') {\n\t\t\t\t\tif (x===j+1 && y===i+1) return true;\n\t\t\t\t\tif (x===j+1 && y===i) return true;\n\t\t\t\t\tif (x==j+1 && y==i-1) return true;\n\t\t\t\t\tif (x==j && y==i+1) return true;\n\t\t\t\t\tif (x==j && y==i-1) return true;\n\t\t\t\t\tif (x==j-1 && y==i+1) return true;\n\t\t\t\t\tif (x==j-1 && y==i) return true;\n\t\t\t\t\tif (x==j-1 && y==i-1) return true;\n\t\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "5e8f022866a09511733d3e3197ff6892", "score": "0.6485907", "text": "canMove(where) {\n // go through every element in the piece (4x4)\n for (let j=0; j<this.matrix.length; j++) {\n for (let i=0; i<this.matrix[j].length; i++) {\n let value = this.matrix[j][i];\n let newY = j+this.pos.y;\n let newX = i+this.pos.x+where;\n\n if (this.pos.y < -1\n || (value == 1\n && (newX < 0 || newX >= gridWidth\n || newY < 0 || newY >= gridHeight))\n || (value == 1 && this.pos.y >= 0\n && this.board.matrix[newY][newX].value == 1)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "13583ce46060388b564cef2f5dc687f8", "score": "0.6474704", "text": "function checkWin(board, turn) {\n if (winByRow(board, turn) || winByCol(board, turn) || winByNegSlope(board, turn) || winByPosSlope(board, turn)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "4198dd37d4cd248d1c608fbab61b4c55", "score": "0.6469882", "text": "pawnSpecialMoveCheck(boardThreatenedDefendedSquares, board) {\n for (let i = 0; i < this.pieces.length; i++) {\n if (this.pieces[i].piece === 'pawn') {\n if (this.player === 0) {\n if (this.pieces[i].y === 6) {\n boardThreatenedDefendedSquares.buildInRangeOfPawn(null, this.player, [], 'initialMove', board);\n }\n if (this.pieces[i].y === 3 && this.pieces[i].prevY === 1) {\n boardThreatenedDefendedSquares.buildInRangeOfPawn(null, this.player, [], 'enPassant', board);\n }\n }\n\n if (this.state.isMate === false) {\n return false;\n }\n\n if (this.player === 1) {\n if (board.pieces[i].y === 1) {\n boardThreatenedDefendedSquares.buildInRangeOfPawn(null, this.player, [], 'initialMove', board);\n }\n if (this.pieces[i].y === 4 && this.pieces[i].prevY === 6) {\n boardThreatenedDefendedSquares.buildInRangeOfPawn(null, board.player, [], 'enPassant', board);\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "4a8fe2d54f4a4b59838e1f16eb7a991f", "score": "0.646843", "text": "function winning(board, player){\n\tif(\n\t\t(board[0] == player && board[1] == player && board[2] == player)||\n\t\t(board[3] == player && board[4] == player && board[5] == player)||\n\t\t(board[6] == player && board[7] == player && board[8] == player)||\n\t\t(board[0] == player && board[3] == player && board[6] == player)||\n\t\t(board[1] == player && board[4] == player && board[7] == player)||\n\t\t(board[2] == player && board[5] == player && board[8] == player)||\n\t\t(board[0] == player && board[4] == player && board[8] == player)||\n\t\t(board[2] == player && board[4] == player && board[6] == player)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "18628afe453edff68c9f12b013d2d274", "score": "0.64673066", "text": "canGoDown() {\n // go through every element in the piece (4x4)\n for (let j=0; j<this.matrix.length; j++) {\n for (let i=0; i<this.matrix[j].length; i++) {\n let value = this.matrix[j][i];\n\n if ((value == 1)\n && (!this.board.matrix[j+this.pos.y+1]\n || this.board.matrix[j+this.pos.y+1][i+this.pos.x].value == 1)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "a85bf470891e5a983653a377ef2b2704", "score": "0.6463475", "text": "function isSolved(board) {\n board = board.join('-').replace(/,/g, '');\n if (/111|1...1...1|1....1....1|1..1..1/.test(board)) return 1;\n if (/222|2...2...2|2....2....2|2..2..2/.test(board)) return 2;\n if (/0/.test(board)) return -1;\n return 0;\n}", "title": "" }, { "docid": "f09c6780869ac0c2457d2f5b6bd15759", "score": "0.64597607", "text": "function isValid(board, i, j) {\n if(isRow(board, i) && isCol(board, j) && isBox(board, j, i)){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "554339bb25dd2429140a0364e4ed84a4", "score": "0.64450276", "text": "function inBounds(board, row, col) {\n\treturn row >= 0 && row < board.length && col >= 0 && col < board[0].length;\n}", "title": "" }, { "docid": "d4409fbc01f19fef999bae31830021cf", "score": "0.6437204", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n//checks to make sure the pieces are within the board and the piece corresponds to the player\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n //goes through 'rows' in the board\n for (var y = 0; y < HEIGHT; y++) {\n //goes through each cell within the 'rows'\n for (var x = 0; x < WIDTH; x++) {\n //defines the various ways the pieces will connect four times\n var horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n var vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n var diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n var diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n //if any of the variables are true, return true;\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "c3ff751429580be3e7570b5919246127", "score": "0.6435284", "text": "enemyTile(tileX, tileY) {\n for (let enemy of this.enemies) {\n if (enemy.tileX === tileX && enemy.tileY === tileY) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "5f844e7f837e03aa9f2a0922531ae30a", "score": "0.64318717", "text": "isValidMove(move, player) {\n if (this.getPieceAt(move) != null) {\n return false;\n }\n\n for (let direction of allDirections) {\n let currGrid = move;\n let currPiece = null;\n let theOtherColorDetected = false;\n\n do {\n currGrid = [currGrid[0] + direction[0], currGrid[1] + direction[1]];\n currPiece = this.getPieceAt(currGrid);\n if (!theOtherColorDetected && currPiece == !player) {\n theOtherColorDetected = true;\n }\n } while (currPiece != null && currPiece !== player);\n\n if (currPiece == null) {\n continue;\n }\n\n if (theOtherColorDetected) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "588e13032bd49115a46aaf5cb306f43c", "score": "0.6430663", "text": "function canRookMove(board, deltaFrom, deltaTo, turnIndex) {\n var fromRow = deltaFrom.row, fromCol = deltaFrom.col, toRow = deltaTo.row, toCol = deltaTo.col;\n if (toRow < 0 || toCol < 0 || toRow > 7 || toCol > 7) {\n return false;\n }\n var endPiece = board[toRow][toCol];\n var opponent = getOpponent(turnIndex);\n if (endPiece !== '' && endPiece.charAt(0) !== opponent) {\n return false;\n }\n if (fromRow === toRow) {\n if (fromCol === toCol) {\n return false;\n }\n for (var i = (fromCol < toCol ? fromCol + 1 : toCol + 1); i < (fromCol < toCol ? toCol : fromCol); i++) {\n if (board[fromRow][i] !== '') {\n return false;\n }\n }\n return moveAndCheck(board, turnIndex, deltaFrom, deltaTo);\n }\n else if (fromCol === toCol) {\n if (fromRow === toRow) {\n return false;\n }\n for (var j = (fromRow < toRow ? fromRow + 1 : toRow + 1); j < (fromRow < toRow ? toRow : fromRow); j++) {\n if (board[j][fromCol] !== '') {\n return false;\n }\n }\n return moveAndCheck(board, turnIndex, deltaFrom, deltaTo);\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "024d6e898f0e4bdf1b7e8bee45c412a9", "score": "0.6425776", "text": "function winner(board,player){\n for (var i = 0; i < win.length; i++){\n if(board[win[i][0]] == player && board[win[i][1]] == player && board[win[i][2]] == player)\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "db405fb46972c2f5a21d3bdb29d4bce4", "score": "0.64227766", "text": "function inColumn(arr, row, num){\n for(var row=1; i<=9; i++){\n if(arr[row][col]== num){\n return true;\n }\n }\n}", "title": "" }, { "docid": "e50ffc9d4b4a241bf4f282717e82ba61", "score": "0.6420562", "text": "function checkGoodMove(board, token) {\n let result = true;\n let token2 = token == \"O\" ? \"X\" : \"O\";\n winningCombos.forEach(function (arr) {\n if (board[arr[0]] == token && board[arr[1]] == token && board[arr[2]] == token2 || board[arr[0]] == token && board[arr[1]] == token2 && board[arr[2]] == token || board[arr[0]] == token2 && board[arr[1]] == token && board[arr[2]] == token) {\n result = false;\n }\n });\n return result;\n }", "title": "" }, { "docid": "cf3e5a8a43937824c27aaf6eee48881f", "score": "0.6415759", "text": "function checkWin(player) {\n for(let i = 0; i < winCondition.length; i++) {\n if(board[winCondition[i][0]] == player &&\n board[winCondition[i][1]] == player &&\n board[winCondition[i][2]] == player) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "5507e8474160326dfe0badc4872f8879", "score": "0.6404327", "text": "function checkLine(check) {\n for (let i = 0; i < winCombos.length; i++) {\n if (board[winCombos[i][0]] + board[winCombos[i][1]] + board[winCombos[i][2]] === check) {\n for (let j = 0; j < 3; j++) {\n if (!board[winCombos[i][j]]) {\n board[winCombos[i][j]] = turn;\n return true;\n }\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "434d02774b515b10c45db5618e5a149b", "score": "0.6401036", "text": "function checkCell(board, num, pos) {\r\n if (isValid(board, num, pos)) {\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "b655d83e74e9d89912676fb223e1d8a3", "score": "0.6400775", "text": "function willBeConnected(place) { //after this move the piece is still connected to other pieces\n var piecesAround = getAllPlaceIdsAroundThisId(place);\n for (var i = 0; i < board.length; i++) {\n if (piecesAround.includes(board[i].placeNumber)) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "0e08782e9c12f09a7bcc4e3a3d795295", "score": "0.639637", "text": "checkRowWise(cRow){ \r\n for(let j=0;j<this.state.matrix[cRow].length;j++){\r\n if(this.state.matrix[cRow][j] !== this.state.player){\r\n return false;\r\n }\r\n }\r\n return true; \r\n }", "title": "" }, { "docid": "bcad0472d78390044a8a4fdc1576ca98", "score": "0.63840353", "text": "checkIfOnGrid(location, grid) {\n\t for(var i = 0; i < grid.length; i++) {\n\t for(var j = 0; j < grid[i].length; j++) {\n\t if(location == grid[i][j]) {\n\t return true;\n\t }\n\t }\n\t }\n\t\treturn false;\n\t}", "title": "" }, { "docid": "285346e70f6b1809cec6ffd6b991a07c", "score": "0.6382893", "text": "function inGrid(arr, startRow,startCol, num){\n for(var i=1; i<=3; i++){\n for(var j=1; j<=3; j++){\n if(arr[i+startRow][j+startCol]== num){\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "73a17c7cb8f266497c4e4e7c8a527439", "score": "0.6377365", "text": "function safe(num, row, col){\n\t\tfor (var i = 0 ; i < 9; i++){\n\t\t\tif (grid[row][i] == num)\n\t\t\t\treturn false;\n\t\t\tif (grid[i][col] == num)\n\t\t\t\treturn false;\n\t\t}\n\t\tif (row >= 0 && row <= 2){\n\t\t\tif (col >= 0 && col <= 2){\n\t\t\t\tfor (var i = 0 ; i <= 2; i++){\n\t\t\t\t\tfor (var j = 0; j <= 2; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (col >= 3 && col <= 5){\n\t\t\t\tfor (var i = 0 ; i <= 2; i++){\n\t\t\t\t\tfor (var j = 3; j <= 5; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (col >= 6 && col <= 8){\n\t\t\t\tfor (var i = 0 ; i <= 2; i++){\n\t\t\t\t\tfor (var j = 6; j <= 8; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif (row >= 3 && row <= 5){\n\t\t\tif (col >= 0 && col <= 2){\n\t\t\t\tfor (var i = 3 ; i <= 5; i++){\n\t\t\t\t\tfor (var j = 0; j <= 2; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (col >= 3 && col <= 5){\n\t\t\t\tfor (var i = 3 ; i <= 5; i++){\n\t\t\t\t\tfor (var j = 3; j <= 5; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (col >= 6 && col <= 8){\n\t\t\t\tfor (var i = 3 ; i <= 5; i++){\n\t\t\t\t\tfor (var j = 6; j <= 8; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (row >= 6 && row <= 8){\n\t\t\tif (col >= 0 && col <= 2){\n\t\t\t\tfor (var i = 6; i <= 8; i++){\n\t\t\t\t\tfor (var j = 0; j <= 2; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (col >= 3 && col <= 5){\n\t\t\t\tfor (var i = 6; i <= 8; i++){\n\t\t\t\t\tfor (var j = 3; j <= 5; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (col >= 6 && col <= 8){\n\t\t\t\tfor (var i = 6; i <= 8; i++){\n\t\t\t\t\tfor (var j = 6; j <= 8; j++){\n\t\t\t\t\t\tif (grid[i][j] == num)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "d10cec847b14cb08a04974022b5ca8a7", "score": "0.637666", "text": "function isRow(board, j){\n for(var i = 0; i < 9; i++) {\n\t\t\tfor(var k = i + 1; k < 9; k++) {\n\t\t\t\tif(board[i][j] != 0 && board[i][j] == board[k][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n }", "title": "" }, { "docid": "93c210a5c743f990a9037649231f5879", "score": "0.63749605", "text": "function checkIfWin(markerToTest, boardToTest) {\n\t//horizontal wins\n if (boardToTest[0] == markerToTest && boardToTest[1] == markerToTest && boardToTest[2] == markerToTest) {\n return winCondition = true;\n }\n else if (boardToTest[3] == markerToTest && boardToTest[4] == markerToTest && boardToTest[5] == markerToTest) {\n return winCondition = true;\n }\n else if (boardToTest[6] == markerToTest && boardToTest[7] == markerToTest && boardToTest[8] == markerToTest) {\n return winCondition = true;\n }\n //vertical wins\n else if (boardToTest[0] == markerToTest && boardToTest[3] == markerToTest && boardToTest[6] == markerToTest) {\n return winCondition = true;\n }\n else if (boardToTest[1] == markerToTest && boardToTest[4] == markerToTest && boardToTest[7] == markerToTest) {\n return winCondition = true;\n }\n else if (boardToTest[2] == markerToTest && boardToTest[5] == markerToTest && boardToTest[8] == markerToTest) {\n return winCondition = true;\n }\n //diagonal wins\n else if (boardToTest[0] == markerToTest && boardToTest[4] == markerToTest && boardToTest[8] == markerToTest) {\n return winCondition = true;\n }\n else if (boardToTest[2] == markerToTest && boardToTest[4] == markerToTest && boardToTest[6] == markerToTest) {\n return winCondition = true;\n } \n}", "title": "" }, { "docid": "30817490e116b6a5047aa0b979d30c8c", "score": "0.63707584", "text": "function foundChar(row, col, char) {\n if (row < 0 || col < 0 || col == board[0].length || row == board.length)\n return false;\n\n return board[row][col] === char && boolBoard[row][col] !== true;\n }", "title": "" }, { "docid": "7a4b01fc15bb0babeadd807e4bae69d5", "score": "0.6368708", "text": "function squareIsOccupied(square, occupiedSquares){\n return occupiedSquares.includes(square)\n}", "title": "" }, { "docid": "d7897f59806b17b551936059de991ac3", "score": "0.6367983", "text": "function checkSquare(a, b, c, move) {\n var result = false;\n if (getSquare(a) == move && getSquare(b) == move && getSquare(c) == move) {\n result = true;\n }\n return result;\n}", "title": "" }, { "docid": "a870cd3333124776916b06f270da0bdb", "score": "0.6365403", "text": "function inCheck(board){\n\tlet blackKing = board.black.filter(x => x.name == \"Ki\")[0];\n\tlet whiteKing = board.white.filter(x => x.name == \"Ki\")[0];\n\tfor(let i=0; i<board.white.length; i++){\n\t\tlet piece = {}\n\t\tpiece.piece = board.white[i];\n\t\tpiece.color = \"white\";\n\t\tlet moves = possibleMoves(board, piece);\n\n\t\tfor(let j=0; j<moves.length; j++){\n\t\t\tif(moves[j].x == blackKing.x && moves[j].y == blackKing.y){\n\t\t\t\treturn \"black\";\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(let i=0; i<board.black.length; i++){\n\t\tlet piece = {}\n\t\tpiece.piece = board.black[i];\n\t\tpiece.color = \"black\";\n\t\tlet moves = possibleMoves(board, piece);\n\n\t\tfor(let j=0; j<moves.length; j++){\n\t\t\tif(moves[j].x == whiteKing.x && moves[j].y == whiteKing.y){\n\t\t\t\treturn \"white\";\n\t\t\t}\n\t\t}\n\t}\n\n\n\treturn undefined;\n}", "title": "" }, { "docid": "e130dfe8bbee86ec39abea7499d99124", "score": "0.63649094", "text": "function used_in_box(arr, row, col, num) {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if (arr[i + row][j + col] == num) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "110a9d34121c84644ac46e7d0d3b14f3", "score": "0.63601613", "text": "function exist(board, word) {\n for (let i = 0; i < board.length; i++) {\n for (let j = 0; j < board[i].length; j++) {\n // find the starting character and do a depth first search\n if (board[i][j] == word[0] && dfs(board, i, j, 0, word)) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "4a4be299535d0c1cc6bee78a13070d8e", "score": "0.63506573", "text": "function checkCoordinates(coord, ship) {\n let j;\n if (ship.details.direction === 'vertical') {\n j = coord[0];\n for (let i = 0; i < ship.shipSize.length; i += 1) {\n if (board[j + i][coord[1]] === 1) {\n return true;\n }\n }\n } else {\n for (let i = 0; i < ship.shipSize.length; i += 1) {\n j = coord[1];\n if (board[coord[0]][j + i] === 1) {\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "11ff5811886d4b3fdd213d55bb0dfe8a", "score": "0.6349118", "text": "function does_position_have_fruit(check_position_x, check_position_y){\n var board = get_board();\n if (isValidMove(check_position_x , check_position_y)){\n if (has_item(board[check_position_x][check_position_y])){\n return true;\n }\n else\n return false;\n }\n else\n return false;\n}", "title": "" }, { "docid": "6e42d7316e440fe27aa495522fa6a504", "score": "0.63315946", "text": "function contains(cell) {\n for (i in this) {\n if(this[i][0] === cell[0] && this[i][1] === cell[1]) return true;\n else continue;\n } \n return false;\n}", "title": "" }, { "docid": "c09529d18eb78f5e6df10e642ad7521e", "score": "0.6330625", "text": "check(x, y) {\n if (x >= this.x - off*3 && x <= this.x + off*3 \n && y >= this.y - off*3 && y <= this.y + off*3) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e2fe6c41cb9305f6d2993dfd87abcff1", "score": "0.63292557", "text": "function board_full()\n{\n\tfor(i=0; i<board.length;i++){\n\t\tif (board[i] == \"vacant\") return false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "2871475e0e4353a03094f0da7fcc67d6", "score": "0.63192487", "text": "function checkBox (x, y, theBoard) {\n if(theBoard[x][y] == \"o\" || theBoard[x][y] == \"$\"){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "a599632daba579f92b92bd450cc84b5d", "score": "0.63189954", "text": "function isClickedBy(row,col,player){\n if(board[row][col].classList.contains(`clicked-box-${player}`)){\n return true;\n }\n}", "title": "" }, { "docid": "17320c34de594de7ef08320854ef4e98", "score": "0.6312046", "text": "function isWinner(piece) {\n //Checks which ID space has which player's piece.\n let spaceId = [...status]\n if (spaceId[0] === spaceId[1] && spaceId[0] === spaceId[2]) {\n if (spaceId[0] !== \"\") {\n return true;\n }\n }\n if (spaceId[3] === spaceId[4] && spaceId[3] === spaceId[5]) {\n if (spaceId[3] !== \"\"){\n return true;\n }\n }\n if (spaceId[6] === spaceId[7] && spaceId[6] === spaceId[8]) {\n if (spaceId[6] !== \"\"){\n return true;\n }\n }\n if (spaceId[0] === spaceId[3] && spaceId[0] === spaceId[6]) {\n if (spaceId[0] !== \"\"){\n return true;\n }\n }\n if (spaceId[1] === spaceId[4] && spaceId[1] === spaceId[7]) {\n if (spaceId[1] !== \"\"){\n return true;\n }\n }\n if (spaceId[2] === spaceId[5] && spaceId[2] === spaceId[8]) {\n if (spaceId[2] !== \"\"){\n return true;\n }\n }\n if (spaceId[0] === spaceId[4] && spaceId[0] === spaceId[8]) {\n if (spaceId[0] !== \"\"){\n return true;\n }\n }\n if (spaceId[2] === spaceId[4] && spaceId[2] === spaceId[6]) {\n if (spaceId[2] !== \"\") {\n return true;\n }\n }\n console.log(spaceId);\n //How do I compare IDs with winning combinations?\n }", "title": "" }, { "docid": "f2e8d17245a6007d780a8178266bfa63", "score": "0.6311279", "text": "function winConditionPlayer(){\n let b = ticTacToe.board;\n let p = ticTacToe.playerSymbol;\n if(b[0][0] === ` ${p} ` && b[0][1] === ` ${p} ` && b[0][2] === ` ${p} `) {\n return true;\n } else if (b[2][0] === ` ${p} ` && b[2][1] === ` ${p} ` && b[2][2] === ` ${p} `) {\n return true;\n } else if (b[4][0] === ` ${p} ` && b[4][1] === ` ${p} ` && b[4][2] === ` ${p} `) {\n return true;\n } else if (b[0][0] === ` ${p} ` && b[2][0] === ` ${p} ` && b[4][0] === ` ${p} `) {\n return true;\n } else if (b[0][1] === ` ${p} ` && b[2][1] === ` ${p} ` && b[4][1] === ` ${p} `) {\n return true;\n } else if (b[0][2] === ` ${p} ` && b[2][2] === ` ${p} ` && b[4][2] === ` ${p} `) {\n return true;\n } else if (b[0][0] === ` ${p} ` && b[2][1] === ` ${p} ` && b[4][2] === ` ${p} `) {\n return true;\n } else if (b[0][2] === ` ${p} ` && b[2][1] === ` ${p} ` && b[4][0] === ` ${p} `) {\n return true;\n }\n}", "title": "" }, { "docid": "3933113ce36ab1eb9a65b4c443a0c932", "score": "0.63089895", "text": "function checkWinner(board){\n if (\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)) {\n return true;\n } \n return false;\n}", "title": "" }, { "docid": "e898b3b23e3fbe7dc61d9ab975ca80e8", "score": "0.6306155", "text": "PlayTurn(player, y1=0, x1=0, y2=0, x2=0)\n {\n console.log(this.board.Occupied(y1, x1)[1])\n console.log(this.board.Occupied(y2, x2)[1])\n if (this.white != this.black)\n {\n if (player == this.white && this.turn)\n return false;\n if (player == this.black && !this.turn)\n return false;\n if (player == this.white && contains(BLACK_PIECES, this.board.Occupied(y1, x1)[1]))\n return false;\n if (player == this.black && contains(WHITE_PIECES, this.board.Occupied(y1, x1)[1]))\n return false;\n if (player == this.white && contains(WHITE_PIECES, this.board.Occupied(y2, x2)[1]))\n return false;\n if (player == this.black && contains(BLACK_PIECES, this.board.Occupied(y2, x2)[1]))\n return false;\n }\n else\n {\n if (!this.turn && contains(BLACK_PIECES, this.board.Occupied(y1, x1)[1]))\n return false;\n if (this.turn && contains(WHITE_PIECES, this.board.Occupied(y1, x1)[1]))\n return false;\n if (!this.turn && contains(WHITE_PIECES, this.board.Occupied(y2, x2)[1]))\n return false;\n if (this.turn && contains(BLACK_PIECES, this.board.Occupied(y2, x2)[1]))\n return false;\n }\n if (this.board.Move(y1, x1, y2, x2))\n {\n this.turn = !this.turn\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "ad5ef56d08cc471ecd64103b0812cc30", "score": "0.6305997", "text": "anyMove(board, is_x_next) {\n for(let i = 0; i < 64; i++){\n const validation_check = this.checkMove(board, i, is_x_next);\n if (validation_check.move_check) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "5967487955c0cafed8fd68c2a3cabf8c", "score": "0.6289785", "text": "function checkWin(p)\n{\n for(let i = 0; i < 3; i++)\n {\n if(board[i][1] == p.symbol && board[i][0] == p.symbol && board[i][2] == p.symbol) //row checks!\n {\n end = 1;\n console.log(p.name + \" WINS! in row: \" + i);\n return true;\n }\n else if (board[1][i] == p.symbol && board[0][i] == p.symbol && board[2][i] == p.symbol) { //column checks!\n console.log(p.name + \" WINS! in col: \" + i);\n end = 1;\n return true;\n }\n }\n if (board[0][0] == p.symbol && board[1][1] == p.symbol && board[2][2] == p.symbol)\n {\n end = 1;\n console.log(p.name + \" WINS! with left-to-right diag \");\n return true;\n }\n else if (board[0][2] == p.symbol && board[2][0] == p.symbol && board[1][1] == p.symbol)\n {\n end = 1;\n console.log(p.name + \" WINS! with right-to-left diag\");\n return true;\n }\n else\n {\n return false;\n }\n\n //TODO: Add latency to the result so that player move can be seen!\n //DONE!!!!\n}", "title": "" }, { "docid": "27ed9c0545e8158ec0ee550f27fd3fea", "score": "0.62889874", "text": "function isAlive(x, y) {\n let idx = boardIndex(x, y)\n return (x >= 0) && (y >= 0) && (x < w) && (y < h) && board[idx]\n }", "title": "" }, { "docid": "1d71d5bb1f5367254b639c0ccea381c1", "score": "0.62889683", "text": "function inRow(arr, col, num){\n for(var col=1; i<=9; i++){\n if(arr[row][col]== num){\n return true;\n }\n }\n}", "title": "" }, { "docid": "a826d15051e3c240f848d786e4f7b05b", "score": "0.6288247", "text": "isPossibleRow(randomNumber, y, board) {\n for (let i = 0; i < 9; i++) {\n if (parseInt(board[y * 9 + i]) === randomNumber) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "2ad29217ee26c12a3fd8fc9bc5f2d907", "score": "0.62880874", "text": "function checkDirection(board, row, col, color, rowAdd, colAdd) {\n const oppositeColor = util.oppositeColor(color);\n let i = row + rowAdd;\n let j = col + colAdd;\n if ((!board.inBounds(i, j)) || (board.get(i, j) !== oppositeColor)) {\n return false;\n }\n for (i += rowAdd, j += colAdd; board.inBounds(i, j); i += rowAdd, j += rowAdd) {\n const tile = board.get(i, j);\n if (tile === empty) {\n return false;\n } else if (tile === color) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "977dbf6b3793e161681feca04c1d7d32", "score": "0.62874633", "text": "function checkWin() {\r\n // let result = false\r\n // [...] === \"...\" -> 不相等\r\n // if (ooxx[0] === \"O\" || ooxx[0] === \"X\") {\r\n // result = true\r\n // };\r\n // if (ooxx[1] === \"O\" || ooxx[1] === \"X\") {\r\n // result = true\r\n // };\r\n // if (ooxx[2] === \"O\" || ooxx[2] === \"X\") {\r\n // result = true\r\n // };\r\n\r\n // O + O + O = \"OOO\"\r\n if (ooxx[0][0] + ooxx[1][0] + ooxx[2][0] === \"OOO\" || ooxx[0][0] + ooxx[1][0] + ooxx[2][0] === \"XXX\") {\r\n // result = true\r\n return true\r\n };\r\n if (ooxx[0][1] + ooxx[1][1] + ooxx[2][1] === \"OOO\" || ooxx[0][1] + ooxx[1][1] + ooxx[2][1] === \"XXX\") {\r\n // result = true\r\n return true\r\n };\r\n if (ooxx[0][2] + ooxx[1][2] + ooxx[2][2] === \"OOO\" || ooxx[0][2] + ooxx[1][2] + ooxx[2][2] === \"XXX\") {\r\n // result = true\r\n return true\r\n };\r\n if (ooxx[0][0] + ooxx[1][1] + ooxx[2][2] === \"OOO\" || ooxx[0][0] + ooxx[1][1] + ooxx[2][2] === \"XXX\") {\r\n // result = true\r\n return true\r\n };\r\n if (ooxx[0][2] + ooxx[1][1] + ooxx[2][0] === \"OOO\" || ooxx[0][2] + ooxx[1][1] + ooxx[2][0] === \"XXX\") {\r\n // result = true\r\n return true\r\n };\r\n return false\r\n}", "title": "" }, { "docid": "7da90322fa1c0bd4d14fe92f8430c8de", "score": "0.628358", "text": "function isValid(x, y){\n\tif(!chessboard[x] || chessboard[x][y] == undefined){\n\t\treturn false; \n\t}\n\n\tif( chessboard[x][y] == -1){\n\t\treturn false;\n\t} \n\n\tif(x<0 || x>colNum-1){\n\t\treturn false;\n\t}\n\n\tif(y<0 || y>9){\n\t\treturn false;\n\t} \n\treturn true;\n}", "title": "" }, { "docid": "869b0f1ea080142a9d9644c136d911e8", "score": "0.6283522", "text": "function canKingMove(board, deltaFrom, deltaTo, turnIndex) {\n var fromRow = deltaFrom.row, fromCol = deltaFrom.col, toRow = deltaTo.row, toCol = deltaTo.col;\n if (toRow < 0 || toCol < 0 || toRow > 7 || toCol > 7) {\n return false;\n }\n var endPiece = board[toRow][toCol];\n var opponent = getOpponent(turnIndex);\n if (endPiece !== '' && endPiece.charAt(0) !== opponent) {\n return false;\n }\n for (var i = fromRow - 1; i <= fromRow + 1; i++) {\n for (var j = fromCol - 1; j <= fromCol + 1; j++) {\n if (i >= 0 && i <= 7 && j >= 0 && j <= 7) {\n if (i === toRow && j === toCol) {\n return moveAndCheck(board, turnIndex, deltaFrom, deltaTo);\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "513988271fd9bdeca33f479dbac20808", "score": "0.6282378", "text": "function isBeatable(color, x, y) {\r\n\tfor (var i = 0; i < 8; i++) {\r\n\t\tfor (var j = 0; j < 8; j++) {\r\n\t\t\tif((Game.board[i][j].type != 'Chip') && (Game.board[i][j].player != color) && (Game.board[i][j] != 'empty')) {\r\n\t\t\t\tvar figure = Game.board[i][j];\r\n\t\t\t\t//when the rules allow a move to the specified field\r\n\t\t\t\tif (Rules[figure.type](i,j,x,y))\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "0c9b3a0e7b9df11ae2f01e75781d84a5", "score": "0.6281391", "text": "is_enemy_on_tile([tile_x, tile_y]) { \n const { enemy_1, enemy_2 } = this.game;\n return (enemy_1.pos[0] === tile_x && enemy_1.pos[1] === tile_y) ||\n (enemy_2.pos[0] === tile_x && enemy_2.pos[1] === tile_y);\n }", "title": "" }, { "docid": "b8f2cdbd35ec336c84e622b7fddf8984", "score": "0.62813824", "text": "function foundMatchP(indexesArray, board) {\n for (var i in indexesArray) {\n\tvar found = true;\n\tfor (j = 0; j < indexesArray[i].length - 1; j++) {\n\t /* If current position has not been filled yet; or\n\t the current posititon is diferent than the next one then\n\t return false */\n\t if (board[indexesArray[i][j]] === \"?\" || board[indexesArray[i][j]] !== board[indexesArray[i][j + 1]]) {\n\t\tfound = false;\n\t\tbreak;\n\t }\t \n\t}\n\tif (found) return true;\n }\n return false;\n}", "title": "" }, { "docid": "c40839e6e3fca45cd4e86d98c3f579b8", "score": "0.62629414", "text": "function isWin(squares){\n var arr = squares.slice(); // copy one piece\n var newArr = [];\n while(arr.length) newArr.push(arr.splice(0, DIMENSION));\n\n for (var i = 0; i < NUM_VSQUARES; i++) {\n for (var j = 0; j < NUM_HSQUARES; j++) {\n if (newArr[i][j] != null) {\n if ( downward(i, j, newArr)\n || rightward(i, j, newArr)\n || lDiagonal(i, j, newArr)\n || rDiagonal(i, j, newArr)\n ) {\n return true;\n }\n } \n \n }\n }\n return false;\n}", "title": "" }, { "docid": "ad3bd42a10cce01cb5d098fc16abfcfb", "score": "0.62620807", "text": "checkForWin() {\n const _win = (cells) => {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n \n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer\n );\n }\n \n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const horiz = [\n [y, x], \n [y, x + 1], \n [y, x + 2], \n [y, x + 3]\n ];\n const vert = [\n [y, x], \n [y + 1, x], \n [y + 2, x], \n [y + 3, x]\n ];\n const diagDR = [\n [y, x], \n [y + 1, x + 1], \n [y + 2, x + 2], \n [y + 3, x + 3]\n ];\n const diagDL = [\n [y, x], \n [y + 1, x - 1], \n [y + 2, x - 2], \n [y + 3, x - 3]\n ];\n \n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "62d0ce273381eb82926aed50dce6bcdb", "score": "0.62551224", "text": "function isSolved(board){\r\n for (var i = 0; i < 9; i++){\r\n for (var j = 0; j < 9; j++){\r\n if (board[i][j] == null){\r\n return false\r\n }\r\n }\r\n }\r\n return true\r\n}", "title": "" }, { "docid": "508f527ebb87cde8d52505dfeec649a9", "score": "0.62535906", "text": "function validBoard(board) {\n // Board -> Boolean\n // checks to see if given board is valid\n return rowsGood(board) && columnsGood(board) && boxesGood(board)\n}", "title": "" }, { "docid": "c4f11a2dace892fb5bf8488db15120ee", "score": "0.62413394", "text": "function checkWon() {\n // Horizontal\n for (let row = 0; row < 3; row++) {\n let count = 0;\n for (let col = 0; col < 3; col++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Vertical\n for (let col = 0; col < 3; col++) {\n let count = 0;\n for (let row = 0; row < 3; row++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Diagonal\n if (gameboard[0][0] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][2] == currentPlayer) {\n return true;\n }\n\n if (gameboard[0][2] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][0] == currentPlayer) {\n return true;\n }\n\n return false\n}", "title": "" }, { "docid": "5057c66bb393db6d11ee4e9b44ff6ef2", "score": "0.62406266", "text": "isValidPosition(loc, arr) {\n // remove own piece from the virtual board before checking\n\n for (var row = 0; row < arr.length; row++) {\n for (var col = 0; col < arr[0].length; col++) {\n // if the tile in arr is empty don't need to check\n if (arr[row][col] !== 0) {\n // + 20 because the game board is 20 squares taller than the other board\n var curRow = loc[0] + row;\n var curCol = loc[1] + col;\n // if the tile is off the edge\n if (curRow >= this.board.board.tiles.length || curCol >= this.board.board.tiles[0].length || curRow < 0 || curCol < 0)\n return false;\n \n // check if the tile is empty\n if (this.board.board.tiles[curRow][curCol].p !== \"\")\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "698dd42b44c650486b1462e0c042d5db", "score": "0.62381774", "text": "function isVaildTile(row, col, board, isWhite) {\n\n\tif (board[row][col] === undefined) {\n\t\treturn false;\n\t}\n\telse if (board[row][col] !== null) {\n\t\tif (board[row][col][0] === 'b' && isWhite) {\n\t\t\treturn true;\n\t\t}\n\t\telse if (board[row][col][0] === 'w' && !isWhite) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "54c60c173ac0c543a831666413e60aa2", "score": "0.6236082", "text": "function hasWon() {\n for (let row of board) {\n if (row.indexOf(false) === -1) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "bf083d06c060cf1f2dc80bc6fbe7e020", "score": "0.6232113", "text": "checkBoardWin() {\n console.log(\"\\n*****\");\n for (let i in this.wins) {\n if (this.checkRowWin(this.wins[i])) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "a7607f0239023dcef9408e5e064f13df", "score": "0.6230591", "text": "function checkDiagUpWin() {\nfor (var y = 3; y <= 5; y++) {\n for (var x = 0; x <= 3; x++) {\n if (board[y][x] != 0 &&\n board[y][x] == board[y-1][x+1] &&\n board[y][x] == board[y-2][x+2] &&\n board[y][x] == board[y-3][x+3]) {\n return (currentPlayer);\n }\n }\n }\n}", "title": "" } ]
f158d6797ddb9828476f0f69b5a870e0
Spawns a munchie at a random position on the grid
[ { "docid": "84e4e3b34fe43dbe0cd11f3b7a3a87a2", "score": "0.7509095", "text": "spawnMunchie() {\n let munchX = Math.round(Math.random() * 37) ;\n let munchY = Math.round(Math.random() * 24) ;\n\n this.munchies.push({ x: munchX, y: munchY });\n }", "title": "" } ]
[ { "docid": "741e36e5b4b294ce0f403f7217d1cfa7", "score": "0.7421819", "text": "function spawnLocation() {\n //Breaking the entire canvas into a grid of tiles\n let rows = width / tileSize;\n let cols = height / tileSize;\n\n let xPos, yPos;\n\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n return { x: xPos, y: yPos };\n}", "title": "" }, { "docid": "0f532386fba18a878461822a9111c181", "score": "0.7416805", "text": "respawn() {\n this.x = random(0, width);\n this.y = -this.dia;\n this.speed = random(5, 10);\n }", "title": "" }, { "docid": "76eb2e2fa4cd8c18699421508db194dd", "score": "0.731482", "text": "function createPlayer(){\n //pick a random true grid and spawn the player there\n var valid=[];\n for (var i=0;i<grid.length;i++){\n for (var j=0;j<grid[i].length;j++){\n if(grid[i][j]) { valid.push({'i':i,'j':j}); }\n }\n }\n var spawnPoint = valid[Math.floor(Math.random()*valid.length)];\n var playerX = Math.floor(spawnPoint.i*CELL_SIZE)+15;\n var playerY = Math.floor(spawnPoint.j*CELL_SIZE)+15;\n player = new Player(playerX,playerY);\n}", "title": "" }, { "docid": "79ae9a4aee69a68df1c5537a89807f1d", "score": "0.71520525", "text": "generateRandom() {\n // generating proper amount of mines\n this.mineCount = Math.min(this.width * this.height, this.minecount);\n for (let i = 0; i < this.mineCount; i++) {\n this.placeRandomMine();\n }\n }", "title": "" }, { "docid": "1ace0d7f54f28321f34995fdc359bdf6", "score": "0.71316224", "text": "function createRandomMinesPosition() {\nfor (let k = 0; k < totalMines; k++) {\n\tlet index = floor(random(totalPositions.length));\n\tlet choice = totalPositions[index];\n\tlet i = choice[0];\n\tlet j = choice[1];\n\ttotalPositions.splice(index, 1); //Deletes that coordinate so it's no longer an option;\n\tgrid[i][j].mine = true;\n\t}\n}", "title": "" }, { "docid": "fa1d8307108fc7bf595e7d486422af0d", "score": "0.7019915", "text": "spawnTile(){\n var openPositions = [];\n for (var col = 0; col < 4; col++){\n for (var row = 0; row < 4; row++){\n if(this.board[col][row] == null){\n openPositions.push([col,row]);\n }\n }\n }\n var index = Math.floor(Math.random() * Math.floor(openPositions.length));\n\n var value;\n var randInt = Math.floor(Math.random() * Math.floor(10));\n if (randInt < 8) value = 2;\n else value = 4;\n this.board[openPositions[index][0]][openPositions[index][1]] = new Tile(this.scene,openPositions[index][0],openPositions[index][1],value);\n this.board[openPositions[index][0]][openPositions[index][1]].displayWidth = 0;\n this.board[openPositions[index][0]][openPositions[index][1]].displayHeight = 0;\n var grow = this.scene.add.tween({\n targets: this.board[openPositions[index][0]][openPositions[index][1]],\n ease: 'Linear',\n duration: 100,\n yoyo: false,\n repeat: 0,\n displayWidth: {\n getStart: () => 0,\n getEnd: () => TILESIZE,\n },\n displayHeight: {\n getStart: () => 0,\n getEnd: () => TILESIZE,\n },\n delay: 50,\n onComplete: () => {\n },\n });\n }", "title": "" }, { "docid": "90c34843c302106f59f7e893089356a8", "score": "0.6997749", "text": "function addMine() {\r\n var i = getRandomInt(0, gLevel.SIZE)\r\n var j = getRandomInt(0, gLevel.SIZE)\r\n var pos = { i: i, j: j }\r\n if (gBoard[pos.i][pos.j].isMine) {\r\n i = getRandomInt(0, gLevel.SIZE)\r\n j = getRandomInt(0, gLevel.SIZE)\r\n }\r\n else {\r\n gBoard[pos.i][pos.j].isMine = true;\r\n gBoard[pos.i][pos.j].isShown = false;\r\n\r\n }\r\n}", "title": "" }, { "docid": "2b8e6278fcea5bf506ed45ed5f99163c", "score": "0.6979488", "text": "spawn() {\n // Put the next tetrimino in play.\n //\n this.tetrimino = this.next();\n // Set the inital position, top centered in well.\n //\n this.position = new Vector(Math.floor(this.tetris.well.getWidth() / 2) - Math.floor(this.tetrimino.matrix[0].length / 2), 0);\n // If we collide immediately, game is lost.\n //\n if (this.tetris.well.collide(this.tetrimino, this.position)) {\n this.tetris.end();\n }\n }", "title": "" }, { "docid": "0565eead06d3a8a20fda3e30b5f0c0c0", "score": "0.69140637", "text": "moveGem() {\n this.x = randomXPosition();\n this.y = randomYPosition();\n }", "title": "" }, { "docid": "9503aa50b525d0d508a84b8175c15cec", "score": "0.68280816", "text": "function Spawn () {\n\t// reset the character's speed\n\tmovement.verticalSpeed = 0.0;\n\tmovement.speed = 0.0;\n\t\n\t// make sure we're not attached to a platform\n\tactivePlatform = null;\n\t\n\t// reset the character's position to the spawnPoint\n\t//transform.position = spawnPoint.position;\n\t//transform.position.x = 0;//Random.Range(0,300);\n\t//transform.position.y = 0;\n\t\n\tsprite.SetActive(true);\n\tcanControl = true;\n}", "title": "" }, { "docid": "4635298bbb9695336eda789fc7d688d3", "score": "0.68083364", "text": "function spawnApple() {\n let row = getRandomInt(0, 14)\n let col = getRandomInt(0, 14)\n\n // keep calculating a random position until an unoccupied tile is found\n while(isASnekPiece({ row, col })) {\n row = getRandomInt(0, 14)\n col = getRandomInt(0, 14)\n }\n\n console.log(`Apple added to row: ${row}, col: ${col}`)\n\n // add apple to location\n insertApple({ row, col })\n appleLocation = { row, col }\n appleInPlay = true\n}", "title": "" }, { "docid": "a14344ccf7af2f0bd158a501966d1e5d", "score": "0.6774171", "text": "function pickLocation() {\r\n var cols = floor(width/scl);\r\n var rows = floor(height/scl);\r\n food = createVector(floor(random(cols)), floor(random(rows)));//this ensure the food is in the grid aligned with snake\r\n food.mult(scl);//to expand it back out\r\n\r\n\r\n}", "title": "" }, { "docid": "a6f0123f8d7da1bf1aecb3ba54ee2e65", "score": "0.674739", "text": "function randomGridPosition() {\n return {\n x: Math.floor(Math.random() * 21) + 1,\n y: Math.floor(Math.random() * 21) + 1\n }\n}", "title": "" }, { "docid": "da69edd8270370c253d83abd2d5524ef", "score": "0.6734415", "text": "_moveToRandomPosition() {\n const screen = this.screen;\n const maxX = screen.width - this.sprite.width;\n const maxY = screen.height - this.sprite.height;\n const sprite = this.sprite;\n\n sprite.position.x = Util.Math.random(0, maxX);\n sprite.position.y = Util.Math.random(0, maxY);\n }", "title": "" }, { "docid": "186410109f21b3cd7ad5cbc7dc3b567b", "score": "0.67224365", "text": "expand() {\n this.x = this.x + random( -3, 3 );\n this.y = this.y + random( -3, 3 );\n }", "title": "" }, { "docid": "e85359656696875a45ed35eab6af35f4", "score": "0.67218393", "text": "function spawnEnemyShip(){\n\t\tenemyShipArray.push(new Projectile(Math.max(Math.random()*canvas.width-enemyShipXDimension, 0), 30+Math.random()*20, enemyShipXDimension, enemyShipYDimension, enemyShipXSpeed, enemyShipYSpeed, true));\n\t}", "title": "" }, { "docid": "92a06fdc2be3c89c636825dfd1c3ef67", "score": "0.67188317", "text": "warp() {\n if (this.y >= height - 3) {\n this.x = random(0, width);\n this.speed = random(1, 3);\n }\n }", "title": "" }, { "docid": "563dec0cecf4bc49efeed0c7797233e0", "score": "0.668311", "text": "function placeEnemyShip(e){\n\te.speed = Math.floor(Math.random() * 10) + 6;\n\t\t\t\t\n\tvar maxX = GS_WIDTH - parseInt(e.style.width);\n\tvar newX = Math.floor(Math.random()*maxX);\n\te.style.left = newX + 'px';\n\t\t\t\t\n\tvar newY = Math.floor(Math.random()*600) -1000;\n\te.style.top = newY + 'px';\n}", "title": "" }, { "docid": "5628a3ac848e40a5ce1f37d9ac9e4765", "score": "0.6679421", "text": "function create_mover(){\n\tmover = {\n\t x: Math.round(Math.random()*(w-cw)/cw), \n\t y: Math.round(Math.random()*(h-cw)/cw),\n\t dir_x: -1,\n\t dir_y: 1\n\t};\n //This will create a cell with x/y between 0-44\n //Because there are 45(450/10) positions accross the rows and columns\n }", "title": "" }, { "docid": "8cac684626b8cda547af7d14a634a06d", "score": "0.66754764", "text": "function placeBombRandomLoc() {\n bombPlaced = false;\n while(!bombPlaced) {\n let i = 0, j = 0;\n with(Math) {\n i = floor(random() * (maxX+1));\n j = floor(random() * (maxY+1));\n }\n bombPlaced = (placeBomb(i,j));\n }\n}", "title": "" }, { "docid": "bc92065e6aff90b312f2d9ebfd3a2420", "score": "0.666671", "text": "function randomMineAssign() {\n for (let i = 1; i <= userNumOfMines; i++) {\n do {\n xCoord = Math.floor(Math.random() * gridSize); //returns random number between 0 and gridSize-1;\n yCoord = Math.floor(Math.random() * gridSize); //returns random number between 0 and gridSize-1;\n } while (arr[xCoord][yCoord].isBomb != 0); //Loop through random coordinates until a non-mine space is found (avoid multiple assignments to same square)\n arr[xCoord][yCoord].isBomb = 1; //assign isBomb property. 0 - No, 1 - Yes\n }\n}", "title": "" }, { "docid": "e2501cb77c5ca8becead9c0f81d79e44", "score": "0.66617787", "text": "spawnEnemy() {\n // Pick a random x coordinate without set bounds\n // x will be between 25 and 425\n const x = (Math.random() * 400) + 25;\n // Creates the actual enemy object at the given position\n this.createEnemy(x, 0);\n // Set the spawn timer and time between spawns\n this.lastSpawned = this.now();\n this.spawnTime *= .9;\n // Puts a hard limit on how small spawn time can get\n if (this.spawnTime < this.minSpawnTime) {\n this.spawnTime = this.minSpawnTime;\n }\n }", "title": "" }, { "docid": "6f80eba39613db34272346d91b03bcc4", "score": "0.6645475", "text": "function monter1_random () {\n\tmonter1.x=Math.floor(Math.random()*(wid));\n\tmonter1.y=Math.floor(Math.random()*(hei));\n}", "title": "" }, { "docid": "4007ef0d805c4331525868f1e3c72b4b", "score": "0.662541", "text": "move() {\n this.x += random(-this.speed, this.speed);\n this.y += random(-this.speed, this.speed);\n }", "title": "" }, { "docid": "7bc44e248b0f41281677f482177a4d4d", "score": "0.66227734", "text": "function placePacmanInRandomCell() {\n var emptyCell = findRandomEmptyCell(_board);\n _board[emptyCell[0]][emptyCell[1]] = 2;\n pacman.i = emptyCell[0];\n pacman.j = emptyCell[1];\n\n var param = '\"pacman_i\" :' +pacman.i + ', \"pacman_j\" :' + pacman.j + ', \"lastPressKey\" :' + '\"\"';\n send_message(ServerBuildJson(\"updatePacmanLocation\",param));\n}", "title": "" }, { "docid": "ccec05d36c52e1f243f61968bffe6b20", "score": "0.65998435", "text": "function plantMines() {\n if (board.cells.length == 0) {\n return;\n }\n\n let totalCells = board.cells.length\n let totalMines = Math.ceil(totalCells * 0.2); // 20% of cells have mines\n setTotalMines(totalMines);\n\n while (totalMines > 0) {\n let location = Math.floor(Math.random() * totalCells)\n if (board.cells[location].isMine == false) {\n board.cells[location].isMine = true;\n totalMines -= 1;\n }\n }\n\n}", "title": "" }, { "docid": "13a8bb70663adc595da810fe102fdf4a", "score": "0.65975183", "text": "function spawn_enemy_soldiers()\n{\n\t//Generate random number for random lane\n\tvar randNum = Math.floor((Math.random() * 4) + 1);\n\tvar position;\n\tif (randNum == 1)\n\t{\n\t\tposition = 375;\n\t}\n\telse if (randNum == 2)\n\t{\n\t\tposition = 345;\n\t}\n\telse if (randNum == 3)\n\t{\n\t\tposition = 315;\n\t}\n\telse \n\t{\n\t\tposition = 285;\n\t}\n\tvar soldier = new stickMan(400, position, position, 2, 10, 10, 5, 2, false);\n\teArmy.eFootSoldiers.push(soldier);\n\tmaterials += 5;\n}", "title": "" }, { "docid": "2c91cb07e8be49ae4069aa47890f7438", "score": "0.658812", "text": "function randomSpawn(buffer) {\n var randX = random(buffer, width - buffer);\n var randY = random(buffer, (height / 2) - buffer);\n\n return {\n x: randX,\n y: randY\n }\n}", "title": "" }, { "docid": "440149c22aa026c22377625e6d2e481f", "score": "0.65792763", "text": "function goToRandom(){\n\n\tcoords = {\n\t\tx: Math.random() * 4561920,\n\t\ty: Math.random() * 4561920\n\t};\n\t\n\tgoToLoc(coords);\n}", "title": "" }, { "docid": "49da6d3e39b74be2ede03faecd22b415", "score": "0.65735686", "text": "randomisePosition() {\n this.setX(Phaser.Math.Between(-1500, 1500));\n this.setY(Phaser.Math.Between(-1000, 1000));\n }", "title": "" }, { "docid": "82e8e393e635fb64212bdd80d3819992", "score": "0.65690637", "text": "function makeMines(board) {\r\n var emptyCells = findEmptyCells(board);\r\n var rndCell = getRandomInteger(0, emptyCells.length - 1);\r\n var mineLocation = emptyCells.splice(rndCell, 1);\r\n board[mineLocation[0].i][mineLocation[0].j].minesAroundCount = MINE;\r\n board[mineLocation[0].i][mineLocation[0].j].isMine = true;\r\n}", "title": "" }, { "docid": "a7a4d3fdee2ae52ebe9110bd55ece383", "score": "0.6568448", "text": "function spawnCube(){\n\tif(flag){\n\t\tif(!mBoard.GameOver()){\n\t\t\tspot = round(random(-1,15));\n\t\t\tif(spot < 0){\n\t\t\t\tspot = 0;\n\t\t\t}\n\t\t\tif(!moves[spot][2]){\n\t\t\t\tmove(spot);\n\t\t\t\tcubes[spot] = new Cube(moves[spot][0],moves[spot][1]);\n\t\t\t\tcubes[spot].display(25);\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0040ad2059fca77e4a566377f3431908", "score": "0.6567534", "text": "function placeRandom() {\n let placed = false;\n let directionArr = [\"down\", \"across\"];\n while (!placed) {\n let newCoords = [_randIntUpTo(10), _randIntUpTo(10)];\n let direction = _randIntUpTo(2);\n if (placeShip(directionArr[direction], newCoords)) {\n placed = true;\n }\n }\n }", "title": "" }, { "docid": "536f7250c31dd7c40290757cbfbf9fd2", "score": "0.6549474", "text": "function place_food() {\n /*for(var i = 0; i < 10; i++){\n var random_x = Math.floor(Math.random() * (config.grid_size - 2)) + 1;\n var random_y = Math.floor(Math.random() * (config.grid_size - 2)) + 1;\n }*/\n\n\n\n do {\n var random_x = Math.floor(random() * (config.grid_size - 2)) + 1;\n var random_y = Math.floor(random() * (config.grid_size - 2)) + 1;\n } while (squares[random_x][random_y] != 0);\n\n squares[random_x][random_y] = 2;\n food = new Point(random_x, random_y);\n\n\n/*\n let loc = tot.pop();\n\n console.log(loc);\n squares[loc.x][loc.y] = 2;\n food = new Point(loc.x, loc.y);*/\n}", "title": "" }, { "docid": "8fdd10f9483d6ee9a84102b703fd8dee", "score": "0.6544114", "text": "function spawn_enemy_soldiers()\n{\n\t//Generate random number for random lane\n\tvar randNum = Math.floor((Math.random() * 4) + 1);\n\tvar yPos;\n\tvar zPos;\n\tif (randNum == 1)\n\t{\n\t\tyPos = Lane1;\n\t\tzPos = Lane1;\n\t}\n\telse if (randNum == 2)\n\t{\n\t\tyPos = Lane2;\n\t\tzPos = Lane2;\n\t}\n\telse if (randNum == 3)\n\t{\n\t\tyPos = Lane3;\n\t\tzPos = Lane3;\n\t}\n\telse \n\t{\n\t\tyPos = Lane4;\n\t\tzPos = Lane4;\n\t}\n\t//stickMan(x, y, z, speed, health, atk, rng, fight, type, img_status){\n\tvar soldier = new stickMan(500, yPos, zPos, 1, 200, 2, 15, false, \"grunt\", 0);\n\teArmy.eFootSoldiers.push(soldier);\n}", "title": "" }, { "docid": "42eef6b21030e1ef44143ef9d95048d8", "score": "0.6541062", "text": "function spawnRandomEnemy()\n{\n var enemyType;\n\n if(0 == Math.floor(Math.random() * 35))\n {\n enemyType = 5;\n }\n else \n {\n enemyType = Math.floor(Math.random() * 4 + 1);\n }\n var newPos = new Vector2(Math.floor(Viewport.viewportOffset.x + Math.random() * Viewport.viewportSize.x), Math.floor(Viewport.viewportOffset.y + Viewport.viewportSize.y ));\n\n return spawnEnemyOfType(enemyType, newPos);\n}", "title": "" }, { "docid": "540c3a01c49f7e910d3d320e6fc135d4", "score": "0.65229267", "text": "move() {\n // this.x += Math.random();\n this.y += Math.random() * 1 + 3;\n if (this.y >= 550) {\n this.y = 550;\n }\n }", "title": "" }, { "docid": "35c76db45f18224b46c30cd73c3eb5b0", "score": "0.65189445", "text": "function getRandomGrassPosition() {\n let newGrassPosition\n while(newGrassPosition == null || onCow(newGrassPosition)) {\n newGrassPosition = randomGridPosition()\n }\n return newGrassPosition\n}", "title": "" }, { "docid": "1255b81909390abde6307da09d3e4acf", "score": "0.6517829", "text": "generateRandomLocation()\n {\n this.babylonBox.position.x = Math.random() * worldBounds;\n this.babylonBox.position.y = Math.random() * worldBounds;\n this.babylonBox.position.z = Math.random() * worldBounds;\n }", "title": "" }, { "docid": "228247e49d972e8fe74e98ebbc377159", "score": "0.65022564", "text": "function spawnBoard() {\n\n //BOARD_COLS = Math.floor(game.world.width / DONUT_SIZE_SPACED);\n //BOARD_ROWS = Math.floor(game.world.height / DONUT_SIZE_SPACED);\n BOARD_COLS = 8;\n BOARD_ROWS = 8;\n //alert(BOARD_ROWS);\n\n tray = game.add.sprite(DONUT_SPACE_LEFT_MARGIN-50,DONUT_SPACE_TOP_MARGIN-50,'tray');\n\n //tray.frame.width = 700;\n //tray.frame.height = 800;\n\n tray.scale.setTo(1,1.35);\n\n donuts = game.add.group();\n\n donuts.centerX = DONUT_SPACE_LEFT_MARGIN;\n donuts.centerY = DONUT_SPACE_TOP_MARGIN;\n\n for (var i = 0; i < BOARD_COLS; i++)\n {\n for (var j = 0; j < BOARD_ROWS; j++)\n {\n var type = selectRandomType();\n \n var donut = donuts.create(i * DONUT_SIZE_SPACED, j * DONUT_SIZE_SPACED, \"smallshadow\");\n donut.donutType = type;\n donut.name = 'donut' + i.toString() + 'x' + j.toString();\n donut.inputEnabled = true;\n donut.events.onInputDown.add(selectDonut, this);\n donut.events.onInputUp.add(releaseDonut, this);\n donut.addChild(game.add.sprite(0,0,type.img));\n donut.children[0]\n donut.children[0].anchor.x = +0.12;\n donut.children[0].anchor.y = +0.12;\n donut.children[0].sendToBack();\n donut.bringToTop();\n \n //temp_emitter.anchor.x = 0.5;\n //temp_emitter.anchor.y = 0.5;\n //donut.addChild(temp_emitter);\n //randomizeDonutColor(donut);\n setDonutPos(donut, i, j); // each donut has a position on the board\n donut.kill();\n }\n }\n\n removeKilledDonuts();\n\n var dropDonutDuration = dropDonuts();\n\n // delay board refilling until all existing donuts have dropped down\n game.time.events.add(dropDonutDuration * 100, refillBoard);\n\n allowInput = false;\n\n selectedDonut = null;\n tempShiftedDonut = null;\n\n // refillBoard();\n} //creates a grid of donut Objects, fills it", "title": "" }, { "docid": "2eaf0d7afcf91bab138f6bc4de0f186d", "score": "0.6492266", "text": "function placeBomb() {\n\t// select a random solid tile for the bomb except for teh borders\n let x = random(4*tileSize, width-5*tileSize);\n let y = random(4*tileSize, height-5*tileSize);\n let count = 0;\n// while random position is not on a solid tile, keep find a new position 5 more times\n while (getTile(x, y) == 0 && count < 5) {\n x = int(random(4*tileSize, width-5*tileSize));\n y = int(random(4*tileSize, height-5*tileSize));\n count += 1;\n }\n // if new position is found\n if (count < 5) {\n \t// return its coordinates\n return [x, y];\n }\n // if not\n else {\n \t// return false\n return false;\n }\n}", "title": "" }, { "docid": "eaad3e4a29baf72ffdb05bae00a83e42", "score": "0.64837873", "text": "function monter3_random () {\n\tmonter3.x=Math.floor(Math.random()*(wid));\n\tmonter3.y=Math.floor(Math.random()*(hei));\n}", "title": "" }, { "docid": "157e33f0431a254bb3c026b53c4c5dfe", "score": "0.6481109", "text": "function spawnapple() {\r\n apple[0].x = randnum(canvas.width);\r\n apple[0].y = randnum(canvas.height);\r\n if (apple[0].x === undefined || apple[0].x > 580 || apple[0].x < 10) {\r\n spawnapple();\r\n }\r\n if (apple[0].y === undefined || apple[0].y > 580 || apple[0].y < 10) {\r\n spawnapple();\r\n }\r\n\r\n}", "title": "" }, { "docid": "7cc05e8bf289617d62db06b037eb108b", "score": "0.64580876", "text": "spawn(name, pos) {\n this.alive = true;\n this.name = name;\n this.pos = pos;\n this.r = MIN_RADIUS;\n this.growToR = this.r;\n this.dir = {x: 0, y: 0};\n }", "title": "" }, { "docid": "308172808a2b981f7dc120a62b9da292", "score": "0.64468586", "text": "function monter4_random () {\n\tmonter4.x=Math.floor(Math.random()*(wid));\n\tmonter4.y=Math.floor(Math.random()*(hei));\n}", "title": "" }, { "docid": "f5cbe72cc8075540cf64ac1389a9d65b", "score": "0.64418095", "text": "function spawn() {\n let particle = {\n opacity: getRandomNumber(0.006, 0.025),\n color: color_interpolator_nodes(Math.random()),\n\n x: Math.random() * width,\n y: Math.random() * height,\n wander: getRandomNumber(0.75, 1.5),\n drag: getRandomNumber(0.85, 0.99),\n theta: getRandomNumber(-Math.PI, Math.PI),\n\n outside: false,\n draw: Math.random() < 0.1\n }\n\n //Set the speed\n particle.vx = Math.sin(particle.theta) * particle.wander\n particle.vy = Math.cos(particle.theta) * particle.wander\n particle.direction = particle.theta >= 0 ? 1 : -1;\n\n return (particle)\n}//spawn", "title": "" }, { "docid": "aba18995e7bf8926ddc893008e26334c", "score": "0.64412284", "text": "add() {\n let randCellRow = getRandomInt(0, this.GRID_SIZE - 1);\n let randCellCol = getRandomInt(0, this.GRID_SIZE - 1);\n\n // ensures the player begin at different sides of the map.\n if (\n randCellRow >= this.rowMin &&\n randCellRow <= this.rowMax &&\n (randCellCol > this.colMin && randCellCol < this.colMax)\n ) {\n if (this.isAvailableCell(randCellRow, randCellCol)) {\n this.placeItem(randCellRow, randCellCol, this.className);\n } else {\n return this.add();\n }\n } else {\n return this.add();\n }\n }", "title": "" }, { "docid": "1deeeda75ead10fa0f177f4a413eadc9", "score": "0.6440256", "text": "function initialPos(point) {\n if (seconds === 0 && distanceEnemy === 5) {\n point.style.left = getRandomInt(751) + 'px';\n point.style.bottom = getRandomInt(751) + 'px';\n }\n}", "title": "" }, { "docid": "a2e99f7492b8b71b8db6d0cb44192349", "score": "0.6426278", "text": "function monter2_random () {\n\tmonter2.x=Math.floor(Math.random()*(wid));\n\tmonter2.y=Math.floor(Math.random()*(hei));\n\n}", "title": "" }, { "docid": "f23163d9683de84a6187fb8c35046fa7", "score": "0.64220905", "text": "function pickLocation() {\n food = createVector(floor(random(cols)), floor(random(rows)));\n food.mult(scl);\n}", "title": "" }, { "docid": "2f54d6ad353dbf9cfa406b90f278cae2", "score": "0.640455", "text": "function enemyAI(){\r\n //creating the enemies inside the maze\r\n //enemy = createSprite(random(10,1200),30,10,10);\r\n enemy = createSprite(random(10,1200),30,20,20);\r\n enemy.shapeColor = \"black\";\r\n enemy.velocityY = 30;\r\n enemy.velocityX = 30;\r\n enemyGroup.add(enemy);\r\n \r\n}", "title": "" }, { "docid": "b7aface2c0251b60acd59010df9fd347", "score": "0.6402278", "text": "function sacarZombie(){\n\tsetTimeout(function(){\t\t\n\t\tvar spawns = conseguirIndexSpawns();\n\t\tvar rand = Math.floor(Math.random()*2);\n\t\tif(rand == 0){\n\t\t\tzombie = new Zombie(spawns[0][0],spawns[0][1],mapaactual);\n\t\t\tzombies.push(zombie);\n\t\t}else if(rand == 1){\n\t\t\tzombie = new Zombie(spawns[1][0],spawns[1][1],mapaactual);\n\t\t\tzombies.push(zombie);\n\t}\n\t}, 500);\n\t\n}", "title": "" }, { "docid": "63fc88b5f59fd45746c2f017f6c8bd3f", "score": "0.6396902", "text": "function randomMaze() {\r\n resetWalls();\r\n for (var row = 0; row < constants_1.HEIGHT; row++) {\r\n fillRowRandomly(row);\r\n }\r\n}", "title": "" }, { "docid": "2eea8add00806e02b85992004b26e5d8", "score": "0.6394878", "text": "randomgem() {\n this.x = Math.floor(Math.random() * 450);\n this.y = Math.floor(Math.random() * 450);\n }", "title": "" }, { "docid": "928a9f0fa959b8de57f6e8240b0825c4", "score": "0.6394243", "text": "function randomizeNewLocation(object,num){\n var newLocation = findRandomEmptyCell(board);\n\tboard[newLocation[0]][newLocation[1]] = num;\n\tobject.i = newLocation[0];\n\tobject.j = newLocation[1];\n}", "title": "" }, { "docid": "64b267cbe1de21ba0ec0bf2a89967df4", "score": "0.63830596", "text": "function randomCells() {\n setGen(0);\n setCells(createGrid(60, 60, true).cells);\n setTranslate({translateX:0,translateY:0});\n setSize(10);\n }", "title": "" }, { "docid": "fb1d25a0ba91a286e049fd35fdac1b34", "score": "0.6381218", "text": "function findSpawn(enemy) {\n\tvar testPath;\n\tvar times = 0;\n\t/**\n\t * test paths until a\n\t */\n\tdo {\n\t\tdo {\n\t\t\t// 0-3 top-left clockwise\n\t\t\tvar x = 0;\n\t\t\tvar y = 0;\n\t\t\tif (side === 0 || side === 2) {\n\t\t\t\tx = random(0, canvasWidth - 1);\n\t\t\t\tif (side === 2) {\n\t\t\t\t\ty = canvasWidth - 1;\n\t\t\t\t}\n\t\t\t} else if (side === 1 || side === 3) {\n\t\t\t\ty = random(0, canvasHeight - 1);\n\t\t\t\tif (side === 1) {\n\t\t\t\t\tx = canvasHeight - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttimes++\n\t\t\tvar testMap = compile();\n\t\t} while (testMap[x][y].speed === 0 /* && times < canvasWidth * canvasHeight*/ );\n\n\t\tdata.x = x;\n\t\tdata.y = y;\n\t\tdata.pixelX = centerSymmetrical(x, data.size);\n\t\tdata.pixelY = centerSymmetrical(y, data.size);\n\t\ttestPath = getPaths([data], testMap);\n\t} while (!testPath.length)\n\tdata.path = testPath;\n\tdata.targetX = testPath[0].x;\n\tdata.targetY = testPath[0].y;\n\tdata.pathIndex = 0;\n\treturn enemy;\n}", "title": "" }, { "docid": "f5e3990cd68625893c28c242a4d697d4", "score": "0.63792014", "text": "function spawn_enemy()\n{\n IsEnemySpawning = true;\n\n let position_x = int( random( player.position.x + 2000, player.position.x - 2000 ) );\n let y_random = random( 0, 10 );\n let y_pos;\n if ( y_random > 5 )\n y_pos = 1;\n else\n y_pos = -1;\n\n let position_y = int( y_pos * sqrt( 2000 * 2000 - position_x * position_x ) );\n\n if ( enemy.length < max_enemy )\n enemy.push( new spaceship( position_x, position_y, 30, enemy_level ) );\n}", "title": "" }, { "docid": "29838cbbff3817cd817bef11a40803b6", "score": "0.63643736", "text": "function spawnMonster(){\n \n var monster = createSprite(windowWidth,Math.round(random(windowHeight/2-50,windowHeight-100)),10,20);\n monster.velocityX = wall.velocityX;\n monster.addImage(monImg);\n monster.scale = 0.5;\n monster.lifetime = 500;\n \n monster.debug = false;\n monster.setCollider(\"circle\",0,0,150)\n \n monsterSound.play();\n \n monsterG.add(monster);\n \n}", "title": "" }, { "docid": "0247322257643d3cee56ad5354c25121", "score": "0.6363394", "text": "function randomCell(size) {\n return new Cell(\n size, //size\n randInt(0, worldWidth), //x\n randInt(0, worldHeight), //y\n randColor(), //color\n randInt(100, 500) / 1000, //fraction\n randCommands(randInt(1, 9)), //args\n randCommand()\n );\n}", "title": "" }, { "docid": "84fdfd3930c373e86a2505197a3afb1a", "score": "0.6361428", "text": "function generateboard()\n{\n // Remove enemies cache\n gs.enemies=[];\n\n // Empty the board first\n for (var y=0; y<dimension; y++)\n for (var x=0; x<dimension; x++)\n gs.board[boardpos(x, y)]=0;\n\n // Place the items\n placeitem(0, 2);\n placeitem(1, 3);\n placeitem(2, 4);\n}", "title": "" }, { "docid": "2c4130248758fc9232cd22026156533d", "score": "0.6356542", "text": "function randPosition() {\n //random nummer tussen 1 en 10\n var randX = Math.floor((Math.random() * 79) + 1);\n var randY = Math.floor((Math.random() * 49) + 1);\n var position = {x : randX, y : randY};\n \n return position;\n}", "title": "" }, { "docid": "c8769787c9d1872b08c6d8fb1e7e2c2d", "score": "0.63499933", "text": "function makeRandomMove() {\n\tconst possibleMoves = game.moves();\n\n\t// game over\n\tif (!possibleMoves.length) {\n\t\treturn;\n\t}\n\n\tconst randomIdx = Math.floor(Math.random() * possibleMoves.length);\n\tgame.move(possibleMoves[randomIdx]);\n\tboard.position(game.fen());\n}", "title": "" }, { "docid": "352f00a3c4410b6ef313e6d8b5774476", "score": "0.63446754", "text": "spawnLoot(){\n\t\tthis.loot.x = this.x;\n\t\tthis.loot.y = this.y;\n\t\tthis.game.add.existing(this.loot);\n\t}", "title": "" }, { "docid": "c7fccb93fc01b625fe32004fe78b1f43", "score": "0.63390744", "text": "function placemine(){\n let grid = [];\n let chanceOfHavingMine = 30; //set the chance of having a mine\n for (let i=0; i<GRIDSIZE; i++) {\n grid.push([]);\n for (let j=0; j<GRIDSIZE; j++) {\n \n if (random(100) < chanceOfHavingMine) {\n grid[i].push(\"mine\");\n }\n\n else {\n grid[i].push(\"no mine\");\n \n }\n }\n }\n return grid;\n \n}", "title": "" }, { "docid": "4fb8d25a7d3b3cd3a745c74e7ff72b5f", "score": "0.6338127", "text": "function makeBoard(size) {\n for (x = 0; x < size; x++){\n for (y = 0; y < size; y++){\n board.cells.push({\n row: x,\n col: y,\n isMine: Math.random() <0.3,\n isMarked: false,\n hidden: true\n })\n }\n }\nstartGame\n}", "title": "" }, { "docid": "de90701df744abb9b71a7843774753c6", "score": "0.6330083", "text": "update(){\n this.pos.x += random(-1, 1);\n this.pos.y += random(-1, 1);\n }", "title": "" }, { "docid": "63cdaf03d0860e09ada2d6721511f702", "score": "0.63295996", "text": "function enemyAI(){\r\n //creating the enemies inside the maze\r\n//enemy = createSprite(random(10,1200),30,10,10);\r\nenemy = createSprite(random(10,1200),30,20,20);\r\nenemy.shapeColor = \"black\";\r\nenemy.velocityY = 10;\r\nenemy.velocityX = 5;\r\nenemyGroup.add(enemy);\r\n\r\n}", "title": "" }, { "docid": "9daef1324ab347c09b04eeb79193c05f", "score": "0.63269585", "text": "function getRandomPosition(){\n return {\n x: Math.floor(Math.random()*boardSize),\n y: Math.floor(Math.random()*boardSize)\n }\n}", "title": "" }, { "docid": "ed5c280e42a3acbefba3baaab8af777b", "score": "0.6325567", "text": "function randomNinja(){\n var randomTop = ((Math.floor((Math.random() * 10))) * ($('#ninjas').width() / 12) + 50);\n var randomLeft = ((Math.floor((Math.random() * 10))) * ($('#ninjas').height() / 10));\n\n var randoms = [randomTop, randomLeft];\n\n return randoms;\n\n //var ninja = new Ninja(randomTop, randomLeft);\n}", "title": "" }, { "docid": "8844f6c13a5239ac8793285114802ed1", "score": "0.6322613", "text": "function randomPiece() {\r\n can.clearRect(0, 0, 100, 100);\r\n let r = Math.floor(Math.random() * PIECES.length) // 0 -> 6\r\n let piece = new Piece(PIECES[r][0], PIECES[r][1]);\r\n minidraw(piece);\r\n return piece;\r\n }", "title": "" }, { "docid": "a86de0e24561510a6c348913c7547fff", "score": "0.63197786", "text": "setStartingPosition(root){\n let startingRoom = root.getRoom();\n this.x = ceil(random(startingRoom.x + 10, startingRoom.x + startingRoom.w - 20));\n this.y = ceil(random(startingRoom.y + 10, startingRoom.y + startingRoom.h - 20));\n }", "title": "" }, { "docid": "976c3bc4a422ab39d7e118d3e5d38424", "score": "0.63186526", "text": "move() {\n var empty = random(this.chooseCell(0));\n\n if (empty) {\n var newX = empty[0]\n var newY = empty[1]\n matrix[newY][newX] = this.index\n matrix[this.y][this.x] = 0\n\n this.x = newX\n this.y = newY\n this.energy -= 1;\n }\n\n }", "title": "" }, { "docid": "05baa980d750688f5879688ddfd1aa19", "score": "0.6317805", "text": "move () {\n this.x = this.x - random (0,10);\n this.y = this.y + random (-1,1);\n\n//Using If statements to make sure the\n//fish don't just leave the screen\n if (this.x <= 0){\n this.x = 800;\n }\n\n if (this.y <= 0){\n this.y = 600;\n }\n\n if (this.y >= 600){\n this.y = 0;\n }\n }", "title": "" }, { "docid": "c7a33632e489a193f0f9a20b7d00a015", "score": "0.6314266", "text": "function randomizePlantsPos() {\n for (let i = 0; i < num_plant; i++) {\n PlantsPosX[i] = random(0, width);\n PlantsPosY[i] = random(0, height);\n }\n}", "title": "" }, { "docid": "26a909c250f462d6343729b618139e42", "score": "0.631364", "text": "function spawn(numeroNemiciDaSpawnare : int, tipoNemico : int) {\n\tstageLivello++;\n\t//Vettore che indica quanti nemici ho già spawnato per ogni spawn point\n\tvar numeroSpawnPerSP : int[] = new int[6];\n\tvar randomPosition : float;\n\tvar spawnIsOk : boolean = false;\n\tvar i : int;\n\t\n\tfor(i = 0; i < numeroNemiciDaSpawnare; i++){\n\t\twhile(!spawnIsOk){\n\t\t\trandomPosition = Random.Range(0.0, 5.0);\n\t\t\tif(numeroSpawnPerSP[randomPosition] <= media(numeroSpawnPerSP)){\n\t\t\t\tspawnIsOk = true;\n\t\t\t\tnumeroSpawnPerSP[randomPosition]++;\n\t\t\t\tGameObject.Instantiate(nemici[tipoNemico], spawnPoints[randomPosition].transform.position, spawnPoints[randomPosition].transform.rotation);\n\t\t\t}\n\t\t}\n\t\tspawnIsOk = false;\n\t}\n\n}", "title": "" }, { "docid": "131d17a165ee60d25fe20500a70a25e9", "score": "0.63068545", "text": "function moveFood() {\r\n console.log((Math.pow(SQUARES_DIVISION_AMOUNT, 2)) - 1);\r\n if (FilledTiles.length < (Math.pow(SQUARES_DIVISION_AMOUNT,2)) - 1) {\r\n\r\n do {\r\n var NewX = Math.floor(Math.random() * SQUARES_DIVISION_AMOUNT);\r\n var NewY = Math.floor(Math.random() * SQUARES_DIVISION_AMOUNT);\r\n \r\n }\r\n while (ContainsTileCoOrdinates(NewX, NewY));\r\n var NewGridPosition = {\r\n x: NewX,\r\n y: NewY,\r\n }\r\n \r\n food.gridposition = NewGridPosition;\r\n FilledTiles[1].position = NewGridPosition;\r\n food.draw();\r\n }\r\n}", "title": "" }, { "docid": "abeed1c079ceccde850309ecdc16a6ac", "score": "0.6302613", "text": "function moveMole(){\n mole.style.display = \"inline-block\";\n holes[Math.floor(Math.random()* (holes.length -1))].appendChild(mole);\n}", "title": "" }, { "docid": "157671913262b73c8d353662d0f07d0c", "score": "0.6301325", "text": "function genRandomSpriteAt(x,y){\r\n\tvar sprite = newSprite();\r\n\tvar randomnumber=Math.floor(Math.random()*tileNum);\r\n\tsprite.initSprite(ctx,leftOffset+(x*tileSizeX),topOffset+(y*tileSizeY),(randomnumber*tileSizeX),0,tileSizeX,tileSizeY,1,1,\"images/sprite3.png\",0,randomnumber);\t\r\n\treturn sprite;\r\n}", "title": "" }, { "docid": "e874df483dd301c0cafa61ab660b3d3f", "score": "0.62961704", "text": "function createMonster() {\n let newMonster = document.createElement('img');\n let monsterSpriteImg = monsterImgs[Math.floor(Math.random()*monsterImgs.length)];\n newMonster.src = monsterSpriteImg;\n newMonster.classList.add('monster');\n newMonster.classList.add('monster-transition');\n newMonster.style.left = '840px';\n newMonster.style.top = `${Math.floor(Math.random() * 420) + 30}px`;\n mainPlayArea.appendChild(newMonster);\n moveMonster(newMonster);\n }", "title": "" }, { "docid": "68af9dd1a9b5cd927602980152d556d0", "score": "0.6288303", "text": "function randomCoordinate() {\n return random_place(0, canvas.width - 10);\n}", "title": "" }, { "docid": "ff3db974e40619c8e10a88f1ccdb1b57", "score": "0.6276599", "text": "function foodLocation() {\n let x = floor(random(w));\n let y = floor(random(h));\n food = createVector(x, y);\n// creaza un vector v cu coordonate random x si y;\n \n\n \n \n}", "title": "" }, { "docid": "f2ce489ba2973a84b57d70cc6b14d39e", "score": "0.6275825", "text": "newRandomPosition(board) {\n\n // Generate a new random position\n let position = this.generateRandomPosition(this.size, board, this.x, this.y);\n\n // Update the current positions\n this.x = position.x;\n this.y = position.y;\n }", "title": "" }, { "docid": "05e0625f08bfcdd4f1c1cb1600c1ca52", "score": "0.6271984", "text": "addMines() {\n this.mines = this.rows * this.columns * this.dificulty;\n\n for (let mine = 0; mine < this.mines; mine++) {\n let column;\n let row;\n\n do {\n column = Math.floor(Math.random() * this.columns);\n row = Math.floor(Math.random() * this.rows);\n } while (this.board[row][column]);\n\n this.board[row][column] = { value: -1 };\n }\n }", "title": "" }, { "docid": "516bdea87bc82b751d42cc04dd77933c", "score": "0.62695044", "text": "function makeNewPosition() {\n\t\tvar h = gameAreaHeight - 50;\n\t\tvar w = gameAreaWidth - 50;\n\n\t\tvar nh = Math.floor(Math.random() * h);\n\t\tvar nw = Math.floor(Math.random() * w);\n\n\t\treturn [nh, nw];\n\t}", "title": "" }, { "docid": "f1df2bce625e8884a8c2475c542d4f50", "score": "0.62689394", "text": "function layoutBoardRandom()\n{\n for (var n = 0; n < 1000; n++)\n {\n var i = Math.floor(Math.random() * 15);\n console.log(\"RANDOM: \" +i);\n makeRandomMove(i);\n }\n}", "title": "" }, { "docid": "f8ecd552bf36923ebaf52466670e4d7a", "score": "0.6262624", "text": "function makeMines(){\n var ids = allCells.slice();\n ids.splice(ids.indexOf(outOfPlay[0]),1);\n for (var iterator = 0; iterator < QUANTITYOFMINES; iterator++){\n var index = Math.floor(Math.random() * ids.length);\n var mine = ids[index];\n mines.push(mine);\n ids.splice(index, 1);\n }\n}", "title": "" }, { "docid": "c65aba34b40e0df7d8959b99b2f38a5e", "score": "0.62589127", "text": "function makeNewPosition() {\n\t\tvar h = gameAreaHeight - 25;\n\t\tvar w = gameAreaWidth - 25;\n\n\t\tvar nh = Math.floor(Math.random() * h);\n\t\tvar nw = Math.floor(Math.random() * w);\n\n\t\treturn [nh, nw];\n\t}", "title": "" }, { "docid": "ffdb5590296b2f63e178c0b1e489cc43", "score": "0.6256575", "text": "placeRandom(){\n\n this.players[this.playerTurn].placeStashRandom();\n this.map.showMapStash(this.players[this.playerTurn]);\n\n this.resetPossibleStash();\n this.sidebar.allPlaced();\n }", "title": "" }, { "docid": "9b5292120fd89ab6564001390a70c002", "score": "0.6251309", "text": "function generateMaze() {\n // gambar tembok\n for (var i = 0; i < 15; i++) {\n for (var j = 0; j < 15; j++) {\n if (j === 0 || j === 14) {\n // buat tembok mendatar\n Crafty.e(\"2D, Canvas, hWall, solid\")\n .attr({x: i * 32, y: j * 32, h: 32, w: 32});\n } else if (i === 0 || i === 14) {\n // buat tembok tegak\n Crafty.e(\"2D, Canvas, vWall, solid\")\n .attr({x: i * 32, y: j * 32, h: 32, w: 32});\n } else {\n // buat lantai\n Crafty.e(\"2D, Canvas, floor\")\n .attr({x: i * 32, y: j * 32, h: 32, w: 32});\n \n // buat tembok di dalam arena\n // kita ingin agar ada banyak tembok di dalam arena,\n // jadi peluang adanya tembok adalah 2/3\n if (Crafty.math.randomInt(1, 3) < 3) {\n Crafty.e(\"2D, Canvas, iWall, solid\")\n .attr({x: i * 32, y: j * 32, h: 32, w: 32});\n }\n }\n }\n }\n }", "title": "" }, { "docid": "a4463c90505b18d120afb7376a3eef71", "score": "0.62501353", "text": "randomizeMove(index) {\n if (Math.floor(Math.random() * 150) === 0) this.changeCoords(index);\n }", "title": "" }, { "docid": "205a5bc94b93cd6b411a73e53b8cfe4b", "score": "0.6246681", "text": "Move(){\n\n if(this._tick > 80){\n // GENERATE NEW RANDOM POINT\n this._xTarget = Math.ceil(Math.random() * X_LIMIT) - START_POINT;\n this._yTarget = Math.ceil(Math.random() * Y_LIMIT);\n this._tick = 0;\n }\n this._tick += 1.5;\n\n // MOVE\n this._x += (this._xTarget - this._x)/INTERVAL;\n this._y += (this._yTarget - this._y)/INTERVAL;\n }", "title": "" }, { "docid": "f6c079aef05b89914449315586524c47", "score": "0.6240509", "text": "function addEnemy() \n{ \n // Variables to store the X position of the spawn object\n // See image below\n var x1 = transform.position.x - GetComponent.<Renderer>().bounds.size.x/2;\n var x2 = transform.position.x + GetComponent.<Renderer>().bounds.size.x/2;\n\n // Randomly pick a point within the spawn object\n var spawnPoint = new Vector2(Random.Range(x1, x2), transform.position.y);\n\n // Create an enemy at the 'spawnPoint' position\n Instantiate(enemy, spawnPoint, Quaternion.identity);\n}", "title": "" }, { "docid": "0a0b5d3f6591bfd0e7e91da50903d015", "score": "0.6239797", "text": "function buildBoard(size, mineCount) {\n\n // Creating the board as an empty one\n var board = [];\n for (var i = 0; i < size; i++) {\n board[i] = [];\n for (var j = 0; j < size; j++) {\n board[i][j] = createCell('empty', false, '');\n }\n }\n\n // Assigning mines to random cells in the board\n for (var z = 0; z < mineCount; z++) {\n\n // X and Y stand for the X-axis and Y-axis, respectively\n // This is valid for the rest of the program\n var xIndex = getRandomInt(0, size - 1);\n var yIndex = getRandomInt(0, size - 1);\n var cell = board[xIndex][yIndex];\n\n if (!cell.isMine) {\n cell.name = 'mine-' + xIndex + '-' + yIndex;\n cell.isMine = true;\n cell.content = '☠';\n }\n else z--;\n\n console.log(xIndex);\n console.log(yIndex);\n }\n\n return board;\n}", "title": "" }, { "docid": "0021cc31a872156d9c810c75ae296758", "score": "0.6239327", "text": "function randPosition() {\n var x = rand.uniInt(0, sim_mng.SIM_BORDER[0]);\n var y = rand.uniInt(0, sim_mng.SIM_BORDER[1]);\n return new Vector2(x, y);\n}", "title": "" }, { "docid": "bba85dd85c5b0b48089813efcb6776c3", "score": "0.6239028", "text": "function asteroid() {\n let size = Math.floor((Math.random() * 150) + 30);\n $galaxy.append($(\"<div>\").addClass(\"asteroid\").css({\n top: -100,\n left: Math.floor((Math.random() * 100) + 1) + '%',\n width: size,\n height: size,\n }));\n }", "title": "" }, { "docid": "02acd7fcf83bc76eabdd917cd816d504", "score": "0.6234351", "text": "function monsterMove (){\n\tif((Math.abs(monsterDestX - monsterLoc.x)) < 32 &&\n\t\t(Math.abs(monsterDestY - monsterLoc.y)) < 32){\n\t\tmonsterDestX = Math.floor(Math.random() * 2000);\n\t\tmonsterDestY = Math.floor(Math.random() * 640);\n\t}else{\n\t\tif(monsterDestX > monsterLoc.x){\n\t\t\tmonsterLoc.x += Math.ceil(Math.random() * 5);\n\t\t}\n\t\tif(monsterDestX < monsterLoc.x){\n\t\t\tmonsterLoc.x -= Math.ceil(Math.random() * 5);\n\t\t}\n\t\tif(monsterDestY > monsterLoc.y){\n\t\t\tmonsterLoc.y += Math.ceil(Math.random() * 5);\n\t\t}\n\t\tif(monsterDestY < monsterLoc.y){\n\t\t\tmonsterLoc.y -= Math.ceil(Math.random() * 5);\n\t\t}\n\t\tif(monsterDestY < 250){\n\t\t\tmonsterDestY = 500;\n\t\t}\n\t\tif(monsterLoc.x <= -1){\n\t\t\tmonsterLoc.x = 1840\n\t\t}\n\t\tif(monsterLoc.x >= 920){\n\t\t\tmonsterLoc.x = 0\n\t\t}\n\t}\n}", "title": "" }, { "docid": "165f871a25110298bbe812957c627b54", "score": "0.6232262", "text": "function createMines(board, level) {\n var randomLocations = randomEmptyLocations(board).slice();\n for (var i = 0; i < level.MINES; i++) {\n var idx = getRandomInt(0, randomLocations.length);\n var currLocation = randomLocations[idx];\n board[currLocation.i][currLocation.j].isMine = true;\n randomLocations.splice(idx, 1);\n }\n}", "title": "" }, { "docid": "8285a2c1a6fdb79ee1a64541eac9b4a7", "score": "0.6228185", "text": "function summon(monster){\n var time = new Date().getTime()\n var x = Math.floor(Math.random()*10)*50;\n var y = Math.floor(Math.random()*6)*50;\n \n monCounter += 1;\n monSelector = monCounter;\n socket.emit('queue', {user:'monster', monsterName: monCounter.toString(), coords:{lastUpdate: time, x:x, y:y, width:50, height:50}});\n }", "title": "" }, { "docid": "5b666db06cd5b2f67613f0353226b79f", "score": "0.62279266", "text": "function generate() {\n // Get the number of mines from the html.\n\n // choose a random cell and add a mine to it as many times as we have number of mines\n\t// use the helper function provided: getRandomNumber\n\n\t// If the random cell has a mine, try another random cell, do not increase the number of mines since no mine was actually placed.\n \n\t// If the random cell has no mine, Put a mine in it!\n \n\n // The neighbors of the random cell must have their value increased by one (unless the neighbor is a mine).\n\t// make sure neighbors are not out of bounds\n\t// if neighbor is a mine, do not do anything \n\t// if it is not a mine, increase value by 1\n}", "title": "" } ]
7c32d6b2c3ed615ec3c9509f1fc7bd81
helper method that is sends a message
[ { "docid": "d7708f1fc9c2bb77b7f88cb4c2a0bfc0", "score": "0.0", "text": "function handleSend(newMessage = []) {\n setMessages(GiftedChat.append(messages, newMessage));\n }", "title": "" } ]
[ { "docid": "8b5b53caa21ec7aedcd41396bc79e3e7", "score": "0.8078407", "text": "function sendMessage(){}", "title": "" }, { "docid": "baa55503427fa00d578d4cf6a4ac3482", "score": "0.751243", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "title": "" }, { "docid": "35eca8a26f6eb1b24447ea5208f034d0", "score": "0.7499783", "text": "function sendMessage() {\n \n\n}", "title": "" }, { "docid": "acbb0619116bd25599f1f59970df9b01", "score": "0.7459819", "text": "function sendMessage() {\n}", "title": "" }, { "docid": "1ae5085aa90e6eeacafa08a27d31191d", "score": "0.7443047", "text": "onSend() {\n this.sendMSG(this.state.message)\n }", "title": "" }, { "docid": "1fe1053c449fbd37196672e29cc9661c", "score": "0.7442256", "text": "function messageSend(message) {\n sendMessage(message, roomID);\n }", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.74381334", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.74381334", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.74381334", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.74381334", "text": "SendMessage() {}", "title": "" }, { "docid": "de67166466d4bc3da4cdc460619af3f4", "score": "0.7435268", "text": "sending () {\n }", "title": "" }, { "docid": "b15e582f9e010d29dde0bed2218604ce", "score": "0.74227136", "text": "function sendMessage() {\n\t//Pebble.sendAppMessage({\"status\": 0});\n //testRequest();\n //testRequestTime();\n\t\n\t// PRO TIP: If you are sending more than one message, or a complex set of messages, \n\t// it is important that you setup an ackHandler and a nackHandler and call \n\t// Pebble.sendAppMessage({ /* Message here */ }, ackHandler, nackHandler), which \n\t// will designate the ackHandler and nackHandler that will be called upon the Pebble \n\t// ack-ing or nack-ing the message you just sent. The specified nackHandler will \n\t// also be called if your message send attempt times out.\n}", "title": "" }, { "docid": "31fb4d6c44ef6403ebe4db283b583f3f", "score": "0.7422034", "text": "send_message(message) {\n this.socket.send(message)\n }", "title": "" }, { "docid": "0230bea19d4c29b4e917390069557ed0", "score": "0.7293258", "text": "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "title": "" }, { "docid": "3f2828a2d593a90d06780b8eea883d82", "score": "0.7288122", "text": "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'gameMessage' message event\n Socket.emit('gameMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "title": "" }, { "docid": "ab1847f0545efa1c003b142f829d88ce", "score": "0.7282124", "text": "function sendMessage() {\n\n channel.push('shout', { \n name: name.value || \"guest\", // get value of \"name\" of person sending the message. Set guest as default\n message: msg.value, // get message text (value) from msg input field.\n inserted_at: new Date() // date + time of when the message was sent\n });\n\n msg.value = ''; // reset the message input field for next message.\n}", "title": "" }, { "docid": "b71342c3af9ee94f5ba54720187b342f", "score": "0.7267381", "text": "handleSendMessage() {\n this.props.sendMessageAction({\n \"userId\": this.state.to,\n \"fromNumber\": this.props.profile.mobile,\n \"text\": this.state.text,\n \"read\": false,\n \"sentDate\": new Date().getTime()\n });\n }", "title": "" }, { "docid": "0cba0a80baf65009f429d1bfac9b9766", "score": "0.72562677", "text": "function send( text ) {\n\tvar to_send = \"t:\".concat(Date.now());\n\tto_send = to_send.concat(\":\");\n\tto_send = to_send.concat(text);\n\tServer.send( 'message', to_send);\n}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.72308546", "text": "send() {}", "title": "" }, { "docid": "7e050b419575fccb75ef0e45542f1c42", "score": "0.72045887", "text": "function sendMessage (message) {\n connection.sendMessage({\n message: message\n });\n renderMessage(message);\n }", "title": "" }, { "docid": "36662ccabb884ee00c3ac9ecb8035b8d", "score": "0.71867764", "text": "sendMessage() {\n\n // get the message from the messaging input\n const message = App.elements.input.val();\n\n // make sure the message is not empty or just spaces.\n if (message.trim().length > 0) {\n\n // do a POST request with the message\n App.requests.sendMessage(message).done(() => {\n\n // clear the message box.\n App.dom.clearMessageBox();\n });\n }\n }", "title": "" }, { "docid": "8ef8495d6b4bc0069f382abc30ebc978", "score": "0.71816075", "text": "function send(msg) { ltSck.write(JSON.stringify(msg) + \"\\n\"); }", "title": "" }, { "docid": "f661dfa3227d4d0a1af656d1dac230cf", "score": "0.7164298", "text": "function SendMessage(message)\n{\n client.sendEvent(new Message(JSON.stringify(message))); //, printResultFor(\"send\"));\n}", "title": "" }, { "docid": "c1ef20f1809cddb380018cf28f45761d", "score": "0.7162554", "text": "channelSend(message, content) {\n message.channel.send(content)\n }", "title": "" }, { "docid": "316a76246eeb036e7d16bed313916dd3", "score": "0.7142494", "text": "function sendMessage () {\n var message = $('#input_' + target).val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $('#input_' + target).val('');\n \n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', {\n message: message,\n target: target,\n displayName: displayName,\n });\n }\n }", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.7141719", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.7141719", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "7e29d00efa03e9f276723d94b2f55003", "score": "0.71376544", "text": "function send(msg) {\n ws.send( msg );\n }", "title": "" }, { "docid": "0978b5b39d8645582e8212b8d637ba4a", "score": "0.71171945", "text": "send(message) {\n this.log(\"Sending message: \"+message);\n this.ws.send(message);\n }", "title": "" }, { "docid": "f4c90de3876ddaaf165d20777edcb18b", "score": "0.7110199", "text": "Send(msg) {\n\t\tthis.Receive(msg);\n\t}", "title": "" }, { "docid": "38f812ffd79eb58ace1a3ea7ba0726cf", "score": "0.70972204", "text": "function sendMessage(m) {\n process.send(m);\n}", "title": "" }, { "docid": "28217888643bb1d933c1ffcdd6f58e01", "score": "0.7095274", "text": "function doSend(message) {\n console.log(\"Sending: \" + message);\n websocket.send(message);\n}", "title": "" }, { "docid": "d2021f5b34cfba97d2e0c7397ae5060c", "score": "0.70685774", "text": "function sendMessage() {\n let message = $inputMessage.value;\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n addChatMessage({ username, message }, { kind: \"sent\" });\n // tell server to execute 'new message' and send along one parameter\n\n let payload = {\n username: username,\n message: message\n }\n if (!dev) {\n socket.emit('new message', payload);\n }\n }\n }", "title": "" }, { "docid": "dd3b78804af268295a79e0c0b22c9f12", "score": "0.70682156", "text": "function sendMessage() {\n json.activeSince = moment();\n \n var message = JSON.stringify(json);\n \n console.log('Music ' + SOUNDS[json.instrument] + ' message : ' + message);\n\n socket.send(message, 0, message.length, protocol.PORT, protocol.MULTICAST_ADDRESS, function (err, bytes) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "d5dd6428454a27ba547d32d171cdfd36", "score": "0.7060635", "text": "function sendMessage() {\n var windSpeed = 8 + (Math.random() * 7);\n var data = JSON.stringify({ \n deviceId: device, \n uuid: uuid(), \n windSpeed: windSpeed \n });\n var message = new Message(data);\n console.log(\"Sending message: \" + message.getData());\n client.sendEvent(message, printResultFor('send'));\n}", "title": "" }, { "docid": "d32ccdacb694404d1b941050de6b15bf", "score": "0.7059628", "text": "onMessageSend() {\n const {\n loading,\n message\n } = this.state.currentMessage;\n\n if(loading)\n return;\n\n if(!message.trim().length)\n return;\n\n this.setState({\n currentMessage: {\n loading: true,\n message\n }\n });\n\n Utils.contract.postMessage(message).send({\n callValue: 10000000\n }).then(res => Swal({\n title: '发送成功',\n type: 'success'\n })).catch(err => Swal({\n title: '发送失败',\n type: 'error'\n })).then(() => {\n this.setState({\n currentMessage: {\n loading: false,\n message\n }\n });\n });\n }", "title": "" }, { "docid": "67feda0d1008d4249e417e0b62aa7133", "score": "0.70516086", "text": "function send () {\n Cute.get(\n // Send the event name and emission number as URL params.\n Beams.endpointUrl + '&m=' + Cute.escape(name) + '&n=' + Beams.emissionNumber,\n // Send the message data as POST body so we're not size-limited.\n 'd=' + Cute.escape(data),\n // On success, there's nothing we need to do.\n function () {\n Beams.retryTimeout = Beams.retryMin\n },\n // On failure, retry.\n function () {\n Beams.retryTimeout = Math.min(Beams.retryTimeout * Beams.retryBackoff, Beams.retryMax)\n setTimeout(send, Beams.retryTimeout)\n }\n )\n }", "title": "" }, { "docid": "07eb95ba177f26900ddf12c495ec8457", "score": "0.70492977", "text": "send (message) {\n if (_.isObject(message))\n message = MessageMaster.stringify(message)\n\n this.socket.send(message)\n }", "title": "" }, { "docid": "f8e313bb556ea84ee9969180f4830531", "score": "0.70417225", "text": "function sendTheMessage() {\r\n\r\n console.log(\"sending data: \\\"\", sendText, \"\\\"\");\r\n // Send Data to the server to draw it in all other canvases\r\n dataServer.publish(\r\n {\r\n channel: channelName,\r\n message:\r\n {\r\n text: sendText //text: is the message parameter the function is expecting\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "5d8087b88a0fdb864a7c171af39700f6", "score": "0.70403427", "text": "sendMessage(id, data) {\n if (process.send) {\n process.send({\n id,\n data,\n });\n }\n }", "title": "" }, { "docid": "17b0d1eaf37ee7f5993a4d57a8b65501", "score": "0.7036783", "text": "function sendMessage(client, str) {\n client.send(str);\n}", "title": "" }, { "docid": "8cf97af6c1896ee0f865cc8a78e8594e", "score": "0.7033173", "text": "function send_message(status, msg) {\n\tPebble.sendAppMessage({'status': status, 'message': msg});\n}", "title": "" }, { "docid": "21caab345e71d2e3a98cd6d14342c43d", "score": "0.7023704", "text": "send(msg: SendArg) {\n this.lastMessage = msg\n return true\n }", "title": "" }, { "docid": "e2788109dced8a7d462f3394a8850a88", "score": "0.7019525", "text": "sendMessage(message) {\n if (this.handler) {\n this.handler.sendMessageFor(message, this.identity);\n }\n }", "title": "" }, { "docid": "45c8358a716f0f3212bbfa27515bc24d", "score": "0.70042676", "text": "sendMessage(options) {\n return this.execute('sendMessage', options);\n }", "title": "" }, { "docid": "4d7367f7fe88574cba86144d4b806672", "score": "0.6984195", "text": "function sendMessage () {\n var message = $inputMessage.val();\n console.log(message);\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n console.log(message + ' and connected');\n $inputMessage.val('');\n addChatMessage({\n name: name,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n \n if (canPlay) {\n if (message === cleanInput('start')) {\n startRound();\n }\n } else if (playing) {\n if (message === cleanInput(answer)) {\n personal_score += score; \n }\n }\n }\n }", "title": "" }, { "docid": "ce02308ffe8912bb2999b118a920d4e2", "score": "0.69825447", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n console.log(\"sendMessage\")\n }", "title": "" }, { "docid": "8eceb4df90644f440ea3717e1378d39c", "score": "0.6977218", "text": "function sendMessage() {\n if(data.value === \"\")\n return;\n var message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n }", "title": "" }, { "docid": "40d942734e12fc4d7aa80bd526b01b9b", "score": "0.6968659", "text": "send(message) {\n if (port) {\n port.postMessage(message);\n }\n }", "title": "" }, { "docid": "8b7f1afdfb4173974177be42e20df890", "score": "0.6963298", "text": "function sendMessage () {\n var message = $inputMessage.val();\n if(message.charAt(0) == '@'){\n var pmuser = message.substr(1,message.indexOf(' ')).trim();\n message = message.substr(message.indexOf(\" \") + 1);\n $inputMessage.val('@'+pmuser+' ');\n addChatMessage({\n username: username,\n message: message,\n pmuser: pmuser\n }); \n socket.emit('new message', message,pmuser);\n }\n else {\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n pmuser: null\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message,null);\n }\n }\n }", "title": "" }, { "docid": "be62db02818270751ec8e68c6c10ba42", "score": "0.6959408", "text": "sendUserMessage(text) {\n this.state.currentUser.sendMessage({\n text,\n roomId: this.state.currentRoom.id\n });\n }", "title": "" }, { "docid": "14c6dfc9092c17a2eabd49039fa92b4a", "score": "0.6953861", "text": "function sendMessage(to, message, id) {\n let msg = candy.starwave.createMessage(message, to, undefined, id);\n candy.starwave.sendMessage(msg);\n}", "title": "" }, { "docid": "1a7512994c6e96ec5603c01e02e4fb71", "score": "0.6945789", "text": "sendMessage(userID, message) {\n Dispatcher.handleViewAction({\n type: ActionTypes.SEND_MESSAGE,\n userID: userID,\n message: message,\n timestamp: +new Date(),\n })\n }", "title": "" }, { "docid": "d6cfde771678fa916de81dfd397a61c0", "score": "0.6941594", "text": "send (message) {\n return this.receive(this.reporter(message))\n }", "title": "" }, { "docid": "57ae4d5c45df6fc006054276e28b6575", "score": "0.69219553", "text": "sendMessage(message) {\n self.socket.emit('message', message);\n }", "title": "" }, { "docid": "28fdd0419276aa91c3ea1a9fe30f1de3", "score": "0.69126594", "text": "function sendMess(mess) {\n console.log(\"logged\");\n notebookClient.send(mess, () => {\n console.log(\"sent\");\n });\n}", "title": "" }, { "docid": "d3db8ac217b69ba35f746418439cdd9b", "score": "0.69021505", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n namecolor: namecolor,\n floatdir: 'right',\n msgbgcolor: '#94C2ED'\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "7d38e898c16f15334480cf0dcfee8b55", "score": "0.689899", "text": "function sendMessage(client, data){\n\t\tclient.emit('news', data);\n\t}", "title": "" }, { "docid": "70b40b644767c9f19208dd5d5beb9d7f", "score": "0.68978", "text": "function sendMessages(type){\n\n var message = \"\";\n switch(type){\n case 'fall':\n message = 'I think I\\'m falling';\n break;\n case 'stroke':\n message = 'I think I\\'m having a stroke';\n break;\n case 'heartattack':\n message = 'I think I\\'m having a heart attack';\n break;\n case 'other':\n message = 'I need help.'\n break;\n }\n\n\n action.forEach(function(profile){\n\n console.log(profile);\n\n client.sendMessage({\n from: '+16473609283',\n to: profile.phoneNumber,\n body: message\n }, function(err, responseData){\n if (!err){\n console.log('Hello, it\\'s me.');\n }else{\n console.log(err);\n }\n });\n });\n\n}", "title": "" }, { "docid": "470823ab0ec5c09a0e1374fde4078dbb", "score": "0.6892687", "text": "sendIn(text) {\n this.emit('message', { data: text });\n }", "title": "" }, { "docid": "06be4204f2426f398f66873b348a2080", "score": "0.6886457", "text": "function msg() {\r\n\t\tsetTimeout(function () {\r\n\t\t\tif(message !== lastMessage) {\r\n\t\t\t\t//client.sendMessage(chanObj, message);\r\n\t\t\t\tchanObj.send(message);\r\n\t\t\t\tlastMessage = message;\r\n\t\t\t}\r\n\t\t\tmsg();\r\n\t\t}, 100);\r\n\t}", "title": "" }, { "docid": "e93d47126d67b038d49321ac9c5f0361", "score": "0.6883466", "text": "function sendMessage(data) {\n\t\tlog('sendMessage', data);\n\t\tthread.sendMessage(data);\n\t}", "title": "" }, { "docid": "f117fcfa18a255a898a7f3f55793c534", "score": "0.68759435", "text": "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "title": "" }, { "docid": "b42f2dbecd5ce9d869e79e19e5ed1fc7", "score": "0.6872544", "text": "function sendMessage() {\n if (!that.connection.isConnected()) {\n displayMessage(\"<span style='color: red'>Verbindung beendet oder noch nicht geöffnet.</span>\");\n return;\n }\n\n var textMessage = getChatMessageFromInput();\n\n if (!textMessage) {\n $(\"gameInputField\").focus();\n return;\n }\n\n var message = new GameMessage(GameMessage.GameChatMessage);\n message.text = \"<b>\" + User.load().getUsername() + \": </b> \" + textMessage;\n\n that.connection.send(message);\n\n // adding \"Ich: \" in front of every printed message from the user so\n // that he knows it was his\n displayMessage(\"<b>Ich: </b>\" + textMessage);\n\n }", "title": "" }, { "docid": "b4285c1eaf9a4c1f19b7b000bc1d3416", "score": "0.68656135", "text": "function sendMessage() {\n var data = messageBox.value();\n var destination = addressBox.value();\n var outGoing = encodeURI(data);\n httpGet('/destination/' + destination + '/msg/' + outGoing, 'text', requestDone);\n}", "title": "" }, { "docid": "219c77d3e9514ba7dc5fbb6244ad2e3a", "score": "0.6861844", "text": "sendMessage(msgType, content, callback) {\n const msg = {\n header: {\n msg_type: msgType,\n },\n content,\n };\n this.send(msg, callback);\n }", "title": "" }, { "docid": "3e12f99a5366f48081c0ecbab375b71b", "score": "0.6846653", "text": "sendMessage() {\n const currentTime = new Date();\n this.state.socket.send(JSON.stringify({\n who_send: Cookie.get('userId'),\n message: this.messageRef.current.value,\n time: currentTime.toISOString().replace(/T/, ' ').replace(/\\..+/, ''),\n person: this.state.selected_contact\n }));\n }", "title": "" }, { "docid": "b39e291494343fab55a2f611955ce41e", "score": "0.68456906", "text": "function send(msg) { // send: msg\n if (socket.readyState === READY_STATE_OPEN) { socket.send(msg); }\n\n console.log('chatService(wsBaseUrl).send('+msg+')');\n }", "title": "" }, { "docid": "9a422e8bf6295bed5a853cfecc01f8ac", "score": "0.6837348", "text": "function onSendMessage(e)\n{\n\tvar self = this;\n\te.preventDefault();\n\n\tshh.post({\n\t\t\"from\": this.identity,\n\t\t\"topic\": [ web3.fromAscii(TEST_TOPIC) ],\n\t\t\"payload\": [ web3.fromAscii(self.messagePayload()) ],\n\t\t\"ttl\": 1000,\n\t\t\"priority\": 10000\n\t});\n}", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.6836135", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.6836135", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.6836135", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "152f72c2fa11189177f01be474379213", "score": "0.6834473", "text": "function doSend(message,id) {\n websocket[id].send(message);\n}", "title": "" }, { "docid": "61de75f8bfebf83e28a3abb8d0b22d5e", "score": "0.68339187", "text": "sendMessage (msg) {\n throw new Error('sendMessage should be implemented in a concrete class')\n }", "title": "" }, { "docid": "8a06273a3b34d62ad69d67e6708a7e8f", "score": "0.6828088", "text": "send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }", "title": "" }, { "docid": "910d775a1cf8fb43e3b856cad764c92a", "score": "0.68243814", "text": "function _send(message, chatstate) {\n var elem = $msg({\n to: contact.jid,\n from: jtalk.me.jid,\n type: \"chat\"\n });\n\n if (message) elem.c(\"body\", message);\n if (chatstate) {\n elem.c(chatstate, {xmlns: Strophe.NS.CHATSTATE});\n }\n\n connection.send(elem);\n }", "title": "" }, { "docid": "e888fd40c3f9528bedfdb5f2e961f515", "score": "0.68241364", "text": "function send(message){\n append(line(message, 'blue'))\n websocket.send(message);\n}", "title": "" }, { "docid": "0c50dd93be5b5796bdb7845c6e3f3720", "score": "0.6822892", "text": "sendMessage(message) {\n this.socket.emit('message', message);\n }", "title": "" }, { "docid": "66d3b93c19bec19fa9f019cf5c6110be", "score": "0.6816276", "text": "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "title": "" }, { "docid": "66d3b93c19bec19fa9f019cf5c6110be", "score": "0.6816276", "text": "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "title": "" }, { "docid": "e677dfafaa458e7a8d52670dd66cc492", "score": "0.68112594", "text": "sendMessage(text) {\n const msg = {\n type: \"newMessage\",\n chatId: this.chatId(),\n user: this.state.user,\n text: text\n };\n this.ws.send(JSON.stringify(msg));\n }", "title": "" }, { "docid": "1fffba3df6a8abd4c408a0432780a2f0", "score": "0.681031", "text": "function sendTo(conn, message) {\n\tconn.send(JSON.stringify(message));\n}", "title": "" }, { "docid": "e17b46519a274e5ec29c4a1acc6c40d3", "score": "0.6810128", "text": "function sendMessage(type, content, visgoth_content) {\n ws.send(JSON.stringify({\n \"type\": type,\n \"content\": content,\n \"visgoth_content\": visgoth_content,\n }));\n}", "title": "" }, { "docid": "b2819fed440aeee21f1b26e3062efc03", "score": "0.6800976", "text": "function mavlink_message_send() {\n var args = Array.prototype.slice.call(arguments);\n var mavcmd = \"mavlink_message_send(\" + args.join() + \")\";\n command_send(mavcmd);\n}", "title": "" }, { "docid": "fc6094143b4fc5eadbee4f855ecfddd6", "score": "0.68009055", "text": "broadCastMessage(message){\n this.socket.send(message);\n }", "title": "" }, { "docid": "82d1aafaa9f3fd43688467575b91b954", "score": "0.6792624", "text": "async sendMessage (toSend) {\n\t\tif (!this._isActive) throw new Error(`Connection is not active!`);\n\n\t\tconst packet = {\n\t\t\thead: {\n\t\t\t\ttype: this._role,\n\t\t\t\tversion: \"0.0.1\",\n\t\t\t},\n\t\t\tdata: toSend,\n\t\t};\n\n\t\tthis._ctx.dc.send(JSON.stringify(packet));\n\t}", "title": "" }, { "docid": "66f17242f10b14c9c5bfd6292b013422", "score": "0.67899156", "text": "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message,\n });\n }", "title": "" }, { "docid": "565e8fb67025e6aa59b8e004125afa68", "score": "0.678374", "text": "function sendMessage (target,message) {\n\t// twitch seems to cut message that are over 500 chars:\n\n\tlet timesToCut = (message.length / 500);\n\tlet messages = [];\n\tif (timesToCut > 0){\n\t\t//\t\tconsole.log(\"gachipls:\" + timesToCut);\n\t\tfor (var i = 0; i < Math.floor(timesToCut) + 1 ; i++){\n\t\t\tmessages.push( message.substr(i*500, i*500+500) );\t\t\n\t\t\t//\t\t\tconsole.log(i);\n\t\t}\n\t}else{\n\t\tmessages.push(message);\n\t}\n\n\t// send the first one immediately\n\t//client.chat.say(target, messages[0] );\n\t/*for (i = 1; i < messages.length; i++){\n\t console.log(\"gnééé:\" + messages[i]);\n\t setTimeout( () => { client.chat.say(target, messages[i] ) }, i*500);\n\t }*/\n\n\ti = 0;\n\tmessages.forEach( (element) => {\n\t\t\tsetTimeout(() => {client.chat.say(target, element)},i * 500)\n\t\t\ti++;\n\t\t\t});\n\n}", "title": "" }, { "docid": "9560ee602c23aed31a6a8c88352537dc", "score": "0.67813313", "text": "function send(message) {\n conn.send(JSON.stringify(message));\n}", "title": "" }, { "docid": "749c990b74fdda123da955391f4d2eba", "score": "0.67677814", "text": "function onSendMessage(data){\n\t//TODO \n}", "title": "" }, { "docid": "accd30051fc4b3a2c7176c11f1060f68", "score": "0.67667526", "text": "send(message) {\n if(this.currentConversation){\n //this.emit('send', message, this.currentConversation);\n this.log(this.userProfile.nickname+\": \"+message);\n this.currentConversation.send(message);\n }\n else {\n this.log(\"No conversation specificed! Please specify a conversation before sending.\");\n }\n }", "title": "" }, { "docid": "5917630eb2e4288cfd37e56a9400398c", "score": "0.67653185", "text": "function send(message) {\n try {\n //attach the other peer username to our messages\n if (connectedUser) {\n message.name = connectedUser;\n }\n connect.current.send(JSON.stringify(message));\n } catch (err) {\n swal({\n title: \"Alert!\",\n text: err,\n type: \"error\",\n confirmButtonText: \"Retry\",\n }).then(() => {\n history.push(\"/CustCallIndex\");\n });\n }\n\n }", "title": "" }, { "docid": "692f08442a5f249834bc911e6132b03b", "score": "0.676109", "text": "function sendToClient(clientId, msg) {\n\n\t//just let the client got the message\n\tclients[clientId].message(msg);\n\n}", "title": "" }, { "docid": "0a880d7bbdbb4685acb8c36b2ba5665d", "score": "0.6754597", "text": "function send(){\n if (client) {\n client.send(channel, \"Triggering a push notification\");\n };\n}", "title": "" }, { "docid": "68838b623e7ed813c00d8a76b4eb9d22", "score": "0.67537856", "text": "function sendDummyMessage () {\n var string = process.argv[2]\n var params = {\n DelaySeconds: 10,\n MessageBody: string,\n QueueUrl: process.env.QUEUE_URL\n }\n\n sqs.sendMessage(params, function (err, data) {\n if (err) {\n console.log('Error', err)\n } else {\n console.log('> Message sent', data.MessageId)\n }\n })\n}", "title": "" }, { "docid": "d1a0ca74a8750def91d9b7f632550348", "score": "0.67527467", "text": "function sendMessage() {\n\tconst message = messageInputBox.value;\n\tdisplayMessage(message);\n\tdataChannel.send(message);\n\n\t// Clear the input box and re-focus it, so that we're\n\t// ready for the next message.\n\tmessageInputBox.value = \"\";\n\tmessageInputBox.focus();\n}", "title": "" } ]
33c10512802daed1fe05d6aae98f205b
MOVE OUT THE CAPTIONS //
[ { "docid": "6c5eb9a040b3e3fe2133a108aa4e98c4", "score": "0.0", "text": "function endMoveCaption(nextcaption,opt) {\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass(\"randomrotate\") && (opt.ie || opt.ie9)) nextcaption.removeClass(\"randomrotate\").addClass(\"sfb\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass(\"randomrotateout\") && (opt.ie || opt.ie9)) nextcaption.removeClass(\"randomrotateout\").addClass(\"stb\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar endspeed=nextcaption.data('endspeed');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (endspeed==undefined) endspeed=nextcaption.data('speed');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar xx=nextcaption.data('repx');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar yy=nextcaption.data('repy');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar oo=nextcaption.data('repo');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.css({'opacity':'inherit','filter':'inherit'});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('ltr') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('ltl') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('str') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('stl') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('ltt') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('ltb') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('stt') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('stb')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=nextcaption.position().left;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=nextcaption.position().top;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('ltr'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=opt.width+60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('ltl'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=0-nextcaption.width()-60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('ltt'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=0-nextcaption.height()-60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('ltb'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=opt.height+60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('str')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=xx+50;oo=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (nextcaption.hasClass('stl')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=xx-50;oo=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (nextcaption.hasClass('stt')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=yy-50;oo=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (nextcaption.hasClass('stb')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=yy+50;oo=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar easetype=nextcaption.data('endeasing');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (easetype==undefined) easetype=\"linear\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (easetype.indexOf(\"Bounce\")>=0 || easetype.indexOf(\"Elastic\")>=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t nextcaption.animate({'opacity':oo,'left':xx+'px','top':yy+\"px\"},{duration:nextcaption.data('endspeed'), easing:easetype,complete:function() { jQuery(this).css({visibility:'hidden'})}});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t nextcaption.transition({'opacity':oo,'left':xx+'px','top':yy+\"px\",duration:nextcaption.data('endspeed'), easing:easetype});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( nextcaption.hasClass(\"randomrotateout\")) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.transition({opacity:0, scale:Math.random()*2+0.3, 'left':Math.random()*opt.width+'px','top':Math.random()*opt.height+\"px\", rotate:Math.random()*40, duration: endspeed, easing:easetype, complete:function() { jQuery(this).css({visibility:'hidden'})}});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('fadeout')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.transition({'opacity':0,duration:200});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//nextcaption.animate({'opacity':0},{duration:200,complete:function() { jQuery(this).css({visibility:'hidden'})}});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('lfr') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('lfl') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('sfr') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('sfl') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('lft') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('lfb') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('sft') ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.hasClass('sfb')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('lfr'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=opt.width+60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('lfl'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txx=0-nextcaption.width()-60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('lft'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=0-nextcaption.height()-60;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (nextcaption.hasClass('lfb'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyy=opt.height+60;\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar easetype=nextcaption.data('endeasing');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (easetype==undefined) easetype=\"linear\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (easetype.indexOf(\"Bounce\")>=0 || easetype.indexOf(\"Elastic\")>=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.animate({'opacity':oo,'left':xx+'px','top':yy+\"px\"},{duration:nextcaption.data('endspeed'), easing:easetype, complete:function() { jQuery(this).css({visibility:'hidden'})}});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.transition({'opacity':oo,'left':xx+'px','top':yy+\"px\",duration:nextcaption.data('endspeed'), easing:easetype});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass('fade')) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//nextcaption.animate({'opacity':0},{duration:endspeed,complete:function() { jQuery(this).css({visibility:'hidden'})} });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.transition({'opacity':0,duration:endspeed });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextcaption.hasClass(\"randomrotate\")) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.transition({opacity:0, scale:Math.random()*2+0.3, 'left':Math.random()*opt.width+'px','top':Math.random()*opt.height+\"px\", rotate:Math.random()*40, duration: endspeed, easing:easetype });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) nextcaption.removeClass('noFilterClass');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t}", "title": "" } ]
[ { "docid": "e4be36fd907d33224e2c9381f2166a2a", "score": "0.5943378", "text": "function deSelectCapsules() {\n\t\t// Revert grind details to original styles\n\t\tgrind.style.pointerEvents = \"revert\";\n\t\tgrind.removeAttribute(\"tabindex\");\n\t\tgrind.style.color = \"revert\";\n\t\tmethod.textContent = \"as\";\n\t\t// Revert order summary text\n\t\tgrindText.forEach((span) => {\n\t\t\tspan.style.display = \"inline\";\n\t\t});\n\t\t// If a grind type has been selected open the grind details element\n\t\tgrinds.forEach((item) => {\n\t\t\tif (item.checked) {\n\t\t\t\tgrind.setAttribute(\"open\", \"\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "99ce58890036168e00634ebea3ec40ae", "score": "0.56999934", "text": "function onCapitalClick() {\n arySkipped.push($(this).off(\"click\")\n .hide(\"fast\")\n .removeClass(\"cur-cap\")\n .detach()\n .appendTo(\"#capitals\")\n .text());\n console.log(\"skipped: \" + arySkipped[arySkipped.length - 1]);\n $(\".capital\").not(\".cap-used\")\n .filter(\":first\")\n .addClass(\"cur-cap\")\n .show(\"fast\")\n .click(onCapitalClick);\n}", "title": "" }, { "docid": "1fee7d7be66ff4f659e1aad16d1e752d", "score": "0.5691121", "text": "exitAlphabetThrough(ctx) {\n\t}", "title": "" }, { "docid": "fc7e28a25bb67a02270af8a6c9fd521b", "score": "0.56055856", "text": "function fixCaption(cap){\n\t\"use strict\";\n\tcap = cap.replace(\"PW\", \"Polywog\"); \n\tif(cap.includes(\"jpg\")){\n\t\tcap = cap.replace(\".jpg\", \"\"); \n\t}\n\telse if (cap.includes(\"png\")){\n\t\tcap = cap.replace(\"png\", \"\"); \n\t}\n\treturn cap; \n}", "title": "" }, { "docid": "a8eca2e85c6dbff18281068ed6981f93", "score": "0.5483244", "text": "exitAlphabetAlso(ctx) {\n\t}", "title": "" }, { "docid": "591d2b94dd7a635fcf4e788bbfb69267", "score": "0.5463281", "text": "function questionsh1El() {\n startText.remove();\n selectQsandAs();\n}", "title": "" }, { "docid": "3f339ad9f2a4ade17b2d0c945132c63a", "score": "0.5451409", "text": "function continueSameLevel(callback){\n setStatusText(\"PRESS SPACE TO CAPTURE\", \"lightblue\");\n CURRENT_INPUT_NOTE = null;\n PREVIOUS_NOTE = null;\n updateTextGUI();\n waitingForSpace = true;\n}", "title": "" }, { "docid": "306957e8b3dfd2f626b549125a452656", "score": "0.5442553", "text": "exitScreenDescriptionUnderlineClause(ctx) {\n\t}", "title": "" }, { "docid": "8cc62f88b7963c9fb063ab2403ce0c32", "score": "0.5423958", "text": "function ltrCorrect(letterIndex, ltr) {\n dashes.splice(letterIndex, 1, ltr);\n $(\".hangman\").empty();\n\n for (o = 0; o < dashes.length; o++) {\n var m = dashes[o];\n $(\".hangman\").append(m);\n }\n\n checkWin();\n}", "title": "" }, { "docid": "1367077882fd8e547fff431b8912ea88", "score": "0.54140955", "text": "enterAlphabetThrough(ctx) {\n\t}", "title": "" }, { "docid": "dfb60d37a8d75d350c654546eaedf5a6", "score": "0.53822994", "text": "enterAlphabetAlso(ctx) {\n\t}", "title": "" }, { "docid": "7566c1a2ead8e0b9d9197a94542cf698", "score": "0.53456837", "text": "function swapCaption(cap) {\r\n let caption = document.getElementById('caption');\r\n let newCaption;\r\n newCaption = captionArray[cap];\r\n caption.innerHTML = newCaption;\r\n}", "title": "" }, { "docid": "35f11a6730944203c336e3b8c1649176", "score": "0.53455234", "text": "function hide_wordView(){\n this.hide_word = hangman.hide_word();\n for (i = 1 ; i <= hide_word.length; i++)\n if (hide_word.substring(i -1 , i) != '_'){\n\t\t $(\"#letter\" + i).empty(); \n $(\"#letter\" + i).append(hide_word.substring(i -1 , i)); \t \t\n } \n }", "title": "" }, { "docid": "4bbab7aab90d7e90f9e0fbc7f30c2e64", "score": "0.53246397", "text": "exitInspectReplacingPhrase(ctx) {\n\t}", "title": "" }, { "docid": "926bd66233dbbb262e23d823d41d40a6", "score": "0.53234", "text": "exitScreenDescriptionAutoClause(ctx) {\n\t}", "title": "" }, { "docid": "0adb5c8cae2e38453c44ea3ac997d2aa", "score": "0.5305201", "text": "function removeSynopsis() {\n document.getElementById(\"synopsis_text\").innerHTML = \"\";\n\n const otherCards = document.getElementsByClassName(\"card\");\n for (var i = 0; i < otherCards.length; i++) {\n otherCards[i].style.visibility = \"visible\";\n }\n document.getElementById(\"overlay\").style.display = \"none\";\n }", "title": "" }, { "docid": "824438b8306e4ff11cd009bbc9ddedc7", "score": "0.5289799", "text": "function setCaption(curCap) {\n if (index == 0) {\n console.log(\"GJ Caption\" + (curCap - 1));\n document.getElementById(\"caption\").innerHTML = gjrweCaptions[curCap - 1];\n } else if (index == 1) {\n console.log(\"BA Caption\" + (curCap - 1));\n document.getElementById(\"caption\").innerHTML = baCaptions[curCap - 1];\n }\n}", "title": "" }, { "docid": "34c3d0bdd8aba286d9a8243224f66161", "score": "0.5275161", "text": "handleInteraction(button) {\r\n button.disabled = true;\r\n\r\n console.log(this.activePhrase);\r\n // const splitActivePhrase = this.activePhrase.phrase.split('');\r\n // console.log(splitActivePhrase);\r\n\r\n\r\n if(this.activePhrase.phrase.includes(`${button.textContent}`)){\r\n button.classList += ' chosen';\r\n const phrase = new Phrase(this.activePhrase.phrase);\r\n phrase.showMatchedLetter(button.textContent);\r\n if(this.checkForWin()){\r\n this.gameOver(true);\r\n }\r\n \r\n }else{\r\n button.classList += ' wrong';\r\n this.removeLife();\r\n }\r\n\r\n\r\n /*FOR TO REMOVE SPACES*/ \r\n // for(let i = 0; i < splitActivePhrase.length; i++){\r\n // if(splitActivePhrase[i] == ' '){\r\n // splitActivePhrase.splice(i, 1);\r\n // }\r\n // }\r\n\r\n }", "title": "" }, { "docid": "b80b0d4c859b6435bf2a5f3502dcfb9a", "score": "0.52544075", "text": "function C101_KinbakuClub_Discipline_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\n\t// Jump to lunch on phase 3\n\t//if (TextPhase >= 4) SaveMenu(\"C102_KinbakuDiscipline\", \"Intro\");\n\n}", "title": "" }, { "docid": "e938fc88a0fab0e59292c8b6b42f52e4", "score": "0.5240064", "text": "function aboutRightPress() {\n try {\n switch (aboutHeader.toLowerCase()) {\n case 'general':\n changeAboutHeader('About Quizzes');\n changeAboutText(aboutQuizText);\n break;\n case 'about quizzes':\n changeAboutHeader('About Tests');\n changeAboutText(aboutTestText);\n break;\n case 'about tests':\n changeAboutHeader('About Progress Tracker');\n changeAboutText(aboutProgressTrackerText);\n break;\n case 'about progress tracker':\n changeAboutHeader('General');\n changeAboutText(aboutGeneralText);\n break;\n }\n } catch (e) { }\n }", "title": "" }, { "docid": "da5ac42fac94149a26d298b6350e76c5", "score": "0.52272516", "text": "function capitalizeWords() {\n\n}", "title": "" }, { "docid": "739069e2b1cff3babb457db7db56213b", "score": "0.5226362", "text": "function capWords(trackName)\r\n{\r\n // make text lower case\r\n trackName = trackName.toLowerCase();\r\n\r\n // split words into an array\r\n var words = trackName.split(' ');\r\n\r\n // create an array for the letters\r\n var chars = [];\r\n\r\n for (i = 0; i < words.length; i++)\r\n {\r\n // capitalize the first letter in every word\r\n chars.push(words[i].charAt(0).toUpperCase() + words[i].slice(1));\r\n }\r\n\r\n // put humpy back together and return him\r\n return chars.join(' ');\r\n}", "title": "" }, { "docid": "df6712498fb81f4f56c481d72f8d798b", "score": "0.52009845", "text": "function removeTheCaptions(actli,opt) {\r\n\r\n\r\n\t\t\t\t\t\tactli.find('.tp-caption').each(function(i) {\r\n\t\t\t\t\t\t\tvar nextcaption=jQuery(this); //actli.find('.tp-caption:eq('+i+')');\r\n\r\n\t\t\t\t\t\t\tif (nextcaption.find('iframe').length>0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// VIMEO VIDEO PAUSE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar ifr = nextcaption.find('iframe');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar id = ifr.attr('id');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar froogaloop = $f(id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfroogaloop.api(\"pause\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(nextcaption.data('timerplay'));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} catch(e) {}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//YOU TUBE PAUSE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar player=nextcaption.data('player');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.stopVideo();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(nextcaption.data('timerplay'));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} catch(e) {}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// IF HTML5 VIDEO IS EMBEDED\r\n\t\t\t\t\t\t\tif (nextcaption.find('video').length>0) {\r\n\t\t\t\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\t\t\t\tnextcaption.find('video').each(function(i) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar html5vid = jQuery(this).parent();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar videoID =html5vid.attr('id');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(html5vid.data('timerplay'));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvideojs(videoID).ready(function(){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar myPlayer = this;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmyPlayer.pause();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t\t}catch(e) {}\r\n\t\t\t\t\t\t\t\t\t\t} // END OF VIDEO JS FUNCTIONS\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tendMoveCaption(nextcaption,opt,0);\r\n\t\t\t\t\t\t\t\t} catch(e) {}\r\n\r\n\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}", "title": "" }, { "docid": "324ce95fceacb8388c2cffbc5d6624e6", "score": "0.5197823", "text": "function removeWords() { \n cancelAnimationFrame(wordAnimation);\n cancelAnimationFrame(word2Animation);\n cancelAnimationFrame(word3Animation);\n removeEventListener('keydown', keyPress);\n removeEventListener('keydown', keyPress2);\n removeEventListener('keydown', keyPress3);\n}", "title": "" }, { "docid": "ee94634783b018becbe33084f7963c35", "score": "0.51918286", "text": "function deactivateWord() {\n\t$('#caption li:nth-child('+ (wordCount + 1) +')').addClass('deactivated');\n}", "title": "" }, { "docid": "013ad8f0ad07c1d83616613b92484981", "score": "0.51789945", "text": "enterUnstringOrAllPhrase(ctx) {\n\t}", "title": "" }, { "docid": "69484bcc17b3a6c9ba19055d505ba830", "score": "0.51637006", "text": "function removeCensored() {\n logger.debug(\"removeCensored\");\n //Section A\n $(\"#preview-preview-A .secA-Q-allA .censored\").each(function (i) {\n $(this).text(\"*****\");\n });\n //Section B\n $(\"#preview-preview-B .secB-Q-allA .censored\").each(function (i) {\n $(this).text(\"*****\");\n });\n //Section C\n\n $(\"#preview-preview-C .secC-Q-allA .censored\").each(function (i) {\n $(this).text(\"*****\");\n });\n\n}", "title": "" }, { "docid": "354a7a932b497f4c3230d0a3ee5e518c", "score": "0.51605445", "text": "function grabUpper() {\n upperCasePreference = confirm(\"Do you want to include Uppercase letters? Choose Ok or Cancel\");\n}", "title": "" }, { "docid": "ca325a84154bc0cddb9f79cb99d9d218", "score": "0.5157684", "text": "exitScreenDescriptionControlClause(ctx) {\n\t}", "title": "" }, { "docid": "f41c76dfad8ef42a604c5c7773716a2a", "score": "0.51529914", "text": "function right() {\n //Add letter to correct letter area and replace underscores with letter\n for (var i = 0; i < wordSelected.length; i++) {\n //if the guessed letter matches a letter in the wordSelected...\n if (wordSelected[i] === guessedLetter) {\n //replace underscore with correct letter\n underscores[i] = guessedLetter;\n }\n }\n document.getElementById('currentWord').innerHTML = underscores.join(\" \");\n}", "title": "" }, { "docid": "b23b1bc7d749a29ad1507a699efbdffe", "score": "0.5142136", "text": "handleInteraction(e) {\n const keyboard = document.querySelectorAll(`.key`);\n const keyEvent = e.type === \"click\" ? e.target.textContent : e.key;\n const keyChosen = Array.from(keyboard).filter(\n (key) => key.textContent === keyEvent\n );\n keyChosen[0].disabled = true;\n if (!this.activePhrase.checkLetter(keyChosen[0].textContent)) {\n keyChosen[0].classList.add(\"wrong\");\n this.removeLife();\n } else {\n keyChosen[0].classList.add(\"chosen\");\n this.activePhrase.showMatchedLetter(keyChosen[0].textContent);\n \n if (this.checkForWin()) {\n this.gameOver();\n }\n }\n \n }", "title": "" }, { "docid": "d10d64b81b21fd334f7cd8581a7bf212", "score": "0.5139733", "text": "function removeCaseIntroStyle() {\n TweenMax.to($('g'), 0, { clearProps: \"all\" });\n TweenMax.to($('.cases'), 0, { clearProps: \"all\" });\n TweenMax.to($('.read-btn'), 0, { clearProps: \"all\" });\n TweenMax.to($('.letter-wrapper__blob'), 0, { clearProps: \"all\" });\n TweenMax.to($('.cases__menu'), 0, { clearProps: \"all\" });\n TweenMax.to($('.cases__client'), 0, { clearProps: \"all\" });\n TweenMax.to($('.big-btn'), 0, { clearProps: \"all\" });\n TweenMax.to($('.after-case'), 0, { clearProps: \"all\" });\n\n $('.cases').removeClass('slow-down');\n $('.cases .cases__wrapper__article__top-left').removeClass('slow-down');\n $('.cases .cases__wrapper__article__bottom-right').removeClass('slow-down');\n}", "title": "" }, { "docid": "2d41fe367ae5189cf0dcc53640648912", "score": "0.5131437", "text": "function confirmText (col2) {\n //joining the text into one string\n var one=join(youChose,\" \");\n //splitting the string into the explanations for each colour\n var expl=split(one,\"-\");\n //adding the \"congratulations\" and \"press mouse to restart\" to each explanation\n var yay=congrats+expl[col2]+press;\n //textFont(nice);\n textSize(30);\n //the text and the text placement and limiting rectangle\n text(yay,width/2,height/2,700,700);\n}", "title": "" }, { "docid": "30f26121f20bfb14c2538d935443be2c", "score": "0.5130641", "text": "function menuselection(interaction) {\r\n let menuoptiondata = menuoptions.find(v=>v.value.substr(0, 25) == interaction.values[0])\r\n interaction.reply({embeds: [new Discord.MessageEmbed()\r\n .setColor(es.color)\r\n .setAuthor(client.la[ls].cmds.info.botfaq.menuembed.title, client.user.displayAvatarURL(), \"https://discord.gg/sngXqWK2eP\")\r\n .setDescription(menuoptiondata.replymsg)], ephemeral: true});\r\n }", "title": "" }, { "docid": "dd1e28f4ea6f7d0f60d5bda8789c7494", "score": "0.51260686", "text": "function deplaceVignettes(){\n\t\t\t\tdocument.getElementById(\"vignettes\").style.top = \"250px\";\n\t\t\t}", "title": "" }, { "docid": "d403fead53640f43f26248e73b816831", "score": "0.51245505", "text": "resetToOriginal() {\n //reset hearts \n var heartsOl = document.querySelector(\"#scoreboard\").children[0] ; \n for (var i=heartsOl.children.length-1; i >= 0; i-=1) { // replace right heart first \n var heartsImg = heartsOl.children[i].children ;\n heartsImg[0].outerHTML = '<img src=\"images/liveHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\">' ;\n }\n // re-enable keys and remove wrong class attribute\n var qwertyEl = document.querySelector('#qwerty') ; \n for(var i=0; i<qwertyEl.children.length; i++) {\n var subEl = qwertyEl.children[i] ; \n for (var j=0 ; j < subEl.children.length ; j++ ) {\n subEl.children[j].disabled = false ; // this disables the display-keyboard button after keyborad input \n subEl.children[j].classList.remove('wrong') ;\n subEl.children[j].classList.remove('chosen') ;\n }\n } \n // remove phrase list items\n var phraseUl = document.querySelector(\"#phrase\").children[0];\n phraseUl.innerHTML = '' ;\n this.missed = 0 ; \n }", "title": "" }, { "docid": "a8f6f06a7d526ae2406f4be5b0399a54", "score": "0.5122709", "text": "function markButton(event){\n // Mark each clicked letter as chosen\n if(event.target.className.indexOf('keyrow') === -1 &&\n event.target.className.indexOf('section') === -1){\n event.target.classList.add('chosen');\n }\n\n // Handle interactions with the hidden phrase\n game.handleInteraction(event);\n}", "title": "" }, { "docid": "5d26b61d6168cba6e7878c34ea50cea1", "score": "0.5114891", "text": "function finalQuest(input) {\n let text = input.shift().split(' ');\n for ( let i = 0; i < input.length; i ++ ) {\n let commandArray = input[i].split(' ');\n let command = commandArray[0];\n let first = commandArray[1];\n let second = commandArray[2];\n switch ( command ) {\n case 'Delete':\n if ( text[Number(first)+1] !== undefined ) {\n text.splice((Number(first)+1),1);\n }\n break;\n case 'Swap':\n if ( text.indexOf(first !== -1 && text.indexOf(second) !== -1 ) ) {\n let indexOne = text.indexOf(first);\n let indexTwo = text.indexOf(second);\n text.splice(indexOne,1);\n text.splice(indexOne,0,second);\n text.splice(indexTwo,1);\n text.splice(indexTwo,0,first);\n }\n break;\n case 'Put':\n if ( text.indexOf(Number(second)-1) !== undefined && text[Number(second)-1] !== undefined ) {\n text.splice((Number(second)-1),0,first);\n }\n break;\n case 'Sort':\n text.sort((a,b) => b.localeCompare(a));\n break;\n case 'Replace':\n if ( text.indexOf(second) !== -1 ) {\n let index = text.indexOf(second);\n text.splice(index,1);\n text.splice(index,0,first);\n }\n break;\n }\n }\n console.log(text.join(' '));\n}", "title": "" }, { "docid": "408c363a087577c5dc96748db7af112c", "score": "0.5111226", "text": "handleInteraction(pressedLet){\n if (this.phrasesRandom) {\n if (this.phrasesRandom.checkLetter(pressedLet)) {\n [...phraseUl.querySelectorAll('li')].map(el => {\n if (el.innerText.toUpperCase() === pressedLet.toUpperCase()) {\n this.phrasesRandom.showMatchedLetter(el, pressedLet, key);\n this.checkForWin();\n }\n });\n } else {\n this.removeLife(pressedLet);\n }\n }\n }", "title": "" }, { "docid": "308d64d9c0b70de27a7d702a97a6a9c0", "score": "0.51084423", "text": "function removeTookEmotions() {\n\tif (emotionsMatched > 2){\n\t\tuiEmotions.hide();\n\t\tuiComplete.show();\n\t\tclearTimeout(scoreTimeout);\n\t}\t\n}", "title": "" }, { "docid": "f4765c713d6966612c3232cc0e1e8fd0", "score": "0.5103417", "text": "function moveTitle()\n\t{\n\t$(\"#instructions\").empty();\n\t$(\"#content\").css(\"margin-top\", \"75px\");\n\t}", "title": "" }, { "docid": "61d653a1a6694d05e60db470cfedc665", "score": "0.509682", "text": "function pressOther(e) {\n if (e.target.innerText.includes(\"AC\")) {\n clearAll();\n }\n if (e.target.innerText === \"+/-\") {\n posNeg();\n }\n if (e.target.innerText === \"%\") {\n percent();\n }\n if (e.target.innerText === \"/\") {\n divide();\n }\n if (e.target.innerText === \"*\") {\n multiply();\n }\n if (e.target.innerText === \"-\") {\n minus();\n }\n if (e.target.innerText === \"+\") {\n plus();\n }\n if (e.target.innerText === \"=\") {\n equals();\n }\n}", "title": "" }, { "docid": "12c684ce8ef45f32b6950c79f5eeffe0", "score": "0.5096009", "text": "stopMenu(menu, member, embed) {\n\t\tlet acties = \"acties\";\n\t\tif (member.actions === 1) acties = \"actie\";\n\t\tmenu.message.edit(embed()\n\t\t\t.setAuthor(member.user.username, member.user.displayAvatarURL())\n\t\t\t.setTitle(\"Manage\")\n\t\t\t.setDescription(`Gestopt, ${member.actions} ${acties} ondernomen.`)\n\t\t);\n\t}", "title": "" }, { "docid": "408482e5826a748a306d46d5d66c904a", "score": "0.50947404", "text": "function sentencetopiglatin(sentence){\n if (\"#name[0]\"=== a,e,i,o,u,y)\n {return(sentence + \"way\")}\n else { \n sentence.splice (1,sentence.length -1);\n $(\"sentence\").append(\"#name[0]\");\n \n }\n \n ;}", "title": "" }, { "docid": "b8a350ebb026e4b3db4893be510be881", "score": "0.50795007", "text": "function addMoveCaption(nextcaption,opt,params,frame,downscale) {\n\t\t\t\t\t\t\tvar tl = nextcaption.data('timeline');\n\n\t\t\t\t\t\t\tvar newtl = new TimelineLite();\n\n\t\t\t\t\t\t\tvar animobject = nextcaption;\n\n\t\t\t\t\t\t\tif (params.typ == \"chars\") animobject = nextcaption.data('mySplitText').chars;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif (params.typ == \"words\") animobject = nextcaption.data('mySplitText').words;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif (params.typ == \"lines\") animobject = nextcaption.data('mySplitText').lines;\n\t\t\t\t\t\t\tparams.animation.ease = params.ease;\n\n\t\t\t\t\t\t\tif (params.animation.rotationZ !=undefined) params.animation.rotation = params.animation.rotationZ;\n\t\t\t\t\t\t\tparams.animation.data = new Object();\n\t\t\t\t\t\t\tparams.animation.data.oldx = params.animation.x;\n\t\t\t\t\t\t\tparams.animation.data.oldy = params.animation.y;\n\n\t\t\t\t\t\t\tparams.animation.x = params.animation.x * downscale;\n\t\t\t\t\t\t\tparams.animation.y = params.animation.y * downscale;\n\n\n\t\t\t\t\t\t\ttl.add(newtl.staggerTo(animobject,params.speed,params.animation,params.elementdelay),params.start);\n\t\t\t\t\t\t\ttl.addLabel(frame,params.start);\n\n\t\t\t\t\t\t\tnextcaption.data('timeline',tl);\n\n\t\t\t\t}", "title": "" }, { "docid": "02bcbde95aa4c1b41b2821c6ffa858a2", "score": "0.50740165", "text": "exitScreenDescriptionToClause(ctx) {\n\t}", "title": "" }, { "docid": "2fa524c0f9a06dd9bd0b53591e07eae1", "score": "0.5066449", "text": "static OverlapCapsuleAll() {}", "title": "" }, { "docid": "ad4411618041c492f340e6f721e04ad7", "score": "0.5049871", "text": "function plain()\n{\n $('.help3').removeClass('hide');\n $('.help3').addClass('hidden');\n $('.nucleus').removeClass('marked');\n $('.omdoc-omtext').removeClass('markbackground');\n $('.omdoc-omgroup').removeClass('markborder');\n $('.help').removeClass('header');\n $('.help2').removeClass('link');\n $('.help2').removeClass('satellites');\n $('.help').addClass('hidden');\n $('.help2').addClass('hidden');\n $('.satellite').removeClass('marked2');\n $('.satellite').removeClass('marked');\n}", "title": "" }, { "docid": "5f9ef7a233e74146697710259bda3ee1", "score": "0.5039335", "text": "function letterClick() {\n $(this).hide(); \n var pressedLetter = this.innerHTML; // assings button pressed to var pressedLetter\n for (var i = 0; i < myWord.length; i++) { \n if (pressedLetter === myWord[i]) { \n blankSpaces[i] = pressedLetter; \n }\n }\n // Grab letters from the array writes it into the answer area\n $('.hiddenClass').text(blankSpaces.join(' ')); \n if (blankSpaces.indexOf('_ ') === -1) { \n $('#incorrectTryBox').text('You Win!'); // \n setTimeout(location.reload.bind(location), 6000); \n // after you win refreshes the page after 6 seconds to start over \n }\n if (!(myWord.indexOf(pressedLetter) > -1)) {\n lives -= 1;\n showHangedMan(lives); // everytime lives counts down goes through the switch/case\n $('#livesLeftNumber').text(lives);\n \n } \n if (lives < 1) {\n $('#incorrectTryBox').text('YOU LOSE!');\n $('.hiddenClass').text(myWord.join(' ')); // added in to show the word when you lose\n setTimeout(location.reload.bind(location), 6000); \n // after you lose refreshes the page after 5 seconds to start over\n }\n }", "title": "" }, { "docid": "9bfd35702d5ada9c9fff67855216988f", "score": "0.50291806", "text": "handleInteraction (e) {\n if (this.activePhrase.checkLetter(e.target.textContent)) {\n this.activePhrase.showMatchedLetter(e.target.textContent);\n $(e.target).addClass('chosen').attr('disabled', true);\n this.checkForWin();\n } else {\n $(e.target).addClass('wrong').attr('disabled', true);\n this.removeLife();\n } \n }", "title": "" }, { "docid": "7bcedd60e202ac61e65ec8558418204d", "score": "0.5028102", "text": "function pendragon_woman_unconvertAreas(opts){\n\n // Find all the spans on the page with \"area\" in their class name\n if (opts['context']) var aSpans = opts['context'].getElementsByTagName('span');\n else var aSpans = document.getElementsByTagName('span');\n\n // Add the necesary save key to the class name\n // Also close out any active edit boxes\n for (var i = 0; i < aSpans.length; i++){\n if (aSpans[i].className.match(/area/)){\n //if (aSpans[i].innerHTML.match(/textarea/)) aSpans[i].submit();\n if (aSpans[i].innerHTML == aisleten.characters.jeditablePlaceholder) aSpans[i].innerHTML = '';\n }\n }\n}", "title": "" }, { "docid": "83e0df17964681ca91234d5362b392b7", "score": "0.50254756", "text": "function letterSpaces(){\n for(let i = 0; i < pickedWord.length; i++){\n if(i === 0 || i === pickedWord.length -1){\n printMessage(`<li>${pickedWord[i]}</li>`, 'words');\n }\n else{\n printMessage(` <li> </li> `, 'words');\n }\n }\n}", "title": "" }, { "docid": "1e6f429a8c4b619b47e1b809b8e89cc0", "score": "0.50222284", "text": "function DialogRemove() {\n\tvar pos = 0;\n\tfor(var D = 0; D < CurrentCharacter.Dialog.length; D++)\n\t\tif ((CurrentCharacter.Dialog[D].Stage == CurrentCharacter.Stage) && (CurrentCharacter.Dialog[D].Option != null) && DialogPrerequisite(D)) {\n\t\t\tif ((MouseX >= 1025) && (MouseX <= 1975) && (MouseY >= 160 + pos * 105) && (MouseY <= 240 + pos * 105)) {\n\t\t\t\tCurrentCharacter.Dialog.splice(D, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpos++;\n\t\t}\n\n}", "title": "" }, { "docid": "d6e60435cc71c75b5b90afb22e87356c", "score": "0.5020426", "text": "function fillFinalWord() {\n var data = \"Parts of Speech\";\n setFinalWord(data.toUpperCase());\n }", "title": "" }, { "docid": "0ee962dbfd1e1fc5ae10347419ae01df", "score": "0.5018787", "text": "handleInteraction() { \n var qwertyEl = document.querySelector('#qwerty') ;\n qwertyEl.addEventListener('click', (e) => { \n if (e.target.className === \"key\") { // this is order not to count \"keyrow clicks\" \n e.target.disabled = true ; // directly disable the display-keyboard button\n if (!this.activePhrase.checkLetter(e.target.textContent)) { //}, e.target)) {\n e.target.classList.add('wrong') ;\n this.removeLife() ;\n e.preventDefault() ;\n e.stopImmediatePropagation() ;\n } else {\n e.target.classList.add('chosen') ;\n console.log(`here: letter is ${e.target.textContent}`)\n this.activePhrase.showMatchedLetter(e.target.textContent) ;\n if(this.checkForWin()) { \n this.gameOver() ; // display win screen\n e.preventDefault() ;\n e.stopImmediatePropagation() ;\n } ; \n }\n }\n }) \n }", "title": "" }, { "docid": "3e004711b4c1b7119d3b28d7a5400aa2", "score": "0.50184417", "text": "addPhraseToDisplay() {\r\n\t this.$phrase.empty(); //Empties previous phrase\r\n // LOOPING THROUGH EVERY CHARACTER IN PHRASE\r\n\t for ( let x = 0; x < this.phrase.length; x++ ) {\r\n let letter = this.phrase[ x ]; // Storing each character\r\n let $letter;\r\n if ( /\\w/.test( letter ) ) { // Testing if a letter\r\n $letter = $( `<li class=\"hide letter ${letter}\">${letter}</li>` ); // Creates <li> and hides letter\r\n } else if ( / /.test( letter ) ) { // Testing if a blank space\r\n $letter = $( `<li class=\"space\"> </li>` ); // Creates <li> for blank space\r\n } else {\r\n continue;\r\n }\r\n this.$phrase.append( $letter ); // Appends character to phrase object\r\n\t }\r\n }", "title": "" }, { "docid": "562fc9165f0bc517d80725ba9c3329e6", "score": "0.5017443", "text": "function capitalize() {\n return playerSelection[0].toUpperCase() + playerSelection.slice(1).toLowerCase();\n }", "title": "" }, { "docid": "7da4035f74122f1680ad05f145833cfd", "score": "0.5016387", "text": "function showNextCue() {\r\n\t\t$(\".associations__previous\").html(\"...\");\t\t\r\n\t\t\r\n\t\tif (CUES.length > 0) {\r\n\t\t\tvar cueEntry = CUES.shift();\r\n\t\t\tcue = cueEntry[0];\r\n\t\t\tcueCat = cueEntry[1];\r\n\t\t\ttrialNb++;\r\n\t\t\tassoIndex = 1;\r\n\t\t\t$(\"#associations__cue\").html(capitalizeFirst(cue));\t\t\r\n\t\t\tRtStart = new Date().getTime(); //reset RT\r\n\t\t} else {\r\n\t\t\tWriteAssociationData();\r\n\t\t\tshowIATInstructions();\r\n\t\t}\t\t\r\n\t}", "title": "" }, { "docid": "61ec4db9bd090e7e0e8608bf2ef2246d", "score": "0.50134134", "text": "enterScreenDescriptionEraseClause(ctx) {\n\t}", "title": "" }, { "docid": "89557959bd6db319bbd88212533eaff2", "score": "0.49999988", "text": "exitScreenDescriptionEraseClause(ctx) {\n\t}", "title": "" }, { "docid": "19b34db0a5f2de616929275c94a31ff1", "score": "0.49977672", "text": "function reset() {\n guessesLeft = 10;\n guesses = [];\n wrongGuesses = [];\n wordOptions = [\"michelangelo\", \"monet\", \"clyfford still\", \"picasso\"];\n displayedWord = \"\";\n displayedWord = wordOptions[Math.floor(Math.random() * wordOptions.length)];\n\n //this function makes the artist name into dashes\n for (var i = 0; i < displayedWord.length; i++) {\n if (displayedWord[i] == \" \") {\n guesses[i] = \" \";\n } else {\n guesses[i] = \"-\";\n }\n }\n }", "title": "" }, { "docid": "a34d0d2ea81d3d204ad03591aa91f091", "score": "0.49966356", "text": "function restoredFocus()\n{\n\t//CSpeak.CommandEchoGo_text(window.arguments[0].captionSpeak);\n}", "title": "" }, { "docid": "60cecb7cf33d22e67801689f3b62cbea", "score": "0.49920183", "text": "function poemInteract() {\n let children = selectAll('span', paragraph);\n if (substringIndex === 0) {\n substringIndex = substringInOut[0];\n }\n // if the current substring reaches it's last character\n if (substringIndex === substringInOut[1]) {\n if (playlistIndex < substringPlaylist.length - 1) {\n // increment the index value for the ins & outs array\n playlistIndex++;\n for (let i = 0; i < children.length; i++) {\n // color wipe the current substring\n children[i].style('color: rgba(0, 0, 0, 0)');\n }\n // move to next substring in array of substrings\n substringInOut = substringPlaylist[playlistIndex];\n console.log('playlist index: ', playlistIndex);\n console.log('substring in & out:', substringInOut);\n // reset substringIndex to the first index of the next substring\n substringIndex = substringInOut[0];\n } else {\n\n // when you reach the end of the ins and outs array, reset\n // playlistIndex = 0;\n // substringInOut = substringPlaylist[playlistIndex];\n\n\n // if(frameCount % 2 == 0 && alphaValue < 1){\n // alphaValue += 0.01;\n\n // console.log(\"alphaValue\", alphaValue);\n // }\n\n // for (let i = 0; i < children.length; i++) {\n // // color wipe the entire poem\n // children[i].style('color: rgba(0, 0, 0, ' + alphaValue + ')');\n // }\n\n reveal = true;\n }\n }\n //\n if (substringIndex >= substringInOut[0] && substringIndex < substringInOut[1]) {\n // print('here');\n children[substringIndex].style('color: black');\n }\n\n if (autoPlay == true) {\n if (frameCount % 4 == 0) { // to slow down the auto play, increase the modulus\n // print(frameCount, \"MOVE\");\n substringIndex++;\n }\n }\n\n if (reveal == true) {\n if (frameCount % 8 == 0) { // to slow down the reveal, increase the modulus\n if (alphaValue < 1) {\n alphaValue += 0.01;\n if (alphaValue >= 0.5) {\n print(\"alphaValue passed 0.5\");\n footer.html(poemNext);\n }\n } else {\n /*\n //use below to reset the reveal animation\n // reveal = false;\n // alphaValue = 0;\n\n // use below to reset the entire interaction (inverted for some reason)\n playlistIndex = 0;\n substringIndex = 0;\n */\n }\n // print(\"alphaValue\", alphaValue);\n }\n // fade-in the entire poem by incrementing the alphaValue\n for (let i = 0; i < children.length; i++) {\n children[i].style('color: rgba(0, 0, 0, ' + alphaValue + ')');\n }\n }\n}", "title": "" }, { "docid": "2c52039062c7a1104195202e6415cfc7", "score": "0.49875945", "text": "addPhraseToDisplay(){\r\n for(let letter of this.phrase){\r\n if(letter!==' '){\r\n $(`#phrase`).children().first().append(`<li class=\"hide letter ${letter}\">${letter}</li>`)\r\n }else{\r\n $(`#phrase`).children().first().append(\"<li class='space'> </li>\")\r\n }\r\n }\r\n \r\n\r\n \r\n }", "title": "" }, { "docid": "6310f4b1009754c57167fa3e1641a5dd", "score": "0.49874705", "text": "exitAlphabetLiterals(ctx) {\n\t}", "title": "" }, { "docid": "b0033f04f9ed4a8df45609f9eea1f693", "score": "0.498306", "text": "tidyUp() {\n $(\".cesium-credit-textContainer\")[0].remove();\n }", "title": "" }, { "docid": "4eea7e0a127a461eb7ec6b9bf965a6ef", "score": "0.49825984", "text": "function endKeys(e){\r\n \r\n \r\n\r\n if (e.detail == 1) {\r\n $(\"#helper\").hide()\r\n handleInput(\"remove\",\"endKeys\")\r\n \r\n newTurn()\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "ee9a37a16683439fb56545ce344eec9e", "score": "0.49820897", "text": "function sparetedAndCapitals(hacker1){\n return hacker1.split(\"\").join(' ');\n}", "title": "" }, { "docid": "5083cb4e5e982d73569ec944215296bc", "score": "0.498203", "text": "exitAlphabetClause(ctx) {\n\t}", "title": "" }, { "docid": "1b20c453bee451ccd6a4d1b23fac5132", "score": "0.49794638", "text": "enterUnstringIntoPhrase(ctx) {\n\t}", "title": "" }, { "docid": "6e717db03c4e387f2716383310eac2ae", "score": "0.49785286", "text": "exitSpecialNamesParagraph(ctx) {\n\t}", "title": "" }, { "docid": "cca9c152267e3a86117d98631f8ff289", "score": "0.49738073", "text": "exitScreenDescriptionFullClause(ctx) {\n\t}", "title": "" }, { "docid": "5fb04b3eaaec865a6217006f28fd3d3a", "score": "0.4973271", "text": "function revealLetters(word, letter) {\n // var elem = document.getElementById('blanks');\n // elem.innerHTML = \"\";\n $(\"#blanks\").text(\"\");\n revealed.push(letter);\n // Play Ding\n ding_audio.play();\n\n for (var i = 0; i < word.length; i++) {\n if (revealed.includes(word[i]) && word[i] !== \" \") {\n // elem.innerHTML += word[i];\n $(\"#blanks\").append(word[i]);\n word[i] === letter ? num_blanks-- : '';\n } else if (word[i] === \" \") {\n console.log(\"test\");\n // elem.innerHTML += \"\\xa0\";\n $(\"#blanks\").append(\"\\xa0\");\n\n } else {\n // elem.innerHTML += \"__\";\n $(\"#blanks\").append(\"__\");\n\n }\n\n // !(i === word.length - 1) ? elem.innerHTML += '\\xa0': ''\n !(i === word.length - 1) ? $(\"#blanks\").append(\"\\xa0\"): ''\n\n }\n\n}", "title": "" }, { "docid": "fd678e16b79e262f1038cad167213c2e", "score": "0.49692604", "text": "function cleanup_slidedown () {\n $('#return a, #hd, #bd').click(function() {\n $('.documentation a.toggle-about-box').trigger(\"click\"); \n return false;\n });\n}", "title": "" }, { "docid": "b141ba6222b7b68cf3c7ec141d521ea7", "score": "0.49677122", "text": "function switchAscii() {\n $(\"#profile-pic\").removeClass(\"show\");\n $(\"#profile-pic\").addClass(\"hide\");\n $(\"#profile-ascii\").removeClass(\"hide\");\n $(\"#profile-ascii\").addClass(\"show\");\n }", "title": "" }, { "docid": "43bc1da29a990870eee3c79d1695bf83", "score": "0.49619803", "text": "clearParsedCaptions() {}", "title": "" }, { "docid": "b9c38c443131c42ede5cdd5600d79ef5", "score": "0.4959333", "text": "function grabAlphabet() {\n lowerCasePreference = confirm(\"Do you want to include lowercase letters? Choose Ok or Cancel\");\n}", "title": "" }, { "docid": "a8cc4b144501e854684498b711282fba", "score": "0.4957387", "text": "function uppercase() {\n\tkey = window.event.keyCode;\n\tif ((key > 0x60) && (key < 0x7B))\n\twindow.event.keyCode = key-0x20;\n}", "title": "" }, { "docid": "4a8025ebf49b9ff6b1fee6980cda70d8", "score": "0.4957363", "text": "exitAlphabetName(ctx) {\n\t}", "title": "" }, { "docid": "cd312a35e1a9c019aa2800d30c76644b", "score": "0.49549618", "text": "function letterCaseToggle(){\r\n if(magicTxt.value != magicTxt.value.toUpperCase()){\r\n magicTxt.value = magicTxt.value.toUpperCase();\r\n magicTxt.focus();\r\n }else{\r\n magicTxt.value = magicTxt.value.toLowerCase();\r\n magicTxt.focus();\r\n }\r\n}", "title": "" }, { "docid": "7b29a0b27b50785b57164f2bf08626a7", "score": "0.49534324", "text": "function initPlayerWord(){\n for(var i =0; i < currentWord.length; i++){\n answerArray[i] = \"_\";\n }\n space = answerArray.join(\" \");\n document.getElementById(\"answer\").innerHTML = space;\n}", "title": "" }, { "docid": "1cc1d9df216261dd82524b2316a8c98d", "score": "0.4952806", "text": "function reactivateSword() {\r\n firstBlock = true;\r\n }", "title": "" }, { "docid": "03aa3fe8e16dc0cb657c188edacce740", "score": "0.4952337", "text": "exitInspectReplacingCharacters(ctx) {\n\t}", "title": "" }, { "docid": "f667a202bcf0148900d2df5351fc8ce7", "score": "0.49510387", "text": "function Action()\r\n{\r\n\t// Open, Loot, Hail, Search, Survey, Scan, Greet, ShowAppreciation, Scold, Flirt, Question, Affirmation, Denial, Cheer(+other emotes), quip, challenge, Answer, Banter, Non-sequitur, wait, harvest\r\n}", "title": "" }, { "docid": "2f4faebaaeb08b2d4dcfb33026f3ad3c", "score": "0.49494746", "text": "handleInteraction(pressedKey)\n {\n pressedKey.disabled = true;\n const phraseClass = new Phrase(this.activePhrase);\n const letterCheck = phraseClass.checkLetter(pressedKey);\n if(letterCheck === false) //if lettercheck is false, letter is not in phrase\n {\n pressedKey.className = \"wrong\";\n this.removeLife();\n }\n else //otherwise it is true and letter is in phrase\n {\n pressedKey.className = \"chosen\";\n phraseClass.showMatchedLetter(pressedKey);\n this.checkForWin();\n }\n\n }", "title": "" }, { "docid": "5def53ee14fef84456435f7dd5786f6c", "score": "0.4949428", "text": "function standardNameEntry(playerName) {\r\n\r\n playerName = playerName.toLowerCase();\r\n let nameArray = playerName.split(\" \");\r\n let capPlayerName = [];\r\n let capitalNamesArray = [];\r\n\r\n for (let i = 0; i < nameArray.length; i++) {\r\n let capitalizedLetter = nameArray[i].charAt(0).toUpperCase();\r\n let restOfName = nameArray[i].slice(1);\r\n let capitalizedName = capitalizedLetter + restOfName;\r\n\r\n capitalNamesArray.push(capitalizedName);\r\n //nameArray[] = nameArray[i].charAt(0).toUpperCase() + nameArray[i].slice(1); //(does all the 'lets' in the ForLoop) ask mike about which loops to remove if used\r\n }\r\n capPlayerName = capitalNamesArray.join(\" \");\r\n return capPlayerName;\r\n}", "title": "" }, { "docid": "b95222638ab66b5aecb9751bbdda5748", "score": "0.49434957", "text": "function defineText() {\n\tvar text = \"\";\n\tfor(var letter in selectedWord)\n\t{\n\t\tif (selectedWord[letter] != ' ')\n\t\t\ttext += '_';\n\t\telse\n\t\t\ttext += ' ';\n\t}\n\tdocument.getElementById('selectedWord').innerText = text;\n\tdocument.getElementById('selectedWord').style.display = 'block';\n\t\n}", "title": "" }, { "docid": "a1ce8969052dcc797a6e478f1c3cddb9", "score": "0.4939961", "text": "addPhraseToDisplay() {\n for (let letter of this.phrase) {\n let insertStr = ``;\n if (/\\w/.test(letter)) {\n insertStr += `<li class=\"hide letter ${letter}\">${letter}</li>`;\n } else {\n insertStr += `<li class=\"space\"> </li>`;\n }\n document.querySelector('#phrase ul').innerHTML += insertStr;\n }\n }", "title": "" }, { "docid": "fb5a843601df8be32eae42f30830008e", "score": "0.49390492", "text": "captureTo(chars) {\n let {i: start} = this;\n const {chunk: chunk} = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n const isNLLike = c === NL_LIKE;\n const final = isNLLike ? NL : c;\n if (final === EOC || chars.includes(final)) {\n this.text += chunk.slice(start, this.prevI);\n return final;\n }\n if (isNLLike) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n }\n }\n }", "title": "" }, { "docid": "ad2bcf587d9cf9184e33865e6c1c2c90", "score": "0.49378476", "text": "handleInteraction(button) {\n button.classList.remove('key');\n let noLetterMatchCount = 0;\n for (let i = 0; i < this.activePhrase.phrase.length; i++) {\n if (button.textContent === this.activePhrase.phrase[i]) {\n this.activePhrase.showMatchedLetter(button.textContent);\n this.checkForWin();\n button.className = 'chosen';\n if (this.checkForWin() === true) {\n this.gameOver(true);\n }\n } else if (button.textContent !== this.activePhrase.phrase[i]) {\n noLetterMatchCount += 1;\n }\n if (noLetterMatchCount === this.activePhrase.phrase.length) {\n button.className = 'wrong';\n game.removeLife();\n }\n }\n }", "title": "" }, { "docid": "a503aeed1edfbb9a5e6749248715a07e", "score": "0.49354964", "text": "function deletion(event) {\n if (event.keyCode === 8) {\n place.innerHTML = place.innerHTML.substr(0, place.innerHTML.length - 1);\n }\n if (place.innerHTML[0]) {\n place.className =\"bound content\";\n } else {\n place.className =\"bound\";\n }\n}", "title": "" }, { "docid": "19d2f92728c18bbec5785284f45dcb68", "score": "0.49312565", "text": "handleInteractions(key) {\n\n // varible holding the buttons of the keyboard.\n const buttons = document.getElementById('qwerty').getElementsByTagName('button');\n\n // Search though the list of buttons and disable the one\n // matching the key 'clicked' or 'pressed'\n var i = 0;\n while (i < buttons.length) {\n if (buttons[i].textContent === key) {\n buttons[i].disabled = true;\n break;\n }\n i += 1;\n }\n\n // if key 'clicked' or 'pressed' is in the phrase\n // change its color to blue and show it on the display\n // and check to see if the game is won.\n if (this.activePhrase.checkLetter(key)) {\n buttons[i].className = 'chosen';\n this.activePhrase.showMatchedLetter(key);\n if (this.checkForWin()) {\n this.gameOver(true);\n }\n\n // else change its color\n // to orange and remove \"liveHeart\"\n } else {\n buttons[i].className = 'wrong';\n this.removeLife();\n }\n }", "title": "" }, { "docid": "4e4b307e72058de33b0be8cb429d4dd8", "score": "0.49283567", "text": "function iCap(headline) {\n var firstLetter = headline.slice(0,1).toUpperCase();\n headline = firstLetter + headline.slice(1);\n return headline;\n}", "title": "" }, { "docid": "9444954d2f141c79a00eeabedeadffe0", "score": "0.4925493", "text": "closeCap () {\n\t\tthis.Body.removeChild(this._elements._cap);\n\n\t\tthis._active = true;\n\t\tthis._elements._cap = undefined;\n\t}", "title": "" }, { "docid": "5d8b4424cd71c9690a095def408edb83", "score": "0.49254647", "text": "function removeSectionTitle(e) {\n if (e.target.parentElement.classList.contains(\"remove-cross\")) {\n e.target.parentElement.parentElement.remove();\n countClicksTitle = 0;\n }\n\n e.preventDefault(); //removeChord\n }", "title": "" }, { "docid": "f782a88b8d1f2eb94ed0cd94702fa81f", "score": "0.4923593", "text": "exitScreenDescriptionFromClause(ctx) {\n\t}", "title": "" }, { "docid": "3f1ea9f7b4811d637d4c9e479212c200", "score": "0.49211004", "text": "enterInspectReplacingPhrase(ctx) {\n\t}", "title": "" }, { "docid": "eedc49ffb29f54f5a5a2d2f7a5f4e669", "score": "0.49200922", "text": "function toggle_words(index) {\n\tvar element = document.getElementById('main_container').children[index];\n\tif (element.getAttribute(\"class\") == \"plain\"){\n\t\tjargonize(index, element);\n\t} else {\n\t\tdejargonize(index, element);\n\t}\n}", "title": "" }, { "docid": "fb19a38f3058ded761ce745786bd0982", "score": "0.4917091", "text": "function keyPress2(e) {\n var key = e.key;\n var currentLetter = newWord2.word.charAt(newWord2.letterIndex);\n if (key === currentLetter) {\n newWord2.letterIndex++;\n } \n if (newWord2.letterIndex === newWord2.word.length) {\n checkScore(newWord2.word.length);\n wordRight++;\n newWord2.explode();\n checkLevel();\n word2Initialize();\n wordReset();\n }\n}", "title": "" }, { "docid": "84731d9dce64e7d923609b7242841d0e", "score": "0.491148", "text": "function removeblank() {\n $(\".post-photo .actions.raw, .post-photoset .actions.raw\").each(function() {\n if (!$(this).siblings(\".caption\").length && !$(this).siblings(\".tags\").is(\":visible\")) {\n $(this).css(\"margin-top\", \"-16px\").children(\"hr\").css(\"visibility\", \"hidden\");\n }\n $(this).removeClass(\"raw\");\n });\n }", "title": "" }, { "docid": "2c3a8becf762de0c7c45b55fb6354d7b", "score": "0.4910692", "text": "resetGame() {\n $(\".key\").removeClass('wrong chosen').off();\n $('img[src=\"images/lostHeart.png\"]').attr(\"src\", \"images/liveHeart.png\").attr(\"alt\", \"Heart Icon\");\n $('.key').click(function (e) {\n const letter = $(this).text();\n game.handleInteraction(letter);\n });\n this.activePhrase.removePhrase();\n this.missed = 0;\n $('.pyro').hide();\n\n }", "title": "" } ]
e19e2f273865daca336086f1df3de284
Subcommand 0x03: Set input report mode
[ { "docid": "6b01ebaf28569963f375a5792ae058d3", "score": "0.6721675", "text": "function setInputReportMode(hid, manageHandler, mode) {\n const outputReportID = 0x01;\n const subcommand = mode === 'standard-full-mode'\n ? [0x03, 0x30]\n : [0x03, 0x3f];\n hid.write([outputReportID, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ...subcommand]);\n return new Promise((resolve) => {\n const handler = (packet) => {\n const { inputReportID, subcommandID } = packet;\n if (inputReportID._raw[0] === 0x21 && subcommandID._raw[0] === 0x03) {\n manageHandler('remove', handler);\n resolve();\n }\n };\n manageHandler('add', handler);\n });\n}", "title": "" } ]
[ { "docid": "c3cf85fe08e91557edc864751fa0e833", "score": "0.49952546", "text": "addInput(command) {\n const { loop, delay } = this.conf;\n\n if (loop) {\n const num = isNumber(loop) ? isNumber(loop) : -1;\n command.addInput(this.getPath()).inputOption('-stream_loop', `${num}`);\n } else {\n command.addInput(this.getPath());\n }\n if (delay) command.inputOption('-itsoffset', delay);\n }", "title": "" }, { "docid": "1ca6abed04e0f944caf8d51712943af3", "score": "0.49439716", "text": "function enterAudioMode() {\n initEditMode();\n }", "title": "" }, { "docid": "bd171756e8c6baf59ba2edf447f8a89c", "score": "0.4887301", "text": "function inputTest() {\r\n\r\n\tswitch (testMode) {\r\n\t\tcase tmEnemyImageSwitching:\r\n\t\t\tinputTestImageSwitching();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandSpawnTest:\r\n\t\t\tinputTestCommandSpawn();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandMove:\r\n\t\t\tinputTestCommandMove();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCreation:\r\n\t\t\tinputTestShotCreation();\r\n\t\t\tbreak;\r\n\t\tcase tmPlayerControl:\r\n\t\t\tinputTestPlayerControl();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCollision:\r\n\t\t\tinputTestShotCollision();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsolePrint(\"Error with test mode.\", \"exit\");\r\n\t}\r\n}", "title": "" }, { "docid": "f65557368ace3257b780d22d780c10d2", "score": "0.4800076", "text": "changeStartMode() {\n this.actions.modeChange('text');\n }", "title": "" }, { "docid": "921cabc3f40c606206df4c6bbc00abe2", "score": "0.4794953", "text": "addInputOptions() {\n const { conf, command } = this;\n const customOpts = conf.getVal('inputOptions');\n customOpts && command.inputOptions(customOpts);\n }", "title": "" }, { "docid": "7515cd92b56a3be03668c3a6233b829e", "score": "0.4758524", "text": "function io_set(packet) {\n\tlog.module('Setting IO status');\n\n\tpacket.unshift(0x0C);\n\tbus.data.send({\n\t\tsrc : 'DIA',\n\t\tmsg : packet,\n\t});\n}", "title": "" }, { "docid": "4ee6f4ede42cc2bc1c3c8150f8972ebe", "score": "0.4756804", "text": "function mode_output(input=null){\n this.classname = \"mode_output\";\n}", "title": "" }, { "docid": "d90c1835b96c30e4d01524b35e33b475", "score": "0.4660373", "text": "function manualMode() {\n if(inAuto) return;\n Output = manTemp * ( WindowSize / 100 );\n}", "title": "" }, { "docid": "9bef0681639e6df014510f5ca33796ae", "score": "0.4648967", "text": "setMode(mode) {\n if (-1 === this.constructor.MODES.indexOf(mode)) {\n throw new Error('Invalid mode: ' + mode);\n }\n\n this.send('M' + mode);\n }", "title": "" }, { "docid": "37f70de6280a7ab817a7c0281bbdbdb8", "score": "0.46441194", "text": "io_set(packet) {\n\t\t// log.module('Setting IO status');\n\n\t\t// Add 'set IO status' command to beginning of array\n\t\tpacket.unshift(0x0C);\n\n\t\t// Set IO status\n\t\tbus.data.send({\n\t\t\tsrc : 'DIA',\n\t\t\tmsg : packet,\n\t\t});\n\t}", "title": "" }, { "docid": "b250cef6a122c40a8da6765457f56f5e", "score": "0.46166953", "text": "function init()\n{\n sendCommand(128, modes[1]);\n}", "title": "" }, { "docid": "095de25bbca430e25beebbe84ec32ea2", "score": "0.4593511", "text": "function EnableEnhancedMonitoringCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "3fdf6ffa2c0572ccfc029ff13b9e905f", "score": "0.45893574", "text": "function setInputMethod(method) {\n this._inputMethod = method;\n}", "title": "" }, { "docid": "cb5565bd06a05afbcbfa5f5980276c78", "score": "0.4575255", "text": "function mode_input(input=null){\n this.classname = \"mode_input\";\n}", "title": "" }, { "docid": "0d0e6dabefe4415921e836355904ee12", "score": "0.4563495", "text": "function switchMode() {\n\tif (data.markov) {\n\t\tdata.markov = false;\n\t} else {\t\t\n\t\tdata.markov = true;\n\t}\n\t$('.aRule').each(function( index ){\n\t\tif ( data.markov ) {\n\t\t\t$(this).children('input').css('visibility', 'visible');\t\t\t\n\t\t} else {\n\t\t\t$(this).children('input').css('visibility', 'hidden');\n\t\t}\n\t});\n\tconsole.log(\"modeSwitched\");\n\t$('#theRun').html('');\t\n}", "title": "" }, { "docid": "0b928f84219fdca040734eaaab04fb73", "score": "0.45470145", "text": "function read() {\n console.log('');\n stdout.write(' \\033[33mEnter your choice: \\33[39m');\n\n stdin.resume();\n stdin.setEncoding(\"utf8\")\n\n stdin.on(\"data\", option);\n }", "title": "" }, { "docid": "b00951b11b303df8395cbbe997de13bc", "score": "0.45089865", "text": "function do_auto_display_cmd(mode) {\n var umode = mode.toUpperCase();\n if (umode === \"OFF\") {\n Auto_display = false;\n } else if (umode === \"ON\") {\n Auto_display = true;\n }\n exports.WriteResponse('+OK');\n}", "title": "" }, { "docid": "3c78a35eb5ef7bb2ae8f977706bbd9a1", "score": "0.4505347", "text": "function setOutput(name, value) {\r\n command_1.issueCommand('set-output', { name }, value);\r\n}", "title": "" }, { "docid": "258f61c11c5b9d68886e6bfe7a5f6606", "score": "0.44738796", "text": "static set keyboardControl(value) {}", "title": "" }, { "docid": "d9527d6d5f9118577f3a6370d664265d", "score": "0.4468772", "text": "function inputing () {\n term(\"\\n>> \");\n term.inputField(\n function (error, input) {\n if (error) {\n inputing();\n }\n let prms = input.trim().split(\" \");\n prms.splice(0, 1);\n let result = commands.execute(input[0], prms);\n if (result !== true) {\n line(result);\n }\n inputing();\n }\n );\n }", "title": "" }, { "docid": "ce00153850a24e6f32b0194e9964bb51", "score": "0.4468396", "text": "function enableInputHandler(){\n\t\tenableInput(this);\n\t\tmodalASIKeyPressHandler();\n\t}", "title": "" }, { "docid": "e02ab53ea464877baae40c669a2f2538", "score": "0.44650424", "text": "function CGActionSetCubeReportLabel() {\n this.base = CGAction;\n this.base(2);\n this.AvailableProcessClass = CGProcessCleanDirty;\n this.RefreshProcessClass = CGProcessRefreshDOM;\n}", "title": "" }, { "docid": "64bafdac5ddaf2ec3e3616cc33fe9061", "score": "0.44563055", "text": "setReadout(key, value) {\n if (!this.readouts.hasOwnProperty(key)) {\n this.readouts[key] = new Report();\n }\n\n this.readouts[key].mode = this.ReadoutModes.TEXT;\n this.readouts[key].value = value;\n }", "title": "" }, { "docid": "4af19d53327f6577d610bcd25493d9c8", "score": "0.4446304", "text": "function audio_control(command) {\n\tconst cmd = 0x36;\n\n\tconst msgs = {\n\t\toff : [ cmd, 0xAF ],\n\n\t\tdsp : {\n\t\t\tfunction_0 : [ cmd, 0x30 ],\n\t\t\tfunction_1 : [ cmd, 0xE1 ],\n\t\t},\n\n\t\tsource : {\n\t\t\tcd : [ cmd, 0xA0 ],\n\t\t\ttunertape : [ cmd, 0xA1 ],\n\t\t},\n\n\t};\n\n\n\tlet msg;\n\n\tswitch (command) {\n\t\tcase 'cd changer' :\n\t\tcase 'cd' :\n\t\tcase 'cd-changer' :\n\t\tcase 'cdc' : {\n\t\t\tcommand = 'source cd changer';\n\t\t\tmsg = msgs.source.cd;\n\n\t\t\tupdate.status('rad.source_name', 'cd', false);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'dsp-0' : {\n\t\t\tcommand = 'DSP function 0';\n\t\t\tmsg = msgs.dsp.function_0;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'dsp-1' : {\n\t\t\tcommand = 'DSP function 1';\n\t\t\tmsg = msgs.dsp.function_1;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 1 :\n\t\tcase true :\n\t\tcase 'tape' :\n\t\tcase 'tuner' :\n\t\tcase 'tuner/tape' :\n\t\tcase 'tunertape' :\n\t\tcase 'power on' :\n\t\tcase 'power' :\n\t\tcase 'power-on' :\n\t\tcase 'poweron' :\n\t\tcase 'on' : {\n\t\t\tcommand = 'source tuner/tape';\n\t\t\tmsg = msgs.source.tunertape;\n\n\t\t\tupdate.status('rad.source_name', 'tuner/tape', false);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 0 :\n\t\tcase false :\n\t\tcase 'off' :\n\t\tcase 'power off' :\n\t\tcase 'power-off' :\n\t\tcase 'poweroff' :\n\t\tdefault : {\n\t\t\tcommand = 'power off';\n\t\t\tmsg = msgs.off;\n\n\t\t\tupdate.status('rad.source_name', 'off', false);\n\t\t}\n\t}\n\n\tlog.module('Sending audio control: ' + command);\n\n\tbus.data.send({\n\t\tsrc : module_name,\n\t\tdst : 'LOC',\n\t\tmsg,\n\t});\n}", "title": "" }, { "docid": "4d0d779140f3af5e222cbdc7903a8cf6", "score": "0.44369754", "text": "function onInput(chv) {\n if (typeof chv === \"string\") {\n page.alert(chv);\n } else if (chv) {\n page.setSaved(false);\n if (tree.autoUpdate && nd.getRequiresUpdate(k)) {\n tree.updateAndShow(\"tree\");\n tree.adjust();\n } else {\n rs.selectChild(\"inh\").hide(); // this field is no longer inherited, if it was before\n rs.selectChild(\"reinh\").show(); \n draw.refresh();\n var dwc = rs.downChain(); // @todo should apply this to the proto chain too\n dwc.forEach(function (cm) {\n cm.selectChild(\"inh\").hide();\n cm.selectChild(\"ovr\").show();\n });\n var upc = rs.upChain();\n upc.forEach(function (cm) {\n cm.updateValue({});\n });\n //nd.showOverrides(k);\n\n }\n }\n }", "title": "" }, { "docid": "3202a1ba09b1f79a71017b3f088e03de", "score": "0.44326165", "text": "function ShowManualCfg()\r\n{\r\n if (LSt > 1) // login level 1 allows operation of controls.\r\n {\r\n Preamble(\"Manual Configuration\");\r\n hd(\"Use great caution\");\r\n fs(\"hid.spi\");\r\n fitx(\"Command\", \"cmd\", \"\", 20);\r\n fex(\"Send\");\r\n }\r\n else\r\n {\r\n ShowLogin(\"hid.spi\");\r\n }\r\n}", "title": "" }, { "docid": "bf6b247568726c30457a4c92618c7896", "score": "0.44192377", "text": "function enhance(buff) {\n if (!Object.values(exports.Buffs).includes(buff)) {\n return false;\n }\n\n return kolmafia_1.cliExecute(\"terminal enhance \" + buff.name);\n}", "title": "" }, { "docid": "470e5a82f3ad5312bfd5ef78694e85ad", "score": "0.4407384", "text": "function exeCommand(command, input) {\n // console.log(command)\n switch(command) {\n case \"concert-this\":\n searchArtist(input);\n break;\n case \"spotify-this-song\":\n searchSong(input);\n break;\n case \"movie-this\":\n searchMovie(input);\n break;\n case \"do-what-it-says\":\n searchTxtFile();\n break;\n default:\n console.log(\"Unidentified Command.\");\n }\n}", "title": "" }, { "docid": "d75eac3bc81544f329e28cf1cc380882", "score": "0.44032282", "text": "function change_mode(mode)\r\n\t{\r\n\t\tplay_mode = mode ;\r\n\t}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "7b6f7b3fc05b9e25c79bf817c534da6d", "score": "0.4395764", "text": "function setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}", "title": "" }, { "docid": "0695566118ce1ba5831f6dea4e3419b9", "score": "0.43936363", "text": "setOnInput(oninput) {\n\t\tthis.oninput = oninput;\n\t}", "title": "" }, { "docid": "f991ee1ec81fa2bda77388ea205d799c", "score": "0.4388338", "text": "function fireReport(msg) {\n console.log(msg);\n testCtrl.keyDown(68);\n testCtrl.keyUp(68);\n}", "title": "" }, { "docid": "03978c9d323a0e743935c5552d689378", "score": "0.43881574", "text": "initInput() {\n }", "title": "" }, { "docid": "95d8a8ea66f54659ff975470cf4844e9", "score": "0.4381075", "text": "function toggleCmdMode() {\n cmdMode = !cmdMode;\n \n var textColor = $('#inputBox').css('color');\n var bgColor = $('#inputBox').css('background-color');\n // Switch colors.\n $('#inputBox').css('color', bgColor);\n $('#inputBox').css('background-color', textColor);\n \n var placeholder = $('#inputBox').prop('placeholder');\n \n $('#inputBox').prop('placeholder', \n (placeholder == inputBoxPlaceholder ? cmdModePlaceholder : inputBoxPlaceholder));\n}", "title": "" }, { "docid": "c51692363ddf246cac306e087c029e0c", "score": "0.4378423", "text": "function src() {\n inputType = \"Source\";\n}", "title": "" }, { "docid": "15cd0fb2a958afde9ef3fdfe50bec479", "score": "0.4375069", "text": "function sc_currentInputPort() {\n return SC_DEFAULT_IN;\n}", "title": "" }, { "docid": "15cd0fb2a958afde9ef3fdfe50bec479", "score": "0.4375069", "text": "function sc_currentInputPort() {\n return SC_DEFAULT_IN;\n}", "title": "" }, { "docid": "3826a6de4e68c99571d8dbde1e9992e4", "score": "0.43721858", "text": "function showInputMNG() {\n\ttype = \"0\";\n\tvar cbxText = (gUserInfo.lang == 'EN')? CONST_INTERNAL_TRANS_SAVE_SAMPLE_STATUS_EN : CONST_INTERNAL_TRANS_SAVE_SAMPLE_STATUS_VN;\n\tvar cbxValue = CONST_INTERNAL_TRANS_SAVE_SAMPLE_STATUS_KEY;\n\taddEventListenerToCombobox(handleInputMNG, handleInputMNGClose);\n\tshowDialogList(CONST_STR.get('TRANS_PERIODIC_MGN_PAYEE_SELCT'), cbxText, cbxValue, false);\n}", "title": "" }, { "docid": "214c9214210e0d4b22a83dcf36a82dc1", "score": "0.436465", "text": "function MOL_InputChange(el_input){\n //console.log( \"===== MOL_InputChange ========= \");\n mod_MSI_dict.otherlang = el_input.value;\n el_MOL_btn_save.disabled = false\n\n }", "title": "" }, { "docid": "bdbed56e4357722bd40b3e48e71d658e", "score": "0.43633866", "text": "function setOutport(value) {\n outport = value;\n var floppy_write = ((value >> 3) & 1) === 1;\n var floppy_stepper = ((value >> 0) & 7);\n floppy[0].select(floppy0Selected(), floppy_write, floppy_stepper);\n floppy[1].select(floppy1Selected(), floppy_write, floppy_stepper);\n }", "title": "" }, { "docid": "275c5fb5c70d777a878f1bf7ac9a5ce1", "score": "0.4361895", "text": "function resetInput(cm, typing) {\n if (cm.display.contextMenuPending) return;\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "title": "" }, { "docid": "275c5fb5c70d777a878f1bf7ac9a5ce1", "score": "0.4361895", "text": "function resetInput(cm, typing) {\n if (cm.display.contextMenuPending) return;\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "title": "" }, { "docid": "c9a4b67c496f7f3c71d8d6280ddeda22", "score": "0.43542597", "text": "static set enableOutput(bool) {\n Writer.outputEnabled = bool;\n }", "title": "" }, { "docid": "da72762f17f7023a6399ec95599843fb", "score": "0.4325327", "text": "set inputEnabled ( bool ) {\r\n button.inputEnabled = bool;\r\n text.inputEnabled = bool;\r\n texture.inputEnabled = bool;\r\n }", "title": "" }, { "docid": "06f3a13cca6ec4d90b7dae97326ee32d", "score": "0.43235978", "text": "function cmd_write_hook(a, v)\n\t{\n\t\tcmd_buffer[a] = v;\n\t\t\n\t\t// Perform operations if flag at cmd[0] is set\n\t\tif (a == 0 && v & 0x01)\n\t\t\tperform_operations();\n\t}", "title": "" }, { "docid": "b14ea51a9829ff0e5ffde0359f9ec660", "score": "0.43190077", "text": "set Off(value) {}", "title": "" }, { "docid": "7cc23ee29032e69d4faa12c867748d9b", "score": "0.43072498", "text": "function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent && (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1e3);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "title": "" }, { "docid": "c57ac710843a4a43c165c55cabd51d24", "score": "0.4300613", "text": "function processInputType(){\n\n comp.config.inputType = comp.config.answerType;\n\n\n /**\n * @abbr: sw\n * @desc: switch statement\n * @param: conf.answerType\n * @parm: 'text','email','date'\n **/\n switch (comp.config.answerType) {\n case 'text':\n case 'email':\n case 'checkbox':\n case 'SingleLineLimited':\n templateType='text';\n\n break;\n case 'number':\n templateType='text';\n\n break;\n case 'wholeNumber':\n templateType='text';\n comp.config.inputType = 'number';\n comp.config.wholeNumber = true;\n delete comp.config.decimal;\n break;\n default:\n templateType = comp.config.answerType;\n }\n }", "title": "" }, { "docid": "bd53a5f5bb84e30af1166afcea323162", "score": "0.42935902", "text": "setViewMode(event) { }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.42935765", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" } ]
3e708322529be4c317c56dd8f7e40464
========== All Request List End Here======== /========== Detail Start Here========
[ { "docid": "e9f34af2534d68f3453d565d4857a346", "score": "0.0", "text": "viewDetail(request_id) {\n console.log(\"id--\", request_id);\n this.service.getRequestDetail(request_id).subscribe(res => {\n if (res['status'] == 1) {\n this.view_obj = res['data'][0];\n console.log(\"api data\", this.view_obj);\n localStorage.setItem('userViewData', JSON.stringify(this.view_obj));\n this.router.navigate(['/request-scheduler/details', request_id]);\n }\n else {\n this.resp_msg = res;\n this.toastr.error(this.resp_msg.message, '', { timeOut: 2000, positionClass: 'toast-top-center' });\n }\n });\n }", "title": "" } ]
[ { "docid": "124f67107e4a0997106a663b87e5d1ff", "score": "0.6405833", "text": "function RequestList(query){\n console.info(query)\n return $http({\n url: baseUrlRe + '/listpro',\n headers:{Authorization: $cookies.get('token'), user: storage.get('username')},\n method: 'GET',\n params: query\n })\n }", "title": "" }, { "docid": "4f6b6587669312e437f322d17399da8c", "score": "0.6267495", "text": "list(request,response,next) {\n return arguments;\n }", "title": "" }, { "docid": "394fd8b787458cbb972485eb8f246dbd", "score": "0.61459863", "text": "function reqViews(){\n\tfetch(\"http://localhost:8084/Proto/AllRQ\").then(function(response) {\n\t\treturn response.json();\n\t}).then(function(data) {\n\t\tif (data.session === null) {\n\t\t\twindow.location = \"http://localhost:8084/Proto/ManagerHome\";\n\t\t} else {\n\t\t\tconsole.log(data);\n\t\t for (let i = 0 ; i < data.length; i ++) {\n\t\t\tvar table = document.getElementById(\"rqManTable\");\n\t\t\tlet row = table.insertRow(0);\n\t\t\tlet requestId = row.insertCell(0);\n\t\t\tlet employeeId = row.insertCell(1);\n\t\t\tlet man = row.insertCell(2);\n\t\t\tlet type = row.insertCell(3);\n\t\t\tlet stat = row.insertCell(4);\n\t\t\tlet info = row.insertCell(5);\n\t\t\n\t\n\t\t\trequestId.setAttribute('scope', 'row');\n\t\t\trequestId.innerHTML = data[i].requestId;\n\t\t\t\n\t\t\temployeeId.setAttribute('scope', 'row');\n\t\t\temployeeId.innerHTML = data[i].employeeId;\n\t\t\t\n\t\t\tman.setAttribute('scope', 'row');\n\t\t\tman.innerHTML = data[i].managedBy;\n\n\t\t\ttype.setAttribute('scope', 'row');\n\t\t\ttype.innerHTML = data[i].rqType;\n\t\t\t\n\t\t\tstat.setAttribute('scope', 'row');\n\t\t\tstat.innerHTML = data[i].status;\n\n\t\t\tinfo.setAttribute('scope', 'row');\n\t\t\tinfo.innerHTML = data[i].info;\n\n\t\t\tconsole.log(data[i].employeeId);\n\t\t}\n\t}\n\t});\n }", "title": "" }, { "docid": "ba505ecab6b4b768762753d3ae4e1b1d", "score": "0.6145886", "text": "list (cb) {\n const reqData =\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <request xmlns:nameserverprofile=\"http://www.eurodns.com/nameserverprofile\">\n <nameserverprofile:list/>\n </request>`\n\n this.request(reqData, (err, res) => {\n cb(err ? err : null, res)\n })\n }", "title": "" }, { "docid": "2454a77ff253e183bef563bbc6f523ca", "score": "0.6084442", "text": "function getRequests(){\r\n\r\n\t// on load, load all requests (it's shown first)\r\n\t$.get(window.location.href.split(\"#\")[0].split(\"?\")[0] + \"/getRequests\", function(data){\r\n\t\t$(\"#request_table table tr:not(.info)\").remove();\r\n\t\trequests = JSON.parse(data);\r\n\t\tfor(let i = 0; i < requests.length; i++){\r\n\r\n\t\t\t// auxiliary data\r\n\t\t\tlet images = \"\";\r\n\t\t\tlet message = \"\";\r\n\r\n\t\t\t// color-coded request status\r\n\t\t\tswitch(requests[i][CLIENT.STATUS].toString()){\r\n\t\t\t\tcase '0':\r\n\t\t\t\t\tmessage = STATUS_MSG.PRE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '1':\r\n\t\t\t\t\tmessage = STATUS_MSG.APPROVED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '2':\r\n\t\t\t\t\tmessage = STATUS_MSG.CANCELED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// if there are images, add a button to view them\r\n\t\t\tif( Array.isArray(requests[i][CLIENT.IMAGES]) ){\r\n\t\t\t\timages += \"<input class='btn btn-default btn_responsive' type='button' value='הצג תמונות'>\";\r\n\t\t\t}\r\n \r\n\t\t\t$(\"#request_table table\").append(\"<tr><td><input type=\\\"checkbox\\\"></td>\");\r\n\t\t\t$(\"#request_table tr:last\").append(\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.FNAME] + \" \" + requests[i][CLIENT.LNAME] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.CITY] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.ADDRESS] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.EMAIL] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.PHONE_NUM] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.JOB_TYPE] + \"</td>\" +\r\n\t\t\t\t\"<td>\" + requests[i][CLIENT.DESCRIPTION] + \"</td>\" +\r\n\t\t\t\t\"<td class='text-center'>\" + images + \"</td>\" +\r\n\t\t\t\t\"<td><select class='form-control'>\"+\r\n\t\t\t\t\"<option value='\" + STATUS_MSG.PRE + \"'>\" + STATUS_MSG.PRE + \"</option>\" + \r\n\t\t\t\t\"<option value='\" + STATUS_MSG.APPROVED + \"'>\" + STATUS_MSG.APPROVED + \"</option>\" +\r\n\t\t\t\t\"<option value='\" + STATUS_MSG.CANCELED + \"'>\" + STATUS_MSG.CANCELED + \"</option>\" +\r\n\t\t\t\t\"</select></td>\" +\r\n\t\t\t\t\"<td class='text-center'>\" + requests[i][CLIENT.REQUEST_DATE] + \"</td>\" +\r\n\t\t\t\t\"<input type='hidden' value='\" + requests[i][CLIENT.CID] + \"'>\"\r\n\t\t\t);\r\n\r\n\t\t\t// set the option from the database into the select element and update it (trigger change)\r\n\t\t\t$(\"#request_table table tr:last select\").prop(\"value\", message).change();\r\n\t\t\t$(\"#request_table table\").append(\"</tr>\");\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "275ff46f7b7f058c302def9f0898f5f7", "score": "0.6051004", "text": "function optionsRequestDataProcessing(){\n\n if($scope[list.name] && $scope[list.name].length > 0) {\n $scope[list.name].forEach(function(item, item_idx) {\n var itm = $scope[list.name][item_idx];\n\n if(item.summary_fields && item.summary_fields.source_workflow_job &&\n item.summary_fields.source_workflow_job.id){\n item.workflow_result_link = `/#/workflows/${item.summary_fields.source_workflow_job.id}`;\n }\n\n // Set the item type label\n if (list.fields.type && $scope.options &&\n $scope.options.hasOwnProperty('type')) {\n $scope.options.type.choices.forEach(function(choice) {\n if (choice[0] === item.type) {\n itm.type_label = choice[1];\n }\n });\n }\n buildTooltips(itm);\n });\n }\n }", "title": "" }, { "docid": "b9249be28e2e917c4f5fb30c78bedb25", "score": "0.6050213", "text": "function getRequests(req){\n output = []\n for (let i in req.body.developers){\n output.push(req.body.developers[i])\n }\n return output\n}", "title": "" }, { "docid": "ff143593e85d50952088e1643b46e1f9", "score": "0.5969576", "text": "function loadRequests(){\n ajaxFunctions.ajaxRequest('GET', appUrl + \"/api/my_requests\" , function(response){\n var data = JSON.parse(response);\n for (var i=0; i<data.length; ++i) {\n $(\"#myRequestsList\").append('<li class=\"list-group-item\">' + data[i].title + '<span class=\"btn glyphicon glyphicon-remove\"></span></li>');\n }\n });\n \n ajaxFunctions.ajaxRequest('GET', appUrl + \"/api/requests_to_me\" , function(response){\n var data = JSON.parse(response);\n for (var i=0; i<data.length; ++i) {\n $(\"#requestToMeList\").append('<li class=\"list-group-item\">' + data[i].title + ' <span class=\"btn glyphicon glyphicon-ok\"></span><span class=\"btn glyphicon glyphicon-remove\"></span></li>');\n }\n });\n}", "title": "" }, { "docid": "4dc0ee3034568a52036c56fbfc6887b7", "score": "0.59394777", "text": "function viewallrequests(){\n\t\t\t$.ajax({\n\t\t\turl:'viewallrequests',\n\t\t\ttype:'POST',\n\t\t\tsuccess:function(data){\t\t\t\n\t\t\t\t$('#pending-apps').html(data);\t\t\n\t\t\t}\n\t\t\t});\n\t}", "title": "" }, { "docid": "9e4ae7692f28642e44cc1470b924b084", "score": "0.59343296", "text": "function printRequest(){\n\tvar storedRequest = JSON.parse(localStorage.getItem(\"Request\"));\n\tvar insertRequest;\n\tvar requestContainer = document.getElementById(\"insertRequestContainer\");\n\twhile (requestContainer.hasChildNodes()){\n\t\trequestContainer.removeChild(requestContainer.lastChild);\n\t}\n\n\tfor(var index in storedRequest){\n\t\tvar upperCase = index[0].toUpperCase() + index.slice(1);\n\t\tinsertRequest = document.createElement(\"LI\");\n\t\tinsertRequest.innerHTML = upperCase + \": \" + storedRequest[index];\n\t\tinsertRequest.setAttribute(\"class\",\"recentRequest\");\n\t\trequestContainer.appendChild(insertRequest);\n\t}\n}", "title": "" }, { "docid": "265ec8d784a87ee6ebb9370fa1e5c3f5", "score": "0.59249747", "text": "async function getRequestList(fetchProfile) {\n\n const webIdDoc = await fetchDocument(fetchProfile);\n const profile = webIdDoc.getSubject(fetchProfile);\n\n /* 1. Check if a Document tracking our notes already exists. */\n const publicTypeIndexRef = profile.getRef(solid.publicTypeIndex);\n const publicTypeIndex = await fetchDocument(publicTypeIndexRef); \n const requestListEntryList = publicTypeIndex.findSubjects(solid.forClass, \"http://schema.org/AskAction\");//schema.TextDigitalDocument\n\n if (requestListEntryList.length > 0) {\n for (let i=0;i<requestListEntryList.length;i++){\n const requestListRef = requestListEntryList[i].getRef(solid.instance);\n if (requestListRef){\n if (requestListRef.toString()===fetchProfile.slice(0, fetchProfile.length-15)+'public/request.ttl'){\n return await fetchDocument(requestListRef);\n }\n }\n }\n }/* 2. If it doesn't exist, create it. */\n return initialiseRequestList(profile, publicTypeIndex).then(()=> {\n alert(\"New file 'public/request.ttl'is created!\")\n });\n}", "title": "" }, { "docid": "791db804b81681c69215cbbbedd906ae", "score": "0.5890913", "text": "function interview_list(request, response, next) {\n console.log('List of interviews');\n}", "title": "" }, { "docid": "159c24024a7993565ab1f99d8b197e13", "score": "0.5864696", "text": "viewAll(request, reply) {\n let id = request.params.id\n\n this.ToDoList.findByIdWithToDos(id)\n .then((response) => this.replyOnResponse(response, reply))\n .catch((err) => reply(this.Boom.wrap(err)))\n }", "title": "" }, { "docid": "bdecbeb6080ca4c324086b48cd2f879d", "score": "0.58590394", "text": "function makeRequest() {\n let url = BASE_URL + \"/v2/list?page=\" + pageNumber + \"&limit=12\";\n fetch(url)\n .then(checkStatus)\n .then(resp => resp.json())\n .then(processData)\n .catch(handleError);\n }", "title": "" }, { "docid": "233cd3685a53f2d42eda1efced3048eb", "score": "0.5858063", "text": "list(request, reply) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let res = {\n statusCode: 1,\n data: {\n page: '1',\n limit: '2',\n count: 2,\n rows: [\n {\n Id: 2,\n Name: 'string',\n ProcessStep: 2,\n Location: 'string',\n Description: 'string',\n CreatedAt: '2018-02-28T02:15:42.934Z',\n manulife_lead: {\n Name: 'string',\n ProcessStep: 3,\n StatusProcessStep: 2,\n Phone: '01693248887'\n }\n },\n {\n Id: 1,\n Name: 'string',\n ProcessStep: 0,\n Location: 'string',\n Description: 'lorem note',\n CreatedAt: '2018-02-28T02:15:42.934Z',\n manulife_lead: {\n Name: 'string',\n ProcessStep: 3,\n StatusProcessStep: 2,\n Phone: '01693248887'\n }\n }\n ]\n },\n msgCode: 'success',\n msg: 'success'\n };\n reply(res);\n }\n catch (ex) {\n }\n });\n }", "title": "" }, { "docid": "2d3ffcde1811558d9a122486b2fab8fb", "score": "0.5858017", "text": "list(){return this._followRelService(\"list\",\"List\")}", "title": "" }, { "docid": "6a99b274abd22bbbbffe955a09358ca1", "score": "0.5852113", "text": "list(request, response) {\n const title = 'List';\n return response.render(`${this.viewsDirectory}/list`, {title, parentPageTitle: this.parentPageTitle});\n }", "title": "" }, { "docid": "78fdc95a21d0c7f9cbfdef1a70a8c87e", "score": "0.58408284", "text": "function createRequestList() {\n // Start process\n getListOfRequets();\n\n // fetches for only book trades which are in pair\n function getListOfRequets() {\n fetch('/api/trades/').then( response => response.json()).then(json => {\n return JSON.parse(JSON.stringify(json)).filter(request => !request.traded);\n }).then(requests => {\n GetBookPair(requests);\n }).catch( e => {console.log(e.message)});\n }\n\n // fetches each book in a pair & combine into an array.\n // Then combine all into an array\n function GetBookPair(requests) {\n let arr = [];\n let bookPairsArr = requests.map(request => {\n return [getBook(request['book1']), getBook(request['book2'])];\n });\n buildHtml(bookPairsArr);\n }\n\n // fetches a single book\n function getBook(url) {\n return fetch(url).then((book) => book.json()).then(json => {\n return JSON.parse(JSON.stringify(json));\n }).catch(e => {\n console.log(e.message);\n });\n }\n\n // build the boom pair container & add to body\n function buildHtml(bookPairsArr) {\n let body = document.querySelector('.body');\n let reqListContainer = document.createElement('div');\n let h3 = document.createElement('h3');\n\n reqListContainer.id = 'all-requests';\n h3.textContent = 'List of Book Requests';\n reqListContainer.appendChild(h3);\n\n bookPairsArr.forEach(bookPair => {\n let container = document.createElement('div');\n container.appendChild(bookContainer(bookPair[0], 'bookRight'));\n container.appendChild(bookContainer(bookPair[1], 'bookLeft'));\n container.className = 'container';\n spinners[1].style.display = 'none';\n reqListContainer.appendChild(container);\n });\n\n body.appendChild(reqListContainer);\n }\n\n // build container for a single book\n function bookContainer(book, className) {\n let div = document.createElement('div');\n let pHeading = document.createElement('p');\n let p = document.createElement('p');\n let p1 = document.createElement('p');\n book.then(book => {\n pHeading.textContent = 'Name: ' + book['title'];\n p.textContent = 'Description: ' + book['description'];\n p1.textContent = 'Owner: ' + book['user'];\n }, e => {console.log});\n\n div.className = className;\n\n div.appendChild(pHeading);\n div.appendChild(p);\n div.appendChild(p1);\n\n return div;\n }\n\n }", "title": "" }, { "docid": "560d5ce6354140ee8962a2641ec40b26", "score": "0.58372915", "text": "function listRequests(value) {\n var sheet = getSpareSheet(\"Spare Request Sheet\");\n\n var allStatus = sheet.getRange(2,6,sheet.getLastRow()).getValues();\n var rowNums = [];\n \n var openSpareRequests = [];\n var requestIndex = [];\n \n for (var i=0; i<allStatus.length; i++) {\n if (allStatus[i] != \"Filled!\") {\n rowNums.push(i+2);\n }\n }\n \n if (rowNums.length == 0) {\n openSpareRequests.push(\"No open requests found.\\n\");\n } else {\n for (i=0; i<rowNums.length-1; i++) {\n openSpareRequests.push(\"*Request ID:* \"+sheet.getRange('C'+rowNums[i]).getValue()+\" \"+\n \"*Player:* \"+sheet.getRange('A'+rowNums[i]).getValue()+\" \"+\n \"*League:* \"+sheet.getRange('B'+rowNums[i]).getValue()+\" \" +\n \"*Date:* \"+sheet.getRange('D'+rowNums[i]).getValue().toDateString()+\" \"+\n \"*Draw Time:* \"+sheet.getRange('E'+rowNums[i]).getValue().toLocaleTimeString('en-US'));\n requestIndex.push(sheet.getRange('C'+rowNums[i]).getValue());\n }\n }\n \n if (value == \"id\"){\n return requestIndex;\n }\n \n if (value == \"list\"){\n return openSpareRequests;\n }\n \n if (value == \"all\"){\n return [openSpareRequests,requestIndex];\n }\n}", "title": "" }, { "docid": "fbb8ab530fb707bb176ce2f74ee61bbb", "score": "0.5835679", "text": "function printRequestOnLoad(){\n\tvar storedRequest = JSON.parse(localStorage.getItem(\"Request\"));\n\tvar insertRequest;\n\tvar requestContainer = document.getElementById(\"insertRequestContainer\");\n\tfor(var index in storedRequest){\n\t\tvar upperCase = index[0].toUpperCase() + index.slice(1);\n\t\tinsertRequest = document.createElement(\"LI\");\n\t\tinsertRequest.innerHTML = upperCase + \": \" + storedRequest[index];\n\t\tinsertRequest.setAttribute(\"class\",\"recentRequest\");\n\t\trequestContainer.appendChild(insertRequest);\n\t}\n}", "title": "" }, { "docid": "e36264fcce58dacae078b9cb475c62d7", "score": "0.58314186", "text": "function getRequests() {\n return webApiService.makeRetryRequest(1, function () {\n return appointmentsDataService.getRequests(vm.selectedPageSize, vm.selectedPage, vm.query, vm.date, vm.time, vm.selectedStatus != null ? vm.selectedStatus.StatusId : null);\n })\n .then(function (data) {\n vm.selectedPage = data.CurrentPage;\n vm.totalPages = data.TotalPages;\n\n vm.pages = paginationHelper.getPages(vm.selectedPage, vm.totalPages);\n\n vm.requests = data.ResultList;\n })\n .catch(function (reason) {\n common.showErrorMessage(reason, Messages.error.requests);\n $(\"html, body\").animate({ scrollTop: 700 }, 2000);\n });\n }", "title": "" }, { "docid": "96b041911e874123f03af01ba6fbe08e", "score": "0.5825947", "text": "function apiRequestList(listid,listname) {\n\t\tvar restRequest = gapi.client.request({'path': '/tasks/v1/lists/'+listid+'/tasks'});\n\t\trestRequest.execute(function(resp,flag) {\n\t\t\tfor(x in resp.items) resp.items[x]['listname']=listname;\n\t\t\t//update local storage array\n\t\t\tconsole.log(resp.items)\n\t\t\t//push in all our tasks\n\t\t\tfor(x in resp.items) tasks.push(resp.items[x]);\n\t\t\t//update local storage\n\t\t\tlocalStorage.setObj('tasks',tasks)\n\t\t\tupdateDOM();\n\t\t});\n}", "title": "" }, { "docid": "72da21d4dd1f911cb80ff63165395bee", "score": "0.5809934", "text": "function GetRequestDetails(result_totalRequest, result_RequestDetails, totalReqApprovalTypeId, index, result_UIAccToReq) {\n\n var mappedRequestDetails = [];\n\n var mappedIndex = 0;\n for (var j = 0; j < result_RequestDetails.length; j++) {\n if (totalReqApprovalTypeId == result_RequestDetails[j].ApprovalTypeId) {\n var requestDetail = {};\n var timeoffReqId = result_RequestDetails[j].TimeOffRequestID;\n var totalReqApprovalTypeId = result_RequestDetails[j].ApprovalTypeId;\n\n var HourMinutes = [];\n var thishour = result_RequestDetails[j].minutes;\n if (thishour != null) {\n HourMinutes = GetHoursMinutes(thishour)\n\n requestDetail.Hours = HourMinutes[0] + \":\" + HourMinutes[1];\n }\n else {\n requestDetail.Hours = \"\";\n }\n\n\n requestDetail.TimeOffRequestID = timeoffReqId;\n requestDetail.Name = result_RequestDetails[j].Name;\n requestDetail.ApprovalTypeId = result_RequestDetails[j].ApprovalTypeId;\n requestDetail.ApprovalType = result_RequestDetails[j].ApprovalType;\n requestDetail.StartTime = result_RequestDetails[j].StartTime;\n requestDetail.EndTime = result_RequestDetails[j].EndTime;\n requestDetail.FromDate = result_RequestDetails[j].FromDate;\n requestDetail.ToDate = result_RequestDetails[j].ToDate;\n requestDetail.isFromOutstation = result_RequestDetails[j].isFromOutstation;\n requestDetail.EarlyleaveId = OutstationId;\n requestDetail.OutstationlabelOn = LableOutstationOn;\n requestDetail.ShiftChangeType = result_RequestDetails[j].ShiftChangeType == \"1\" ? \"Temporary\" : \"Parmenant\";\n requestDetail.NewShift = result_RequestDetails[j].NewShift == null ? \"N/A\" : result_RequestDetails[j].NewShift;\n if (result_RequestDetails[j].IsFullDay == true) {\n requestDetail.IsFullDay = \"Full Day\";\n requestDetail.HalfDayType = \"N/A\";\n }\n else {\n requestDetail.IsFullDay = \"Half Day\";\n\n if (result_RequestDetails[j].HalfDayType == 1) {\n requestDetail.HalfDayType = \"First Half\";\n }\n else {\n requestDetail.HalfDayType = \"Second Half\";\n }\n\n }\n requestDetail.ODDate = result_RequestDetails[j].ODDate;\n requestDetail.CompOffDate = result_RequestDetails[j].CompOffDate;\n requestDetail.WorkDate = result_RequestDetails[j].WorkDate;\n requestDetail.AtDate = result_RequestDetails[j].FromDate;\n requestDetail.IsWFH = result_RequestDetails[j].IsWFH == false ? \"No\" : \"Yes\";\n requestDetail.Qty = result_RequestDetails[j].Qty;\n if (result_RequestDetails[j].proName == \"\" || result_RequestDetails[j].proName == null)\n requestDetail.ProjectName = \"N/A\";\n else\n requestDetail.ProjectName = result_RequestDetails[j].proName;\n\n if (result_RequestDetails[j].OfficeHours == \"\" || result_RequestDetails[j].OfficeHours == null)\n requestDetail.OfficeHours = \"N/A\";\n else\n requestDetail.OfficeHours = result_RequestDetails[j].OfficeHours;\n\n if (result_RequestDetails[j].TimesheetHours == \"\" || result_RequestDetails[j].TimesheetHours == null)\n requestDetail.TimesheetHours = \"N/A\";\n else\n requestDetail.TimesheetHours = result_RequestDetails[j].TimesheetHours;\n\n if (result_RequestDetails[j].ReasonForTimeOff != \"\")\n requestDetail.ReasonForTimeOff = result_RequestDetails[j].ReasonForTimeOff;\n else\n requestDetail.ReasonForTimeOff = \"N/A\";\n mappedRequestDetails[mappedIndex] = requestDetail;\n var id = result_RequestDetails[j].TimeOffRequestID;\n\n // add control's ID which r displayed in table\n for (var i = 0; i < result_UIAccToReq.length; i++) {\n var control = result_UIAccToReq[i].UIID;\n\n if (result_UIAccToReq[i].ApprovalTypeID == totalReqApprovalTypeId) {\n if (result_UIAccToReq[i].ApprovalTypeID != EnumType.Leave || control != \"rbtLeave\") {\n var id = control + result_RequestDetails[j].TimeOffRequestID;\n pendingReqShowControlsIdObj.push(id);\n }\n }\n\n }\n if (result_RequestDetails[j].ApprovalTypeId == EnumType.Leave) {\n //pendingReqShowControlsIdObj.push(\"PendingHalfDayTypeTD\" + result_RequestDetails[j].TimeOffRequestID);\n //pendingReqShowControlsIdObj.push(\"PendingHalfDayTypeTH\" + result_RequestDetails[j].TimeOffRequestID);\n }\n if (result_RequestDetails[j].ApprovalTypeId != EnumType.WorkOnHoliday) {\n pendingReqShowControlsIdObj.push(\"PendingQuantityTH_\" + result_RequestDetails[j].TimeOffRequestID);\n pendingReqShowControlsIdObj.push(\"PendingQuantityTD_\" + result_RequestDetails[j].TimeOffRequestID);\n }\n\n if (requestDetail.ApprovalTypeId == EnumType.WorkOnHoliday) {\n\n pendingReqShowControlsIdObj.push(\"thPendingOfficeHours\" + result_RequestDetails[j].TimeOffRequestID);\n pendingReqShowControlsIdObj.push(\"thPendingTimesheetHours\" + result_RequestDetails[j].TimeOffRequestID);\n pendingReqShowControlsIdObj.push(\"PendingOfficeHours\" + result_RequestDetails[j].TimeOffRequestID);\n pendingReqShowControlsIdObj.push(\"PendingTimesheetHours\" + result_RequestDetails[j].TimeOffRequestID);\n }\n if (result_RequestDetails[j].ApprovalTypeId == EnumType.WorkFromHome) {\n pendingReqShowControlsIdObj.push(\"thPendingTimesheetHours\" + result_RequestDetails[j].TimeOffRequestID);\n pendingReqShowControlsIdObj.push(\"PendingTimesheetHours\" + result_RequestDetails[j].TimeOffRequestID);\n }\n mappedIndex++;\n PendingReqTimeOffRequestId = [];\n PendingReqTimeOffRequestId.push(timeoffReqId);\n }\n }\n return mappedRequestDetails;\n }", "title": "" }, { "docid": "6603de1ccaf30b1ef4bf8ccf69f7a5b3", "score": "0.5798544", "text": "function writeAllRequest(profile, requestTriples, fetchRequest){\n let requestContent = Object(); \n let dataElementList = []\n\n for (let i = 0; i < requestTriples.length; i++){\n if (requestTriples[i].subject.id === fetchRequest){\n requestContent.webid = profile.asRef();\n requestContent.name = profile.getString(foaf.name);\n requestContent.organization = profile.getString(\"http://www.w3.org/2006/vcard/ns#organization-name\");\n requestContent.image = profile.getRef(vcard.hasPhoto);\n\n requestContent.url = fetchRequest;\n if (requestTriples[i].predicate.id === \"http://schema.org/purpose\"){\n requestContent.purpose = \"Purpose: \"+ requestTriples[i].object.value;}\n if (requestTriples[i].predicate.id === schema.endDate){\n requestContent.period = \"End date: \" + requestTriples[i].object.value;}\n if (requestTriples[i].predicate.id === \"http://schema.org/algorithm\"){\n requestContent.analysis = \"Analysis: \" + requestTriples[i].object.value;}\n if (requestTriples[i].predicate.id === \"http://schema.org/DataFeedItem\"){\n dataElementList.push(requestTriples[i].object.value);\n }\n }\n requestContent.dataElement = \"Requested data: \"+ dataElementList;}\n if (Object.keys(requestContent).length < 2){\n requestContent = false;\n }\n return requestContent\n}", "title": "" }, { "docid": "f98f70ead4c05ee8cfd0ce8ff3d66b04", "score": "0.57868195", "text": "get requests() {\r\n return this._reqs;\r\n }", "title": "" }, { "docid": "803877a4a12d907b034e0b0021caa1b2", "score": "0.5760822", "text": "clientList() {\n return ffetch.post('api/client/list')\n }", "title": "" }, { "docid": "e490586f308a599192a5661ba082ad9d", "score": "0.5719338", "text": "handlegetRequests() {\n getRequests({\n recordId: this.recordId\n })\n .then((results) => {\n this.requests = results;\n this.requestCount = results.length;\n this.isLoaded = true;\n this.rowsChecks = false;\n this.errors = undefined;\n })\n .catch((error) => {\n console.error('error handlegetRequests > ' + JSON.stringify(error));\n this.errors = JSON.stringify(error);\n });\n }", "title": "" }, { "docid": "5745d2877852e39c11e1e69c83a987c5", "score": "0.5712893", "text": "afterList(req, results) {\n if (req.body.minSize) {\n results.minSize = [\n self.apos.launder.integer(req.body.minSize[0]),\n self.apos.launder.integer(req.body.minSize[1])\n ];\n }\n }", "title": "" }, { "docid": "7998f250deda9553d128cc2aa982ff8b", "score": "0.57094944", "text": "addtorequestlist (nbfloor)\n {\n if (!this.requestlist.includes(nbfloor))\n this.requestlist.push(nbfloor);\n }", "title": "" }, { "docid": "163c7010e9443ce3ccd873b996f60ee1", "score": "0.5703268", "text": "function viewJobs() {\n var jobRequest = {\n status: 'REQUEST',\n request: 'jobs',\n name: 'all'\n }\n sendData(jobRequest, function(err, response) {\n if (err) {\n alert(err);\n } else {\n showJobs(response.data);\n }\n });\n}", "title": "" }, { "docid": "6707156580d3894e351b51dc05643277", "score": "0.5701828", "text": "function getPublishedRequests(){\r\n $(\"#published-requests\").empty();\r\n $.get(\"../server/user-published-requests.php\",{id:decrypt(sessionStorage.getItem('ID'))},function(data,status){\r\n requests = JSON.parse(data);\r\n currentRequestIndex = 0;\r\n var request = \"\";\r\n\t\tfor(var i = 0; i < requests.length; i++){\r\n\t\t\trequest += \"<tr>\" +\r\n\t\t\t\"<td class=\\\"text-center\\\" style=\\\"width: 25%;text-align: center;vertical-align: middle;\\\">\" +\r\n \"<img class=\\\"img-rounded request-images\\\" src=\\\"\"+ requests[i].img + \"\\\"></img>\" +\r\n \"</td>\" +\r\n\t\t\t\"<td class=\\\"text-center\\\" style=\\\"width: 25%;text-align: center;vertical-align: middle;\\\">\" +\r\n \"<h4>\" + requests[i].name + \"</h4><h5>\" + requests[i].description + \"</h5>\" +\r\n \"</td>\" +\r\n\t\t\t\"<td class=\\\"text-left\\\" style=\\\"width: 25%;text-align: left;vertical-align: middle;\\\">\" +\r\n \"<div><b>Request ID: </b>\" + requests[i].id +\r\n \"</div>\" +\r\n \"<div><b>Request Date: </b>\" + requests[i].date +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Approved Date: </b>\" + requests[i].approvedDate +\r\n \"</div>\" +\r\n \"<div><b>Payment Date: </b>\" + requests[i].paymentDate +\r\n \"</div>\" +\r\n \"<div><b>Published Date: </b>\" + requests[i].publishedDate +\r\n \"</div>\" +\r\n \"<div><b>Duration: </b>\" + requests[i].duration + \" Day(s)\" +\r\n \"</div>\" +\r\n \"<div><b>Frequency: </b>\" + requests[i].frequency + \" Display Per Cycle\" +\r\n \"</div>\" +\r\n \"<div><b>Starting Date: </b>\" + requests[i].startingDate +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>End Date: </b>\" + requests[i].endDate +\r\n \"</div>\" +\r\n \"<div><b>Image: </b>\" + requests[i].artworkName + \".\" + requests[i].extension +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Comments: </b>\" + ((requests[i].comments != \"\" && requests[i].comments != null) ? requests[i].comments : \"No comments\") +\r\n \"</div>\" +\r\n \"</td> \" +\r\n\t\t\t\"<td class=\\\"text-center\\\" style=\\\"width: 25%;text-align: center;vertical-align: middle;\\\">\" +\r\n\t\t\t\"<div>\" + requests[i].status +\r\n \"</div>\" +\r\n \"</td>\" +\r\n \"</tr>\";\r\n }\r\n $(\"#published-requests\").append(request);\r\n });\r\n}", "title": "" }, { "docid": "f143394f870f7d5866aa4b2439d75bd9", "score": "0.5696996", "text": "function seeCustomerRequestMade(){\n\tvar url='http://localhost:7070/Grabhouse/rest/api/pollRequest';\n\tmakeAjaxCalls(url,requestDoneHandler);\n}", "title": "" }, { "docid": "97aec3e742bdaeb991edcc9aca9f25ef", "score": "0.5691768", "text": "function createDraftRequest() {\n console.log(\"function: createDraftRequest\");\n $().SPServices({\n operation: \"UpdateListItems\",\n webURL: siteUrl,\n async: false,\n batchCmd: \"New\",\n listName: \"ccRequestTracker\",\n valuepairs: [\n [\"Title\", $(\"#Requestor\").val()],\n [\"REQUEST_FIELD\", createInitialJson()],\n [\"PURCHASE_DETAILS\", createDetailsJson()],\n [\"REQUEST_STATUS\", \"DRAFT\"]\n ],\n completefunc: function(xData, Status) {\n $(xData.responseXML)\n .SPFilterNode(\"z:row\")\n .each(function() {\n var newId = $(this).attr(\"ows_ID\");\n setTimeout(function() {\n redirectUrl(\"purchase_request\" + fileExt + \"?id=\" + newId);\n }, 2000);\n });\n }\n });\n}", "title": "" }, { "docid": "9e6616a82ad1f815d88d4ae526f26768", "score": "0.5680751", "text": "function filter_requests() {\n const data = { \"req_per_page\": 5, \"page_no\": 1 };\n pagination(data, myarr);\n }", "title": "" }, { "docid": "b545e5ce2d141a57d746b525a5d8f17e", "score": "0.56734025", "text": "async _addFetchedRequests(source, fetchedRequests) {\n const { requestsFromUrl, regex } = source;\n const originalLength = this.requests.length;\n\n fetchedRequests.forEach(request => this._addRequest(request));\n\n const fetchedCount = fetchedRequests.length;\n const importedCount = this.requests.length - originalLength;\n\n log.info('RequestList: list fetched.', {\n requestsFromUrl,\n regex,\n fetchedCount,\n importedCount,\n duplicateCount: fetchedCount - importedCount,\n sample: JSON.stringify(fetchedRequests.slice(0, 5)),\n });\n }", "title": "" }, { "docid": "27da7f3b1c6d978b4df64e6c070ab4f3", "score": "0.56729585", "text": "function list(request, response) {\n response.json({ data: orders });\n}", "title": "" }, { "docid": "3d6e6530307fa38e3d312cd9462c1423", "score": "0.5670873", "text": "function fetch_list() {\n\t\t$http.get('/get-todo-list').\n\t\t\tsuccess(function(data, status, headers, config) {\n\t\t\t\t// this callback will be called asynchronously\n\t\t\t\t// when the response is available\n\t\t\t\tconsole.log(data);\n\t\t\t\tcreate_todolist(data);\n\t\t\t}).\n\t\t\terror(function(data, status, headers, config) {\n\t\t\t\t// called asynchronously if an error occurs\n\t\t\t\t// or server returns response with an error status.\n\t\t\t});\n\t}", "title": "" }, { "docid": "f77a09d9b9832f2695aebe09883c6edb", "score": "0.56573564", "text": "_list() {\n const parameters = [\n 1,\n ['action', 'active', 'created_at', 'id', 'last_run', 'lock', 'name', 'tags'],\n {},\n 1000,\n 'name',\n ];\n return this.list.call(this, ...parameters);\n }", "title": "" }, { "docid": "2842a6f7117b57b21746c32b0ceecf73", "score": "0.5655619", "text": "static get eachReq () {\n return true\n }", "title": "" }, { "docid": "ad878cd02e4456f26ba9a769b92e7c67", "score": "0.56480515", "text": "function requestList() {\n // Create a request object and call Flask method\n const request = new XMLHttpRequest();\n request.open('POST', '/list-memory');\n\n let currentValue = document.querySelector('#userInput1').value;\n\n request.onload = () => {\n const data = JSON.parse(request.responseText);\n // Call helper function that updates the div \n appendList(data, \"list1\"); \n }\n\n // Add data to send with request. NECESSARY or else Flask will get None value on request.form.get(\"userInput1\")\n const data = new FormData();\n if (currentValue.length !== 0) {\n data.append('userInput1', currentValue);\n }\n request.send(data);\n}", "title": "" }, { "docid": "445b3f926957b9c8e51e6ac3987653f0", "score": "0.56388503", "text": "function all(request, response) {\n logger.log(\"info\",\"GET request received \");\n\n //The DBHandler function will retrieve all the todos from the database\n ToDoDbHandler.findAll(ToDoModel,function (error, todos) {\n // if there is an error retrieving, send the error. nothing after response.send(error) will execute\n if (error) {\n return responseHandler(response,false,error);\n }\n // return all todos in the response\n else\n {\n return responseHandler(response,true,todos);\n }\n });\n\n}", "title": "" }, { "docid": "16455129014111ac7890d44e2c9be9b1", "score": "0.56338006", "text": "index(request, reply) {\n this.ToDoList.findAll()\n .then((response) => reply(response))\n .catch((err) => reply(this.Boom.wrap(err)))\n }", "title": "" }, { "docid": "a5f026a6531d05eda5d2a1d0ce97b7e2", "score": "0.56249183", "text": "function listBooks() {\n \n let q = '?_limit=20'\n let path = route + q\n \n request(path, (err, res, body) => {\n if (err) {\n return console.log(err)\n }\n let data = JSON.parse(body)\n for (let i = 0; i < data.length; i++){\n console.log(`${data[i].id} ${data[i].name}`)\n }\n return\n })\n\n}", "title": "" }, { "docid": "affb13e7d2cbbbb39a6ab197ff12819b", "score": "0.5622602", "text": "function interview_detail(request, response, next) {\n console.log('Interview detail');\n}", "title": "" }, { "docid": "2297a68ac362e209c491662940063a4c", "score": "0.561785", "text": "function requestWalmartList() {\n return {type: REQ_WALMART_LIST} \n}", "title": "" }, { "docid": "019f6f1325b3efa2d9c6c2e5875b050b", "score": "0.5610306", "text": "function Listing(){\n \n }", "title": "" }, { "docid": "53746ea211dba6a46927daf1255c05fd", "score": "0.56082714", "text": "function getRequests(pageSize, page, query, date, time, statusId) {\n var url = common.getBaseUrl() + \"api/Administrator/Appointments?pageSize={0}&page={1}&query={2}&date={3}&time={4}&statusId={5}\".format(pageSize, page, query, date, time, statusId);\n var accessToken = authenticationService.getAccessToken();\n //var parameter = {};\n //parameter.pageSize = pageSize;\n //parameter.page = page;\n //parameter.query = query;\n //parameter.date = date;\n //parameter.time = time;\n\n return $http.get(url, {\n headers: {\n 'Content-Type': JSON_CONTENT_TYPE,\n 'Authorization': BEARER_TOKEN_AUTHENTICATION_TEMPLATE.format(accessToken)\n }\n });\n }", "title": "" }, { "docid": "8d324d112f78d4970fbbc19007f6f82d", "score": "0.56057584", "text": "function payment_list(request, response, next) {\n console.log('List of payments');\n}", "title": "" }, { "docid": "f6eee2a9473ecd4a52d68c5895715c62", "score": "0.56055367", "text": "function sendRequestForAgencyList() {\n Gtfs.getAgencies(agencyListUrl).then(function (agencies) {\n var progress = document.getElementById(\"agenciesTableProgress\");\n progress.parentElement.removeChild(progress);\n agencies = agencies.filter(isInWA);\n // Sort by area\n agencies.sort(function (a, b) {\n if (a.area > b.area) {\n return 1;\n } else if (a.area < b.area) {\n return -1;\n } else if (a.name > b.name) {\n return 1;\n } else if (a.name < b.name) {\n return -1;\n } else {\n return 0;\n }\n });\n document.body.appendChild(createAgencyTable(agencies));\n });\n }", "title": "" }, { "docid": "5d44e37bdd891ecea6667b401c8fb2b0", "score": "0.5587763", "text": "function generateRequest() {\n\n}", "title": "" }, { "docid": "479a36864c0969871b9098a74b0aec9d", "score": "0.55739915", "text": "static list() {\n\t\tHttp.getRequest(\"jobs\").then(response =>\n\t \tresponse.json().then(\n\t \t\t\tjson => {\n\t \t\t\t\tlet output = document.querySelector(\"#jobsListOutput\");\n\n\t \t\t\t\tjson.forEach(job => {\n\t \t\t\t\t\tlet table = document.createElement(\"table\");\n\t \t\t\t\t\tlet tbody = document.createElement(\"tbody\");\n\n\t \t\t\t\t\t// display id\n\t \t\t\t\t\ttbody.appendChild(JobService.createRow(\"ID:\", job._id));\n\n\t \t\t\t\t\t// display position\n\t \t\t\t\t\ttbody.appendChild(JobService.createRow(\"Position:\", job.position));\n\n\t \t\t\t\t\t// display description\n\t \t\t\t\t\ttbody.appendChild(JobService.createRow(\"Description:\", job.description));\n\n\t \t\t\t\t\t// display requirements\n\t \t\t\t\t\tjob.requirements.forEach(requirement => tbody.appendChild(JobService.createRow(\"Requirement:\", requirement)));\n\n\t \t\t\t\t\t// display table\n\t \t\t\t\t\ttable.appendChild(tbody);\n\t \t\t\t\t\toutput.appendChild(table);\n\t \t\t\t\t});\n\t \t\t\t}\n\t \t));\n }", "title": "" }, { "docid": "a78d005e860f672a193d05ecb3bfce5b", "score": "0.55581826", "text": "getAll(){}", "title": "" }, { "docid": "152883b900bd6e665d6ee75e4ab659a6", "score": "0.55546796", "text": "function seeMoreFriendReqs() {\n\tfriendReqNotiPage++;\n\tgetFriendReqNotis(friendReqNotiPage);\n}", "title": "" }, { "docid": "b1cc284484fc9e6b3b185b2587e56bf7", "score": "0.5542721", "text": "function _list() {\n document.getElementById('result').innerHTML = ''; \n document.getElementById('data').innerHTML = ''; \n request = getRequestObject() ;\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n objJSON = JSON.parse(request.response);\n var txt = \"\";\n for ( var id in objJSON ) {\n txt += id+\": {\";\n for ( var prop in objJSON[id] ) { \n if ( prop !== '_id')\n { \n txt += prop+\":\"+objJSON[id][prop]+\",\"; \n }\n else\n { \n txt += \"id:\" + objJSON[id][prop]['$oid']+\",\"; \n } \n }\n txt +=\"}<br/>\";\n }\n document.getElementById('result').innerHTML = txt;\n }\n }\n request.open(\"GET\", \"/~8kusm/zad02/biblioteka/list\", true);\n request.send(null);\n}", "title": "" }, { "docid": "62fec172dd9653230fbb88ac61a93517", "score": "0.55393153", "text": "function show(req, res) {\n let organization=Organization.findById(req.params.id)\n let users=User.find({organization: req.params.id})\n let requests=Request.find({organization: req.params.id})\n Promise.all([organization,users,requests])\n .then(function(results){\n return res.json(results)\n })\n .catch(function(err){\n res.status(500).json({ error: true });\n }) \n}", "title": "" }, { "docid": "0cd92fe554513f4993bf2757c673a2ca", "score": "0.5537143", "text": "function multiRequest_CheckRequests()\n{\n //console.log(\"multiRequest_CheckRequests: Checking requests...\");\n \n // Update the UI\n multiRequest_UpdateJobStatusUI();\n \n \n \n \n \n // Checking for data ready to recieve\n if(requests_DataReady.length === 0)\n {\n // Queue is empty, Do nothing\n }\n else\n {\n // There is at least 1 item that has data ready to be pulled from the server... do that now.\n var currentReadyJob = requests_DataReady.pop();\n \n // Make the request to get the data.\n //alert(\"UNCOMMENT THE NEXT LINE TO GET THE DATA THAT IS READY\");\n agriserv_AJAX__getDataFromRequest(currentReadyJob.serverJobID, currentReadyJob.localJobID) ;\n \n // return once a request is made\n return;\n }\n \n \n // Checking for job progress\n if(requests_Waiting_ForData.length === 0)\n {\n // Queue is empty, Do nothing\n }\n else\n {\n // There is at least 1 item that needs to be checked for request progress.. do that now.\n //var currentRequestToCheck = requests_Waiting_ForData.pop(); // // Remove last element\n var currentRequestToCheck = requests_Waiting_ForData.shift(); // Remove first element\n \n // Make the request to check job status.\n agriserv_AJAX__getDataRequestProgress(currentRequestToCheck.serverJobID, currentRequestToCheck.localJobID);\n \n // return once a request is made\n return;\n }\n \n // Check requests_Waiting_ToMake, if any request is found, pull it out of the array, \n if(requests_Waiting_ToMake.length === 0)\n {\n // Queue is empty, Do nothing\n }\n else\n {\n // There is at least 1 item in the request queue.. make that request now.\n var creq = requests_Waiting_ToMake.pop(); // currentRequestToMake\n \n // Lets first see if this request already has a server job ID.\n //\n var isMakeNewRequest = recoverRequest_Checkpoint(creq);\n \n // Make the Request to ClimateSERV's API\n if(isMakeNewRequest == true)\n {\n agriserv_AJAX__Submit_New_DataRequest(creq.cservParam_datatype, creq.cservParam_operationtype, creq.cservParam_intervaltype, creq.cservParam_begintime, creq.cservParam_endtime, creq.UsePolyString, creq.cservParam_geometry, creq.cservParam_layerid, creq.cservParam_featureids, creq.LocalID);\n }\n \n // return once a request is made\n return;\n }\n \n \n // If we got this far... lets see if the requests are done.. if they aren't done, keep trying to work on the requests.\n if(global_IsNewRequestLocked == true)\n {\n // A request should be in progress of processing... check to see if the use case object is now post process ready.\n usecaseObj_MightBe_PostProcessReady_EventHandler();\n }\n \n \n}", "title": "" }, { "docid": "8297c5ec77801b2ca74223c60b96dd79", "score": "0.55342966", "text": "PendingRequestData(e) {\n this.allData = this.search_name.value;\n this.startDate = this.range.value.start_date;\n this.endDate = this.range.value.end_date;\n this.service.AllPendingRequest(this.allData, this.startDate, this.endDate, this.userId)\n .subscribe(res => {\n if (res['status'] == '1') {\n console.log(\"api response\", res);\n this.list_Obj = res['data'];\n this.userData = [...res['data']];\n // console.log(\"listttttttt\", this.list_Obj);\n this.filteredUser = this.list_Obj;\n }\n });\n }", "title": "" }, { "docid": "2b7ed32c372720cd9706b1bb8995cf3a", "score": "0.5531072", "text": "function getPaidRequests(){\r\n $(\"#paid-requests\").empty();\r\n $.get(\"../server/user-paid-requests.php\",{id:decrypt(sessionStorage.getItem('ID'))},function(data,status){\r\n requests = JSON.parse(data);\r\n currentRequestIndex = 0;\r\n var request = \"\";\r\n\t\tfor(var i = 0; i < requests.length; i++){\r\n request += \"<tr>\" +\r\n\t\t\t\"<td class=\\\"text-center\\\" style=\\\"width: 33.33%;text-align: center;vertical-align: middle;\\\">\" +\r\n \"<img class=\\\"img-rounded request-images\\\" src=\\\"\"+ requests[i].img + \"\\\"></img>\" +\r\n \"</td>\" +\r\n\t\t\t\"<td class=\\\"text-center\\\" style=\\\"width: 33.33%;text-align: center;vertical-align: middle;\\\">\" +\t\r\n \"<h4>\" + requests[i].name + \"</h4><h5>\" + requests[i].description + \"</h5>\" +\r\n \"</td>\" +\r\n\t\t\t\"<td class=\\\"text-left\\\" style=\\\"width: 33.33%;text-align: left;vertical-align: middle;\\\">\" +\r\n \"<div><b>Request ID: </b>\" + requests[i].id +\r\n \"</div>\" +\r\n \"<div><b>Request Date: </b>\" + requests[i].date +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Approved Date: </b>\" + requests[i].approvedDate +\r\n \"</div>\" +\r\n \"<div><b>Payment Date: </b>\" + requests[i].paymentDate +\r\n \"</div>\" +\r\n \"<div><b>Duration: </b>\" + requests[i].duration + \" Day(s)\" +\r\n \"</div>\" +\r\n \"<div><b>Frequency: </b>\" + requests[i].frequency + \" Display Per Cycle\" +\r\n \"</div>\" +\r\n \"<div><b>Starting Date: </b>\" + requests[i].startingDate +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>End Date: </b>\" + requests[i].endDate +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Image: </b>\" + requests[i].artworkName + \".\" + requests[i].extension +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Comments: </b>\" + ((requests[i].comments != \"\" && requests[i].comments != null) ? requests[i].comments : \"No comments\") +\r\n \"</div>\" +\r\n \"</td> \" +\r\n \"</tr>\";\r\n }\r\n\t\t$(\"#paid-requests\").append(request);\r\n });\r\n}", "title": "" }, { "docid": "154973d7bda9bc2c86ac334fe782334a", "score": "0.5530336", "text": "function requestAndDisplayMealPlanHistory()\n{\n \n getMealPlans(displayMealPlans);\n}", "title": "" }, { "docid": "1925edacc4b79b0bbf4b77d54d67b7e0", "score": "0.55261534", "text": "constructor() {\n this._requests = {};\n }", "title": "" }, { "docid": "5bece99f1d1b1453a7e79867db50da0c", "score": "0.552278", "text": "next(){this._followRelService(\"next\",\"List\")}", "title": "" }, { "docid": "ce7de81bdfaf29ecb35b586ecedb26ab", "score": "0.55195", "text": "first(){this._followRelService(\"first\",\"List\")}", "title": "" }, { "docid": "1e3672f386be890a9da6cdae91e49b94", "score": "0.55182445", "text": "function getApprovedRequests(){\r\n\t$(\"#approved-requests\").empty();\r\n\t$.get(\"../server/user-approved-requests.php\",{id:decrypt(sessionStorage.getItem('ID'))},function(data,status){\r\n\t\trequests = JSON.parse(data);\r\n\t\tcurrentRequestIndex = 0;\r\n\t\tvar request = \"\";\r\n\t\tfor(var i = 0; i < requests.length; i++){\r\n\t\t\trequest += \"<tr>\" +\r\n \"<td class=\\\"text-center\\\" style=\\\"width: 25%;vertical-align: middle;text-align: center;\\\">\" +\r\n \"<img class=\\\"img-rounded request-images\\\" src=\\\"\"+ requests[i].img + \"\\\"></img>\" +\r\n \"</td>\" +\r\n \"<td class=\\\"text-center\\\" style=\\\"width: 25%;vertical-align: middle;text-align: center;\\\">\" +\r\n \"<h4>\" + requests[i].name + \"</h4><h5>\" + requests[i].description + \"</h5>\" +\r\n \"</td>\" +\r\n \"<td class=\\\"text-left\\\" style=\\\"width: 25%;vertical-align: middle;text-align: left;\\\">\" +\r\n \"<div><b>Request ID: </b>\" + requests[i].id +\r\n \"</div>\" +\r\n \"<div><b>Request Date: </b>\" + requests[i].date +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Approved Date: </b>\" + requests[i].approvedDate +\r\n \"</div>\" +\r\n \"<div><b>Duration: </b>\" + requests[i].duration + \" Day(s)\" +\r\n \"</div>\" +\r\n \"<div><b>Frequency: </b>\" + requests[i].frequency + \" Display Per Cycle\" +\r\n \"</div>\" +\r\n \"<div><b>Starting Date: </b>\" + requests[i].startingDate +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>End Date: </b>\" + requests[i].endDate +\r\n \"</div>\" +\r\n \"<div><b>Image: </b>\" + requests[i].artworkName + \".\" + requests[i].extension +\r\n \"</div>\" +\r\n\t\t\t\"<div><b>Comments: </b>\" + ((requests[i].comments != \"\" && requests[i].comments != null) ? requests[i].comments : \"No comments\") +\r\n \"</div>\" +\r\n \"</td> \" +\r\n \"<td class=\\\"text-center\\\" style=\\\"vertical-align: middle;width: 22%;vertical-align: middle;\\\">\" +\r\n\t\t\t\"<div class=\\\"row align\\\" style=\\\"margin-left: 22%;\\\">\" +\r\n\t\t\t\t\"<div class=\\\"col-lg-4\\\">\" +\r\n \t\t\"<form action=\\\"../server/venta.php\\\" method=\\\"post\\\" name=\\\"forma\\\" target=\\\"_blank\\\">\" +\r\n\t\t\t\t\t\"<input type=\\\"hidden\\\" name=\\\"requestID\\\" value=\\\"\" + requests[i].id + \"\\\">\" +\r\n\t\t\t\t\t\"<input type=\\\"hidden\\\" name=\\\"requestFirstName\\\" value=\\\"\" + decrypt(requests[i].requestFirstName) + \"\\\">\" +\r\n\t\t\t\t\t\"<input type=\\\"hidden\\\" name=\\\"requestLastName\\\" value=\\\"\" + decrypt(requests[i].requestLastName) + \"\\\">\" +\r\n\t\t\t\t\t\"<input type=\\\"hidden\\\" name=\\\"email\\\" value=\\\"\" + decrypt(sessionStorage.getItem('email')) + \"\\\">\" +\r\n\t\t\t\t\t\"<button id=\\\"pay-btn\\\" type=\\\"submit\\\" class=\\\"btn\\\"><span class=\\\"glyphicon glyphicon-usd\\\" style=\\\"font-size: 35px;color:#2D2D2D;\\\"><br><p style=\\\"font-size: 14px;\\\"><b><i>Pay</b></i></p></span></button>\" +\r\n\t\t\t\t\t\"</form>\" +\r\n\t\t\t\t\"</div>\" +\r\n\t\t\t\t\"<div class=\\\"col-lg-4\\\">\" +\r\n\t\t\t\t\t\"<span id=\\\"\" + requests[i].id + \"\\\" onclick=\\\"cancelling(this)\\\" class=\\\"clickable glyphicon glyphicon-remove\\\" style=\\\"font-size: 35px;color:#2D2D2D;\\\"><br><p style=\\\"font-size: 14px;\\\"><b><i>Cancel</b></i></p></span>\" +\r\n\t\t\t\t\"</div>\" +\r\n\t\t\t\"</div>\" +\r\n\t\t\t\"</td>\" +\r\n \"</tr>\";\r\n\t\t}\r\n\t\t$(\"#approved-requests\").append(request);\t\t\t\r\n\t});\r\n}", "title": "" }, { "docid": "ef83033f553c955e7db2d83046651071", "score": "0.55146044", "text": "list({ params }, res) {\n getAllData(db, (err, data) => {\n res.json({ result: data });\n });\n }", "title": "" }, { "docid": "d7faa8d711b3d93647883e99809eba4c", "score": "0.55110776", "text": "paramsRequest () {\n\t\t\tthis.search(false) // busca-se na página atual\n\t\t}", "title": "" }, { "docid": "8460206c1de1029d9d9f0e31a4238151", "score": "0.5507014", "text": "function sentRequestForSingleAgencyList() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", sampleDataUrl, true);\n xhr.onload = function () {\n var agencyData = Gtfs.parseAgencyResponse(xhr.responseText);\n console.log(agencyData);\n };\n xhr.onerror = function (e) {\n console.error(e);\n };\n xhr.send();\n }", "title": "" }, { "docid": "d5c858d338242f464e9e6b04bc955ba4", "score": "0.5505121", "text": "function request() {\n\t\tself.query();\n\t}", "title": "" }, { "docid": "5aa74739e96c0fb2f9cb8405449a71c4", "score": "0.55015236", "text": "requestBatchInfo() {\n const batchId = this.model.getItem('exec.jobState.job_id'),\n jobInfo = this.model.getItem('exec.jobs.info');\n if (!jobInfo || !Object.keys(jobInfo).length) {\n return this.bus.emit(jcm.MESSAGE_TYPE.INFO, { [jcm.PARAM.BATCH_ID]: batchId });\n }\n\n const jobInfoIds = new Set(Object.keys(jobInfo));\n const missingJobIds = Object.keys(this.model.getItem(JOBS_BY_ID)).filter(\n (jobId) => {\n return !jobInfoIds.has(jobId);\n }\n );\n if (missingJobIds.length) {\n this.bus.emit(jcm.MESSAGE_TYPE.INFO, {\n [jcm.PARAM.JOB_ID_LIST]: missingJobIds,\n });\n }\n }", "title": "" }, { "docid": "4c5f1ee955df53dd722c98286c73b01b", "score": "0.54868484", "text": "function list(req, res){\n var json_con = {rfid:''};\n common.list(table_name, json_con, res);\n}", "title": "" }, { "docid": "010a2aba3748f0d937f49eb61fbbc394", "score": "0.5478191", "text": "function requestData (config){\n return RecordMultiple.query({\n data_infos: JSON.stringify(config.dataInfos),\n sort: true,\n limit: config.limit || 0\n }).$promise.then(function (rets){\n return rets;\n });\n }", "title": "" }, { "docid": "2e747038541816bce4ede5e99b253645", "score": "0.54770166", "text": "function getAllPendingRequests(){\r\n\t\tFriendService.getAllPendingRequests().then(\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\t$scope.pendingRequests=response.data\r\n\t\t\t\t},\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\tif(response.status==401)\r\n\t\t\t\t\t\t$location.path('/login')\r\n\t\t\t\t})\r\n\t}", "title": "" }, { "docid": "d59ddc6a33779b71c06f5048174a55e0", "score": "0.5473476", "text": "addList(listName,listDescription,success,error){\n let body={\n method: 'POST',\n body: `{\"name\":\"${listName}\",\"description\":\"${listDescription}\"}`,\n headers:{\"Content-Type\": \"application/json\"}\n };\n let req= new Request('/lists',body);\n fetch(req)\n .then(response=>{\n response.json().then(json=>{\n success(json);\n })\n })\n .catch(error=>{error(error)})\n }", "title": "" }, { "docid": "74f5869b75b4fd22e353941e58464f3e", "score": "0.5470826", "text": "function ticketLists() {\n RestFul.global(\n {\"action\": \"Ticket:MyTickets\", \"params\": {}},\n function(response) {\n if (!response) { return; };\n if (response.hasOwnProperty('message')) {\n if (response.data) {\n $scope.tickets = response.data.tickets;\n } else {\n $scope.tickets = [];\n }\n }\n }\n )\n }", "title": "" }, { "docid": "b9ff9c930619fc2b4553a6f7e4e8206c", "score": "0.5467233", "text": "function list(req, res, next) {\n res.status(200).json({ data: orders });\n}", "title": "" }, { "docid": "94019a3de42be5899769bd368683b91e", "score": "0.5462145", "text": "function ajaxRequest(params) {\n AdminService.getList(params).then(function successCallback(response) { \n params.success(response.data)\n }).catch(function errorCallback(error) {\n \n })\n }", "title": "" }, { "docid": "ec4806421f313fca0b6d5f96273be1dc", "score": "0.54617006", "text": "static getListings() {\n fetch(this.baseUrl)\n .then(response => response.json())\n .then(data => { \n \n data['data'].forEach(element => {\n const i = new Listing({id: element.id, ...element.attributes})\n i.renderList()\n });\n \n }); \n }", "title": "" }, { "docid": "0dc191ba645ad88ebbadd4aba26ebb0c", "score": "0.5455887", "text": "nextPage() {\n ApiHelper.employeeRequestList({ next: this.state.nextPageURL })\n .then(result => {\n this.setState({\n employeeRequestsList: this.state.employeeRequestsList.concat(result.data.results),\n nextPageURL: result.data.next\n });\n })\n .catch(error => {\n console.log(\"can't get employee request list\", error);\n });\n }", "title": "" }, { "docid": "bc6c51662083f271a96c80a21bc40775", "score": "0.5450962", "text": "function newRequest(index) {\n\tswitch (index) {\n\t\tcase 0:\n\t\t\treturn new RRequest(0,0,0,0,'');\n\t\tcase 1:\n\t\t\treturn new RRequest(1,1,1,1,'Baked goods can burn!');\n\t\tcase 2:\n\t\t\treturn new RRequest(1,1,1,1,\"Debug any future issues by entering [X5214] at the monitor.\");\n\t\tcase 3:\n\t\t\treturn new RRequest(1,1,1,1,'We lose money when I run out of battery!');\n\t\tcase 4:\n\t\t\treturn new RRequest(1,1,1,1,'You can break rocks with your hammer.');\n\t\tcase 5:\n\t\t\treturn new RRequest(2,1,2,1,'A locked treasure chest is burried somewhere under a tuft of grass. You have to be carrying your shovel to dig it up. And be careful, it will explode a minute after it is revealed! If you open it, you get $20, so you need to figure out how to open it quickly.');\n\t\tcase 6:\n\t\t\treturn new RRequest(2,1,2,1,'Different resources are worth different amounts of money. Try to make bread; you get $15 per loaf! The recipe is 6 eggs, 4 milk, and 2 wheat. You can also make muffins to earn $18, with 10 berries, 8 eggs, 4 milk, and 1 wheat. If you forget the recipes, open the book near the well.');\n\t\tcase 7:\n\t\t\treturn new RRequest(2,1,2,1,'Animals will occasionally pop up in your environment. Gophers and snakes are pesky. Gophers will steal $1 if they disappear and snakes will steal an egg from you every 4 seconds. But you get a one dollar reward for each one you catch! The same goes for butterflies, but they do not steal any of your resources.');\n\t\tcase 8:\n\t\t\treturn new RRequest(3,2,1,1,'I want to start planting. Can you bring me seeds from the barrels?');\n\t\tcase 9:\n\t\t\treturn new RRequest(3,2,1,1,'I need to water the plants. Can you bring me water from the well?');\n\t\tcase 10:\n\t\t\treturn new RRequest(4,2,1,2,'My battery is less than 20%. Push or pull me over to the charging station to recharge my battery.');\n\t\tcase 11:\n\t\t\treturn new RRequest(5,2,2,1,\"Should I switch tasks? Enter your response [yes, no] at the monitor. If your answer is yes, bring me seeds from the barrels to switch to planting and water from the well to switch to watering.\");\n\t\tcase 12:\n\t\t\treturn new RRequest(6,2,2,2,'One of my parts is missing! Push or pull me around the field; I will beep faster the closer you are.');\n\t\tcase 13:\n\t\t\treturn new RRequest(6,2,2,2,'Enter the password [X91R23Q7] at the monitor to update my software!');\n\t\tcase 14:\n\t\t\treturn new RRequest(7,3,1,2,'My battery is less than 5%! Push or pull me over to the charging station to recharge my battery.');\n\t\tcase 15:\n\t\t\treturn new RRequest(8,3,2,2,\"Something short circuited--I'm about to catch on fire! Put it out with 3 buckets of water. Then enter the code [X5214] at the monitor to debug the issue.\");\n\t\tdefault:\n\t\t\treturn new RRequest(0,0,0,0,'');\n\t}\n}", "title": "" }, { "docid": "6d1097598449eb7dea978a4f13acea02", "score": "0.54474235", "text": "function loadListings() {\n $('#js-spinner').show();\n queryParams = parseURL();\n if (queryParams.id) {\n console.info(\"Request detail page for listing id: \" + queryParams.id);\n requestContent();\n adjustSlider();\n } else if (queryParams.price) {\n console.info(\"Request search results for query: \" + JSON.stringify(queryParams));\n requestContent();\n updateSearchFilter(queryParams);\n } else {\n console.info(\"Request initial listings\");\n requestContent();\n adjustSlider();\n }\n }", "title": "" }, { "docid": "5e781f0040a46b109171b3a6ebbe1f00", "score": "0.54449004", "text": "async function list(req, res) {\n const { date, mobile_number } = req.query;\n if(mobile_number) {\n const data = await service.listByMobileNumber(mobile_number);\n return res.json({ data: data });\n };\n const data = await service.list(date);\n\n res.json({ data: data });\n}", "title": "" }, { "docid": "0d06f47cfff92247eb639ab143d9a173", "score": "0.5444526", "text": "formatRequestParams() {\n const requestParams = this.borrowingsEndingRequest.params;\n return {\n newInventoryItemsStatus: requestParams.newInventoryItemsStatus,\n selectedBorrowings: requestParams.selectedBorrowings.map(borrowing => borrowing.id),\n }\n }", "title": "" }, { "docid": "5cb1a2a9a4377ce36faecfe63cb0bb58", "score": "0.54326606", "text": "list() {\n return this._followRelService('list', 'List');\n }", "title": "" }, { "docid": "7d0a34f27c7fae6c6af73b2b6584df38", "score": "0.54313713", "text": "checkAllies() {\n if (!allyList.length) return\n // Only work 10% of the time\n if (Game.time % (10 * allyList.length) >= allyList.length) return\n const currentAllyName = allyList[Game.time % allyList.length];\n if (RawMemory.foreignSegment && RawMemory.foreignSegment.username == currentAllyName) {\n const allyRequests = JSON.parse(RawMemory.foreignSegment.data);\n //console.log(currentAllyName, RawMemory.foreignSegment.data)\n const requests = utils.getsetd(Cache, \"requests\", {});\n requests[currentAllyName] = [];\n if(!allyRequests){\n return\n }\n for (var request of allyRequests) {\n //const priority = Math.max(0, Math.min(1, request.priority))\n switch (request.requestType) {\n case requestTypes.ATTACK:\n //console.log(\"Attack help requested!\", request.roomName, priority)\n break\n case requestTypes.DEFENSE:\n //console.log(\"Defense help requested!\", request.roomName, priority)\n break\n case requestTypes.RESOURCE:\n requests[currentAllyName].push(request);\n // const resourceType = request.resourceType\n // const maxAmount = request.maxAmount\n //console.log(\"Resource requested!\", request.roomName, request.resourceType, request.maxAmount, priority)\n // const lowerELimit = 350000 - priority * 200000\n // const lowerRLimit = 24000 - priority * 12000\n break\n }\n }\n }\n\n const nextAllyName = allyList[(Game.time + 1) % allyList.length];\n RawMemory.setActiveForeignSegment(nextAllyName, segmentID);\n }", "title": "" }, { "docid": "7bc8cf72e3bba2a60ddd1e7f283e1315", "score": "0.54231185", "text": "requests(state, _, _2, rootGetters) {\n // get the userId from the root vuex index.js\n const coachId = rootGetters.userId;\n //return the state.requests and filter them out depending on coach id\n // filter: check all of the requests and see if req.coachId is equal to the coachId constant\n // we're using 'req' becuase its req of receivedRequests\n return state.requests.filter(req => req.coachId === coachId);\n }", "title": "" }, { "docid": "c5a04412d9d2b381c54a7a13a909cfd2", "score": "0.542051", "text": "function searchForList(){\n request(_options, function(error, response, body) {\n if (error) throw new Error(error);\n\n // Write out Report on items\n if(debug.enabled){\n printFeedReport(JSON.parse(body));\n }\n\n // Generate basketItems for next process and write it\n generateBasket(JSON.parse(body));\n\n // Write out model to new file\n writeToFile(FILE_TYPE_LIST, body);\n });\n}", "title": "" }, { "docid": "152dc6ae75fb48e7f03cd0f7f89fd92c", "score": "0.5416798", "text": "function listUpdate(page,username){\n\t var xmlhttp = new XMLHttpRequest();\n var url = \"https://pulsenavigationtest.flextronics.com/node/webGMT/getTaskList\";\n var list = [];\n\tconsole.log(\"username : \"+username);\n var params = \"ProjectId=28&FlexOwnerADLogin=\"+username;\n xmlhttp.onreadystatechange = function() {\n \n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n \n\t\t\t\n\t\t\t page.data(function(data) {\n\t\t\t\t for (var i = 0; i < response['results'].length; i++) {\n\t\t\t\t\t if(response['results'][i].TaskStatus == 0){\n\t\t\t\t\t\t statusTask = \"OverDue\";\n\t\t\t\t\t }else if(response['results'][i].TaskStatus == 1){\n\t\t\t\t\t\t statusTask = \"Closed\";\n\t\t\t\t\t }else if(response['results'][i].TaskStatus == 2){\n\t\t\t\t\t\t statusTask = \"Open\";\n\t\t\t\t\t }\n /* list array to show the homescreen list*/\n list[i] = { 'name': response['results'][i].ProjectName, 'taskid': response['results'][i].TaskID, 'gatename': response['results'][i].GateName, 'taskname': response['results'][i].TaskName, 'status': statusTask };\n }\n \n data.list = list;\n })\n .screen(\"home\");\n\t\t\t\n }\n };\n xmlhttp.open(\"GET\", url + \"?\" + params, true);\n xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xmlhttp.send();\n}", "title": "" }, { "docid": "182c2858a654fd58f2d3d8cd56f8d6d3", "score": "0.5407872", "text": "async function list(req, res) {\n const { date, mobile_number } = req.query;\n let data = [];\n\n if (date) {\n data = await reservationsService.listByDate(date);\n } else if (mobile_number) {\n data = await reservationsService.listByMobileNumber(mobile_number);\n } else {\n data = await reservationsService.list();\n }\n\n res.json({\n data: data,\n });\n}", "title": "" }, { "docid": "48315fc5d89ca39f2673efd96e167bbe", "score": "0.5392299", "text": "get(req, res) {\n return Request.find({ status : \"pending\" }).sort({ dateCreated : 1 }).then(request => {\n if(!request.length) return helper.retError(res,'400',true,'','No matching results',request);\n return helper.retSuccess(res,'200',true,'','Sucess',request);\n }).catch(err => {\n return helper.retError(res,'500',false,err,'Error get','');\n });\n }", "title": "" }, { "docid": "b9e6e25fe1b3953ef45245c4efe16c32", "score": "0.5387314", "text": "function printReqSummary(request) {\n // Display handled HTTP method and link (path + queries)\n //console.log(`Handling ${request.method} ${request.originalUrl}`);\n console.log(`${Date.now()}: Handling ${request.method} ${request.originalUrl}`);\n}", "title": "" }, { "docid": "0c51aaca65878d7822bcb28cc7125f3b", "score": "0.53809595", "text": "function requestRetailer() {\n return {\n type: REQUEST_ALL_RETAILER,\n payload: {\n receivedAt: Date.now(),\n loading: true,\n },\n };\n}", "title": "" }, { "docid": "e46256f5cf4b7e64f53fa45dc212adc7", "score": "0.53779596", "text": "function modifyDraftRequest() {\n console.log(\"function: modifyDraftRequest\");\n $().SPServices({\n operation: \"UpdateListItems\",\n webURL: siteUrl,\n async: false,\n batchCmd: \"Update\",\n listName: \"ccRequestTracker\",\n ID: qId,\n valuepairs: [\n [\"REQUEST_FIELD\", createInitialJson()],\n [\"PURCHASE_DETAILS\", createDetailsJson()]\n ],\n completefunc: function(xData, Status) {\n setTimeout(function() {\n redirectUrl(\"purchase_request\" + fileExt + \"?id=\" + qId);\n }, 2000);\n }\n });\n}", "title": "" }, { "docid": "69a70e3d88884abfa3ab841aee857a2f", "score": "0.53774714", "text": "function viewjobrequests(userID) {\n console.log(\"In service viewjobrequests function\");\n var deferredObject = $q.defer();\n $http({\n url : 'http://ecomdemo.cloudapp.net:8888/api/job/ShowOfferedJobNotificationsToSP',\n method : 'POST',\n params : {\"spid\": userID},\n headers: {'Content-Type': 'application/x-www-form-urlencoded'},\n transformRequest: function(obj) {\n var str = [];\n for(var p in obj)\n str.push(encodeURIComponent(p) + \"=\" + encodeURIComponent(obj[p]));\n return str.join(\"&\");\n }})\n .success(function(response){\n console.log(\"View All Job requests API successfully called\");\n deferredObject.resolve(response);\n })\n .error(function(error){\n deferredObject.reject(response);\n });\n \n return deferredObject.promise; \n \n }", "title": "" }, { "docid": "0c134219a693159728c1b7cd1dbfc8ac", "score": "0.5375492", "text": "function getList(){\n $.ajax({\n url:'/getList',\n type:'GET',\n success: function(response){\n console.log(response);\n $('#task_list').empty();\n for (var i = 0; i < response.length; i++) {\n $('#task_list').append('<li>' + response[i].task + \" \" + response[i].status + '</li>');\n\n }//end for\n } // end success\n }); // end ajax GET\n} // end getList", "title": "" }, { "docid": "2c9817b893bc89fd8b2014d901d22edb", "score": "0.53721726", "text": "function concat_all_request( request_list, num)\r\n {\r\n var chaine = \" \";\r\n\r\n if(request_list[num][3] == null)\r\n {\r\n return request_list[num][2];\r\n }\r\n\r\n //return request_list[num][2];\r\n\r\n\r\n // Si les dépendances ne sont pas nulles, il faut rechercher dans la liste des\r\n // requêtes l'ensemble des éléments\r\n \t chaine += concat_one_request( request_list, num );\r\n\r\n \treturn chaine;\r\n\r\n }", "title": "" }, { "docid": "76ccab8ab390466ac877886801eed9a9", "score": "0.53673625", "text": "function requestTable() {\n\tdoRequestForData((boatList) => { \n\t\tcreateTable(boatList);\n\t\tgetAllRoutesForToday();\n\t},\n\t\"/client/boats\");\n}", "title": "" }, { "docid": "cc49fd35b7a295f187bd0d1867bcb398", "score": "0.53647405", "text": "list(req,res) {\n return Device\n .findAll({\n include: [{\n model: Item\n }],\n })\n .then(device => res.status(200).send(device))\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "d6a4ca230fb9cecbff137223b7e9ad6b", "score": "0.53574675", "text": "index(request, response) {\n RestfulTask.find({})\n //When we retrieve all the content we've requested, then send it back as a json response back to the client\n .then(tasks => response.json(tasks))\n //Instead of the above the platform style would have been passing in an object.\n //The key \"tasks\" would be an array of tasks\n //.then(resttasks => response.json({tasks: resttasks}));\n .catch(error => response.json(error));\n }", "title": "" }, { "docid": "d71347dbf6e095ce2b465e2416139eef", "score": "0.53539693", "text": "function list(req, res){\n res.status(200).json({data: orders});\n}", "title": "" }, { "docid": "ef702702a1a5ea3b8fcca86683db87d3", "score": "0.5353035", "text": "getFollowRequests(){\n\t\t// TODO: query from DB using ids\n\t\treturn this.followRequests;\n\t}", "title": "" }, { "docid": "ffc9d98a39104813fb28191cea08959a", "score": "0.53529537", "text": "function requestNewBatch(req,res, connection)\n\t{\n\t\tconsole.log('New Batch Create Requested');\n\t\t//first we see if the user already has an open batch\n\t\tshowOpenBatchesNew(req,res, connection);\n\t\treturn;\n\t}", "title": "" }, { "docid": "73e3f8dacd90981fa0a71840ee61f66e", "score": "0.535063", "text": "function processAll(response){\n console.log(response);\n console.log(getIds(response));\n \n}", "title": "" } ]
ac2f05b27bd80e75328ba39b513d9b44
helper method, returns true if a given case node is supported, false otherwise
[ { "docid": "5aea7c430e79152fa011d612470f258f", "score": "0.73559105", "text": "function isSupported(caseNode) {\n\n var ns = caseNode.attributes[\"required-namespace\"];\n if(!ns) {\n // the namespace was not specified, that should\n // never happen, we don't support it then\n console.log(\"Encountered a case statement with no required-namespace\");\n return false;\n }\n // all the xmlns that readium is known to support\n // TODO this is going to require maintenance\n var supportedNamespaces = [\"http://www.w3.org/1998/Math/MathML\"];\n return _.include(supportedNamespaces, ns);\n }", "title": "" } ]
[ { "docid": "74b0f65b8982e72ba1b53ad3c1a0088c", "score": "0.5767195", "text": "function isSwitchCaseEnder(stmt) {\n\t return n.BreakStatement.check(stmt)\n\t || n.ContinueStatement.check(stmt)\n\t || n.ReturnStatement.check(stmt)\n\t || n.ThrowStatement.check(stmt);\n\t}", "title": "" }, { "docid": "74b0f65b8982e72ba1b53ad3c1a0088c", "score": "0.5767195", "text": "function isSwitchCaseEnder(stmt) {\n\t return n.BreakStatement.check(stmt)\n\t || n.ContinueStatement.check(stmt)\n\t || n.ReturnStatement.check(stmt)\n\t || n.ThrowStatement.check(stmt);\n\t}", "title": "" }, { "docid": "369038d8c9b8336e75635862bddbc940", "score": "0.57251805", "text": "static isNode(val) {\n return val instanceof Node;\n }", "title": "" }, { "docid": "dc664912a7c231ac82ecac792e1c690b", "score": "0.5634336", "text": "isNode(val) {\n return val instanceof NodeParent\n }", "title": "" }, { "docid": "6e7359a2ff182f598cf5d1417c633ec1", "score": "0.560156", "text": "function acceptNode(telm) {\n //if(telm.outerHTML==undefined)return true;\n var t = telm.outerHTML.replace(telm.innerHTML, \"\");\n //console.log(\"ITS:\" + t);\n if (\n t.indexOf(\"noscript\") >= 0 || t.indexOf(\"textarea\") >= 0 || t.indexOf(\"ncgchover\") >= 0 || t.indexOf(\"ui-dialog\") >= 0 || t.indexOf(\"input\") >= 0 || t.indexOf(\"display:none\") >= 0 || t.indexOf(\"textbox\") >= 0 || t.indexOf(\"ncgchover\") >= 0 || t.indexOf(\"script\") >= 0 || t.indexOf(\"jGrowl\") >= 0 || (t.indexOf(\"style\") >= 0 && t.indexOf(\"style\") < 3)\n ) {\n return false;\n }\n return true;\n\n}", "title": "" }, { "docid": "ec3bcc96fa1336d7d414dfad475ccb6c", "score": "0.558113", "text": "function isNode(nodeImpl) {\n return Boolean(nodeImpl && \"nodeType\" in nodeImpl);\n}", "title": "" }, { "docid": "7e705567380bd8d987a44228ba79c70a", "score": "0.5480967", "text": "function processing__INSTRUCTION__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 7);\n}", "title": "" }, { "docid": "035874c3d35868361d0fba429aa153f6", "score": "0.5345328", "text": "_isCaseReady() {\n let caseNumber;\n for (const role of this._roles.values()) {\n caseNumber = caseNumber || role.currentCase;\n if (role.state !== RoleState.ready || caseNumber !== role\n .currentCase) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "a393a693dd1ebe2b7ff768b49d3ef4ca", "score": "0.53438604", "text": "isValidNode(node) {\n return this.validNodes.includes(node)\n }", "title": "" }, { "docid": "968cc096905109c8670176cf9c877956", "score": "0.5322987", "text": "function notation__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 12);\n}", "title": "" }, { "docid": "512a2484e934c85c4adaa00b212b994d", "score": "0.5314975", "text": "function isNode(obj) {\n return !!((typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string');\n }", "title": "" }, { "docid": "e6689a0a664368181a0499de45a4fa4a", "score": "0.53045803", "text": "function isNode(obj) {\n return !!((typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string');\n }", "title": "" }, { "docid": "c1fa5c9f42f9fad964b17372496c7055", "score": "0.52922505", "text": "matches(node, props) {\n return Element.isElement(node) && Element.matches(node, props) || Text.isText(node) && Text.matches(node, props);\n }", "title": "" }, { "docid": "7a4e4075baae99ae48f84499bfac612c", "score": "0.52901417", "text": "function isNode(node) {\r\n return node && node.nodeType && node.nodeName &&\r\n toString.call(node) === '[object Node]';\r\n }", "title": "" }, { "docid": "13688f10aa2b7f9a975e996cea2b9fd1", "score": "0.52881896", "text": "isNode(value) {\n return Text.isText(value) || Element.isElement(value) || Editor.isEditor(value);\n }", "title": "" }, { "docid": "13688f10aa2b7f9a975e996cea2b9fd1", "score": "0.52881896", "text": "isNode(value) {\n return Text.isText(value) || Element.isElement(value) || Editor.isEditor(value);\n }", "title": "" }, { "docid": "2f6ba373b8f8aa60b4b9832a58dc18d9", "score": "0.528782", "text": "function document__TYPE__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 10);\n}", "title": "" }, { "docid": "080ccf33df9e23b378309c309c9d5042", "score": "0.527056", "text": "function isUsableNode(node){\r\n\t\tvar tgN = node.tagName,\r\n\t\t\tinputNodeType, data, retVal;\r\n\t\t\t\r\n\t\tif(!node.dataset) node.dataset = {};\r\n\t\t\r\n\t\tdata = node.dataset;\r\n\t\t\r\n\t\tif(data && typeof data[CACHE_DATASET_STRING] !== \"undefined\")\r\n\t\t\tretVal = data[CACHE_DATASET_STRING] === \"true\";\r\n\t\t\r\n\t\telse if(isParent(node, null, [\"CodeMirror\", \"ace\"], 3))\r\n\t\t\tretVal = false;\r\n\t\t\r\n\t\telse if(tgN === \"TEXTAREA\" || isContentEditable(node))\r\n\t\t\tretVal = true;\r\n\t\t\r\n\t\telse if(tgN === \"INPUT\"){\r\n\t\t\tinputNodeType = node.getAttribute(\"type\");\r\n\t\t\tretVal = allowedInputElms.indexOf(inputNodeType) > -1;\r\n\t\t}\t\t\r\n\t\telse retVal = false;\r\n\t\t\r\n\t\tnode.dataset[CACHE_DATASET_STRING] = retVal;\r\n\t\t\r\n\t\treturn retVal;\r\n\t}", "title": "" }, { "docid": "ebe00c69b99139763d9b6d5b6047cd1a", "score": "0.5264581", "text": "function document__FRAGMENT__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 11);\n}", "title": "" }, { "docid": "6d297539693bbb7d9b4583980dbfc2b1", "score": "0.52527285", "text": "function entity__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 6);\n}", "title": "" }, { "docid": "889ab8dadda16ee9e4d7814273077035", "score": "0.52490306", "text": "function isNodeOneOf(elem,nodeTypeArray){if(nodeTypeArray.indexOf(elem.nodeName)!==-1){return true;}}", "title": "" }, { "docid": "457c4d7f4d9be5c69a39109bb1c24448", "score": "0.522512", "text": "function can_infect(node, worm)\n{\n \n if(worm == \"W32.BLASTER\")\n {\n if(node.intrusion_detect == \" true\")\n return false;\n else\n return true;\n }\n else if(worm == \"W32.BORM\")\n {\n if(node.software_uptodate == \" true\")\n return false;\n else\n return true;\n }\n else if(worm == \"W32.ILOVEYOU\")\n {\n if(node.social_eng == \" true\")\n return false;\n else\n return true;\n }\n else\n return true;\n}", "title": "" }, { "docid": "30b262569e222638e6eb20db9bd8db35", "score": "0.52241343", "text": "function evaluateCaseClause({ node, evaluate, environment, statementTraversalStack }, switchExpression) {\n const expressionResult = evaluate.expression(node.expression, environment, statementTraversalStack);\n // Stop immediately if the expression doesn't match the switch expression\n if (expressionResult !== switchExpression)\n return;\n for (const statement of node.statements) {\n evaluate.statement(statement, environment);\n // Check if a 'break', 'continue', or 'return' statement has been encountered, break the block\n if (pathInLexicalEnvironmentEquals(node, environment, true, BREAK_SYMBOL, CONTINUE_SYMBOL, RETURN_SYMBOL)) {\n break;\n }\n }\n}", "title": "" }, { "docid": "b4d2cf5ec115263b6812dbfb8d4ebc48", "score": "0.5216674", "text": "checkNodeEl(el) {\n return el.nodeType === 1;\n }", "title": "" }, { "docid": "fcc0c5e967bb9ea699a1e8a30bb16aff", "score": "0.52130127", "text": "detect(node) {\n\t\t// allow element nodes only\n\t\tif (node.nodeType !== 1) return false;\n\n\t\tthis.resolvable = node.hasAttribute(this.options.prefix + 'bind-' + this.name) ? node.getAttribute(this.options.prefix + 'bind-' + this.name) : undefined;\n\t\tthis.configurable = node.hasAttribute(this.options.prefix + 'config-' + this.name) ? node.getAttribute(this.options.prefix + 'config-' + this.name) : undefined;\n\t\tthis.alterable = node.hasAttribute(this.options.prefix + 'alter-' + this.name) ? node.getAttribute(this.options.prefix + 'alter-' + this.name) : undefined;\n\n\t\tif (!this.resolvable) return false;\n\n\t\tthis.node = node;\n\t\treturn true;\n\t}", "title": "" }, { "docid": "e19a449c35860f4b5412393899baf985", "score": "0.5207113", "text": "function hasContent($node) {\n\t\treturn false;\n\t}", "title": "" }, { "docid": "1be8d35cdfeadf50337d6e8c7e6151b4", "score": "0.52045876", "text": "isNode (obj) {\n return obj instanceof Node && (obj.constructor === Node || !(obj instanceof cc.Scene));\n }", "title": "" }, { "docid": "8a2a086022895464b1e40b6b6263c137", "score": "0.51709247", "text": "function match(node, ...types) {\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n if (node.type === type) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "add45a5266de051cf45d2609991e4f72", "score": "0.515354", "text": "static canInflect (node) {\n return true\n }", "title": "" }, { "docid": "add45a5266de051cf45d2609991e4f72", "score": "0.515354", "text": "static canInflect (node) {\n return true\n }", "title": "" }, { "docid": "2241485ff7a349e2c6969b67aebf43f8", "score": "0.51469994", "text": "static canInflect (node) {\n return false\n }", "title": "" }, { "docid": "2241485ff7a349e2c6969b67aebf43f8", "score": "0.51469994", "text": "static canInflect (node) {\n return false\n }", "title": "" }, { "docid": "2241485ff7a349e2c6969b67aebf43f8", "score": "0.51469994", "text": "static canInflect (node) {\n return false\n }", "title": "" }, { "docid": "2241485ff7a349e2c6969b67aebf43f8", "score": "0.51469994", "text": "static canInflect (node) {\n return false\n }", "title": "" }, { "docid": "427b17985e34a9ae81e6c161618377e7", "score": "0.5138401", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "1f3226b9d4a835bb6c08d5e494a6994d", "score": "0.51334417", "text": "function document__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 9);\n}", "title": "" }, { "docid": "71559fa87637b94df5dd7a6fe42c9b8b", "score": "0.51121986", "text": "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "title": "" }, { "docid": "d0eeff0b45f296743e4465fe005c9d1b", "score": "0.51067287", "text": "function entity__REFERENCE__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 5);\n}", "title": "" }, { "docid": "f7e2376c29e3d662de8b199f9b13e0ea", "score": "0.51020664", "text": "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "title": "" }, { "docid": "781a60a86dc2e42b20f75e60eb31d0e3", "score": "0.5101735", "text": "function testElement(options, node) {\n const test = compileTest(options);\n return test ? test(node) : true;\n}", "title": "" }, { "docid": "d3dcbef5de7a3a1b4fd6331113153e91", "score": "0.5098764", "text": "function _isNode(o){\n return (\n typeof Node === \"object\" ? o instanceof Node : \n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName===\"string\"\n );\n }", "title": "" }, { "docid": "c59e88149ba1ee1a7fb1070c0da47324", "score": "0.50867313", "text": "function hasTemplateContent(node) {\n\n // Check the param state\n if ((node == undefined) || (node == null) || (node == '') || (node.children == undefined) || (node.children.length == 0))\n return false;\n\n // Loop over the children\n for (var i = 0; i < node.children.length; i++) {\n\n // Establish the name\n var name = getNodeName(node.children[i]);\n\n // Check the node name\n if ((name == \"IF\") ||\n (name == \"ELSEIF\") ||\n (name == \"ELSE\") ||\n (name == \"FOR\") ||\n (name == \"WITH\"))\n return true;\n\n if (hasTemplateContent(node.children[i]) == true)\n return true;\n\n }\n\n // Return\n return false;\n\n }", "title": "" }, { "docid": "c14f783eab90404784ffec20ca1ffb8b", "score": "0.5084128", "text": "isCase() {\n return this.contributions.resourcetype === \"CaseView\";\n }", "title": "" }, { "docid": "3580f2cdfde23574e6e110d1fd6de7ed", "score": "0.5083274", "text": "test(pos, entity, tags, zoom) {\n\t\t// summary:\t\tTest a rule chain by running all the tests in reverse order.\n\t\tif (this.rules.length === 0) { return true; } // orig: { return false; } // todo: wildcard selector \"*\" semms broken... \n\t\tif (pos===-1) { pos=this.rules.length-1; }\n\n\t\tvar r = this.rules[pos];\n\t\tif (!r.test(entity, tags, zoom)) { return false; }\n\t\tif (pos === 0) { return true; }\n\n\t\tvar o = entity.getParentObjects();//TODO//entity.entity.parentObjects();\n\t\tfor (var i = 0; i < o.length; i++) {\n\t\t\tvar p=o[i];\n\t\t\tif (this.test(pos-1, p, p.tags, zoom)) { return true; }\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "60dc1faa9652372374dda73e4f561bd1", "score": "0.50736046", "text": "function checkIfSpecialCase() {\n var vreturn = false;\n $.each( specialCases, function(index, spec){\n if(isFunction(spec.url)){\n if(spec.url()) {\n vreturn = spec;\n console.log(\"spec.url is \", spec);\n }\n return false; // break out of each loop\n } else if(window.location.host.search(spec.url) != -1){\n // We have a special case!\n vreturn = spec;\n return false; // break out of each loop\n }\n });\n return vreturn;\n }", "title": "" }, { "docid": "4d28183fa936534b368b9cd27829cd7e", "score": "0.50357884", "text": "function element__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 1);\n}", "title": "" }, { "docid": "973110cde14e18e4089847b9e6812c58", "score": "0.5015773", "text": "matches(node, props) {\n return Element.isElement(node) && Element.isElementProps(props) && Element.matches(node, props) || Text.isText(node) && Text.isTextProps(props) && Text.matches(node, props);\n }", "title": "" }, { "docid": "a716b757bf95614e050c90d4c83a3628", "score": "0.50092375", "text": "function isNode(o){\n\t\t\treturn (\n\t\t\t\ttypeof Node === \"object\" ? o instanceof Node : \n\t\t\t\to && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName===\"string\"\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "80da69e412d59daef8b7d23a24cf4a11", "score": "0.49948898", "text": "function cdata__SECTION__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 4);\n}", "title": "" }, { "docid": "59b27a47c973c8f1f0530a4a3055a34c", "score": "0.4993639", "text": "function isSupportedEl( e ) {\n\n return isSupportedBlockEl( e ) || isSupportedInlineEl( e );\n\n }", "title": "" }, { "docid": "3daa0272576961ddf6d660bef82c8dee", "score": "0.4988048", "text": "function isNodeLike(obj) {\n return obj && (obj.nodeType === 1 || obj.nodeType === 9);\n }", "title": "" }, { "docid": "09ebdee006d8d6bffa7d7bdcebe6c992", "score": "0.49855775", "text": "function attribute__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 2);\n}", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.49836263", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.49836263", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.49836263", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.49836263", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "b52f0cba9633c16d7037c428db5dfabc", "score": "0.49618712", "text": "function validateNode(node) {\n return [\n node.type === \"Literal\" && typeof node.value === \"string\"\n ];\n}", "title": "" }, { "docid": "c0f90866564d679c546710eccc73060b", "score": "0.49617708", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n \n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n \n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n \n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "b04eb5b8746b6315ed01b100ed170ac0", "score": "0.4955723", "text": "function isNode(o){\n return (\n typeof Node === \"object\" ? o instanceof Node : \n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName===\"string\"\n );\n}", "title": "" }, { "docid": "4b3b935678d4b5070e4aab6fe10a0549", "score": "0.49519217", "text": "function text__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 3);\n}", "title": "" }, { "docid": "e84bab47277d64398daddfdb27d763ea", "score": "0.49491027", "text": "function canPlayNode(node) {\n return true;\n }", "title": "" }, { "docid": "2fecfa75b456cb92ba41d5189c5add69", "score": "0.49341258", "text": "function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }", "title": "" }, { "docid": "2fecfa75b456cb92ba41d5189c5add69", "score": "0.49341258", "text": "function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }", "title": "" }, { "docid": "2fecfa75b456cb92ba41d5189c5add69", "score": "0.49341258", "text": "function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }", "title": "" }, { "docid": "2fecfa75b456cb92ba41d5189c5add69", "score": "0.49341258", "text": "function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }", "title": "" }, { "docid": "080a5e424eb3e4c8d31f0e3a38356af9", "score": "0.49297312", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement;\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return delegate.createSwitchCase(test, consequent);\n }", "title": "" }, { "docid": "080a5e424eb3e4c8d31f0e3a38356af9", "score": "0.49297312", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement;\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return delegate.createSwitchCase(test, consequent);\n }", "title": "" }, { "docid": "b0c308ebe276f5912aea62c4a90b1ab4", "score": "0.49214253", "text": "function isNode(source){\n if (window.Node) {\n return source instanceof Node;\n }\n else {\n // the document is a special Node and doesn't have many of\n // the common properties so we use an identity check instead.\n if (source === document) \n return true;\n return (typeof source.nodeType === 'number' &&\n source.attributes &&\n source.childNodes &&\n source.cloneNode);\n }\n }", "title": "" }, { "docid": "93763b3f7f4de92782bfea4c4af6c497", "score": "0.49153042", "text": "function comment__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 8);\n}", "title": "" }, { "docid": "ae954b27c158b1e9dc29798dcb8cab61", "score": "0.49023125", "text": "function isEditMode(mode) {\r\n // Mutliple edit modes should not be on simultaenously\r\n if (mode == \"any\" && (addChildToggleSwitch.checked || \r\n addLinkToggleSwitch.checked || \r\n removeLinkToggleSwitch.checked || \r\n highlightNextPathToggleSwitch.checked ||\r\n removeNodeToggleSwitch.checked || \r\n editNodeToggleSwitch.checked)) {\r\n return true;\r\n } // Below states are ordered by their least destructive nature \r\n else if (mode == \"highlightPath\" && highlightNextPathToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"editNode\" && editNodeToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"addChild\" && addChildToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"addLink\" && addLinkToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"removeLink\" && removeLinkToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"removeNode\" && removeNodeToggleSwitch.checked) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "072127f31034c0cc488132d9ffba53f9", "score": "0.48972827", "text": "isNodeOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_node');\n }", "title": "" }, { "docid": "072127f31034c0cc488132d9ffba53f9", "score": "0.48972827", "text": "isNodeOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_node');\n }", "title": "" }, { "docid": "99bedd8f584f72b56184475306a15feb", "score": "0.48969278", "text": "function tryClassifyNode(node) {\n if (ts.isJSDocTag(node)) {\n return true;\n }\n if (ts.nodeIsMissing(node)) {\n return true;\n }\n var classifiedElementName = tryClassifyJsxElementName(node);\n if (!ts.isToken(node) && node.kind !== 244 /* JsxText */ && classifiedElementName === undefined) {\n return false;\n }\n var tokenStart = node.kind === 244 /* JsxText */ ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);\n var tokenWidth = node.end - tokenStart;\n ts.Debug.assert(tokenWidth >= 0);\n if (tokenWidth > 0) {\n var type = classifiedElementName || classifyTokenType(node.kind, node);\n if (type) {\n pushClassification(tokenStart, tokenWidth, type);\n }\n }\n return true;\n }", "title": "" }, { "docid": "6bb8b748216373473c4cbbba35de6f01", "score": "0.48925206", "text": "function mayWorkFor(node1, node2) {\n if (!(node1 instanceof go.Node)) return false; // must be a Node\n if (node1 === node2) return false; // cannot work for yourself\n if (node2.isInTreeOf(node1)) return false; // cannot work for someone who works for you\n return true;\n }", "title": "" }, { "docid": "31cebcf6bde2c54d1a8ab60fe3ef669c", "score": "0.48912647", "text": "_isValidContext() {\n const isNode = (typeof process !== 'undefined')\n && (typeof process.release !== 'undefined')\n && (process.release.name === 'node');\n return isNode;\n }", "title": "" }, { "docid": "5de4a02a334868b48c1063342c5ffac4", "score": "0.4871557", "text": "check_if_passed() {\n const passed = this.node.value === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "title": "" }, { "docid": "6a8f996f8adec09e8caf50052b8c20b0", "score": "0.48690054", "text": "function canUse(mode, type) {\n\t // Check for required functions\n\t switch (mode) {\n\t case 'svg-box':\n\t case 'svg-raw':\n\t case 'svg-uri':\n\t if (!iconify.Iconify.renderHTML) {\n\t return false;\n\t }\n\t }\n\t // Check type\n\t switch (type) {\n\t case 'raw':\n\t return config[type];\n\t case 'api':\n\t return config.api !== void 0;\n\t case 'npm':\n\t return config.npmES !== void 0 || config.npmCJS !== void 0;\n\t }\n\t }", "title": "" }, { "docid": "40921267150a28396e207f033e4954e8", "score": "0.48674494", "text": "function validateStructure(el) {\n const html_tag = el.tagName;\n const parent = el.parentElement;\n switch (html_tag) {\n case 'QUESTION':\n return parentHasToBe(el, parent, \"QUESTIONNAIRE\");\n case 'SOLUTION':\n case 'DISTRACTOR':\n return parentHasToBe(el, parent, \"QUESTION\");\n case 'EXPLANATION':\n return parentHasToBe(el, parent, \"SOLUTION\", \"DISTRACTOR\");\n default:\n console.log('html_tag to check was no question, solution, distractor or explanation');\n return true;\n }\n}", "title": "" }, { "docid": "f42ee40f6214c9438a11545112999b55", "score": "0.48596752", "text": "function parseSwitchCase() {\n\t var test, consequent = [], statement, node = new Node();\n\n\t if (matchKeyword('default')) {\n\t lex();\n\t test = null;\n\t } else {\n\t expectKeyword('case');\n\t test = parseExpression();\n\t }\n\t expect(':');\n\n\t while (startIndex < length) {\n\t if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n\t break;\n\t }\n\t statement = parseStatementListItem();\n\t consequent.push(statement);\n\t }\n\n\t return node.finishSwitchCase(test, consequent);\n\t }", "title": "" }, { "docid": "87928d38fc91f9e63d4bc6b9201ffb2a", "score": "0.48479393", "text": "function detectElement(tags) {\n\n var resultdetect = false, $node = getSelectedNode(), parentsTag;\n\n if ($node) {\n $.each(tags, function (i, val) {\n parentsTag = $node.prop('tagName').toLowerCase();\n\n if (parentsTag == val)\n resultdetect = true;\n else {\n $node.parents().each(function () {\n parentsTag = $(this).prop('tagName').toLowerCase();\n if (parentsTag == val)\n resultdetect = true;\n });\n }\n });\n\n return resultdetect;\n }\n else\n return false;\n }", "title": "" }, { "docid": "5d8faf5b70c4ebd79729fa7b672f9a22", "score": "0.48446068", "text": "function parseSwitchCase()\n\t\t{\n\t\t\tvar test, consequent = [], statement, node = new Node();\n\t\t\tif (matchKeyword('default'))\n\t\t\t{\n\t\t\t\tlex();\n\t\t\t\ttest = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texpectKeyword('case');\n\t\t\t\ttest = parseExpression();\n\t\t\t}\n\t\t\texpect(':');\n\t\t\twhile (index < length)\n\t\t\t{\n\t\t\t\tif (match('}') || matchKeyword('default') || matchKeyword('case'))\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tstatement = parseStatement();\n\t\t\t\tconsequent.push(statement);\n\t\t\t}\n\t\t\treturn node.finishSwitchCase(test, consequent);\n\t\t}", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "60187ef233b908590e2a2a142054e8ac", "score": "0.48437756", "text": "function parseSwitchCase() {\n var test,\n consequent = [],\n sourceElement,\n marker = markerCreate();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n consequent.push(sourceElement);\n }\n\n return markerApply(marker, delegate.createSwitchCase(test, consequent));\n }", "title": "" }, { "docid": "1f6fa2048f8e4a0514f61dfe09fdad0e", "score": "0.48399812", "text": "function shouldRenderNode(curNode, stringToSearchFor) {\n if (!isValidSearchActive(stringToSearchFor)){\n return true;\n }\n\n return nodeOrChildrenMatchSearch(curNode, stringToSearchFor);\n }", "title": "" }, { "docid": "c94a279fa17bcc4a2cdb394f7ce4d375", "score": "0.48374736", "text": "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "title": "" }, { "docid": "c9a6be6da3b8dd8df8b8dd0d3c55c8b8", "score": "0.48302594", "text": "function isNode(o) {\n return (typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\");\n }", "title": "" }, { "docid": "733c860496a2a0f53d6aa882b157d3f0", "score": "0.48145318", "text": "function parseSwitchCase() {\n var test, consequent = [], statement, node = new Node();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return node.finishSwitchCase(test, consequent);\n }", "title": "" }, { "docid": "382f5043c5be0fd89de0af8c67747d9f", "score": "0.48109525", "text": "function canConvert (input) {\n return (\n input != null && (\n typeof input === 'string' ||\n input.nodeType && (\n input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11\n )\n )\n )\n}", "title": "" }, { "docid": "9897b7cf8eae93dd05182b8fe3a38573", "score": "0.48095182", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n }", "title": "" }, { "docid": "7493e79f16e752c07d7450ecc49731ad", "score": "0.48030353", "text": "function is(node, flag) {\n\t return t.isLiteral(node) && node.regex && node.regex.flags.indexOf(flag) >= 0;\n\t}", "title": "" }, { "docid": "7493e79f16e752c07d7450ecc49731ad", "score": "0.48030353", "text": "function is(node, flag) {\n\t return t.isLiteral(node) && node.regex && node.regex.flags.indexOf(flag) >= 0;\n\t}", "title": "" }, { "docid": "240c32da2b949bbb904c29565050b03e", "score": "0.4798983", "text": "function valid(data, options) {\n if (options === void 0) { options = { lowerCaseTagName: false, comment: false }; }\n var stack = html_1.base_parse(data, options);\n return Boolean(stack.length === 1);\n}", "title": "" }, { "docid": "4dc7adbc01951729d60173b5e20a6399", "score": "0.4794527", "text": "function parseSwitchCase() {\n var test, consequent = [], statement, node = new Node();\n\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (startIndex < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatementListItem();\n consequent.push(statement);\n }\n\n return node.finishSwitchCase(test, consequent);\n }", "title": "" }, { "docid": "dd96898c61b2a113912b19f7f10b4a71", "score": "0.4788521", "text": "function isTagOfNode(tag) {\n //'this' is set by the second parameter that calls this function.\n //God knows why. In this case it will be an node that we're creating.\n return this.node_ID == tag.node_ID;\n}", "title": "" }, { "docid": "0d24f1b127e35d1f70c85d1c73a213e5", "score": "0.47790262", "text": "function isNode(o) {\n return (\n typeof Node === 'object' ? o instanceof Node :\n o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string'\n );\n }", "title": "" } ]
30d168f3739f0144de8cd8709a804c86
para uniformizar las medidas utilizadas en las condiciones de choque
[ { "docid": "388b398e1f3f4632ad7bd9db002ee692", "score": "0.0", "text": "setBorders(object) {\n let upperLimit, lowerLimit, leftLimit, rightLimit;\n\n // if( object instanceof Shots || object instanceof EnemyShots){\n if (object instanceof SuperShots) {\n upperLimit = object.pos.y - object.radius\n lowerLimit = object.pos.y + object.radius\n leftLimit = object.pos.x - object.radius\n rightLimit = object.pos.x + + object.radius\n } else {\n upperLimit = object.pos.y\n lowerLimit = object.pos.y + object.size.h\n leftLimit = object.pos.x\n rightLimit = object.pos.x + object.size.w\n }\n // return upperLimit\n return [upperLimit, lowerLimit, leftLimit, rightLimit]\n }", "title": "" } ]
[ { "docid": "e7f0b2f79b491713973439017eb3d876", "score": "0.61242914", "text": "function generarMeses() {\n // Generar listado de meses (1-48) \n let result = []; \n for (let mes = 1; mes < 49; mes++) {\n result.push(\n <option value={mes} key={mes}>{mes}</option>\n ) \n }\n setMes(result) \n }", "title": "" }, { "docid": "818262fb0569e9cc48e1e15ae93f8732", "score": "0.572646", "text": "function MetaCaixaInit() {\n // S'executa al carregar-se la pàgina, si hi ha metacaixes,\n // s'assignen els esdeveniments als botons\n //alert(\"MetaCaixaInit\");\n var i = 0 // Inicialitzem comptador de caixes\n for (i = 0; i <= 9; i++) {\n var vMc = document.getElementById(\"mc\" + i);\n if (!vMc) break;\n //alert(\"MetaCaixaInit, trobada Metacaixa mc\"+i);\n var j = 1 // Inicialitzem comptador de botons dins de la caixa\n var vPsIni = 0 // Pestanya visible inicial\n for (j = 1; j <= 9; j++) {\n var vBt = document.getElementById(\"mc\" + i + \"bt\" + j);\n if (!vBt) break;\n //alert(\"MetaCaixaInit, trobat botó mc\"+i+\"bt\"+j);\n vBt.onclick = MetaCaixaMostraPestanya; // A cada botó assignem l'esdeveniment onclick\n //alert (vBt.className);\n if (vBt.className == \"mcBotoSel\") vPsIni = j; // Si tenim un botó seleccionat, en guardem l'index\n }\n //alert (\"mc=\"+i+\", ps=\"+j+\", psini=\"+vPsIni );\n if (vPsIni == 0) { // Si no tenim cap botó seleccionat, n'agafem un aleatòriament\n vPsIni = 1 + Math.floor((j - 1) * Math.random());\n //alert (\"Activant Pestanya a l'atzar; _mc\"+i+\"bt\"+vPsIni +\"_\");\n document.getElementById(\"mc\" + i + \"ps\" + vPsIni).style.display = \"block\";\n document.getElementById(\"mc\" + i + \"ps\" + vPsIni).style.visibility = \"visible\";\n document.getElementById(\"mc\" + i + \"bt\" + vPsIni).className = \"mcBotoSel\";\n }\n }\n }", "title": "" }, { "docid": "e1fc2eedcc20790ddf25f06eee6d2f7f", "score": "0.5722591", "text": "function dcInicia(){\r\n preguntas = [\r\n 'Que actor dio vida a Superman por primera vez?',\r\n 'Cual es el nombre de la mama de la Mujer Maravilla?',\r\n 'Cuantos actores han dado vida al jocker en el cine?'\r\n ];\r\n respuestas = [\r\n 'George Reeves',\r\n 'Christopher Reeve',\r\n 'Kirk Alyn',\r\n 'Keanu Reeves',\r\n 'Hippolyta',\r\n 'Antiope',\r\n 'Amazona',\r\n 'Themyscira',\r\n '2',\r\n '4',\r\n '3',\r\n '5'\r\n ];\r\n resultadoReal =[\r\n '3',\r\n '1',\r\n '2'\r\n ]; \r\n siguientePregunta(mensajePregunta1, respuesta11, respuesta12, respuesta13, respuesta14, pantalla2);\r\n}", "title": "" }, { "docid": "c683a63ce600656551497f8f178c4330", "score": "0.56675875", "text": "display(cle=\"sample\"){\n this.initialize();\n document.getElementById(\"param-title-act\").innerHTML = this.id;\n // affichages\n document.getElementById('activityTitle').innerHTML = this.title;\n if(this.speech){\n MM.audioSamples = [];\n document.getElementById(\"voix\").classList.remove(\"hidden\")\n if(this.audioRead){\n MM.setAudio(1);\n } else{\n MM.setAudio(0);\n }\n } else {\n document.getElementById(\"voix\").classList.add(\"hidden\")\n this.audioRead = false;\n MM.setAudio(0);\n }\n if(this.description)\n document.getElementById('activityDescription').innerHTML = this.description;\n else\n document.getElementById('activityDescription').innerHTML = \"\";\n // affichage d'exemple(s)\n let examples = document.getElementById('activityOptions');\n examples.innerHTML = \"\";\n MM.setSeed(cle);\n if(this.options !== undefined && this.options.length > 0){\n let colors = ['',' red',' orange',' blue', ' green', ' grey',];\n // Ajout de la possibilité de tout cocher ou pas\n let p = utils.create(\"span\",{className:\"bold\"});\n let hr = utils.create(\"hr\");\n let input = utils.create(\"input\",{type:\"checkbox\",id:\"checkalloptions\",className:\"checkbox blue\",id:\"chckallopt\"})\n //input.setAttribute(\"onclick\",\"MM.editedActivity.setOption('all',this.checked)\");\n p.appendChild(input);\n p.appendChild(document.createTextNode(\" Tout (dé)sélectionner\"));\n examples.appendChild(p);\n examples.appendChild(hr);\n let optionsLen = 0;\n // affichage des options\n for(let i=0;i<this.options.length;i++){\n this.generate(1,i,false);// génère un cas par option (si plusieurs)\n if(this.audios.length>0){\n for(let audio of this.audios){\n if(audio)\n MM.audioSamples.push(audio)\n }\n }\n let p = utils.create(\"span\");\n let input = utils.create(\"input\",{id:\"o\"+i,type:\"checkbox\",value:i,defaultChecked:(this.chosenOptions.indexOf(i)>-1)?true:false,className:\"checkbox\"+colors[i%colors.length]});\n p.appendChild(input);\n p.innerHTML += \" \"+this.options[i][\"name\"] + \" :\";\n let ul = document.createElement(\"ul\");\n if(Array.isArray(this.questions[0])){\n if(this.figures[0]){\n let div = utils.create(\"div\");\n this.examplesFigs[i] = new Figure(utils.clone(this.figures[0]), \"fig-ex\"+i, div);\n p.appendChild(div);\n }\n for(let jj=0; jj<this.questions[0].length;jj++){\n optionsLen++;\n let li = utils.create(\"li\",{className:\"tooltip\"});\n let checked = \"\";\n if(this.chosenQuestions[i]){\n if(this.chosenQuestions[i].indexOf(jj)>-1)\n checked = \"checked\";\n }\n li.innerHTML = \"<input class='checkbox\"+colors[i%colors.length]+\"' type='checkbox' id='o\"+i+\"-\"+jj+\"' value='\"+i+\"-\"+jj+\"'\"+checked+\"> \"+this.setMath(this.questions[0][jj]);\n // answer\n let span = utils.create(\"span\",{className:\"tooltiptext\"});\n if(Array.isArray(this.answers[0]))\n span.innerHTML = this.setMath(String(this.answers[0][jj]).replace(this.questions[0],this.questions[0][jj]));\n else {\n span.innerHTML = this.setMath(String(this.answers[0]).replace(this.questions[0],this.questions[0][jj]));\n }\n li.appendChild(span);\n ul.appendChild(li);\n }\n } else {\n optionsLen++;\n let li = utils.create(\"li\",{className:\"tooltip\",innerHTML:this.setMath(this.questions[0])});\n if(this.figures[0]){\n this.examplesFigs[i] = new Figure(utils.clone(this.figures[0]), \"fig-ex\"+i, li);\n }\n let span = utils.create(\"span\",{className:\"tooltiptext\"});\n if(Array.isArray(this.answers[0]))\n span.innerHTML = this.setMath(this.answers[0][0]);\n else\n span.innerHTML = this.setMath(this.answers[0]);\n li.appendChild(span);\n ul.appendChild(li);\n }\n p.appendChild(ul);\n examples.appendChild(p);\n }\n // si plus de 3 options/sous-options, 2 colonnes seulement si panier non affiché.\n if(optionsLen>3 && document.getElementById(\"phantom\").className===\"\"){\n utils.addClass(document.getElementById(\"divparams\"),\"colsx2\");\n }\n } else {\n // no option\n this.generate(1);\n if(this.audios.length>0){\n for(let audio of this.audios){\n if(audio)\n MM.audioSamples.push(audio)\n }\n }\n let p = document.createElement(\"span\");\n let ul = document.createElement(\"ul\");\n if(Array.isArray(this.questions[0])){\n for(let jj=0; jj<this.questions[0].length;jj++){\n let li = document.createElement(\"li\");\n li.className = \"tooltip\";\n li.innerHTML = \"<input type='checkbox' class='checkbox' value='\"+jj+\"' onclick='MM.editedActivity.setQuestionType(this.value, this.checked);' ><span class='math'>\"+this.questions[0][jj]+\"</span>\";\n let span = document.createElement(\"span\");\n span.className = \"tooltiptext\";\n if(Array.isArray(this.answers[0]))\n span.innerHTML = this.setMath(this.answers[0][jj].replace(this.questions[0],this.questions[0][jj]));\n else {\n span.innerHTML = this.setMath(this.answers[0].replace(this.questions[0],this.questions[0][jj]));\n }\n li.appendChild(span);\n ul.appendChild(li);\n }\n } else {\n let li = document.createElement(\"li\");\n li.className = \"tooltip\";\n li.innerHTML = this.setMath(this.questions[0]);\n if(this.figures[0]){\n this.examplesFigs[0] = new Figure(utils.clone(this.figures[0]), \"fig-ex\"+0, li);\n }\n let span = document.createElement(\"span\");\n span.className = \"tooltiptext\";\n span.innerHTML = this.setMath(this.answers[0]);\n li.appendChild(span);\n ul.appendChild(li);\n }\n p.appendChild(ul);\n /*let p1 = document.createElement(\"p\"); // affiche la réponse\n p1.innerHTML = this.setMath(this.answers[0]);\n p.appendChild(p1);*/\n // display answer\n examples.appendChild(p);\n }\n if(!utils.isEmpty(this.examplesFigs)){\n // it has to take his time... \n setTimeout(()=>{\n for(let i in this.examplesFigs){\n this.examplesFigs[i].display();\n }\n }, 300);\n }\n utils.mathRender();\n }", "title": "" }, { "docid": "95821fcdc36dc3c03a0987a7e510949c", "score": "0.56294775", "text": "function mostrarCampeonesOrdenadosAlfabeticamente() {\n let ordenSeleccionado = filtrarAlfabeticamente.selectedIndex;\n const campeonesOrdenados = ordenandoAlfabeticamente(ordenSeleccionado, arrayAllChampions);\n imprimiendoCampeones(campeonesOrdenados);\n}", "title": "" }, { "docid": "6cd10e1a0e1b22c6a9e59445b670100b", "score": "0.5573914", "text": "inizializzaMatriceA() {\n if (this.tipoCampo == 'casuale')\n {\n // colora un po' di celle a casaccio\n this.inizializzaMatriceAACaso();\n }\n else if (this.tipoCampo == 'alianti')\n {\n // prepara un campo di alianti\n this.inizializzaMatriceAConAlianti();\n }\n else if (this.tipoCampo == 'astronavi')\n {\n // prepara un campo di astronavi leggere\n this.inizializzaMatriceAConAstronavi();\n }\n else if (this.tipoCampo == 'oscillatori')\n {\n // prepara un campo con oscillatori\n this.inizializzaMatriceAConOscillatori();\n }\n }", "title": "" }, { "docid": "035f940b35d6797a04e03103bc12afbe", "score": "0.5558571", "text": "function dibujarProcesarMuestra(){\n if(niveles[2] === 1){\n \n dibujarFondoTexto(50, 50, 900, 550, '#9254C4', 1 );\n dibujarFondoTexto(50, 50, 900, 100, '#640AAA', 1 );\n\n dibujarTexto(textoNivel3[4].txt,80, 90, 'white', fuente, 0, 0, 0);\n dibujarTexto(textoNivel3[5].txt,80, 110, 'white', fuente, 0, 0, 0);\n\n dibujarTexto(textoNivel3[1].txt,80, 180, 'black', subtitulo, 0, 0, 0);\n dibujarTexto(textoNivel3[1].a,150, 220, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[1].b,150, 260, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[1].c,150, 300, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[1].d,150, 340, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[1].e,150, 380, 'black', tuboinc, 0, 0, 0);\n\n dibujarTexto(textoNivel3[2].txt,380, 180, 'black', subtitulo, 0, 0, 0);\n dibujarTexto(textoNivel3[2].a,380, 220, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[2].b,380, 260, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[2].c,380, 300, 'black', tuboinc, 0, 0, 0);\n\n dibujarTexto(textoNivel3[3].txt,760, 180, 'black', subtitulo, 0, 0, 0);\n dibujarTexto(textoNivel3[3].a,760, 220, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[3].b,760, 260, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[3].c,760, 300, 'black', tuboinc, 0, 0, 0);\n dibujarTexto(textoNivel3[3].d,760, 340, 'black', tuboinc, 0, 0, 0);\n \n if ((textoNivel3[6].c1) && (textoNivel3[6].c2) && (textoNivel3[6].c3)){\n dibujarTexto('Continuar',760, 550, 'white', tuboinc, 4, 4, 5);\n\n if(mascaraClick(760, 530, 90, 30, 0.0)){\n niveles[2] = 2; // termino el nivel 2, no se muestra el texto\n }\n }\n \n verificarInclinacion();\n verificarTemperatura();\n verificarTiempo();\n ctx.drawImage(imgTuboSangre, objetoTuboSangre.x, objetoTuboSangre.y - 130, objetoTuboSangre.width + 15, objetoTuboSangre.height + 70);\n\n\n }\n\n function verificarTiempo(){\n if (mascaraClick(760, 200, 100, 30, 0.0)){\n incorrecto(730, 220);\n textoNivel3[6].c3 = false;\n }\n if (mascaraClick(760, 240, 100, 30, 0.0) && (tiempo === false)){\n tiempo = true;\n textoNivel3[6].c3 = false;\n }\n if (tiempo){\n correcto(740, 253);\n textoNivel3[6].c3 = true; }\n\n if (mascaraClick(760, 280, 100, 30, 0.0)){\n incorrecto(730, 300);\n textoNivel3[6].c3 = false;\n }\n if (mascaraClick(760, 320, 100, 30, 0.0)){\n incorrecto(730, 340);\n textoNivel3[6].c3 = false;\n }\n\n }\n function verificarTemperatura(){\n if (mascaraClick(380, 200, 250, 30, 0.0) && (inclinacion === false)){\n inclinacion = true;\n textoNivel3[6].c2 = true;\n }\n if (inclinacion){correcto(360, 214);}\n\n if (mascaraClick(380, 240, 250, 30, 0.0)){\n incorrecto(355, 260);\n textoNivel3[6].c2 = false;\n }\n if (mascaraClick(380, 280, 250, 30, 0.0)){\n incorrecto(355, 300);\n textoNivel3[6].c2 = false;\n }\n \n }\n\n function verificarInclinacion(){\n if (mascaraClick(150, 200, 50, 30, 0.0)){\n incorrecto(125 , 220);\n textoNivel3[6].c1 = false;\n }\n if (mascaraClick(150, 240, 50, 30, 0.0)){\n incorrecto(125, 260);\n textoNivel3[6].c1 = false;\n }\n if (mascaraClick(150, 280, 50, 30, 0.0) && (verde === false)){\n verde = true;\n textoNivel3[6].c1 = true;\n }\n if (verde){correcto(130, 293);}\n\n if (mascaraClick(150, 320, 50, 30, 0.0)){\n incorrecto(125, 340);\n textoNivel3[6].c1 = false;\n }\n if (mascaraClick(150, 360, 50, 30, 0.0)){\n incorrecto(125, 380);\n textoNivel3[6].c1 = false;\n }\n }\n}", "title": "" }, { "docid": "eab8e383610085724725a00386360867", "score": "0.5547632", "text": "function muoviMotore(velocitaImpostata,direzione,motore){\n\tvar esito ={};\n var velocitaFisicaImpostataSX,velocitaFisicaImpostataDX,direzioneSX,direzioneDX;\n\tif(REGISTRAZIONE){\n\t\tregistraAzioniCarro(motore,velocitaImpostata,direzione);\n\t}\n\tif(direzione=='AVANTI'){\n\t\tif(motore=='SX'){\n\t\t\tMOTORE_SX_FORWARD.pwmWrite(velocitaImpostata); \t\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_FORWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_FORWARD.getPwmDutyCycle();\t\n\t\t\tdirezioneSX=direzione;\n\t\t}else if(motore=='DX'){\n\t\t\tMOTORE_DX_FORWARD.pwmWrite(velocitaImpostata); \t\t\t\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_FORWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_FORWARD.getPwmDutyCycle();\t\t\t\t\t\t\n\t\t}else if(motore=='DRITTO'){\n\t\t\tMOTORE_SX_FORWARD.pwmWrite(velocitaImpostata); \t\n\t\t\tMOTORE_DX_FORWARD.pwmWrite(velocitaImpostata); \t\t\t\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_FORWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_FORWARD.getPwmDutyCycle();\t\t\t\n\t\t}\n\t}else if(direzione=='INDIETRO'){\n\t\tif(motore=='SX'){\n\t\t\tMOTORE_SX_BACKWARD.pwmWrite(velocitaImpostata);\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_BACKWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_BACKWARD.getPwmDutyCycle();\t\t\t\t\t\n\t\t}else if(motore=='DX'){\n\t\t\tMOTORE_DX_BACKWARD.pwmWrite(velocitaImpostata);\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_BACKWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_BACKWARD.getPwmDutyCycle();\t\t\t\t\t\n\t\t}else if(motore=='DRITTO'){\n\t\t\tMOTORE_SX_BACKWARD.pwmWrite(velocitaImpostata);\n\t\t\tMOTORE_DX_BACKWARD.pwmWrite(velocitaImpostata);\n\t\t\tvelocitaFisicaImpostataSX=MOTORE_SX_BACKWARD.getPwmDutyCycle();\n\t\t\tvelocitaFisicaImpostataDX=MOTORE_DX_BACKWARD.getPwmDutyCycle();\t\t\n\t\t}\t\n\t}\n\tesito.stepManetta=DELTA_VELOCITA;\n\tesito.velocitaFisicaMotoreSX=velocitaFisicaImpostataSX;\n\tesito.velocitaFisicaMotoreDX=velocitaFisicaImpostataDX;\t \n\tesito.direzioneMotoreSX = ultimaDirezioneSX;\n\tesito.direzioneMotoreDX = ultimaDirezioneDX;\n\treturn esito;\n}", "title": "" }, { "docid": "16b218a7e438a95418103e09f985217c", "score": "0.5540348", "text": "function accionSeleccionaMatriz(){\n if (setFilaSeleccion()) {\n hidOcultarNueva = 'SI';\n set('frmContenido.conectorAction', 'LPSeleccionarMF');\n set('frmContenido.accion', 'Matriz seleccionada');\n enviaSICC('frmContenido');\n }else\n ShowError(1);\n }", "title": "" }, { "docid": "c347102d943c5dac4e0f66204a2db6a8", "score": "0.55213195", "text": "function mejorAlternativa() {\n $scope.mejor_credito = []; // mejor tasa de interes\n for (var i = 0; i < $scope.bancos_credito.length; i++) {\n $scope.mejor_credito[i] = $scope.bancos_credito[i].tasaInteres;\n }\n $scope.mejor = Math.min.apply(null, $scope.mejor_credito);\n\n for (var i = 0; i < $scope.bancos_credito.length; i++) {\n if ($scope.bancos_credito.length != 1) {\n if ($scope.bancos_credito[i].tasaInteres == $scope.mejor) {\n $scope.bancos_credito[i].opcion = 1; // Cuando las tasas de interes es igual a la menor\n } else {\n $scope.bancos_credito[i].opcion = 0; // Cuando las tasas de interes es diferente a la menor\n }\n } else {\n $scope.bancos_credito[i].opcion = 2; // Cuando existe un solo banco para simular\n }\n }\n }", "title": "" }, { "docid": "bb24a8413b8e0e7ca6a6999b374f0bb2", "score": "0.5515824", "text": "function choixCoupable(perso)\n {\n socket.emit('vote joueur', {numPlayer: numPlayer, perso: perso.id, room: room});\n addChat('Vous avez selectionner le coupable numéro: ' + perso.id, 20000);\n }", "title": "" }, { "docid": "d118fbef7825828eecc1da0f51f57faa", "score": "0.55079424", "text": "function setDispositionReponseAll(how){\n let elts = document.querySelectorAll(\".ceinture .grid .flex\");\n let selindex = 1;\n if(how===\"row\"){\n elts.forEach(el=>{\n el.classList.remove(\"column\");\n })\n selindex = 0;\n document.querySelectorAll(\".answidth\").forEach(el=>{\n changeAnswerWidth(el.id.substring(8),el.value)\n })\n }\n else {\n elts.forEach(el=>{\n el.classList.add(\"column\");\n })\n changeAnswerWidth(\"s\",\"100\",false)\n }\n // on met les valeurs des autres input à cette valeur\n let inputs = document.querySelectorAll(\".selectpos\");\n for(let i=0;i<inputs.length;i++){\n inputs[i].selectedIndex = selindex;\n }\n}", "title": "" }, { "docid": "e552ffebeb96c5c7c62fe1b41e5e6026", "score": "0.55013853", "text": "function escondeMoneda() {\r\n //funsion random:\r\n vGblPosicionMoneda = Math.floor(Math.random() * 9 + 1);\r\n vGblIntentosUsados = 0;\r\n vGblJuegoTerminado = 0;\r\n}", "title": "" }, { "docid": "23b65b885db51231c67fd7b36de36b83", "score": "0.54709715", "text": "function Start()\r\n{\r\n ordenarTablaP_Contenidos()\r\n\r\n ModificacionesCeldasElementos()\r\n\r\n for (let i = 0; i < EQ.length; i++) \r\n {\r\n EQ[i].Inicio();\r\n }\r\n\r\n seccionGuia();\r\n\r\n cambiarColorTP();\r\n\r\n /* Simulaciones */\r\n InformacionResultadosPauling(moleculaPauling, true)\r\n}", "title": "" }, { "docid": "fa9086701d66c57d85be234428b26206", "score": "0.54696465", "text": "function procesaSelectMuseo()\r\n{\r\n\tvar museoSelect = sectionMuseoSelect[\"museoSelect\"];\r\n\tvar categoria = lee(slcCategoria);\r\n\tvar titulo = categoria;\r\n\t\r\n\tmuseoSelect = lee(museoSelect);\r\n\t\r\n\tif(museoSelect == \"nada\")\r\n\t{\r\n\t\tnewHTML.innerHTML = \"<div class='12u$'>\" +\r\n\t\t\t\t\t\t\t\"\t<hr>\" +\r\n\t\t\t\t\t\t\t\"</div>\" +\r\n\t\t\t\t\t\t\t\"<div class='12u$'>\" +\r\n\t\t\t\t\t\t\t\"<h2>Selecciona un museo</h2>\" +\r\n\t\t\t\t\t\t\t\"</div>\" +\r\n\t\t\t\t\t\t\t\"<div class='12u'>\" +\r\n\t\t\t\t\t\t\t\"<p>.......................................</p>\" +\r\n\t\t\t\t\t\t\t\"</div>\";\r\n\t}\r\n\telse\r\n\t\textracDataMuseos(titulo, categoria, sqlListar, museoSelect);\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "fda45ce403b1b26c162f85ff5041084b", "score": "0.5457097", "text": "function mostrar()\n{\n let nombre;\n let carrera;\n let sexo;\n let materias;\n let notaPromedio;\n let edad;\n let mejorPromedioFisica;\n let nombreMejorPromedioFisica;\n let FlagMejorPromedioFisica=1;\nlet contFisica=0;\nlet acumF=0;\nlet contQ=0;\nlet acumQ=0;\nlet contS=0;\nlet acumS=0;\nlet edadMujerMasJoven;\nlet FlagMujerJoven=1;\nlet nombreMujerJoven;\nlet contMujeres=0;\nlet nombreMasMateriasNQ;\nlet edadMasMateriasNQ;\nlet maxMateriasNQ;\nlet FlagMasMateriasNQ =1;\nlet contNQ=0;\n\n\n\n\n\n for(let i =0 ; i<500 ; i++){\nnombre = prompt(\"ingrese su nombre\");\ncarrera = prompt(\"ingrese su carrera\");\nwhile(carrera!= \"quimica\" && carrera!= \"fisica\" && carrera != \"sistemas\"){\n\tcarrera= prompt(\"ingrese su carrera, quimica, fisica, sistemas\");\n\n}\nsexo= prompt(\"ingrese su sexo, masculino, femenino, no binario\");\nwhile(sexo!= \"masculino\" && sexo!= \"no binario\" && sexo != \"femenino\"){\n\tsexo= prompt(\"ingrese su sexo, masculino, femenino, no binario\");\n\n}\nmaterias = parseInt(prompt(\"ingrese cantidad de materias entre 1 y 5\"));\nwhile(materias <1 || materias > 5){\n materias = parseInt(prompt(\"Error. ingrese cantidad de materias entre 1 y 5\"));\n\n}\n\nnotaPromedio = parseInt(prompt(\"ingrese nota Promedio entre 0 y 10\"));\nwhile(notaPromedio <0 || notaPromedio > 10){\n notaPromedio = parseInt(prompt(\"Error. ingrese not Promedio entre 0 y 10\"));\n\n} \n\nedad= parseInt(prompt(\"ingrese su edad\"));\nwhile(edad<0 || isNaN(edad)){\n\tedad= parseInt(prompt(\"Error. ingrese su edadvpositiva\"));\n}\t\n\nif(carrera == \"fisica\"){// PUNTO A\ncontFisica++;\n// PUNTO A\n if(FlagMejorPromedioFisica || notaPromedio > mejorPromedioFisica){// PUNTO A\n mejorPromedioFisica = notaPromedio;// PUNTO A\n nombreMejorPromedioFisica = nombre;// PUNTO A\n FlagMejorPromedioFisica =0;// PUNTO A\n }// PUNTO A\n}// PUNTO A\n\nif(sexo ==\"femenino\"){// PUNTO B\n contMujeres++;// PUNTO B\n if(FlagMujerJoven || edad < edadMujerMasJoven){// PUNTO B\n nombreMujerJoven = nombre;// PUNTO B\n edadMujerMasJoven = edad;// PUNTO B\n FlagMujerJoven=0;// PUNTO B\n }// PUNTO B\n}\n// PUNTO B\n\nif(carrera == \"quimica\"){\n contQ++;\n}\n\nif(carrera == \"sistemas\" ){\n contS++;\n} \n\nif(carrera != \"quimica\"){\n contNQ++;\n if(FlagMasMateriasNQ || materias > maxMateriasNQ){\n nombreMasMateriasNQ= nombre;\n edadMasMateriasNQ = edad;\n FlagMasMateriasNQ=0;\n }\n}\n\n\n\n\n}// fin del for\n \nif(contFisica !=0){\n console.log(\"A- El nombre del mejor promedio de fisica es \" + nombreMejorPromedioFisica+ \" y su promedio es de \" + mejorPromedioFisica);\n}else{\n console.log(\"A- No se ingresaron alumnos que cursen Fisica\");\n}\n\nif(contMujeres!=0){\n console.log(\"B- el nombre de la mujer mas joven es \" + nombreMujerJoven + \" y su edad es de \" + edadMujerMasJoven + \" años\");\n}else{\n console.log(\"B- No se ingresaron alumnas mujeres\")\n}\n\n// NO SE SACAR EL PORCENTAJE DEL TOTAL DE CADA CARRERA\nconsole.log(\"C- Los estudiates de fisica son \" + contFisica + \" , los de quimica son , \" + contQ + \" y los de sistemas son \" + contS);\n\n\nif(contNQ!=0){\n console.log(\"D- El alumno con mas materias que no sea de la carrera quimica es \" + nombreMasMateriasNQ + \" , tiene \" + edadMasMateriasNQ + \" y cursa \" + maxMateriasNQ + \" materias\");\n}else{\n console.log(\"D- Solo se ingresaron cursantes de quimica.\");\n}\n\n\n\n}// Fin MOSTRAR", "title": "" }, { "docid": "1a1f89bc7466d8748d9d1a61dde0acc1", "score": "0.54463", "text": "function cargartres() {\n\n let inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"JOAQQQUUIINNNN\",\n \"apellido\": \"HANDDBALLLL\",\n \"mail\": \"marting@gmail.com\",\n };\n cargarinscripcion(inscripto);\n inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"Elva\",\n \"apellido\": \"Kehler\",\n \"mail\": \"elva@gmail.com\",\n };\n cargarinscripcion(inscripto);\n inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"Sergio\",\n \"apellido\": \"Yañez\",\n \"mail\": \"sergio@gmail.com\",\n };\n cargarinscripcion(inscripto);\n\n }", "title": "" }, { "docid": "849a2ab9baddd37a015f1ac933090996", "score": "0.5446276", "text": "function update_modify_mode_mos_generators() {\n show_modify_mode_mos_options(document.querySelector('input[name=\"mode_type\"]:checked').value)\n let coprimes = get_coprimes(tuning_table.note_count - 1)\n jQuery('#modal_modify_mos_degree').empty()\n for (var d = 1; d < coprimes.length - 1; d++) {\n var num = coprimes[d]\n var cents = Math.round(decimal_to_cents(tuning_table.tuning_data[num]) * 10e6) / 10.0e6\n var text = num + ' (' + cents + 'c)'\n jQuery('#modal_modify_mos_degree').append('<option value=\"' + num + '\">' + text + '</option>')\n }\n }", "title": "" }, { "docid": "b1e2612277afc879968ce705d7a4b0a7", "score": "0.54313934", "text": "function parametres2() {\n chrono = new Chrono(parametres.duree_tour, function() {\n equipe_qui_joue = (equipe_qui_joue + 1) % parametres.nb_equipes\n PUSH({url: 'manchedebut'})\n }, 1, function(temps_restant) {\n $('#chronometre').text(temps_restant)\n })\n console.log(\"j'ai lancé la fonction parametres2\")\n // for tous les data-numero supérieur au nombre d'équipe > suprimer\n var max = 4\n for (var numero = parametres.nb_equipes + 1; numero <= max; numero++) {\n console.log(numero)\n $('input[data-numero=\"' + numero + '\"]').remove()\n }\n //enregistre les noms des equipes\n $('body').on('change', 'input', function() {\n console.log($(this).val())\n console.log($(this).data('numero'))\n var numero_equipe = $(this).data('numero') - 1\n var nom_equipe = $(this).val()\n les_equipes[numero_equipe].nom_equipe = nom_equipe\n console.log(les_equipes)\n })\n}", "title": "" }, { "docid": "6f8e84a900a5a5aaf63f930aaab16a61", "score": "0.53995335", "text": "function marvelInicia(){\r\n preguntas = [\r\n 'En cuantas peliculas de Marvel aparece Iron Man?',\r\n 'En que orden obtiene Thanos las gemas del infinito?',\r\n 'Cual es el verdadero nombre de Black Widow?'\r\n ];\r\n respuestas = [\r\n '6',\r\n '10',\r\n '8',\r\n '5',\r\n 'Espacio, mente, poder, alma, tiempo, realidad',\r\n 'Realidad, poder, mente, alma, espacio, tiempo',\r\n 'Poder, espacio, realidad, mente, tiempo, alma',\r\n 'Poder, espacio, realidad, alma, tiempo, mente',\r\n 'Natasha Alianovna Romanoff',\r\n 'Natasha Romanoff',\r\n 'Natalia Alianovna Romanoff',\r\n 'Wanda Ramonaff'\r\n ]; \r\n resultadoReal =[\r\n '2',\r\n '4',\r\n '3'\r\n ];\r\n siguientePregunta(mensajePregunta1, respuesta11, respuesta12, respuesta13, respuesta14, pantalla2);\r\n}", "title": "" }, { "docid": "25122f0317d7b3fc02f2b34d7b5bf52e", "score": "0.5397391", "text": "function getMeteo() {\n //dico intanto che la tabella sta caricando\n //poi ciclo sulle righe e per ognuna faccio una chiamata al server\n onTableLoadingChange(true);\n for (let i = 0; i < loadedTable.length; i++) {\n let myNewObj = {};\n const data = loadedTable[i].data;\n const splittedData = data.split('-');\n let provincia = loadedTable[i].denominazione_provincia;\n let year = splittedData[0];\n let month = splittedData[1];\n let day = splittedData[2].split('T')[0];\n const url = `http://localhost:3001/meteo/single-line/${provincia}/${year}/${month}/${day}`;\n // riempio intanto l'oggetto con i dati delle colonne già presenti selezionate\n for (const col of selectedCol) {\n myNewObj[col] = loadedTable[i][col];\n }\n axios.get(url)\n .then(\n (res) => {\n\n myNewObj = { ...myNewObj, ...res.data };\n dispatchUpdate(i, myNewObj);\n myNewData.push(myNewObj);\n if (i === (loadedTable.length - 1)) {\n // se ho recuperato l'ultima riga carico i dati nello stato\n //per estrarre le keys devo accertarmi che la riga sia completa\n for (let x = 0; x < myNewData.length; x++) {\n if ((Object.keys(myNewData[x]).length) > selectedCol.length) {\n //estraggo le keys\n dispatchKeys(Object.keys(myNewData[x]).map((key) => {\n return {\n Header: <p>{key}</p>,\n accessor: parseInt(key, 10) || key,\n key: key,\n show: true,\n id: key,\n added: selectedCol.includes(key) ? false : true,\n }\n }));\n dispatchExtended(true);\n onTableLoadingChange(false);\n break;\n }\n }\n\n\n\n }\n }\n )\n .catch((err) => {\n console.log(err);\n })\n }\n }", "title": "" }, { "docid": "f3dbf56dae3584b0b28f3458949946a3", "score": "0.5391906", "text": "function changePhishValues () {\n\t\ttreyChoice = Math.floor(Math.random() * (12 -1 + 1) + 1);\n\t\tgordoChoice = Math.floor(Math.random() * (12 -1 + 1) + 1);\n\t\tpageChoice = Math.floor(Math.random() * (12 -1 + 1) + 1);\n\t\tfishChoice = Math.floor(Math.random() * (12 -1 + 1) + 1);\n\n\t}", "title": "" }, { "docid": "8f7a20905fcf312b763f4d041bc07b5d", "score": "0.53915596", "text": "function mostrarNota(nofNota, noNota) {\r\n var select = document.querySelector('#' + nofNota).querySelector('.' + nofNota + ' .' + noNota);\r\n switch (noNota) {\r\n case 'do': //al haber dos do, se va a mostrar cualquiera de las dos, de manera aleatoria\r\n var rdm = Math.floor((Math.random() * 2) + 1);\r\n var dos = document.querySelector('#' + nofNota);\r\n if (rdm == 1) {\r\n dos.querySelector('.' + nofNota + ' .do').style.display = 'block';\r\n audio1.play();\r\n }\r\n if (rdm == 2) {\r\n dos.querySelector('.' + nofNota + ' .do2').style.display = 'block';\r\n audio8.play();\r\n }\r\n break;\r\n case 're':\r\n select.style.display = 'block';\r\n audio2.play();\r\n break;\r\n case 'mi':\r\n select.style.display = 'block';\r\n audio3.play();\r\n break;\r\n case 'fa':\r\n select.style.display = 'block';\r\n audio4.play();\r\n break;\r\n case 'sol':\r\n select.style.display = 'block';\r\n audio5.play();\r\n break;\r\n case 'la':\r\n select.style.display = 'block';\r\n audio6.play();\r\n break;\r\n case 'si':\r\n select.style.display = 'block';\r\n audio7.play();\r\n break;\r\n }\r\n\r\n }", "title": "" }, { "docid": "b7432149890fdcc4f58cd954c05bec1c", "score": "0.5384305", "text": "function ValoresDados ()\n{\n dado12_caras = parseInt (Math.random() * (13 - 1) + 1);\n\n for(let i = 0; i< 3; i++)\n dado6_caras[i] = parseInt (Math.random() * (7 - 1) + 1);\n\n for(let i = 0; i<2; i++)\n dado3_caras[i] = parseInt (Math.random() * (4 - 1) + 1);\n\n MostrarPorPantallaDados();\n}", "title": "" }, { "docid": "d7ecca30f1df152893d2477c3faba546", "score": "0.5353491", "text": "function ProcesosGenerales(socket) {\n SeleccionarNotas(socket);\n InsertarNota(socket);\n EliminarNota(socket);\n \n SeleccionarCategorias(socket);\n InsertarCategoria(socket);\n}", "title": "" }, { "docid": "492a9cb0b3b841d199717717556ac2d1", "score": "0.53479487", "text": "constructor(ambiente){\n this.ambiente = ambiente;\n //Valores default. \n this.cantidadGeneraciones = 2;\n this.probablidadCruce = 1;\n this.probabilidadMutacion = 0.001;\n }", "title": "" }, { "docid": "fb391ac0b4c14822659defdc3a569b77", "score": "0.5346381", "text": "function cambiarMotor(){\r\n \r\n var seleccion = document.getElementById(\"motores\").selectedIndex;\r\n \r\n switch (seleccion ) {\r\n case 0:\r\n precio_final = precio_final - precios_motor[motor_guardado];\r\n document.getElementById(\"modelo3\").disabled = false;\r\n break;\r\n \r\n case 1:\r\n case 2:\r\n precio_final = precio_final + precios_motor[seleccion] - precios_motor[motor_guardado];\r\n document.getElementById(\"modelo3\").disabled = true;\r\n document.getElementById(\"modelo3\").checked = false;\r\n \r\n break;\r\n }\r\n motor_guardado = seleccion;\r\n \r\n actualiza();\r\n \r\n}", "title": "" }, { "docid": "4152b79a52f61ef7e058a2be65b592b2", "score": "0.5345737", "text": "function getOptions() {\n var options = {};\n\n\n options.buffai = document.getElementById(\"buffai\").checked;\n options.buffgotw = document.getElementById(\"buffgotw\").checked;\n options.buffbk = document.getElementById(\"buffbk\").checked;\n options.buffibow = document.getElementById(\"buffibow\").checked;\n options.buffids = document.getElementById(\"buffids\").checked;\n options.buffmoon = document.getElementById(\"buffmoon\").checked;\n options.buffmoonrg = document.getElementById(\"buffmoonrg\").checked;\n options.sbufws = document.getElementById(\"sbufws\").checked;\n options.debuffjow = document.getElementById(\"debuffjow\").checked;\n options.debuffisoc = document.getElementById(\"debuffisoc\").checked;\n options.debuffmis = document.getElementById(\"debuffmis\").checked;\n options.confbl = document.getElementById(\"confbl\").checked;\n options.confmr = document.getElementById(\"confmr\").checked;\n options.conbwo = document.getElementById(\"conbwo\").checked;\n options.conmm = document.getElementById(\"conmm\").checked;\n options.conbb = document.getElementById(\"conbb\").checked;\n options.consmp = document.getElementById(\"consmp\").checked;\n options.condp = document.getElementById(\"condp\").checked;\n options.condr = document.getElementById(\"condr\").checked;\n options.totms = document.getElementById(\"totms\").checked;\n options.totwoa = document.getElementById(\"totwoa\").checked;\n options.totcycl2p = document.getElementById(\"totcycl2p\").checked;\n options.buffeyenight = document.getElementById(\"buffeyenight\").checked;\n options.bufftwilightowl = document.getElementById(\"bufftwilightowl\").checked;\n\n options.buffbl = parseInt(document.getElementById(\"buffbl\").value) || 0;\n options.buffspriest = parseInt(document.getElementById(\"buffspriest\").value) || 0;\n options.totwr = parseInt(document.getElementById(\"totwr\").value) || 0;\n options.buffdrums = parseInt(document.getElementById(\"buffdrums\").value) || 0;\n options.sbufrace = parseInt(document.getElementById(\"sbufrace\").value) || 0;\n\n options.custom = {};\n options.custom.custint = parseInt(document.getElementById(\"custint\").value) || 0;\n options.custom.custsp = parseInt(document.getElementById(\"custsp\").value) || 0;\n options.custom.custsc = parseInt(document.getElementById(\"custsc\").value) || 0;\n options.custom.custsh = parseInt(document.getElementById(\"custsh\").value) || 0;\n options.custom.custha = parseInt(document.getElementById(\"custha\").value) || 0;\n options.custom.custmp5 = parseInt(document.getElementById(\"custmp5\").value) || 0;\n options.custom.custmana = parseInt(document.getElementById(\"custmana\").value) || 0;\n \n options.dpsReportTime = 0;\n\n return options;\n}", "title": "" }, { "docid": "1ac91b58d2596c3a8c3ed7af7a500bf5", "score": "0.5340969", "text": "para_matrizes(matriz, cromossomo_individuo, bias1, bias2){\n let z = 0;\n\n //inserindo pesos da entrada (dependendo de quem chama a função)\n for (let i = 0; i < this.linhas; i++) {\n for (let j = 0; j < this.colunas; j++) {\n this.dados[i][j] = cromossomo_individuo[z];\n z++;\n }\n }\n //inserindo bias da oculta\n for (let i = 0; i < bias1.linhas; i++) {\n for (let j = 0; j < bias1.colunas; j++) {\n bias1.dados[i][j] = cromossomo_individuo[z];\n z++;\n }\n }\n\n //inserindo pesos da saida (dependendo de quem chama a função)\n for (let i = 0; i < matriz.linhas; i++) {\n for (let j = 0; j < matriz.colunas; j++) {\n matriz.dados[i][j] = cromossomo_individuo[z];\n z++;\n }\n }\n //inserindo bias_s\n for (let i = 0; i < bias2.linhas; i++) {\n for (let j = 0; j < bias2.colunas; j++) {\n bias2.dados[i][j] = cromossomo_individuo[z];\n z++;\n }\n }\n\n }", "title": "" }, { "docid": "d7321006c309d3052ddf9c6caa469867", "score": "0.53351957", "text": "function ejecutaMejora(tipo, nivelesaugmentados) {\n nivelesaugmentados--;\n switch (tipo) {\n case 0:\n player.vida++;\n player.vidaMax++;\n break;\n case 1:\n player.ataque++;\n break;\n case 2:\n player.armadura++;\n break;\n case 3:\n player.resistenciaMagica++;\n break;\n }\n\n actualizaHUD();\n $('#mejora').remove();\n if (nivelesaugmentados == 0) {\n $('#navegacion').append('<canvas id=\"visor\" width=\"300\" height=\"300\"></canvas>');\n cargaPosicion(player.estadoPartida.x, player.estadoPartida.y, player.estadoPartida.direccion);\n } else {\n augmentaNivel(nivelesaugmentados);\n }\n}", "title": "" }, { "docid": "c203d2182b30ed9b79f73b949aff2359", "score": "0.53349656", "text": "setupAdvance( tg, dtg ){\r\n console.log(\"Recibido columna B: \" + tg.dataset.pair);\r\n console.log(\"Recibido columna A: \" + dtg);\r\n let targetOptionParent=null\r\n let targetSelectParent =null;\r\n // let countPair = 0;\r\n\r\n\r\n tg.style.background=this.state._color;\r\n targetOptionParent = tg.parentNode.querySelector(\".box-rounded\");\r\n // targetOptionParent.style.background=this.state._color;\r\n // targetOptionParent.querySelector(\".p-o\").style.color = \"white\";\r\n targetOptionParent.classList.remove(\"border\")\r\n\r\n targetSelectParent = this._current.parentNode.querySelector(\".box-rounded\");\r\n // targetSelectParent.style.background=this.state._color;\r\n // targetSelectParent.querySelector(\".p-o\").style.color = \"white\";\r\n targetSelectParent.classList.remove(\"border\")\r\n\r\n this._current.classList.add(\"lock\");\r\n this._count++;\r\n\r\n if (dtg === tg.dataset.pair) {\r\n if (this.state.countCorrectPairing === 0) {\r\n console.log(\"primera pareja\");\r\n this.state.countCorrectPairing = 1\r\n // this.setState({ countCorrectPairing: countPair })\r\n } else {\r\n console.log(\"otras parejas\");\r\n this.state.countCorrectPairing = this.state.countCorrectPairing + 1\r\n // this.setState({ countCorrectPairing: this.state.countCorrectPairing + 1 })\r\n }\r\n\r\n console.log(\"Empajeradas buenas: \" + this.state.countCorrectPairing);\r\n }\r\n\r\n // SI ES EL MAXIMO ES PORQUE TERMINÓ\r\n if(this._count === this._max) {\r\n console.log(this._max);\r\n let button = document.getElementById('btnSend');\r\n button.classList.remove('disabled');\r\n if (this.state.countCorrectPairing === this._max) {\r\n this.setState({ countCorrect: this.state.countCorrect + 1 }); // contador de las preguntas correctas y conteo de seguimiento\r\n console.log(\"Se suma un punto\");\r\n } else {\r\n console.log(\"Parejas buenas: \" + this.state.countCorrectPairing);\r\n let puntoParcial = (this.state.countCorrectPairing * 1) / this._max;\r\n this.setState({ countCorrect: this.state.countCorrect + puntoParcial });\r\n console.log(\"Punto Parcial: \" + puntoParcial);\r\n console.log(\"Suma Completa: \" + (this.state.countCorrect + puntoParcial));\r\n console.log(\"Se suma una decima\");\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "8b4bbb6dfe772056c486943af0de0310", "score": "0.53270197", "text": "function combocampos(a,b) {\n\t\n\t//CREAMOS DOS VARIABLES Y LAS PONEMOS VACIAS\n\tvar varcampos=\"\";\n\tvar varprueba=\"\";\n\t\n\t//COMPROBAMOS QUE LAS VARIABLES QUE RECOGEMOS NO VENGAN VACIAS\n\t//Y ASIGNAMOS SU VALOR A LAS VARIABLES QUE HEMOS CREADO\n\tif (a != null & a != \"undefined\"){\n\t\tvarprueba = a;\n\t}\n\t\n\tif (b != null & b != \"undefined\"){\n\t\tvarcampos = b;\n\t}\n\t\n\tvar index = null;\n\t\n\t//COMPROBAMOS SI LA VARIABLE ESTÁ VACÍA O SE HA RELLENADO EN LOS IF\n\tif (varprueba==\"\"){\t\t\n\t\n\t// Crea una variable index y guarda en ella el valor del Index seleccionado\n\t// en el combobox con nombre \"Clases\"\n\t\tindex = document.getElementById('Clases').selectedIndex;\n\t}\n\telse{\n\t\t//SI LA VARIABLE QUE CREAMOS NO ESTÁ VACIA, RECOGEMOS SU VALOR EN INDEX\n\t\t//Y SELECCIONAMOS SU VALOR EN EL PRIMER SELECT DEL BUSCADOR\n\t\tdocument.getElementById('Clases').selectedIndex = varprueba;\n\t\tindex = varprueba;\n\t\t\n\t}\n\n\t// En función del valor de index rellenará el segundo combobox\n\t//SI INDEX VALE 0 (PRIMER VALOR DEL PRIMER SELECT)\n\tif (index == 0) {\n\t\t//BORRAMOS TODOS LOS CAMPOS DEL SEGUNDO SELECT\n\t\tborrarComboCampos();\n\t\t// Crea elementos Option para el combobx \"Campos\"\n\t\topcion0 = new Option(\"Nombre\", \"Nombre\");\n\t\topcion1 = new Option(\"Apellidos\", \"Apellidos\");\n\t\topcion2 = new Option(\"Telefono\", \"Telefono\");\n\t\topcion3 = new Option(\"Email\", \"Email\");\n\t\topcion4 = new Option(\"Asignatura\", \"Asignatura\");\n\t\t// Rellena el combobox\n\t\tdocument.getElementById('Campos').options[0] = opcion0;\n\t\tdocument.getElementById('Campos').options[1] = opcion1;\n\t\tdocument.getElementById('Campos').options[2] = opcion2;\n\t\tdocument.getElementById('Campos').options[3] = opcion3;\n\t\tdocument.getElementById('Campos').options[4] = opcion4;\n\t\t\n\t\t//SI LA VARIABLE SEGUNDA QUE CREAMOS NO ESTÁ VACÍA ES QUE VOLVEMOS DE UNA\n\t\t//BUSQUEDA Y ENTONCES SELECCIONAMOS EL VALOR QUE VIENE DE LA BUSQUEDA\n\t\tif (varcampos != \"\"){\t\t\n\t\t\t\tdocument.getElementById('Campos').selectedIndex = varcampos;\t\t\n\t\t}\n\t\t\t\n\n\t} else if (index == 1) {\n\n\t\tborrarComboCampos();\n\t\topcion0 = new Option(\"Nombre\", \"Nombre\");\n\t\topcion1 = new Option(\"Horario\", \"Horario\");\n\t\topcion2 = new Option(\"Aula\", \"Aula\");\n\t\tdocument.getElementById('Campos').options[0] = opcion0;\n\t\tdocument.getElementById('Campos').options[1] = opcion1;\n\t\tdocument.getElementById('Campos').options[2] = opcion2;\n\t\tif (varcampos != \"\"){\t\t\n\t\t\t\tdocument.getElementById('Campos').selectedIndex= varcampos;\t\n\t\t}\n\t} else if (index == 2) {\n\t\tborrarComboCampos();\n\t\topcion0 = new Option(\"Nombre\", \"Nombre\");\n\t\topcion1 = new Option(\"Apellidos\", \"Apellidos\");\n\t\topcion2 = new Option(\"Telefono\", \"Telefono\");\n\t\topcion3 = new Option(\"Email\", \"Email\");\n\t\tdocument.getElementById('Campos').options[0] = opcion0;\n\t\tdocument.getElementById('Campos').options[1] = opcion1;\n\t\tdocument.getElementById('Campos').options[2] = opcion2;\n\t\tdocument.getElementById('Campos').options[3] = opcion3;\n\t\tif (varcampos != \"\"){\t\t\n\t\t\t\tdocument.getElementById('Campos').selectedIndex= varcampos;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a70a54f5a9aec1a29c4b70bcb942644", "score": "0.53103226", "text": "function seleccion_lab(){\n\n//Declaracion de variables\nvar bact = document.getElementById(\"bactereologia\").checked;//Devuelve verdadero si esta chequeado y falso si no\nvar bio = document.getElementById(\"bioquimica\").checked;\nvar cqb = document.getElementById(\"cqb\").checked;\nvar ext = document.getElementById(\"exterior\").checked;\nvar fq = document.getElementById(\"fq\").checked;\nvar ga = document.getElementById(\"ga\").checked;\nvar mp = document.getElementById(\"mp\").checked;\nvar mon = document.getElementById(\"monitoreo\").checked;\nvar pb = document.getElementById(\"pb\").checked;\n\n\tif (bact != false){\n\tdocument.getElementById(\"bact1\").value = 1;//Son los input hidden\n\t}\n\telse{\n\tdocument.getElementById(\"bact1\").value = 0;\n\t}\n\n\tif (bio != false){\n\tdocument.getElementById(\"bio1\").value = 2;\n\t}\n\telse{\n\tdocument.getElementById(\"bio1\").value = 0;\n\t}\n\n\tif (cqb != false){\n\tdocument.getElementById(\"cqb1\").value = 3;\n\t}\n\telse{\n\tdocument.getElementById(\"cqb1\").value = 0;\n\t}\n\n\tif (ext != false){\n\tdocument.getElementById(\"et1\").value = 4;\n\t}\n\telse{\n\tdocument.getElementById(\"et1\").value = 0;\n\t}\n\n\tif (fq != false){\n\tdocument.getElementById(\"fq1\").value = 5;\n\t}\n\telse{\n\tdocument.getElementById(\"fq1\").value = 0;\n\t}\n\n\tif (ga != false){\n\tdocument.getElementById(\"ga1\").value = 6;\n\t}\n\telse{\n\tdocument.getElementById(\"ga1\").value = 0;\n\t}\n\n\tif (mp != false){\n\tdocument.getElementById(\"mp1\").value = 7;\n\t}\n\telse{\n\tdocument.getElementById(\"mp1\").value = 0;\n\t}\n\n\tif (mon != false){\n\tdocument.getElementById(\"mo1\").value = 8;\n\t}\n\telse{\n\tdocument.getElementById(\"mo1\").value = 0;\n\t}\n\n\tif (pb != false){\n\tdocument.getElementById(\"pb1\").value = 9;\n\t}\n\telse{\n\tdocument.getElementById(\"pb1\").value = 0;\n\t}\n}", "title": "" }, { "docid": "b81651c8cb6f9449e84b1b94299387ec", "score": "0.53082573", "text": "function medidasCallback(err,temp,hum){\n\tif (!err) {\n if (temp == tempAnterior){\n estabilidadMedidas++;\n }else{\n estabilidadMedidas=0;\n }\n tempAnterior=temp;\n if (estabilidadMedidas>=5 || primeraMedida===true){\n primeraMedida=false;\n estado.guardaTemperatura(temp);\n pantalla.escribeTemperatura(temp);\n estabilidadMedidas=0;\n console.log(estado.estado);\n }else{\n estado.guardaTemperatura(temp);\n }\n\n\n var ahora = new Date();\n if ((ahora.getMinutes()%minutoEnvio)===0){\n if (enviado===false){\n console.log('30 minutos ... enviamos dato')\n cloud.escribeEstado(estado.estado,function(error){\n if (error){\n console.log(error)\n enviado=false;\n }\n else{\n console.log(\"Estado enviado OK\");\n enviado=true;\n }\n });\n cloud.escribeRegistro(estado.estado,function(error){\n if (error){\n console.log(error)\n enviado=false;\n }\n else{\n console.log(\"Estado enviado OK\");\n enviado=true;\n }\n });\n }\n }\n else{\n enviado=false;\n }\n }\n}", "title": "" }, { "docid": "56a80aaf968cc344a11a59b0d86b57c0", "score": "0.53003794", "text": "function cargarNuevoJuego() {\n\tlet nav = $('#headerNav').show();\n let presentacion = $('#backgroundEntrada').hide();\n let presentacion2 = $('#headerGreen').hide();\n let infoJuego = $('#infoJuego').show(); //\tHACER! ANIMACION ASIDE\n let tablero = $('#play').show();\n\n let nombreJugador = $('input').val();\n $('#nombreJugador').text(nombreJugador); //guardo el nombre del imput\n let dificultad = document.getElementById(\"myRange\").value;\n\n let tipoJuego = $('select option:selected').val(); //me traigo el valor del select\n\n MemoTest(tipoJuego, dificultad, nombreJugador);\n\n}", "title": "" }, { "docid": "00e5cb0a2ddc2a562cd0e9fc3e6d3098", "score": "0.5295306", "text": "function carchoice(){\n $('#motorbike').click(function(){\n var chosencar = 0;\n carinfo(chosencar);\n $('.inputdiv').slick('slickNext');\n $.modal.close();\n $('.mapslider').slick('slickNext');\n });\n\n $('#smallcar').click(function(){\n var chosencar = 1;\n carinfo(chosencar);\n $('.inputdiv').slick('slickNext');\n $.modal.close();\n $('.mapslider').slick('slickNext');\n });\n\n $('#largecar').click(function(){\n var chosencar = 2;\n carinfo(chosencar);\n $('.inputdiv').slick('slickNext');\n $.modal.close();\n $('.mapslider').slick('slickNext');\n });\n\n $('#motorhome').click(function(){\n var chosencar = 3;\n carinfo(chosencar);\n $('.inputdiv').slick('slickNext');\n $.modal.close();\n $('.mapslider').slick('slickNext');\n });\n }", "title": "" }, { "docid": "1de6dea39904455d6064f1290bd99ba0", "score": "0.52939516", "text": "function gotData(data){\n console.log(data.val());\n //ques is an type of an array of key of questions\n ques =data.val();\n //we store all the key with the data in keys array\n var keys=Object.keys(ques);\n ranarr=getRandom(keys,n1);\n console.log(ranarr);\n \n k=ranarr[count];\n var option1=ques[k].option1;\n var option2=ques[k].option2;\n var option3=ques[k].option3;\n var option4=ques[k].option4;\n var q=ques[k].question;\n\n document.getElementById(\"option1text\").innerText=option1;\n document.getElementById(\"option2text\").innerText=option2;\n document.getElementById(\"option3text\").innerText=option3;\n document.getElementById(\"option4text\").innerText=option4;\n document.getElementById(\"questiontext\").innerText=q; \n}", "title": "" }, { "docid": "6361e7dc4c2f0201afdc153e2947a07e", "score": "0.5276652", "text": "function limpiarCamposPantallaAlta() {\n\t// obtener los input\n\tcamposInput = document.getElementsByTagName('input');\n\tfor (i = 0; i < camposInput.length; i++) {\n\t\tele = camposInput[i];\n\t\tif (ele.type == 'text') {\n\t\t\tif (ele.className.indexOf('deshabilitado') == -1) {\n\t\t\t\tele.value = \"\";\n\t\t\t}\n\t\t} else if (ele.type == 'checkbox') {\n\t\t\tif (ele.className.indexOf('deshabilitado') == -1) {\n\t\t\t\tele.checked = false;\n\t\t\t}\n\t\t} else if (ele.type == 'radio') {\n\t\t\tif (ele.className.indexOf('deshabilitado') == -1) {\n\t\t\t\tele.checked = false;\n\t\t\t}\n\t\t}\n\n\t\tvolverAMarcarObligatoriosActivados(ele);\n\n\t}\n\t// obtener los select\n\tvar camposSelect = document.getElementsByTagName('select');\n\tfor (i = 0; i < camposSelect.length; i++) {\n\t\tele = camposSelect[i];\n\t\t// seleccionar el primer elemento del combo\n\t\tif (ele[0] != null)\n\t\t\tif (ele[0].className.indexOf('deshabilitado') == -1) {\n\t\t\t\tele[0].selected = true;\n\t\t\t}\n\n\t\tvolverAMarcarObligatoriosActivados(ele);\n\n\t}\n\t// TEXTAREA\n\tcamposTextarea = document.getElementsByTagName('textarea');\n\t// Deseleccionar columna anterior\n\tfor (i = 0; i < camposTextarea.length; i++) {\n\t\tele = camposTextarea[i];\n\t\tif (ele.className.indexOf('deshabilitado') == -1) {\n\t\t\tele.value = \"\";\n\n\t\t\tvolverAMarcarObligatoriosActivados(ele);\n\t\t}\n\t}\n\t// TODO: faltan pick list, pantallas con pestañas\n\n\t// poner en verde los campos en rojo\n}", "title": "" }, { "docid": "847ded9005790323643e74c88b96872d", "score": "0.527182", "text": "function setInitValues() {\n\n // Parte 1\n anime.set('#part1 .titlee', {\n opacity: 0,\n translateY: -300\n });\n \n anime.set('.title_plus img', {\n opacity: 0,\n });\n\n anime.set('.title_plus h2', {\n opacity: 0,\n translateX: 100\n });\n\n anime.set('.part-1-b .tabla', {\n opacity: 0,\n translateY: 100\n });\n\n anime.set('#part1b .tabla2', {\n opacity: 0,\n translateY: 100\n });\n\n // Parte 2\n\n anime.set('.part-2 .icon, .part-2 .row img ', {\n opacity: 0,\n scale: 0,\n });\n\n // Parte 3\n\n anime.set('#part3 .title', {\n opacity: 0,\n scale: 0,\n });\n\n anime.set('#part3 .text', {\n opacity: 0,\n translateX: -100\n });\n\n anime.set('#part3 .icon', {\n opacity: 0,\n translateX: 100\n });\n\n anime.set('#part3 .mano', {\n opacity: 0,\n translateY: 500\n });\n\n // Parte 4\n \n anime.set('#part4 .title, #part4 .images img',{\n opacity: 0,\n zoom: 2\n });\n\n anime.set('#line_part4 path',{\n strokeDashoffset: anime.setDashoffset,\n });\n\n // Parte 5\n \n anime.set('#part5 .title, #part5 .text',{\n opacity: 0,\n translateX: -100\n });\n\n anime.set('#part5 .celu',{\n opacity: 0,\n translateY: 200\n });\n\n // Parte 6\n \n anime.set('#part6 .text, #part6 .text4',{\n opacity: 0,\n scale: 0\n });\n\n anime.set('#part6 .text5',{\n opacity: 0,\n });\n\n anime.set('#part6 .text6',{\n opacity: 0,\n translateX: 200\n });\n\n anime.set('#part6 .img1',{\n opacity: 0,\n translateX: -100\n });\n\n anime.set('#part6 .img2',{\n opacity: 0,\n translateX: 100\n });\n\n anime.set('#part6 .text7',{\n opacity: 0,\n translateX: -200\n });\n\n // Parte 7\n \n anime.set('#part7 .carousel',{\n opacity: 0\n });\n\n // Parte 8\n\n anime.set('#part8 .title',{\n scale: 0,\n opacity: 0,\n });\n \n anime.set('#part8 .icon',{\n scale: 0.8,\n translateX: 200,\n opacity: 0\n });\n\n anime.set('#part8 .text',{\n scale: 0.8,\n translateX: -200,\n opacity: 0\n });\n\n // Parte 9\n\n anime.set('#part9 .text',{\n scale: 0,\n opacity: 0\n });\n\n anime.set('#part9 .title, #part9 .text2',{\n opacity: 0\n });\n\n anime.set('#part9 .icon',{\n opacity: 0,\n translateY: 200\n });\n\n // Parte 10\n\n anime.set('#part10 .icon',{\n opacity: 0,\n translateX: -200\n });\n\n anime.set('#part10 .text',{\n opacity: 0,\n translateX: 200\n });\n\n anime.set('#part11 .text2',{\n opacity: 0,\n });\n\n }", "title": "" }, { "docid": "d9f73590188f4486d292142b80d5c552", "score": "0.5269494", "text": "function CChansons()\r\n\t\t{\r\n\t\t\t/* données membre (private) */\t\t// (public :) this.m_Toto;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t// Gestion du HappyBday\r\n\t\t\t\tvar m_bClick_HappyBday = false;\r\n\t\t\t\tvar m_Chansons = document.getElementById(\"Chansons\");\r\n\t\t\t\t\r\n\t\t\t\t\t// Gestion des playes_buttons\r\n\t\t\t\tvar m_ButtonPlayer_new = null;\r\n\t\t\t\tvar m_ButtonPlayer_old = null;\r\n\t\t\t\t\r\n\t\t\t\t\t// Gestion des players\t\t\t\t\r\n\t\t\t\tvar m_Player_new = null;\r\n\t\t\t\tvar m_Player_old = null;\r\n\t\t\t\t\r\n\t\t\t\t\t// gestion du playing (inutilisé)\r\n\t\t\t//\tvar m_bPlaying = false;\r\n\t\t\t\r\n\t\t\t\t\t// récupération des buttons/players\r\n\t\t\t\tvar m_but01 = document.getElementById(\"jsAudio_Belle_button\");\r\n\t\t\t\t\tvar m_p01 = document.getElementById(\"jsAudio_Belle\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but02 = document.getElementById(\"jsAudio_Etoile_button\");\r\n\t\t\t\t\tvar m_p02 = document.getElementById(\"jsAudio_Etoile\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but03 = document.getElementById(\"jsAudio_Rtrouve_button\");\r\n\t\t\t\t\tvar m_p03 = document.getElementById(\"jsAudio_Rtrouve\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but04 = document.getElementById(\"jsAudio_Apocalyptico_button\");\r\n\t\t\t\t\tvar m_p04 = document.getElementById(\"jsAudio_Apocalyptico\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but05 = document.getElementById(\"jsAudio_Roy_button\");\r\n\t\t\t\t\tvar m_p05 = document.getElementById(\"jsAudio_Roy\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but06 = document.getElementById(\"jsAudio_FilleFleur_button\");\r\n\t\t\t\t\tvar m_p06 = document.getElementById(\"jsAudio_FilleFleur\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but07 = document.getElementById(\"jsAudio_Saison_button\");\r\n\t\t\t\t\tvar m_p07 = document.getElementById(\"jsAudio_Saison\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but08 = document.getElementById(\"jsAudio_Dimanche_button\");\r\n\t\t\t\t\tvar m_p08 = document.getElementById(\"jsAudio_Dimanche\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but09 = document.getElementById(\"jsAudio_Berk_button\");\r\n\t\t\t\t\tvar m_p09 = document.getElementById(\"jsAudio_Berk\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but10 = document.getElementById(\"jsAudio_Forbiden_button\");\r\n\t\t\t\t\tvar m_p10 = document.getElementById(\"jsAudio_Forbiden\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but11 = document.getElementById(\"jsAudio_WakeUp_button\");\r\n\t\t\t\t\tvar m_p11 = document.getElementById(\"jsAudio_WakeUp\");\r\n\t\t\t\t\t\r\n\t\t\t\tvar m_but12 = document.getElementById(\"jsAudio_DyingSun_button\");\r\n\t\t\t\t\tvar m_p12 = document.getElementById(\"jsAudio_DyingSun\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t/* ---------- ---------- */\r\n\t\t\t\r\n\t\r\n\t\t\t/* fonctions membres (.h) */\t// (public)\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t// Gestion du HappyBday\r\n\t\t\t\tthis.HappyBday_Click = HappyBday_Click;\r\n\t\t\t\t\r\n\t\t\t\tthis.Chansons_Display = Chansons_Display;\r\n\t\t\t\t\r\n\t\t\t\t\t// Click Chansons\r\n\t\t\t\tthis.SetButton_Clicked = SetButton_Clicked;\r\n\t\t\t\t\r\n\t\t\t\t\t// Lectures Chansons\r\n\t\t\t\tthis.GetPlayer = GetPlayer;\r\n\t\t\t\tthis.SetPlayer = SetPlayer;\r\n\t\t\t\tthis.Audio_Play = Audio_Play;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t/* ---------- ---------- */\r\n\t\r\n\t\r\n\t\t\t/* fonctions membres (.cpp) */\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t/* Gestion du HappyBday */\r\n\t\t\t\t\r\n\t\t\t\t\tfunction HappyBday_Click()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(m_bClick_HappyBday == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_bClick_HappyBday = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_bClick_HappyBday = true;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tChansons_Display();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction Chansons_Display()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(m_bClick_HappyBday == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_Chansons.style.display = \"block\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_Chansons.style.display = \"none\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t/* ---------- */\r\n\t\t\t\t\r\n\t\t\t\t/* Affichage dynamique */\r\n\t\t\t\t\r\n\t\t\t\t\tfunction SetPlayer_Button_color()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(m_Player_new.ended == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_ButtonPlayer_new.style.color = \"gray\";\r\n\t\t\t\t\t\t\tm_ButtonPlayer_new.style.fontSize = \"2em\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(m_ButtonPlayer_old != null)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tm_ButtonPlayer_old.style.color = \"red\";\r\n\t\t\t\t\t\t\t\tm_ButtonPlayer_old.style.fontSize = \"1em\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tm_ButtonPlayer_new.style.color = \"green\";\r\n\t\t\t\t\t\t\tm_ButtonPlayer_new.style.fontSize = \"2em\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t/* ---------- */\r\n\t\t\t\r\n\t\t\t\t/* Click Chansons */\r\n\t\t\t\t\r\n\t\t\t\t\tfunction SetButton_Clicked(button_clicked)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tm_ButtonPlayer_old = m_ButtonPlayer_new;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tm_ButtonPlayer_new = button_clicked;\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tfunction GetPlayer()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar Player_chosen = null;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// choisi le player correspondant au boutton clické\r\n\t\t\t\t\t\tswitch(m_ButtonPlayer_new)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase m_but01 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p01;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but02 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p02;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but03 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p03;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but04 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p04;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but05 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p05;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but06 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p06;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but07 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p07;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but08 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p08;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but09 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p09;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but10 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p10;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but11 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p11;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase m_but12 :\r\n\t\t\t\t\t\t\t\tPlayer_chosen = m_p12;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t\talert(\"mini 404 : chansons non référencée\");\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// le renvoi\r\n\t\t\t\t\t\treturn Player_chosen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t/* ---------- */\r\n\t\t\t\r\n\t\t\t\t/* Lectures Chansons */\r\n\t\t\t\t\r\n\t\t\t\t\tfunction SetPlayer(Player_chosen)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// met le \"en cours dans old\r\n\t\t\t\t\t\tm_Player_old = m_Player_new;\r\n\t\t\t\t\t\t\t// met le choisi dans new\r\n\t\t\t\t\t\tm_Player_new = Player_chosen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction Audio_Play()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// récupère le boutton clické et l'attribut à new, old prenant l'ancien new\r\n\t\t\t\t\t\tSetButton_Clicked(this);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// récupère le player du bouton clické et l'attribut à new, old prenant l'ancien new\r\n\t\t\t\t\t\tSetPlayer(GetPlayer());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// pause et termine l'ancien\r\n\t\t\t\t\t\tif(m_Player_old != null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_Player_old.pause();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// lance le nouveau\r\n\t\t\t\t\t\tm_Player_new.load();\r\n\t\t\t\t\t\tm_Player_new.play();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// change la couleur en fonction du boutton et de la lecture\r\n\t\t\t\t\t\tSetPlayer_Button_color();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// cré la récupération de fin de lecture\r\n\t\t\t\t\t\tm_Player_new.addEventListener(\"ended\", SetPlayer_Button_color, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t/* ---------- */\r\n\t\t\t\t\t\r\n\t\t\t/* ---------- ---------- */\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "7854e18a399cce8c13af06d66ae39602", "score": "0.5253972", "text": "function verificarPossibilidadesDeParaquedista(){\n casasQuePodemReceberParaquedista = [];\n //verifica cada casa\n $.each(casas['campo-cima'], function(index){\n if(this.tipo == 'normal' && this.ocupacao1 == '' && casaEstaNoCampoDePouso(pecaSelecionadaCampoAtaque, index) === true && casasQuePodemReceberParaquedista.indexOf(index) == -1){\n casasQuePodemReceberParaquedista[casasQuePodemReceberParaquedista.length] = index;\n }\n });\n $.each(casas['campo-baixo'], function(index){\n if(this.tipo == 'normal' && this.ocupacao1 == '' && casaEstaNoCampoDePouso(pecaSelecionadaCampoAtaque, index) === true && casasQuePodemReceberParaquedista.indexOf(index) == -1){\n casasQuePodemReceberParaquedista[casasQuePodemReceberParaquedista.length] = index;\n }\n });\n}", "title": "" }, { "docid": "012548d379166c81872a71cb49d9d32f", "score": "0.52505946", "text": "function inicializar(){\n tm = []; \n cv = [];\n tv = [];\n cu = [];\n ct = [];\n cantprod = [];\n uniddisp = [];\n demnosat = []; \n costOp = []; \n ganancia = [];\n demandaDelMes = []; \n}", "title": "" }, { "docid": "83d079b404ae74a707921fd5b4bf064e", "score": "0.5249422", "text": "reiniciarConteo() {\n // creamos un objeto, con los valores de ultimo y hoy\n this.ultimo = 0;\n this.grabarArchivo();\n // aqui estamos reiniciando el conteo de los ticket emitidos\n this.tickets = [];\n this.ultimosCuatros = [];\n }", "title": "" }, { "docid": "e883d7d66e013555e24c872ec116339d", "score": "0.52456397", "text": "onClickMe() {\n const u16 = this.getElementListByCategorie(16, this.tabPlayerInfos);\n const u16N = this.sortByName(u16);\n const u16T2 = this.sortByGenre(u16N);\n let u16T = [];\n if (this.twin) {\n u16T = this.twinFunction(u16T2);\n }\n else {\n u16T = u16T2;\n }\n // const u16T = this.twinFunction(u16T2);\n const u14 = this.getElementListByCategorie(14, this.tabPlayerInfos);\n const u14N = this.sortByName(u14);\n const u14T2 = this.sortByGenre(u14N);\n let u14T = [];\n if (this.twin) {\n u14T = this.twinFunction(u14T2);\n }\n else {\n u14T = u14T2;\n }\n const u12 = this.getElementListByCategorie(12, this.tabPlayerInfos);\n const u12N = this.sortByName(u12);\n const u12T2 = this.sortByGenre(u12N);\n let u12T = [];\n if (this.twin) {\n u12T = this.twinFunction(u12T2);\n }\n else {\n u12T = u12T2;\n }\n const u10 = this.getElementListByCategorie(10, this.tabPlayerInfos);\n const u10N = this.sortByName(u10);\n const u10T2 = this.sortByGenre(u10N);\n let u10T = [];\n if (this.twin) {\n u10T = this.twinFunction(u10T2);\n }\n else {\n u10T = u10T2;\n }\n const u8 = this.getElementListByCategorie(8, this.tabPlayerInfos);\n const u8N = this.sortByName(u8);\n const u8T2 = this.sortByGenre(u8N);\n let u8T = [];\n if (this.twin) {\n u8T = this.twinFunction(u8T2);\n }\n else {\n u8T = u8T2;\n }\n const nexTab = [];\n Array.prototype.push.apply(nexTab, u16T);\n Array.prototype.push.apply(nexTab, u14T);\n Array.prototype.push.apply(nexTab, u12T);\n Array.prototype.push.apply(nexTab, u10T);\n Array.prototype.push.apply(nexTab, u8T);\n this.tabPlayerInfos = nexTab;\n // split array value\n const temporytabPlayerInfos = this.tabPlayerInfos;\n let calculeNumber = 0;\n let calculeNumber2 = calculeNumber + this.nbElementTab;\n this.tabPlayerInfosList1 = this.tabPlayerInfos.slice(calculeNumber, calculeNumber2);\n calculeNumber = calculeNumber2;\n calculeNumber2 = calculeNumber + this.nbElementTab;\n this.tabPlayerInfosList2 = this.tabPlayerInfos.slice(calculeNumber, calculeNumber2);\n calculeNumber = calculeNumber2;\n calculeNumber2 = calculeNumber + this.nbElementTab;\n this.tabPlayerInfosList3 = this.tabPlayerInfos.slice(calculeNumber, calculeNumber2);\n calculeNumber = calculeNumber2;\n calculeNumber2 = calculeNumber + this.nbElementTab;\n this.tabPlayerInfosList4 = this.tabPlayerInfos.slice(calculeNumber, calculeNumber2);\n calculeNumber = calculeNumber2;\n calculeNumber2 = calculeNumber + this.nbElementTab;\n this.tabPlayerInfosList5 = this.tabPlayerInfos.slice(calculeNumber, calculeNumber2);\n calculeNumber = calculeNumber2;\n calculeNumber2 = calculeNumber + this.nbElementTab;\n }", "title": "" }, { "docid": "9a777dead7bfa2c2e2030791221bc909", "score": "0.52443665", "text": "function fbCamposABloquear(tipoAccion){\n\t/*\n\t\t\t'selectUnidadNegocio':'UR',\n\t\t\t'selectUnidadEjecutora':'UE',\n\t*/\n\tvar\tCamposABloquear = [{\n\t\t\t'LocCode':'Código de Almacén'\n\t\t}];\n\n\t$.each(CamposABloquear[0],function(index, el) {\n\t\tif($('#'+index).is(\"select\")){\n\t\t\t$('#'+index).\n\t\t\tmultiselect( tipoAccion ? \"disable\" : \"enable\" );\n\t\t}else{\n\t\t\t//$('#'+index).prop('readonly', tipoAccion);\n\t\t\t$('#'+index).attr('readonly', tipoAccion);\n\t\t\tif(!tipoAccion){\n\t\t\t\t$('#'+index).removeAttr(\"readonly\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9a777dead7bfa2c2e2030791221bc909", "score": "0.52443665", "text": "function fbCamposABloquear(tipoAccion){\n\t/*\n\t\t\t'selectUnidadNegocio':'UR',\n\t\t\t'selectUnidadEjecutora':'UE',\n\t*/\n\tvar\tCamposABloquear = [{\n\t\t\t'LocCode':'Código de Almacén'\n\t\t}];\n\n\t$.each(CamposABloquear[0],function(index, el) {\n\t\tif($('#'+index).is(\"select\")){\n\t\t\t$('#'+index).\n\t\t\tmultiselect( tipoAccion ? \"disable\" : \"enable\" );\n\t\t}else{\n\t\t\t//$('#'+index).prop('readonly', tipoAccion);\n\t\t\t$('#'+index).attr('readonly', tipoAccion);\n\t\t\tif(!tipoAccion){\n\t\t\t\t$('#'+index).removeAttr(\"readonly\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "27086fc92a3838391b8516cc6073f9d9", "score": "0.52425116", "text": "function buscoClasificaciones() { \n var combo = get('frmUnico.cbTipoClasificacion');\n var id = get('frmUnico.clasOid');\n var desc = get('frmUnico.clasDesc');\n var tipocla = get('frmUnico.clasTipoClas');\n id = id.split(\",\");\n desc = desc.split(\",\");\n tipocla = tipocla.split(\",\");\n var longitud = tipocla.length;\n var opciones = new Array();\n var j = 1;\n\n\t\t //alert(combo);\n\n\t\t if (combo != \"\"){\n \t\t\t opciones[0] = [\"\",\"\"];\n\t\t\t for (i = 0; i < longitud; i++){\n\t\t\t\t\tif (tipocla[i] == combo){\n\t\t\t\t\t\t opciones[j] = [id[i],desc[i]];\n\t\t\t\t\t\t j++;\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t if (opciones.length > 0){\n\t\t\t\t\tset_combo('frmUnico.cbClasificacion',opciones);\n\t\t\t } \n\t\t }else{\n\t\t\t\topciones = new Array();\n\t\t\t\topciones[0] = [\"\",\"\"];\n\t\t\t\tset_combo('frmUnico.cbClasificacion', opciones);\n\t\t }\n \n\n }", "title": "" }, { "docid": "961d6a9f4bf0b8b41582c50008c47cb2", "score": "0.5241925", "text": "function agregacampo(valor, holder1) {\n if (valor == 'ldap') {\n idldap++;\n id = valor+idldap;\n } else if (valor == 'dns') {\n iddns++;\n id = valor+iddns;\n } else if (valor == 'dhcp') {\n iddhcp++;\n id = valor+iddhcp;\n } else if (valor == 'correo') {\n idcorreo++;\n id = valor+idcorreo;\n } else if (valor == 'proxy') {\n idproxy++;\n id = valor+idproxy;\n } else if (valor == 'repositorio') {\n idrepositorio++;\n id = valor+idrepositorio;\n } else if (valor == 'subred') {\n idsubred++;\n id = valor+idsubred;\n }\n clase = \".\"+valor;\n idremover = \"'\"+id+\"'\";\n //$(clase).append('<div id=\"'+id+'\" class=\"body-row itemselect\"><div class=\"body-cell\"><input class=\"input'+valor+'\"id=\"input'+id+'\" placeholder=\"'+holder1+'\" type=\"text\"></div><div class=\"body-cell\"><select id=\"estados'+id+'\" class=\"estados'+id+'\" onchange=\"cambiavalor(this.value, '+idremover+')\"></select><span class=\"icon-circle-with-minus\" onclick=\"quitarcampo('+idremover+')\"></span></div></div>');\n $(clase).append('<div id=\"'+id+'\" class=\"body-row itemselect\"><div class=\"body-cell\"><input class=\"input'+valor+'\"id=\"input'+id+'\" placeholder=\"'+holder1+'\" type=\"text\"></div><div class=\"body-cell\"><select id=\"estados'+id+'\" class=\"select'+valor+'\"></select><span class=\"icon-circle-with-minus\" onclick=\"quitarcampo('+idremover+')\"></span></div></div>');\n var estadoid = \"estados\"+id;\n cargarselects(estadoid);\n}", "title": "" }, { "docid": "f975f7d40e61ab672d395bcab63ee223", "score": "0.52380866", "text": "function configurarJogoBotaoDica() {\n\n $('#dica.botaoJogo').click(function (){\n\n pecas = Model.retornarPecasQueSeLigam();\n\n if(pecas != false)\n {\n peca1 = $('#'+pecas[0].pos[0]+'-'+pecas[0].pos[1]+'.peca').addClass('pecaDica');\n peca2 = $('#'+pecas[1].pos[0]+'-'+pecas[1].pos[1]+'.peca').addClass('pecaDica');\n\n setTimeout(function() {\n peca1.removeClass('pecaDica');\n peca2.removeClass('pecaDica');\n }, 1000);\n }\n });\n }", "title": "" }, { "docid": "0a072fbf276f3964097ba3429a33da6e", "score": "0.52307916", "text": "function initMesa(mesaMin){\n var mesa = ObjectsFactory.newMesa();\n mesa.idMesa = mesaMin.idMesa;\n mesa.idLlamado = mesaMin.periodo.idLlamado;\n mesa.fechaHoraInicio = setFechaHora(mesaMin.horaInicio);\n mesa.fechaHoraFin = setFechaHora(mesaMin.horaFin);\n mesa.idMateria = mesaMin.selectedMateria;\n mesa.tribunalDoc1 = mesaMin.docentes[0];\n mesa.tribunalDoc2 = mesaMin.docentes[1];\n mesa.tribunalDoc3 = mesaMin.docentes[2];\n return mesa;\n}", "title": "" }, { "docid": "f3ae62630ca842dd7631866c35fc4352", "score": "0.5225222", "text": "function majParticipants() {\r\n\t\tvar contientAnimateurs = false;\r\n\t\tvar contientNonAnimateurs = false;\r\n\t\tvar contientParticipants = false;\r\n\t\tvar itemsParticipants = new Array();\r\n\t\tfor(var i=0; i<ether.manager.participants.length; i++) {\r\n\t\t\tif(i!=MA_CLE && ether.manager.participants[i]!=null) {\r\n\t\t\t\tcontientParticipants = true;\r\n\t\t\t\tif(ether.manager.participants[i].estAnimateur)\r\n\t\t\t\t\tcontientAnimateurs = true;\r\n\t\t\t\telse\r\n\t\t\t\t\tcontientNonAnimateurs = true;\r\n\t\t\t\titemsParticipants.push({ value: ''+i, name: ether.manager.participants[i].prenom+' '+ether.manager.participants[i].nom });\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(contientParticipants) {\r\n\t\t\tdijit.byId(\"menuParametresATous\").disabled = false;\r\n\t\t\tdijit.byId(\"menuParametresATous\")._applyAttributes();\r\n\t\t\tif(dijit.byId(\"menuParametresATous\").checked) {\r\n\t\t\t\tdomStyle.set(dojo.byId('envoiATous'), \"display\", \"block\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t domStyle.set(dojo.byId('envoiATous'), \"display\", \"none\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdomStyle.set(dojo.byId('envoiATous'), \"display\", \"none\");\r\n\t\t\tdijit.byId(\"menuParametresATous\").disabled = true;\r\n\t\t\tdijit.byId(\"menuParametresATous\")._applyAttributes();\r\n\t\t}\r\n\t\tif(moi.estAnimateur) {\r\n\t\t\tif(contientNonAnimateurs) {\r\n\t\t\t\tdijit.byId(\"menuParametresAuxNonAnimateurs\").disabled = false;\r\n\t\t\t\tdijit.byId(\"menuParametresAuxNonAnimateurs\")._applyAttributes();\r\n\t\t\t\tif(dijit.byId(\"menuParametresAuxNonAnimateurs\").checked) {\r\n\t\t\t\t\tdomStyle.set(dojo.byId('envoiAuxNonAnimateurs'), \"display\", \"block\");\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t domStyle.set(dojo.byId('envoiAuxNonAnimateurs'), \"display\", \"none\");\r\n\t\t\t }\r\n\t\t\t} else {\r\n\t\t\t\tdomStyle.set(dojo.byId('envoiAuxNonAnimateurs'), \"display\", \"none\");\r\n\t\t\t\tdijit.byId(\"menuParametresAuxNonAnimateurs\").disabled = true;\r\n\t\t\t\tdijit.byId(\"menuParametresAuxNonAnimateurs\")._applyAttributes();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(contientAnimateurs) {\r\n\t\t\t\tdijit.byId(\"menuParametresAuxAnimateurs\").disabled = false;\r\n\t\t\t\tdijit.byId(\"menuParametresAuxAnimateurs\")._applyAttributes();\r\n\t\t\t\tif(dijit.byId(\"menuParametresAuxAnimateurs\").checked) {\r\n\t\t\t\t\tdomStyle.set(dojo.byId('envoiAuxAnimateurs'), \"display\", \"block\");\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t domStyle.set(dojo.byId('envoiAuxAnimateurs'), \"display\", \"none\");\r\n\t\t\t }\r\n\t\t\t} else {\r\n\t\t\t\tdomStyle.set(dojo.byId('envoiAuxAnimateurs'), \"display\", \"none\");\r\n\t\t\t\tdijit.byId(\"menuParametresAuxAnimateurs\").disabled = true;\r\n\t\t\t\tdijit.byId(\"menuParametresAuxAnimateurs\")._applyAttributes();\r\n\t\t\t}\r\n\t\t}\r\n\t\tlisteParticipants.clearOnClose = true;\r\n\t\tlisteParticipants.data = { identifier: 'value', label: 'name', items: itemsParticipants };\r\n\t\tlisteParticipants.close();\r\n\t}", "title": "" }, { "docid": "46fb0930944664bb7a926a76969a2cdc", "score": "0.52234054", "text": "setupChoices() {\n\n\t\tthis.CHOICES_INPUTS = [];\n\t\tthis.CHOICES_OUTPUTS = [];\n\t\tthis.CHOICES_PRESETS = [];\n\t\tthis.CHOICES_ROOMS = [];\n\n\t\tif (this.model.audio === true) {\n\t\t\tthis.CHOICES_LAYER: [\n\t\t\t\t{ label: 'Video & Audio', id: '!' },\n\t\t\t\t{ label: 'Video only', id: '%' },\n\t\t\t\t{ label: 'Audio only', id: '$'}\n\t\t\t];\n\t\t}\n\t\telse {\n\t\t\tthis.CHOICES_LAYER: [\n\t\t\t\t{ label: 'Video & Audio', id: '!' }\n\t\t\t];\n\t\t}\n\n\t\tif (this.inputCount > 0) {\n\t\t\tfor(var key = 1; key <= this.inputCount; key++) {\n\t\t\t\tif (this.getInput(key).status != 'None') {\n\t\t\t\t\tthis.CHOICES_INPUTS.push( { id: key, label: this.getInput(key).label } );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.outputCount > 0) {\n\t\t\tfor(var key = 1; key <= this.outputCount; key++) {\n\t\t\t\tif (this.getOutput(key).status != 'None') {\n\t\t\t\t\tthis.CHOICES_OUTPUTS.push( { id: key, label: this.getOutput(key).label } );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.presetCount > 0) {\n\t\t\tfor(var key = 1; key <= this.presetCount; key++) {\n\t\t\t\tif (this.getPreset(key).status != 'None') {\n\t\t\t\t\tthis.CHOICES_PRESETS.push( { id: key, label: this.getPreset(key).label } );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.roomCount > 0) {\n\t\t\tfor(var key = 1; key <= this.roomCount; key++) {\n\t\t\t\tif (this.getRoom(key).status != 'None') {\n\t\t\t\t\tthis.CHOICES_PRESETS.push( { id: key, label: this.getRoom(key).label } );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b3c5811c40417bf763af7106b200c96c", "score": "0.52224404", "text": "function objetoAleatorio(tipo) {\n var num = Math.floor(Math.random() * 3);\n var objeto;\n\n switch (num) {\n case 0:\n //Arma\n switch (tipo) {\n case 'basico':\n //Arma/Hechizo '0' o '1'\n if (player.tipoAtaque == 'AD') {\n objeto = armas[Math.floor(Math.random() * 2)];\n } else {\n objeto = hechizos[Math.floor(Math.random() * 2)];\n }\n break;\n case 'intermedio':\n //Arma/Hechizo '2' o '3'\n if (player.tipoAtaque == 'AD') {\n objeto = armas[Math.floor(Math.random() * 2) + 2];\n } else {\n objeto = hechizos[Math.floor(Math.random() * 2) + 2];\n }\n break;\n case 'fuerte':\n //Arma/Hechizo '4' o '5'\n if (player.tipoAtaque == 'AD') {\n objeto = armas[Math.floor(Math.random() * 2) + 3];\n } else {\n objeto = hechizos[Math.floor(Math.random() * 2) + 3];\n }\n break;\n }\n return objeto;\n case 1:\n //Escudo\n switch (tipo) {\n case 'basico':\n objeto = escudos[0];\n break;\n case 'intermedio':\n //Escudo '1' o '2'\n objeto = escudos[Math.floor(Math.random() * 2) + 1];\n break;\n case 'fuerte':\n objeto = escudos[3];\n break;\n }\n return objeto;\n case 2:\n //Armadura\n switch (tipo) {\n case 'basico':\n objeto = armaduras[0];\n break;\n case 'intermedio':\n //Armaduras '1' o '2'\n objeto = armaduras[Math.floor(Math.random() * 2) + 1];\n break;\n case 'fuerte':\n objeto = armaduras[3];\n break;\n }\n return objeto;\n }\n}", "title": "" }, { "docid": "79acc786d647e7f9bf45c409acbf361e", "score": "0.52133965", "text": "function mesSiguiente ()\n{\n if (this.mes==12) {\n mes2=1;\n ano2=this.ano+1;\n }else{\n mes2=this.mes+1;\n ano2=this.ano;\n }\n dia2=min(diasdelmes(ano2,mes2),this.dia);\n this.cargarDia(ano2,mes2,dia2)\n}", "title": "" }, { "docid": "1d1c9c658e1a8fbf4d155f2b0c1129b5", "score": "0.5206195", "text": "function ObtenerDatos101()\n{\n var movimiento = document.getElementById('bxClase').value;\n var porrc = document.getElementsByName('bx101Prb');\n var lote = document.getElementsByName('bx101Lote');\n var uean = document.getElementsByName('bx101UEAN');//Unidad Medida\n var prov = document.getElementsByName('bx101Prov');\n var cnr = document.getElementsByName('tdCR');//Cantidad Recepcionada\n var cnp = document.getElementsByName('tdCP');//Cantidad\n var ped = document.getElementsByName('tdPedido');\n var pos = document.getElementsByName('tdPos');\n var mat = document.getElementsByName('tdMaterial');\n var alm = document.getElementsByName('tdAlmacen');\n var doc = document.getElementsByName('tdDocCom');\n var cls = document.getElementsByName('tdClase');\n var pro = document.getElementsByName('tdProveedor');\n var txt = document.getElementsByName('tdtxt');\n var ulc = document.getElementsByName('tdulc');\n var cec = document.getElementsByName('tdCeCo');\n var ord = document.getElementsByName('tdOrder');\n var clc = document.getElementsByName('tdClCoste');\n var tim = document.getElementsByName(\"tdTImp\"); ////// Imputacion\n var n1 = 0;\n var n2 = 0;\n var registros = 0;\n switch (movimiento)\n {\n case \"101\":\n for (i = 0; i < porrc.length; i++)\n {\n n1 = parseFloat(porrc[i].value);\n n2 += n1;\n }\n if (n2 <= 0.000) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"No existen posiciones listas para su recepción\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (porrc[i].value.length < 1) {\n porrc[i].focus();\n invalido(\"Cantidad Obligatoria no puede ir vacio\");\n return;\n }\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (uean[i].value == \"\") {\n uean[i].focus();\n invalido(\"Unidad de Medida Obligatorio\");\n return;\n }\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (!(porrc[i].value == \"0\")) {\n var tole = GetCantFinal(cnp[i].textContent, uean[i].value, ped[i].textContent, pos[i].textContent);\n var pr2 = parseFloat(cnp[i].textContent) + parseFloat(tole);\n var ccc = parseFloat(porrc[i].value) + parseFloat(cnr[i].textContent);\n if (ccc > pr2) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"El Material\" + \" \" + mat[i].textContent + \" excede la cantidad de pedido aplicada con tolerancia\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n for (i = 0; i < lote.length; i++)\n {\n if (tim[i].textContent == \"\" && !(mat[i].textContent == \"\")) {\n var isDisabled = $('#bxLote' + i).prop('disabled');\n if (parseInt(porrc[i].value) !== 0) {\n if (isDisabled === false) {\n if (lote[i].value === \"\")\n {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"El Material\" + \" \" + mat[i].textContent + \" esta sujeto a Lote <br> el campo lote es obligatorio\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n }\n }\n ShowMsg(1, \"images/load.gif\", \"audio/sapmsg.wav\");\n $('#ok101').prop(\"disabled\", true);\n $('#Cerra101Taba').prop(\"disabled\", true);\n $('#guardar').prop(\"disabled\", true);\n var random = ObtenerFolioRandom();\n setTimeout(function () {\n GuardaTem101();\n }, 4000);\n break;\n case \"102\":\n var porrec = document.getElementsByName(\"bx102Prb\");\n var claspe = \"\";\n var lotepr = \"\";\n var tdmateri = document.getElementsByName(\"tdMaterial102\");\n var tdtxtmat = document.getElementsByName(\"tdtxt102\");\n var tdalmace = document.getElementsByName(\"tdAlmacen102\");\n var tdlote = document.getElementsByName(\"tdLote102\");\n var tdccance = document.getElementsByName(\"tdCantCa102\");\n var tdccanen = document.getElementsByName(\"tdCanEnt102\");\n var tdunme = document.getElementsByName(\"tdUME102\");\n var tdcentr = document.getElementsByName(\"tdCentro102\");\n var tdfecha = document.getElementsByName(\"tdFecEnt102\");\n var tdprove = document.getElementsByName(\"tdNumProv102\");\n var tddocco = document.getElementsByName(\"tdNumDocCom102\");\n var tdposco = document.getElementsByName(\"tdPosDoc102\");\n var tdceco = document.getElementsByName(\"tdCeCo102\");\n var tdorden = document.getElementsByName(\"tdOrd102\");\n var tdclaco = document.getElementsByName(\"tdClaCos102\");\n var tdmovim = document.getElementsByName(\"tdnumMov\");\n var n1 = 0;\n var n2 = 0;\n for (i = 0; i < porrec.length; i++) {\n n1 = parseInt(porrec[i].value);\n n2 += n1\n }\n\n if (n2 === 0)\n {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"No existen posiciones listas para su recepción\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n for (i = 0; i < porrec.length; i++) {\n if (porrec[i].value.length == 0) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"La cantidad no puede ir vacia, ingrese una cantidad\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n if (!(parseInt(porrec[i].value) == 0)) {\n var cf = (parseFloat(tdccance[i].textContent)) + (parseFloat(porrec[i].value));\n if (cf > parseFloat(tdccanen[i].textContent)) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"Cantidad Por Devolver mas Cantidad Cancelada, supera <br> a cantidad Entrante en posición \" + tdposco[i].textContent;\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n ShowMsg(1, \"images/load.gif\", \"audio/sapmsg.wav\");\n $('#ok101').prop(\"disabled\", true);\n $('#Cerra101Taba').prop(\"disabled\", true);\n $('#guardar').prop(\"disabled\", true);\n var random = ObtenerFolioRandom();\n setTimeout(function () {\n GuardaTem102();\n }, 4000);\n break;\n }\n\n}", "title": "" }, { "docid": "af58ca7a7294eeb24e208dd8147362d4", "score": "0.52031565", "text": "constructor(materiasPorCursar, tamanoGrupo, tamanoMinimoGrupo, minimoCreditos, limiteCreditos){\n this.materiasPorCursar= materiasPorCursar;\n this.tamanoGrupo= tamanoGrupo;\n this.tamanoMinimoGrupo= tamanoMinimoGrupo;\n this.minimoCreditos= minimoCreditos;\n this.limiteCreditos= limiteCreditos;\n this.posiblesCombinaciones=[];\n }", "title": "" }, { "docid": "f41e48d59a1d6b330ff4672d6d69ed8c", "score": "0.5192379", "text": "cacherMines() {\n this.champ.innerText = \"\";\n this.personnage.afficher();\n this.tresor.afficher();\n }", "title": "" }, { "docid": "fe956f1224d32e0c1bf88b97d6393b5e", "score": "0.5190902", "text": "function targets(){\n var form = document.querySelectorAll('.choices');\n var opciones = battle.options.current._group; // Se repite el codigo de opciones pero no se/ni he intendo para que no sea asi XD\n console.log(battle);\n //el 2 se refiere a que cuando buscas .choices hay tres elementos que tienen eso y como las de targets la tiene la 2 pues eso de\n // todos modos seguro que hay una forma de que con el querySelector o get elemment salga mejor\n var pari = battle._activeCharacter.party;\n \n console.log(opciones);\n form[2].innerHTML = \"\";\n for(var op in opciones){\n if(pari === battle._charactersById[opciones[op]].party){// descomentar para que solo pueda atacar a enemigos\n form[2].innerHTML += '<li><font color=\"#009200\"><label><input type=\"radio\" name=\"option\" value=\"' \n + op + '\"requiered>' + op + \"</label></font></li>\";\n }\n else form[2].innerHTML += '<li><font color=\"#B70000\"><label><input type=\"radio\" name=\"option\" value=\"' \n + op + '\"requiered>' + op + \"</label></font></li>\";\n }\n}", "title": "" }, { "docid": "0fe59b963a0281e328d82c5cf8d31fb6", "score": "0.51782143", "text": "function leerDatosCurso(cursoSeleccionado)\n{\n \n\n //crear un objeto con el contenido del curso actual\n\n const infoCurso={\n // de estas maneras podemos ir accediendo a los elementos\n imagen:cursoSeleccionado.querySelector('img').src,\n titulo:cursoSeleccionado.querySelector('h4').textContent,\n precio: cursoSeleccionado.querySelector('.precio span').textContent,\n // getAttribute nos sirve para obetener el contenido de un atributo de un elemento\n id: cursoSeleccionado.querySelector('a').getAttribute('data-id'),\n cantidad:1,\n }\n// revisa si un elemento ya existe en el carrito\nconst existe=articulosCarrito.some((curso)=>\n{\n return curso.id===infoCurso.id;\n})\n // si el curso ya esta en la lita ejecutaremos este if\n if(existe)\n {\n //actualizamos la cantidad\n const cursos=articulosCarrito.map((curso)=>\n {\n if(curso.id===infoCurso.id)\n {\n curso.cantidad+=1;\n return curso;//retorna el objeto actualizado\n }\n else\n {\n return curso;\n }\n });\n articulosCarrito=[...cursos];\n }\n // y si no esta agregamos el curso al carrito\n else{\n articulosCarrito=[...articulosCarrito,infoCurso];\n }\n\n\n\n\n \n \n\n carritoHtml();\n\n}", "title": "" }, { "docid": "8d6393eea60875ca5504f3f25938b394", "score": "0.5177599", "text": "Mulligan(socektid){\n //si el id del jugador es el mismo que el del socketId se ejecuta (sirve para que el servidor sepa quien hace mulligan)\n if(socektid == this.player1.id){\n var cardArray = []\n //recorre la mano del jugador1 y la mete en cardArray\n this.player1.mano.forEach(function(data){\n cardArray.push(data)\n })\n //recorre el mazo del jugador1 y la mete en cardArray\n this.player1.mazo.cards.forEach(function(data){\n cardArray.push(data)\n })\n //barajea el cardArray aleatoriamente\n var suflecard = shuffle(cardArray)\n //Y mete el mazo barajeado en el json de player1\n this.player1.mazo.cards = suflecard\n //vacia la mano del jugador1\n this.player1.mano = []\n\n var deal = takeCards(this.mulligan.cardsPla1,this.player1.mazo.cards)\n //cada vez que haces mulligan resta 1 a la cantiad de cartas q robas\n this.mulligan.cardsPla1 -= 1\n //vuelve a meter el mazo en el json de player1 despues de robar\n this.player1.mazo.cards = deal.mazo\n //vuelve a meter la mano en el json de player1 despues de robar\n this.player1.mano = deal.mano\n //emite al player1 su propio json(cliente-gamePlay.js)\n this.io.to(this.player1.id).emit(\"cards_mullig\",deal)\n //hace lo mismo que antes pero con el jugador2\n }else if(socektid == this.player2.id){\n var cardArray = []\n this.player2.mano.forEach(function(data){\n cardArray.push(data)\n })\n this.player2.mazo.cards.forEach(function(data){\n cardArray.push(data)\n })\n var suflecard = shuffle(cardArray)\n this.player2.mazo.cards = suflecard\n this.player2.mano = []\n var deal = takeCards(this.mulligan.cardsPla2,this.player2.mazo.cards)\n this.mulligan.cardsPla2 -= 1\n this.player2.mazo.cards = deal.mazo\n this.player2.mano = deal.mano\n this.io.to(this.player2.id).emit(\"cards_mullig\",deal)\n \n }\n }", "title": "" }, { "docid": "c3d00ba7aa7f3f1730126c61c3c81a28", "score": "0.51702654", "text": "function cargarItemsMaquinas() {\n var valor_seleval = 36;\n var valor_for_options_radio = 1;\n var valor_options_radio = 1;\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_maquinas, v_item, o_descripcion, v_clasificacion FROM ascensor_items_maquinas\";\n tx.executeSql(query, [], function (tx, resultSet) {\n for(var x = 0; x < resultSet.rows.length; x++) {\n var numero_item = resultSet.rows.item(x).k_coditem_maquinas;\n var valor_Item = resultSet.rows.item(x).v_item;\n var descripcion_item = resultSet.rows.item(x).o_descripcion;\n var clasificacion_item = resultSet.rows.item(x).v_clasificacion;\n if (clasificacion_item == \"Leve\") {\n clasificacion_item = \"L\";\n }\n if (clasificacion_item == \"Grave\") {\n clasificacion_item = \"G\";\n }\n if (clasificacion_item == \"Muy Grave\") {\n clasificacion_item = \"MG\";\n }\n var contenidoDiv = \n '<div class=\"container-fluid\">'+\n '<input type=\"hidden\" id=\"numero_item_maquinas'+numero_item+'\" value=\"'+numero_item+'\">'+\n '<input type=\"hidden\" id=\"cal_item_maquinas'+numero_item+'\" value=\"'+clasificacion_item+'\">'+\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid; text-align: center;\">'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; background-color: #5bc0de;\">'+\n '<label>#</label>'+\n '</div>'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid; background-color: #5bc0de;\">'+\n '<label>ÍTEM</label>'+\n '</div>'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid; background-color: #5bc0de;\">'+\n '<label>CAL</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid; text-align: center;\">'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid;\">'+\n '<label>'+numero_item+'</label>'+\n '</div>'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid;\">'+\n '<label>'+valor_Item+'</label>'+\n '</div>'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid;\">'+\n '<label>\"'+clasificacion_item+'\"</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid;\">'+\n '<div class=\"col-xs-12 col-sm-12 col-md-12\" style=\"border-top:1px solid; text-align: center; background-color: #5bc0de;\">'+\n '<label>DEFECTO</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid;\">'+\n '<div class=\"col-xs-12 col-sm-12 col-md-12\" style=\"border-top:1px solid; text-align: justify;\">'+\n '<p style=\"margin: 14px; padding: 15px; width: 88%;\">'+descripcion_item+'</p>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid; text-align: center;\">'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; background-color: #5bc0de; padding-left: 2%;\">'+\n '<label for=\"sele_lv_maquinas'+valor_for_options_radio+'\">SI CUMPLE</label>'+\n '</div>';\n valor_for_options_radio += 1;\n contenidoDiv +=\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid; background-color: #5bc0de; padding-left: 2%;\">'+\n '<label for=\"sele_lv_maquinas'+valor_for_options_radio+'\">NO CUMPLE</label>'+\n '</div>';\n valor_for_options_radio += 1;\n contenidoDiv +=\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid; background-color: #5bc0de; padding-left: 2%;\">'+\n '<label for=\"sele_lv_maquinas'+valor_for_options_radio+'\">NO APLICA</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid; text-align: center;\">'+\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid;\">'+\n '<div class=\"radio\">'+\n '<label for=\"sele_lv_maquinas'+valor_options_radio+'\" style=\"width: 100%;\">'+\n '<input type=\"radio\" name=\"sele_maquinas'+valor_seleval+'\" id=\"sele_lv_maquinas'+valor_options_radio+'\" value=\"Si Cumple\" >'+\n '</label>'+\n '</div>'+\n '</div>';\n valor_options_radio += 1;\n contenidoDiv +=\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid;\">'+\n '<div class=\"radio\">'+\n '<label for=\"sele_lv_maquinas'+valor_options_radio+'\" style=\"width: 100%;\">'+\n '<input type=\"radio\" name=\"sele_maquinas'+valor_seleval+'\" id=\"sele_lv_maquinas'+valor_options_radio+'\" value=\"No Cumple\" required>'+\n '</label>'+\n '</div>'+\n '</div>';\n valor_options_radio += 1;\n contenidoDiv +=\n '<div class=\"col-xs-4 col-sm-4 col-md-4\" style=\"border-top:1px solid; border-left:1px solid;\">'+\n '<div class=\"radio\">'+\n '<label for=\"sele_lv_maquinas'+valor_options_radio+'\" style=\"width: 100%;\">'+\n '<input type=\"radio\" name=\"sele_maquinas'+valor_seleval+'\" id=\"sele_lv_maquinas'+valor_options_radio+'\" value=\"No Aplica\" >'+\n '</label>'+\n '</div>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid;\">'+\n '<div class=\"col-xs-12 col-sm-12 col-md-12\" style=\"border-top:1px solid; text-align: center; background-color: #5bc0de;\">'+\n '<label for=\"text_maquinas_observacion_'+numero_item+'\">OBSERVACIÓN</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-top:1px solid; border-left:1px solid; border-right:1px solid;\">'+\n '<div class=\"col-xs-12 col-md-12\">'+\n '<br>'+\n '<textarea class=\"form-control\" rows=\"3\" id=\"text_maquinas_observacion_'+numero_item+'\" name=\"text_maquinas_observacion_'+numero_item+'\" placeholder=\"Ingrese aquí la observación...\"></textarea>'+\n '<br>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-left:1px solid; border-right:1px solid;\">'+\n '<div class=\"col-xs-12 col-sm-12 col-md-12\" style=\"border-top:1px solid; text-align: center; background-color: #5bc0de;\">'+\n '<label for=\"botonIniciar'+numero_item+'\">REGISTRO FOTOGRÁFICO</label>'+\n '</div>'+\n '</div>'+\n\n '<div class=\"row\" style=\"border-top:1px solid; border-left:1px solid; border-right:1px solid; border-bottom:1px solid; text-align: center;\">'+\n '<div class=\"col-xs-12 col-md-12\">'+\n '<br>'+\n '<button type=\"button\" id=\"botonIniciar'+numero_item+'\" class=\"btn btn-success sombra boton_webcam\" onclick=\"capturePhoto(this.id)\">'+\n '<span class=\"glyphicon glyphicon-camera\"></span>'+\n ' Iniciar Cámara'+\n '</button>'+\n '<br><br>'+ \n '</div>'+\n '</div>'+\n '</div>'+\n \n '<br>'+\n '<div class=\"divisionItems sombra\"></div>'+\n '<br>';\n $(contenidoDiv).appendTo(\"#items_maquinas\");\n valor_for_options_radio += 1;\n valor_options_radio += 1;\n valor_seleval += 1;\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "0f729b0c333f09f71fd5e066f0741654", "score": "0.5169992", "text": "function choices() {\n\n buttons = [];\n // a loop for only 1 profit button at a time\n for (let i = 0; i < PROFIT_OPTIONS; i++) {\n\n // user answer comes from what is in our profit array\n let answer = getRandomElement(profitContent);\n // shows the array content on the button\n let $button = buttonShow(answer);\n // Add this button to the buttons array\n buttons.push($button);\n }\n\n buttons2 = [];\n // a loop for only 1 happiness button at a time\n for (let i = 0; i < HAPPINESS_OPTIONS; i++) {\n // user answer comes from what is in our happiness array\n let answer = getRandomElement(happinessContent);\n // shows the array content on the button\n let $button = buttonShow(answer);\n // Add this button to the buttons array\n buttons2.push($button);\n }\n\n // call our profit and happiness butttons from he content on the buttons\n profitButton = getRandomElement(buttons);\n happinessButton = getRandomElement(buttons2);\n}", "title": "" }, { "docid": "e40525db21f6fe322dd7b6870ad7a440", "score": "0.51676863", "text": "function mostrar(event) {\r\n\r\n\t\tconsole.log(event.type + \" tipo evento\");\r\n\t\t//recoger valor de un texto\r\n\r\n\t\t//preguntar si con value esta bien\r\n\t\tlet valorTexto = datoTexto.value;\r\n\r\n\t\tlet valorNum = datoNumeros.value;\r\n\r\n\t\tlet valorPass = datoContra.value;\r\n\r\n\t\tlet valorArea = datoArea.value;\r\n\r\n\t\tlet valorBuscador = datoBuscador.value;\r\n\r\n\t\t//hacer hincapie, ver tambien las opciones (apuntes word)\r\n\t\tlet valorSelect = datoSel.value; \r\n\r\n\t\t/* \r\n\t\t\trecoger valor \r\n\t\t\tdatoSel.options[1].innerHTML\r\n\r\n\t\t\tpara pillar todos \r\n\t\t\t\trecuperar longitud (cuantas opciones hay)\r\n\t\t\t\tlet long = datoSel.options.length;\r\n\t\t\t\tun for recorriendo tantas y pillando los valores\r\n\t\t\t\t\tfor(let i = 0 ; i < long; i++){console.log(datoSel.options[i].innerHTML);}\r\n\t\t\r\n\t\t\trecuperar el seleccionado\r\n\t\t\t\tlet idxSeleccionado = datoSel.selectedIndex;\r\n\t\t\trecoger el elemento seleccionado\r\n\t\t\t\tlet opcionSeleccionada = datoSel.options[idxSeleccionado]; \r\n\t\t\trecoger el texto del valor\r\n\t\t\t\tlet datoSeleccionado = opcionSeleccionada.innerHTML;\r\n\r\n\t\t*/\r\n\t\tlet valorSex;\r\n\r\n\t\tfor (let i = 0; i < datoRadio.length; i++) {\r\n\t\t\tif (datoRadio[i].checked) {\r\n\t\t\t\tvalorSex = datoRadio[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet valorComida;\r\n\r\n\t\t\tif (datoCheckA.checked) {\r\n\t\t\t\tvalorComida = datoCheckA.value;\r\n\t\t\t}\r\n\t\t\tif (datoCheckP.checked) {\r\n\t\t\t\tvalorComida = datoCheckP.value;\r\n\t\t\t}if(datoCheckA.checked && datoCheckP.checked){\r\n\t\t\t\tvalorComida = datoCheckA.value + \" y \" + datoCheckP.value;\r\n\t\t\t}else{\r\n\t\t\t\tvalorComida=\"No selecciono nada,pobre diablo\";\r\n\t\t\t}\r\n\t\t\r\n\t\tlet valorMail = datoCorreo.value;\r\n\r\n\t\tlet valorFecha = datoFecha.value;\r\n\r\n\t\tlet valorColor = datoColor.value;\r\n\r\n\t\tconsole.log(valorComida + \" valor \");\r\n\r\n\r\n\t\t//ej8 recoger los datos de disponibilidad del formulario (checkbox)\r\n\t\tlet divDispo = document.querySelector(\"#disponibilidad\");\r\n\t\tlet hijosDivDispo = divDispo.children;\r\n\t\thijosDivDispo = Array.from(hijosDivDispo);\r\n\r\n\t\tlet resultado=\"\";\r\n\t\tfor( let i = 2; i < hijosDivDispo.length; i++){\r\n\t\t\tif ( (i == 2) || (i == 5) || (i == 8) || (i == 11) || (i == 14) ) {\r\n\t\t\t\tif (hijosDivDispo[i].checked) {\r\n\t\t\t\t\tlet valor = hijosDivDispo[i].value;\r\n\t\t\t\t\tresultado += valor+ \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//para editar el valor del select, hay que seleccionar el propio selec y de ahi, acceder a su hijo, no funciona con multiples valores\r\n\t\tlet prefe = document.querySelector(\"#idDiaPref\");\r\n\t\tprefe[0].innerHTML = resultado;\r\n\t\tprefe[0].value = resultado;\r\n\t\tconsole.log(resultado)\r\n\r\n\r\n\t\t//ej9 cambiar color de fondo de la pagina, con opcion del checkbox\r\n\t\tlet divColor = document.querySelector(\"#colorfondo\");\r\n\t\tlet hijosDivColor = divColor.children;\r\n\t\thijosDivColor = Array.from(hijosDivColor);\r\n\r\n\t\tlet resultadoColor=\"\";\r\n\t\tfor( let i = 2; i < hijosDivColor.length; i++){\r\n\t\t\tif ( (i == 2) || (i == 5) || (i == 8) || (i == 11) || (i == 14) ) {\r\n\t\t\t\tif (hijosDivColor[i].checked) {\r\n\t\t\t\t\tlet valor = hijosDivColor[i].value;\r\n\t\t\t\t\tresultadoColor += valor+ \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//para editar el valor del color\r\n\t\tdocument.body.style.backgroundColor = resultadoColor;\r\n\t\t\r\n\t\tconsole.log(resultadoColor)\r\n\r\n\t\tinfoFinal.textContent = `Texto ${valorTexto} \r\n\t\t\t\t\t\t\t\tNumero ${valorNum} \r\n\t\t\t\t\t\t\t\tPassword ${valorPass}\r\n\t\t\t\t\t\t\t\tTexto area ${valorArea}\r\n\t\t\t\t\t\t\t\tValor Buscador ${valorBuscador} \r\n\t\t\t\t\t\t\t\tSeleccionado ${valorSelect} \r\n\t\t\t\t\t\t\t\tSexo ${valorSex} \r\n\t\t\t\t\t\t\t\tComida ${valorComida} \r\n\t\t\t\t\t\t\t\tEmail ${valorMail}\r\n\t\t\t\t\t\t\t\tFecha ${valorFecha}\r\n\t\t\t\t\t\t\t\tColor ${valorColor}`;\r\n\t\t\t\t\t\t\t\t\r\n\tevent.preventDefault();\r\n\t\r\n}", "title": "" }, { "docid": "dc3ddf3e161385ac272510acd96506da", "score": "0.5166583", "text": "function generators(){\n p1 = choices[Math.floor(3*Math.random())];\n p2 = choices[Math.floor(3*Math.random())];\n p3 = choices[Math.floor(3*Math.random())];\n p4 = choices[Math.floor(3*Math.random())];\n}", "title": "" }, { "docid": "0ec49e63be46f7a6767145cf6d49b9a9", "score": "0.51547164", "text": "function presionar(boton){\n // Volcamos la información en la variable\n var LCD = getLCD();\n // Comprobamos si LCD es distinto a 0 o si no es un numero\n if(LCD!='0' || isNaN(boton)) setLCD(LCD+boton);\n //Seleccionamos \n else setLCD(boton);\n}", "title": "" }, { "docid": "085c097ea5f90f92ab459a111dfddc1a", "score": "0.5152645", "text": "function mostrar()\n{\n\tlet tipoProductoING;\n\tlet precioING;\n\tlet unidadesCantidadING;\n\tlet tipoInflamableING;\n\tlet marcaING;\n\n\tlet acumuladorCantAlcohol = 0; //A)\n\tlet acumuladorCantIac = 0;\n\tlet acumuladorCantQuat = 0;\n\n\tlet contadorAlcohol = 0;\n\tlet contadorIac = 0;\n\tlet contadorQuat = 0;\n\n\tlet promedioCantAlcohol;\n\tlet promedioCantIac;\n\tlet promedioCantQuat;\n\n\tlet acumuladorIgnífugo = 0; // B)\n\tlet acumuladorCombustible = 0;\n\tlet acumuladorExplosivo = 0;\n\t\n\tlet acumuladorIacMenorPrecio = 0; //C)\n\n\tlet precioCaro; // D)\n\tlet marcaCaro;\n\tlet tipoCaro;\n\tlet flagCaro = 0;\n\n\tfor (let i=0; i<5; i++)\n\t{\n\t\ttipoProductoING = prompt(\"Ingrese producto (ALCOHOL , IAC o QUAT):\");\n\t\twhile (tipoProductoING != \"ALCOHOL\" && tipoProductoING != \"IAC\" && tipoProductoING != \"QUAT\")\n\t\t{\n\t\t\ttipoProductoING = prompt (\"INVALIDO. Ingrese producto (ALCOHOL , IAC , QUAT):\");\n\t\t}\n\n\t\tprecioING = parseFloat(prompt(\"Ingrese precio de dicho producto (entre 100 y 300):\"));\n\t\twhile (precioING < 100 || precioING > 300 || isNaN(precioING) == true)\n\t\t{\n\t\t\tprecioING = parseFloat(prompt(\"INVALIDO. Ingrese precio de dicho producto (entre 100 y 300)\"));\n\t\t}\n\t\t\n\t\tunidadesCantidadING = parseInt(prompt(\"Ingrese cantidad de unidades. (+0 y menor a 1000):\"));\n\t\twhile(unidadesCantidadING < 1 || unidadesCantidadING > 1000 || isNaN(unidadesCantidadING) == true)\n\t\t{\n\t\t\tunidadesCantidadING = parseInt(prompt(\"INVALIDO. Ingrese cantidad de unidades. (+0 y menor a 1000):\"));\n\t\t}\n\n\t\ttipoInflamableING = prompt(\"Ingrese el tipo de inflamable (ignífugo , combustible , explosivo:\");\n\t\twhile(tipoInflamableING!=\"ignifugo\" && tipoInflamableING != \"combustible\" && tipoInflamableING != \"explosivo\")\n\t\t{\n\t\t\ttipoInflamableING = prompt(\"INVALIDO. Ingrese el tipo de inflamable (ignífugo , combustible , explosivo:\");\n\t\t}\n\n\t\tmarcaING = prompt(\"Ingrese la marca de dicho producto:\");\n\t\twhile(isNaN(marcaING) == false || marcaING == \"\")\n\t\t{\n\t\t\tmarcaING = prompt(\"INVALIDO. Ingrese la marca de dicho producto:\");\n\t\t}\n\t\t\n\t\tif (flagCaro == 0 || precioING > precioCaro)//D)\n\t\t{\n\t\t\tprecioCaro = precioING;\n\t\t\ttipoCaro = tipoProductoING;\n\t\t\tmarcaCaro = marcaING; \n\t\t\tflagCaro++;\n\t\t\t\n\t\t}\n\n\t\tswitch(tipoProductoING)\n\t\t{\n\t\t\tcase \"ALCOHOL\":\n\t\t\t\tcontadorAlcohol++;\n\t\t\t\tacumuladorCantAlcohol += unidadesCantidadING;\n\t\t\tbreak;\n\n\t\t\tcase \"IAC\":\n\t\t\t\tcontadorIac++;\n\t\t\t\tacumuladorCantIac += unidadesCantidadING;\n\t\t\t\tif (precioING <= 200) // C)\n\t\t\t\t{\n\t\t\t\t\tacumuladorIacMenorPrecio += unidadesCantidadING;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase \"QUAT\":\n\t\t\t\tcontadorQuat++;\n\t\t\t\tacumuladorCantQuat += unidadesCantidadING;\n\t\t\tbreak;\n\n\t\t}\n\n\t\tswitch(tipoInflamableING)\n\t\t{\n\t\t\tcase \"ignífugo\":\n\t\t\t\tacumuladorIgnífugo += unidadesCantidadING;\n\t\t\tbreak;\n\n\t\t\tcase \"combustible\":\n\t\t\t\tacumuladorCombustible += unidadesCantidadING;\n\t\t\tbreak;\n\n\t\t\tcase \"explosivo\":\n\t\t\t\tacumuladorExplosivo += unidadesCantidadING;\n\t\t\tbreak;\n\t\t}\n\n\t} // Fin del ciclo.\n\n\tif(contadorAlcohol != 0) // A)\n\t{\n\t\tpromedioCantAlcohol = acumuladorCantAlcohol / contadorAlcohol;\n\t\tdocument.write(\"A) Promedio de ALCOHOL: \"+promedioCantAlcohol+\"<br>\");\n\t}\n\telse if (contadorIac != 0)\n\t{\n\t\tpromedioCantIac = acumuladorCantIac / contadorIac;\n\t\tdocument.write(\"A) Promedio de IAC: \"+promedioCantIac+\"<br>\");\n\t}\n\telse if (contadorQuat != 0)\n\t{\n\t\tpromedioCantQuat = acumuladorCantQuat / contadorQuat;\n\t\tdocument.write(\"A) Promedio de QUAT: \"+promedioCantQuat+\"<br>\");\n\t}\n\n\tif(acumuladorIgnífugo > acumuladorCombustible && acumuladorIgnífugo > acumuladorExplosivo) // B)\n\t{\n\t\tdocument.write(\"B) El tipo inflamable con mas unidades es Ignífugo con: \"+acumuladorIgnífugo+\"<br>\");\n\t}\n\telse\n\t{\n\t\tif (acumuladorCombustible > acumuladorIgnífugo && acumuladorExplosivo)\n\t\t{\n\t\t\tdocument.write(\"B) El tipo inflamable con mas unidades es Combustible con: \"+acumuladorCombustible+\"<br>\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.write(\"B) El tipo inflamable con mas unidades es Explosivo con: \"+acumuladorExplosivo+\"<br>\");\n\t\t}\n\t}\n\n\t// C)\n\tdocument.write(\"C) Total unidades de IAC con precios menos a 200 (inclusive): \"+acumuladorIacMenorPrecio+\"<br>\");\n\t\n\t// D)\n\tdocument.write(\"D) Tipo mas caro de los productos: \"+tipoCaro+ \" y su marca: \"+marcaCaro+\"<br>\");\n\n\n\n}", "title": "" }, { "docid": "dfc2331a48842b84121602b4009432f9", "score": "0.5148786", "text": "applyDefaultBiomesSystem() {\n const name = [\"Marine\", \"Hot desert\", \"Cold desert\", \"Savanna\", \"Grassland\", \"Tropical seasonal forest\", \"Temperate deciduous forest\", \"Tropical rainforest\", \"Temperate rainforest\", \"Taiga\", \"Tundra\", \"Glacier\", \"Wetland\" // -15 | +10\n ];\n const color = [\"#466eab\", \"#fbe79f\", \"#b5b887\", \"#d2d082\", \"#c8d68f\", \"#b6d95d\", \"#29bc56\", \"#7dcb35\", \"#409c43\", \"#4b6b32\", \"#96784b\", \"#d5e7eb\", \"#0b9131\"];\n const habitability = [0, 4, 10, 22, 30, 50, 100, 80, 90, 12, 4, 0, 12];\n const iconsDensity = [0, 3, 2, 120, 120, 120, 120, 150, 150, 100, 5, 0, 150];\n const icons = [{}, {\n dune: 3,\n cactus: 6,\n deadTree: 1\n }, {\n dune: 9,\n deadTree: 1\n }, {\n acacia: 1,\n grass: 9\n }, {\n grass: 1\n }, {\n acacia: 8,\n palm: 1\n }, {\n deciduous: 1\n }, {\n acacia: 5,\n palm: 3,\n deciduous: 1,\n swamp: 1\n }, {\n deciduous: 6,\n swamp: 1\n }, {\n conifer: 1\n }, {\n grass: 1\n }, {}, {\n swamp: 1\n }];\n const cost = [10, 200, 150, 60, 50, 70, 70, 80, 90, 200, 1000, 5000, 150]; // biome movement cost\n\n const biomesMartix = [// hot ↔ cold [>19°C; <-4°C]; dry ↕ wet\n new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10]), new Uint8Array([3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 9, 9, 9, 10, 10, 10]), new Uint8Array([5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 10, 10, 10]), new Uint8Array([5, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10]), new Uint8Array([7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10])]; // parse icons weighted array into a simple array\n\n for (let i = 0; i < icons.length; i++) {\n const parsed = [];\n\n for (const icon in icons[i]) {\n for (let j = 0; j < icons[i][icon]; j++) {\n parsed.push(icon);\n }\n }\n\n icons[i] = parsed;\n }\n\n return {\n i: d3.range(0, name.length),\n name,\n color,\n biomesMartix,\n habitability,\n iconsDensity,\n icons,\n cost\n };\n }", "title": "" }, { "docid": "aba8596a043fa9a47988d5e859d36627", "score": "0.51432365", "text": "function Muertisimo() {\n\ttodoNormal();\n\tquitarClases(\"modal2\",\"jugando\",\"perder\");\n\tvivo=false;\n\tvolverIniciar();\n\tcookieScore(puntuacion);\n}", "title": "" }, { "docid": "1621514c34029e8ff01b2a6462c4fc18", "score": "0.51416254", "text": "function KelimeyiTamamla()\n {\n for(i=0;i<MevcutAnahtarKelime.length;i++)\n {\n $(\".cndkLevel\" + MevcutLevel + \" > .HarfKutu input:eq(\"+i+\")\").val(MevcutAnahtarKelime[i]);\n $(\".cndkLevel\" + MevcutLevel + \" > .HarfKutu input:eq(\"+i+\")\").attr(\"disabled\",true);\n $(\".cndkLevel\" + MevcutLevel + \" > .HarfKutu input:eq(\"+i+\")\").parent().addClass(\"cndkBoxOpened\");\n $(\".cndkLevel\" + MevcutLevel + \" > .HarfKutu input:eq(\"+i+\")\").attr(\"data-opened\",\"true\");\n }\n //Mevcut Puanindan Soru Puanini Duser\n Puan -= parseInt($(\".cndkCurrentPoint\").text());\n $('.Puan > span').text(Puani + Puan);\n\n // Mevcut Leveli Siler Siradaki Levele Gecer\n setTimeout(function(){\n $(\".cndkLevel\").remove();\n $(\".LevelBilgi\").remove();\n }, 1500);\n MevcutSoruSayisi++;\n if(MevcutSoruSayisi <= ToplamSoruSayisi)\n {\n if(MevcutSoruSayisi%2 != 0)\n {\n MevcutLevel++;\n }\n\n setTimeout(function(){\n $(\".cndkLevel\").remove();\n getLevel(MevcutLevel);\n }, 2500);\n }\n //Soru sayisi bittiyse Oyun Bitisi\n if(MevcutSoruSayisi>ToplamSoruSayisi)\n {\n OyunBitti();\n }\n }", "title": "" }, { "docid": "fd88eda75d21202c05190a3984d4b9d9", "score": "0.51402164", "text": "function sychroChanson() {\n\tvar sychro = listeMessages[\"CHANSON\"][0][0];\n\tif (sychro === null and CHANSON_SYNCHRO === null) {\n\t\tCHANSON_SYNCHRO = [randInt(0, count(listeChanson)), 0];\n\t\tsendReallyAll(MESSAGE_CUSTOM, [\"CHANSON\", CHANSON_SYNCHRO]);\n\t}\n\telse if (sychro !== null) {\n\t\tCHANSON_SYNCHRO = sychro;\n\t}\n}", "title": "" }, { "docid": "7f547ced3bba57330f172b5b0d89f281", "score": "0.51308304", "text": "function usable() {\n\t\tlet boucle = Math.floor(Math.random() * 2 + 1);\n\t\tif(liste_Niveau[l].Niveau === 1 && liste_Niveau[l].Inventaire.length !== 3) {\n\t\t\tfor(let i = 0; i < 3; i++) { \n\t\t\t\tlet random = Math.floor(Math.random()*3);\n\t\t\t\tif(i === 0) {\n\t\t\t\t\tobjects_usable = usable_objects[0];\n\t\t\t\t\timage_usable = '<img class=\"recompense-description1\" src=\"'+objects_usable.image+'\"/>';\n\t\t\t\t\tmarqueur.objet_usable = image_usable;\n\t\t\t\t\tmarqueur.objet_usable2 = \"\";\n\t\t\t\t\tmarqueur.objet_usable3 = \"\";\n\t\t\t\t}\n\t\t\t\tif(i === 1) {\n\t\t\t\t\tobjects_usable2 = usable_objects[1];\n\t\t\t\t\timage_usable2 = '<img class=\"recompense-description2\" src=\"'+objects_usable2.image+'\"/>';\t\n\t\t\t\t\tmarqueur.objet_usable2 = image_usable2; \n\t\t\t\t}\n\t\t\t\tif(i === 2) {\n\t\t\t\t\tobjects_usable3 = usable_objects[2];\n\t\t\t\t\timage_usable3 = '<img class=\"recompense-description3\" src=\"'+objects_usable3.image+'\"/>';\t\n\t\t\t\t\tmarqueur.objet_usable3 = image_usable3; \n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "322224bc91a7f68f1e0f69fe33a022fb", "score": "0.5130209", "text": "function AccesibilidadPorMetas(rooms_default, rooms_rest, level, jugadores_room_default, jugadores_room_rest) { //Número r. correctas en rooms distintas a las condiciones por defecto vs total de r. correctas por todos los rooms\n\tvar nivel_usuario_default = [];\n\tvar nivel_usuario_rest = [];\n\tvar intentos_OK = 0, correctas_OK = 0, incorrectas_OK = 0, n_user_OK = 0;\n\n\tvar efectividad_default = 0, efectividad_rest = 0, efectividad_room = 0, diferencia = 0;\n\n\t//CALCULO DE LA EFECTIVIDAD DEL ROOM POR DEFAULT\n\t////console.log('Jugadores por default',jugadores_room_default);\n\t////console.log('Jugadores por resto',jugadores_room_rest);\n\n\tfor (var i = 0; i < level.length; i++) {\n\t\tfor (var j = 0; j < jugadores_room_default.length; j++) {\n\t\t\tif (level[i].id_usuario == jugadores_room_default[j].id) {\n\t\t\t\t//Todos los usuarios que jugaron teniendo en cuenta la historia guía.\n\t\t\t\tnivel_usuario_default.push(level[i]);\n\t\t\t}\n\t\t}\n\t}\n\tfor (var i = 0; i < nivel_usuario_default.length; i++) {\n\t\t//De los usuarios que si vieron las historias, cuantos de ellos completaron el nivel\n\t\tif (nivel_usuario_default[i].estado == \"completado\") {\n\t\t\t//todos los intentos que se hicieron para completar el nivel \n\t\t\tintentos_OK = intentos_OK + nivel_usuario_default[i].intentos;\n\t\t\t//todos las respuestas correctas que se hicieron en el el nivel\n\t\t\tcorrectas_OK = correctas_OK + nivel_usuario_default[i].correctas;\n\t\t\t//todos las respuestas incorrectas que se hicieron en el nivel\n\t\t\tincorrectas_OK = incorrectas_OK + nivel_usuario_default[i].incorrectas;\n\t\t\tn_user_OK++;\n\t\t}\n\t}\n\n\tintentos_OK = intentos_OK / n_user_OK;\n\tcorrectas_OK = correctas_OK / n_user_OK;\n\tincorrectas_OK = incorrectas_OK / n_user_OK;\n\t//Efectividad en la meta\n\tefectividad_default = EfectividadMeta(correctas_OK, incorrectas_OK) / 100;\n\n\t//FIN DEL CALCULO DE LA EFECTIVIDAD DEL ROOM POR DEFAULT\n\n\n\t\n\t//Efectividad del resto de rooms\n\tintentos_OK = 0;\n\tcorrectas_OK = 0;\n\tincorrectas_OK = 0;\n\tn_user_OK = 0;\n\n\n//CALCULO DE LA EFECTIVIDAD DEL ROOM POR DEFAULT\n\t////console.log('Jugadores por default',jugadores_room_default);\n\t////console.log('Jugadores por resto',jugadores_room_rest);\n\n\tfor (var i = 0; i < level.length; i++) {\n\t\tfor (var j = 0; j < jugadores_room_rest.length; j++) {\n\t\t\tif (level[i].id_usuario == jugadores_room_rest[j].id) {\n\t\t\t\t//Todos los usuarios que jugaron teniendo en cuenta la historia guía.\n\t\t\t\tnivel_usuario_rest.push(level[i]);\n\t\t\t}\n\t\t}\n\t}\n\t\t////console.log(nivel_usuario_rest);\n\tfor (var i = 0; i < nivel_usuario_rest.length; i++) {\n\t\t//De los usuarios que si vieron las historias, cuantos de ellos completaron el nivel\n\t\tif (nivel_usuario_rest[i].estado == \"completado\") {\n\t\t\t//todos los intentos que se hicieron para completar el nivel \n\t\t\tintentos_OK = intentos_OK + nivel_usuario_rest[i].intentos;\n\t\t\t//todos las respuestas correctas que se hicieron en el el nivel\n\t\t\tcorrectas_OK = correctas_OK + nivel_usuario_rest[i].correctas;\n\t\t\t//todos las respuestas incorrectas que se hicieron en el nivel\n\t\t\tincorrectas_OK = incorrectas_OK + nivel_usuario_rest[i].incorrectas;\n\t\t\tn_user_OK++;\n\t\t}\n\t}\n\tif (n_user_OK == 0) n_user_OK = -1;\n\tintentos_OK = intentos_OK / n_user_OK;\n\tcorrectas_OK = correctas_OK / n_user_OK;\n\tincorrectas_OK = incorrectas_OK / n_user_OK;\n\tefectividad_rest = EfectividadMeta(correctas_OK, incorrectas_OK) / 100;\n\n\tdiferencia = efectividad_default - efectividad_rest;\n\tif (diferencia < 0) diferencia = diferencia * (-1);\n\tefectividad_room = efectividad_room + diferencia;\n\tefectividad_room = efectividad_room / rooms_rest.length;\n\treturn efectividad_room*100;\n}", "title": "" }, { "docid": "de46560d51e60e6a0cb696b191eb3c17", "score": "0.51293755", "text": "function colocarMenuPorMarca(marca){\n var Nom=\"\";\n if(marca==0){\n animacion_salida($(\"#contenedorMenunom\"),\"default\", 0);\n animacion_salida($(\"#contenedorMenuSIX\"),\"default\", 0);\n animacion_salida($(\"#contenedorMenuRetail\"),\"default\", 0);\n }else if(marca==1){\n Nom=\"#contenedorMenunom\";\n animacion_salida($(\"#contenedorMenuSIX\"),\"default\", 0);\n animacion_salida($(\"#contenedorMenuRetail\"),\"default\", 0);\n }else if(marca==2){\n Nom=\"#contenedorMenuSIX\";\n animacion_salida($(\"#contenedorMenunom\"),\"default\", 0);\n animacion_salida($(\"#contenedorMenuRetail\"),\"default\", 0);\n }else if(marca==3){\n Nom=\"#contenedorMenuRetail\";\n animacion_salida($(\"#contenedorMenunom\"),\"default\", 0);\n animacion_salida($(\"#contenedorMenuSIX\"),\"default\", 0);\n }\n if(marca != vista){\n if(marca !=0){\n animacion_entrada($(Nom),\"izquierda_derecha\", 0.5);\n }\n vista = marca;\n }\n}", "title": "" }, { "docid": "50e39304224fbb85d1cba6ff02d74ccf", "score": "0.51292944", "text": "seleccionDificultad(){\n const mensaje = prompt('Seleccione el nivel de difilcultad: facil, intermedio o dificil, si no seleccionas ningun nivel por defecto el nivel sera intermedio')\n\n if(!mensaje){\n this.numeroIntentos = 5\n this.nivelDificultad = 'Intermedio'\n }else{\n //cuando el usuario si seleccione el nivel\n if(mensaje.toLowerCase() === 'facil' || mensaje.toLowerCase() === 'fácil'){\n this.numeroIntentos = 7\n this.nivelDificultad = 'Fácil'\n }else if(mensaje.toLowerCase() === 'intermedio'){\n this.numeroIntentos = 5\n this.nivelDificultad = 'Intermedio'\n }else if(mensaje.toLowerCase() === 'dificil' || mensaje.toLowerCase() === 'difícil'){\n this.numeroIntentos = 3\n this.nivelDificultad = 'Difícil'\n }else{//si pone otro nivel de dificultad se pone intermedio\n this.numeroIntentos = 5\n this.nivelDificultad = 'Intermedio'\n }\n }\n \n //llamo al metodo; para que pueda tener el numero de errores o el nivel de dificultad\n this.contenedorError()\n\n this.mensajeIntentos()\n //console.log(this.numeroIntentos, this.nivelDificultad)\n \n }", "title": "" }, { "docid": "bf5f36acaaf1589aa93c1f4a9dead2a4", "score": "0.5124913", "text": "function qteMoins() {\n\tconst btnMoins = document.querySelectorAll(\".qte-moins\"); // On récupère tous les boutons - présents sur la page\n\tfor(let moins = 0; moins < btnMoins.length; moins++) { //pour chaque bouton - de notre tableau\n\t\tif (contenuStorage[moins].quantite > 1) {\n\t\t//on écoute l'évenement du clic sur le bouton - d'un produit\n\t\t\tbtnMoins[moins].addEventListener(\"click\", (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// On récupère la quantité du produit correspondant au bouton cliqué et on soustrait 1 à la quantité\n\t\t\t\tcontenuStorage[moins].quantite = parseInt(contenuStorage[moins].quantite) - 1;\n\t\t\t\t// On recalcule le prix total du produit\n\t\t\t\tcontenuStorage[moins].totalProduit = parseInt(contenuStorage[moins].quantite) * parseInt(contenuStorage[moins].prix);\n\t\t\t\t//on remet à jour le LS\n\t\t\t\tlocalStorage.setItem(\"produits\", JSON.stringify(contenuStorage));\n\t\t\t\t//on recharge la page\n\t\t\t\tlocation.reload();\n\t\t\t});\n\t\t} else if (contenuStorage[moins].quantite = 1){\n\t\t\tbtnMoins[moins].addEventListener(\"click\", (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Vous ne pouvez pas choisir une quantité inférieure à 1.\");\n\t\t\t});\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "633229b22206f76c5b69f3385e15dee0", "score": "0.5120669", "text": "function cargar_otros_datos(nom_emerg,tel_emerg,dep_econom,transporte,ingreso,con_net,facebook,twitter,acept_inf){\n\n\t$(\"#txtContEmerg\").val(nom_emerg);\n\t$(\"#txtTelEmerg\").val(tel_emerg);\n\n\tdocument.getElementById(\"cboTransporte\").options[transporte].selected='selected';\n\tdocument.getElementById(\"cboIngrFamiliar\").options[ingreso].selected='selected';\n\tdocument.getElementById(\"cboInternet\").options[parseInt(con_net)].selected='selected';\n\t//$(\"#cboInternet option[value='\"+con_net+\"'']\").attr(\"selected\",true);\n\n\tswitch(dep_econom){\n\t\tcase \"si\":cheq1=0;break;\n\t\tcase \"no\":cheq1=1;break;\t\t\t\t\t\n\tdefault:cheq1=1;break;\n\t}\n\t$('input:radio[name=optDepenEconom]')[cheq1].checked = true;\n\n\tswitch(facebook){\n\t\tcase \"si\":cheq2=0;break;\n\t\tcase \"no\":cheq2=1;break;\t\t\t\t\t\n\tdefault:cheq2=1;break;\n\t}\n\t$('input:radio[name=optFacebook]')[cheq2].checked = true;\n\n\tswitch(twitter){\n\t\tcase \"si\":cheq3=0;break;\n\t\tcase \"no\":cheq3=1;break;\t\t\t\t\t\n\tdefault:cheq3=1;break;\n\t}\n\t$('input:radio[name=optTwitter]')[cheq3].checked = true;\n\n\tswitch(acept_inf){\n\t\tcase \"si\":cheq4=0;break;\n\t\tcase \"no\":cheq4=1;break;\t\t\t\t\t\n\tdefault:cheq4=1;break;\n\t}\n\t$('input:radio[name=optInformacion]')[cheq4].checked = true;\n}", "title": "" }, { "docid": "6ade443aa3a95cd7a1f818dbbcba5cdc", "score": "0.5115838", "text": "function escogerPregunta(n) {\n pregunta = interprete_bp[n] // toma la posicion delarreglo donde esta la pregunta\n select_id(\"categoria\").innerHTML = pregunta.categoria //se coloca en el html la categoria\n select_id(\"pregunta\").innerHTML = pregunta.pregunta// se coloca en el html la pregunta\n select_id(\"numero\").innerHTML = n // se coloca en el html el numero de la pregunta\n let pc = preguntas_correctas // se declara la variable pc se le asigna el numero de preguntas correctas\n //se muestran lois aciertos vs las preguntas \n if (preguntas_hechas > 1) {\n select_id(\"puntaje\").innerHTML = pc + \"/\" + (preguntas_hechas - 1)\n } else {\n select_id(\"puntaje\").innerHTML = \"\"\n }\n//monta la imagen\n style(\"imagen\").objectFit = pregunta.objectFit;\n desordenarRespuestas(pregunta) // desordena las respuestas para que las respuestas no vayan en un mismo orden\n if (pregunta.imagen) {\n select_id(\"imagen\").setAttribute(\"src\", pregunta.imagen)\n style(\"imagen\").height = \"350px\"\n style(\"imagen\").width = \"100%\"\n } else {\n style(\"imagen\").height = \"0px\"\n style(\"imagen\").width = \"0px\"\n setTimeout(() => {\n select_id(\"imagen\").setAttribute(\"src\", \"\")\n }, 500);\n }\n}", "title": "" }, { "docid": "fe66fa2dc6993efc9dfe0f5a5012cfeb", "score": "0.51082224", "text": "function mbushCombo ()\n {\n//mbush combo te mesuesve\ndb.collection('Mesuesit').get().then(snapshot => {\n \n snapshot.docs.forEach(doc => {\n \nvar z = document.createElement(\"option\");\nz.setAttribute(\"value\", doc.id);\nvar t = document.createTextNode(doc.data().Emri + ' '+ doc.data().Mbiemri );\nz.appendChild(t);\ndocument.getElementById(\"selectMesuesi\").appendChild(z);\n });\n\n \n //inicializon combo mesuesit\n var elems = document.querySelectorAll('select#selectMesuesi');\nvar instances = M.FormSelect.init(elems);\n});\n\n }", "title": "" }, { "docid": "63d180bba41d2676d6e9ee6a5d52d0a0", "score": "0.5099745", "text": "function seleccionaasientosmasivosvuelta(valor) {\n var contador = 0;\n var totalbutacas = parseFloat(document.getElementById('thocupado').innerHTML) + parseFloat(document.getElementById('threservado').innerHTML) + parseFloat(document.getElementById('thlibre').innerHTML);\n if (!valor) {\n valor = 0;\n $(\"#contenedorbusvuelta .compra\").each(function (index) {\n var id = $(this).attr(\"id\");\n document.getElementById(id).className = \"libre\";\n });\n }\n else {\n if (determinaasientoocupadovuelta(valor) == false) {\n contador = 0;\n if (!valor)\n { }\n else {\n $(\"#contenedorbusvuelta .compra\").each(function (index) {\n var id = $(this).attr(\"id\");\n document.getElementById(id).className = \"libre\";\n });\n var arreglo = valor.split(\",\");\n for (i = 0; i < arreglo.length; i++) {\n var numeroasiento = arreglo[i];\n if (numeroasiento <= totalbutacas) {\n numeroasiento = 'Button' + numeroasiento;\n document.getElementById(numeroasiento).className = 'compra';\n contador++;\n }else {\n cerrarmodal('facturacion-modal');\n mensajeadvertencia(\"No Se Puede Agregar Un Exendente A Los Boletos De Vuelta\");\n document.getElementById(\"TxtAsientosVuelta\").focus();\n return;\n }\n }\n //DETERMINAMOS SI LOS ASIENTOS INGRESADOS POSEEN LA CLASE COMPRA\n $(\"#contenedorbusvuelta .compra\").each(function (index) {\n var id = $(this).attr(\"id\");\n var existe = false;\n for (i = 0; i < arreglo.length; i++) {\n if (id == arreglo[i]) {\n contador++;\n existe = true;\n break;\n }\n }\n //SI EXISTE ES FALSO QUIERE DECIR QUE EL ASIENTO ESTA MARCADO COMO COMPRA Y NO ESTA INGRESADO\n if (existe == false) {\n $(this).removeClass(\"libre\");\n $(this).addClass(\"compra\");\n }\n });\n }\n }\n else {\n mensajeadvertencia(\"Uno o mas asientos ingresados esta ocupado\");\n document.getElementById('TxtAsientosVuelta').focus();\n }\n }\n //MOSTRAMOS EL TOTAL POR LOS BOLETOS INGRESADOS O SELECCIONADOS........\n document.getElementById('totalvuelta').innerHTML = redondea(parseFloat(document.getElementById('totalunitariovuelta').innerHTML) * parseFloat(contador));\n}", "title": "" }, { "docid": "02ab7ccfd6561c823eb5bd455a25c0d1", "score": "0.5099463", "text": "function agComoEstaDia(med, dia, mes, ano){\n \t//ramdom entre 1 e 3\n \t//1 = vazio(<=8) 2 = medio 3(>=9 < 12) = cheio(>=12) \t\n \tcon = CONGetConsultas(med, null, dia, mes, ano);\n \ttam = con.length;\n \tif (!tam)\n \t r=1;\n \tif (tam<=8){\n \t\tr=1;\n \t} \n\n \tif ((tam<12)&&(tam>=9)){\n \t\tr=2;\n \t} \n\n \tif ((tam>=12)){\n \t\tr=3;\n \t} \n \t//r= Math.floor((Math.random()*3)+1);\n \treturn r;\n\n\n\n }", "title": "" }, { "docid": "a2762b5d45cd14d6efa1070acac93549", "score": "0.5097318", "text": "function SetCombinacionPorMaterialComponente(data, modulo)\n{\n var combinacion = new CombinacionPorMaterialComponente();\n var material = new Material();\n var componente = new Componente();\n var combinacionMaterial = new CombinacionMaterial();\n var tipoMaterial = new TipoMaterial();\n \n combinacion.CombinacionPorMaterialComponenteId = data.CombinacionPorMaterialComponenteId;\n combinacion.Grueso = data.Grueso;\n combinacion.Descripcion = data.Descripcion;\n \n tipoMaterial.TipoMaterialId = data.TipoMaterialId;\n tipoMaterial.Nombre = data.NombreTipoMaterial;\n \n material.MaterialId = data.MaterialId;\n material.Nombre = data.NombreMaterial;\n material.TipoMaterial = tipoMaterial;\n \n componente.ComponenteId = data.ComponenteId;\n componente.Nombre = data.NombreComponente;\n if(data.ActivoComponente == \"1\")\n {\n componente.Activo = true;\n }\n else\n {\n componente.Activo = false;\n }\n \n combinacionMaterial.CombinacionMaterialId = data.CombinacionMaterialId;\n combinacionMaterial.Nombre = data.Nombre;\n \n if(data.ActivoCombinacionMaterial == \"1\")\n {\n combinacionMaterial.Activo = true;\n }\n else\n {\n combinacionMaterial.Activo = false;\n }\n \n combinacion.Material = material;\n combinacion.Componente = componente;\n combinacion.CombinacionMaterial = combinacionMaterial;\n \n if(modulo == \"puerta\" || modulo==\"puertaCombinacion\")\n {\n var puerta = new Puerta();\n puerta.Nombre = data.NombrePuerta;\n puerta.PuertaId = data.PuertaId;\n puerta.Activo = data.ActivoPuerta;\n puerta.ComponentePorPuertaId = data.ComponentePorPuertaId;\n combinacion.Puerta = puerta;\n \n combinacion.Componente.ComponenteId = data.ComponenteId2;\n }\n \n return combinacion;\n}", "title": "" }, { "docid": "3ea97fa4a7aa4573e3b2146d1eeef078", "score": "0.5092867", "text": "function DinamicTarger(categoria,DatosCosulta,Actividad){\n\n\tswitch(categoria){\n\t\tcase 0:\n\t\t\tfor (var i = 0; i < valorDepartamento.length; i++) {\n\t\t\t\t\tGeneraTarget(fechaConsulta,DatosCosulta,i,Actividad);\n\t\t\t\t};\n\t\tbreak;\n\n\t}\n\t\n\n}", "title": "" }, { "docid": "b020253a80aa590095f5ab58ed46a63e", "score": "0.5091672", "text": "function recargaUtimos(selector){\n\n\t var contenidoDinamico = '';\t\n\t\t$('#panelAdministrador li').removeClass('active');\n\t\t$(selector).addClass('active');\n\t\t\n\t \n\t \n\t \t$.ajax({\n\t\t\t\t\t method: \"Post\",\n\t\t\t\t\t dataType: \"json\",\n\t\t\t\t\t url: urlMostrarMensajes,\n\t\t\t\t\t data: { muestra: \"General\"},\n\t\t\t\t\t success: function(data){\n\t\t\t\t\t contenidoDinamicoA = datosAsincronos(data);\t\t\n\t\t\t\t\t \t\t}\n\t\t\t\t\t});\n\t\t\t\t\t function datosAsincronos(data){\n\t\t\t\t\t Resultado(data);\n\t\n\t}}", "title": "" }, { "docid": "af580365c4e37a50ba5b439d8e2833f4", "score": "0.5082529", "text": "function interactividad() {\n //esta funcion agarra el valor del data seleccionado para asignar un precio.\n $(\".respuesta\").click(function () {\n $(\"#contador\").toggleClass(\"contadorPlay\");\n $(\"#contador\").toggleClass(\"contadorPlay2\");\n respuestaSeleccionada = $(this).html();\n topic = $(this).data('topic');\n if (valorPorcent == 0 || valorPorcent == undefined) {\n valorSeleccionado = ($(this).data(\"precio\"));\n // console.log(\"El valor es nulo o 0\");\n } else {\n valorSeleccionado = ($(this).data(\"precio\"));\n \n valorSeleccionado = (valorSeleccionado / 100) * valorPorcent;\n }\n \n var topicFind = topic.match(\"%\");\n if (topicFind === null) {\n // console.log(\"es dineros\");\n $(\"#contador\").html((\"+$\" + valorSeleccionado));\n aumentoTemporal(valorSeleccionado);\n } else {\n $(\"#contador\").html((\"+ %\" + valorSeleccionado));\n //console.log(\"es porcentaje\");\n }\n\n\n //asignamos el topic desde la primera pregunta\n // fitrarTopic();\n });\n\n // esta funcion hace un aumento temporal al seleccionar.\n function aumentoTemporal(valorTemp) {\n valorMostrado = valorTotal + valorTemp;\n var valorHTML = \"<h1>$\" + valorMostrado + \".00 MXN</h1>\";\n $(\"#precio\").html(valorHTML);\n }\n\n\n //esta funcion hace el efecto del hover sobre el precio para mostrar\n //el precio sin sumar.\n $(\"#precio\").hover(function () {\n var valorHTML = \"<h1><small>Llevas</small> $\" + valorTotal + \".00 MXN</h1>\";\n $(\"#precio\").html(valorHTML);\n }, function () {\n $(\"#contador\").html(valorSeleccionado + valorTotal);\n aumentoTemporal(valorSeleccionado);\n }\n );\n}", "title": "" }, { "docid": "edc40ad2695db3c3a2d418e23cbd10ae", "score": "0.5081236", "text": "function setGenericMessages(family) {\n if (family === \"ELEGANCE\") { \n //orientation du can hub A -> prise sub D9 elegance\n sendSignalPic(\"A\");\n setTimeout(function(){\n startNodeMsg = \"002400806d68d7551407f09b861e3aad000549a8440200000000000001\" + nodeID + \"000000000000\";\n stopNodeMsg = \"002400806d68d7551407f09b861e3aad000549a8440200000000000002\" + nodeID + \"000000000000\";\n cobID1 = addHexVal(\"00000580\", nodeID);\n cobID2 = addHexVal(\"00000600\", nodeID);\n sendSignal(startNodeMsg);\n if(typeChoice == \"AGILA\"){\n setTimeout(function(){\n var sign = \"002400806d68d7551407f09b861e3aad000549a844080000\" + cobID2 + \"2f01300101000000\";\n sendSignal(sign);\n },100) \n }\n },400); \n \n } else if (family === \"OMEGA\") {\n resetMasterTSSC = \"002400806d68d7551407f09b861e3aad000549a8440800001FC20F000E00000000000000\";\n startSlaveTSSC = \"002400806d68d7551407f09b861e3aad000549a844010000028226402800000000000000\";\n startSlaveSBSH = \"002400806d68d7551407f09b861e3aad000549a844010000028426401000000000000000\";\n startSlaveSBSH2 = \"002400806d68d7551407f09b861e3aad000549a844010000028426400c00000000000000\";\n console.log(modelName);\n \n switch (modelName) {\n case \"TSSC\" :\n sendSignalPic(\"B\");\n var stopTestMode = Cal_post + \"030000\" + \"1fc22f00\" + \"070000\"\n //sendSignal(stopTestMode);\n sendSignal(startSlaveTSSC); \n break;\n case \"SMARTBOX\" :\n sendSignalPic(\"C\");\n var stopTestMode = Cal_post + \"030000\" + \"1fc42f00\" + \"070000\"\n sendSignal(stopTestMode);\n sendSignal(startSlaveSBSH);\n sendSignal(startSlaveSBSH2);\n stopAllLED(globalName, modelName, typeChoice);\n break;\n case \"SMARTHANDLE\" :\n sendSignalPic(\"C\");\n var stopTestMode = Cal_post + \"030000\" + \"1fc42f00\" + \"070000\"\n sendSignal(stopTestMode);\n sendSignal(startSlaveSBSH);\n sendSignal(startSlaveSBSH2);\n stopAllLED(globalName, modelName, typeChoice);\n break;\n default:\n break;\n }\n cobID1 = addHexVal(\"00000580\", nodeID);\n cobID2 = addHexVal(\"00000600\", nodeID);\n\n }\n }", "title": "" }, { "docid": "28049a2af677c9c636fc89a44b0bd2e9", "score": "0.50770944", "text": "function muestraDatos(){ \n let tipos=[\"Alta\",\"Modificar\",\"Baja\",\"Mostrar\"];\n let clases=[\"hospital\",\"personal\",\"paciente\"]\n for(const clase in clases){\n let div = document.createElement(\"div\");\n div.setAttribute(\"id\", clases[clase]);\n document.body.appendChild(div);\n let cabecera=creaCabecera(clases[clase]);\n document.getElementById(clases[clase]).appendChild(cabecera);\n for(const tipo in tipos){\n creaboton(tipos[tipo],clases[clase])\n }\n }\n}", "title": "" }, { "docid": "cce9391ca3102401adfafdd08c445f09", "score": "0.50733644", "text": "function IniciarJuego() {\n // Obtenemos datos\n let numFilas = document.getElementById(\"i_filas\").value;\n let numColumnas = document.getElementById(\"i_columnas\").value;\n\n // Generamos tablero\n crearTablero(numFilas, numColumnas);\n\n // Preparamos valores \n let posicionPlayer = casillaAventureroAleatoria(numFilas, numColumnas);\n let posicionesTesoro = casillasTesorosAleatorias(numFilas, numColumnas, posicionPlayer);\n\n console.log(posicionesTesoro);\n\n // Dibujar Aventurero\n dibujarAventurero(posicionPlayer);\n\n // Dibujar Tesoros\n for (let tesoro of posicionesTesoro) {\n dibujarTesoro(tesoro);\n }\n}", "title": "" }, { "docid": "3f2720516857db2fe1cd1c581517c1e3", "score": "0.50720155", "text": "function monta_detalhes(actpos){\n\n\t$(DIV_TABELA_DETALHES + \" input[type=text]\").val(\"\");\n\t$(DIV_TABELA_DETALHES + \" input[name=cl_consumo]\").val('0');\n\t$(DIV_TABELA_DETALHES + \" input[name=cl_calc_icms]\").val('F');\n\t$(DIV_TABELA_DETALHES + \" input[name=cl_ipinoicms]\").val('F');\n\tif(empty(actpos)){\n\t\treturn;\n\t}\n\n\tjQuery.each(objTabelaCli.registros[actpos], function(key,value){\n\t\tvar campo = key;\n\t\t$(DIV_TABELA_DETALHES + \" input[name=\"+campo+\"]\").val(value);\n\n\t\tvar linha = \"\";\n\t\tif(campo == \"cl_ipinoicms\" || campo == \"cl_calc_icms\" || campo == \"cl_consumo\"){\n\t\t\tlinha = DIV_TABELA_DETALHES + \" input[type='checkbox'][name=\"+campo+\"]\";\n\t\t\tvar valida = (value === '1' || value === 'T' ? true : false);\n\n\t\t\tif(valida){\n\t\t\t\t$(linha).val(value).parent().checkbox('check');\n\t\t\t}else{\n\t\t\t\t$(linha).val(value).parent().checkbox('uncheck');\n\t\t\t}\n\t\t}\n\n\t\tif(campo == \"cl_pagto\" || campo == \"cl_margem\" || campo == \"cl_pessoa\" || campo == \"cl_frete\"){\n\t\t\tlinha = DIV_TABELA_DETALHES + \" select[name=\"+campo+\"]\";\n\t\t\tif(!empty(value)){\n\t\t\t\t$(linha).parent().dropdown(\"set selected\",value);\n\t\t\t}\n\t\t}\n\t});\n\n\tbloqueia_detalhes(false);\n\n\t//EVITA COM QUE MONTE ITENS + DE 1 VEZ\n\tif($(\"#divObs\").attr('Cliente') != actpos && $('#divObs').is( \":visible\" )){\n\t\t$(\"#divObs\").attr('Cliente',actpos);\n\t\tmonta_obs(actpos);\n\t\treturn;\n\t}\n\n\t//EVITA COM QUE MONTE ITENS + DE 1 VEZ\n\tvar actdiv = $(\"#divEnd\").attr('Cliente');\n\tif($(\"#divEnd\").attr('Cliente') != actpos && $('#divEnd').is( \":visible\" )){\n\t\t$(\"#divEnd\").attr('Cliente',actpos);\n\t\tmonta_end(actpos);\n\t\treturn;\n\t}\n\n}", "title": "" }, { "docid": "3394b221434c037c1b909f5ab4ce1c27", "score": "0.5070215", "text": "arrancarCarro() {\r\n let cambio = document.getElementById(\"cambio\");\r\n let velocimetro = document.getElementById(\"velocimetro\");\r\n cambio.innerHTML = this.cambio;\r\n velocimetro.innerHTML = \"\";\r\n\r\n let pantalla = document.getElementById(\"pantalla\");\r\n if (this.carroEncendido == true && this.destinoSeleccionado == true) {\r\n setTimeout(() => { pantalla.innerHTML = \"Iniciado el arranque del carro\", 1000; });\r\n\r\n //Verificando clutch presionado\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Revisando que el clutch este activado</strong>\"; }, 2000);\r\n setTimeout(() => { pantalla.innerHTML = `Clutch ${this.clutch}`; }, 3000);\r\n if (this.clutch != \"activado\") {\r\n setTimeout(() => { pantalla.innerHTML = \"Activando clush\"; }, 3500);\r\n setTimeout(() => { pantalla.innerHTML = \"¡Todo correcto!\"; }, 5000);\r\n this.clutch = \"activado\";\r\n } else {\r\n setTimeout(() => { pantalla.innerHTML += \" ¡Todo correcto!\"; }, 3500);\r\n }\r\n\r\n //Verificando freno de pedal activado\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Revisando que freno de pedal este activado</strong>\"; }, 6000);\r\n setTimeout(() => { pantalla.innerHTML = `Freno de pedal ${this.freno}`; }, 8000);\r\n if (this.freno == \"activado\") {\r\n setTimeout(() => { pantalla.innerHTML += \" ¡Todo correcto!\"; }, 9000);\r\n } else {\r\n setTimeout(() => { pantalla.innerHTML = \"Activando freno de pedal\"; }, 9000);\r\n setTimeout(() => { pantalla.innerHTML = \"¡Todo correcto!\"; }, 9500);\r\n this.freno = \"activado\";\r\n }\r\n\r\n //Verificando freno de emergencia desactivado\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Revisando freno de emergencia desactivado</strong>\"; }, 10000);\r\n setTimeout(() => { pantalla.innerHTML = `Freno de emergencia ${this.frenoEmergencia}`; }, 12000);\r\n if (this.frenoEmergencia == \"desactivado\") {\r\n setTimeout(() => { pantalla.innerHTML += \" ¡Todo correcto!\"; }, 13000);\r\n } else {\r\n setTimeout(() => { pantalla.innerHTML = \"Desactivando freno de emergencia\"; }, 13000);\r\n setTimeout(() => { pantalla.innerHTML = \"¡Todo correcto!\"; }, 13500);\r\n this.frenoEmergencia = \"desactivado\";\r\n }\r\n\r\n //Poner cambio en primera\r\n setTimeout(() => { pantalla.innerHTML = `Cambio en ${this.cambio}.`; }, 14000);\r\n if (this.cambio == \"neutro\") {\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Configurando cambio en primera</strong>\"; }, 15000);\r\n setTimeout(() => { cambio.innerHTML = this.cambio; }, 16000);\r\n setTimeout(() => { pantalla.innerHTML = \"Ahora está en el cambio correcto para arrancar\"; }, 17000);\r\n this.cambio = \"primera\";\r\n } else {\r\n setTimeout(() => { pantalla.innerHTML += \"Cambio correcto para arrancar\"; }, 17000);\r\n };\r\n\r\n //Poniendo freno de pedal desactivado\r\n setTimeout(() => { pantalla.innerHTML = `Freno de pedal ${this.freno}`; }, 19000);\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Se debe desactivar el freno de pedal</strong>\"; }, 20000);\r\n if (this.freno == \"desactivado\") {\r\n setTimeout(() => { pantalla.innerHTML += \" ¡Todo correcto!\"; }, 22000);\r\n } else {\r\n setTimeout(() => { pantalla.innerHTML = \"Desactivando el freno de pedal\"; }, 22000);\r\n this.freno = \"desactivado\";\r\n }\r\n\r\n //Verificación final de las condiciones del arranque\r\n if (this.clutch == \"activado\" && this.frenoEmergencia == \"desactivado\" && this.cambio == \"primera\" && this.freno == \"desactivado\") {\r\n setTimeout(() => { pantalla.innerHTML = \"<strong>Carro listo para arrancar</strong>\" }, 24000);\r\n setTimeout(() => {\r\n pantalla.innerHTML += \" Acelerando y solanto clutch lentamente\";\r\n this.carroArrancado = true;\r\n Toyota.ponerMarcha();\r\n }, 25000);\r\n\r\n }\r\n } else {\r\n cajaAvisos = document.getElementById(\"cajaAvisos\").style.display = \"block\";\r\n avisos.innerHTML = \"<strong>Error</strong> <br>el carro aún no está encendido o no ha seleccionado el destino\";\r\n setTimeout(() => {\r\n cajaAvisos = document.getElementById(\"cajaAvisos\").style.display = \"none\"\r\n }, 3000);\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "ecbea12ddf7cbe99021bac7bb47e948f", "score": "0.5068028", "text": "function muestraControles() {\n\n $(\"#\"+BOTON_ELAN).off(\"click\",dialogoElan);\n $(\"#\"+BOTON_CV).off(\"click\",dialogoCV);\n $(\"#\"+BOTON_TABLAS_ARMAS).off(\"click\",dialogoTablasArmas);\n $(\"#\"+BOTON_ARMA_INICIAL).off(\"click\",dialogoElegirArmaTodas);\n $(\"#\"+BOTON_BONOS_NATURALES).off(\"click\",dialogoBonosNaturales);\n $(\"#\"+BOTON_CREACION).off(\"click\",iniciarGeneracion);\n $(\"#\"+BOTON_FINALIZAR_CREACION).off(\"click\",finalizarGeneracion);\n $(\"#\"+BOTON_SUBIR_NIVEL).off(\"click\",subirNivel);\n $(\"#\"+BOTON_GUARDAR).off(\"click\",muestraDialogoGuardarPersonaje);\n $(\"#\"+BOTON_CARGAR).off(\"click\",muestraDialogoCargarPersonaje);\n $(\"#\"+BOTON_LOG).off(\"click\",mostrarLogCambios);\n $(\"#\"+BOTON_LICENCIA).off(\"click\",mostrarLicencia);\n $(\"#\"+BOTON_COMPRAR_EQUIPO).off(\"click\",muestraVentanaCompraEquipo);\n $(\"#BOTON_IDIOMA_ESPAÑOL\").off(\"click\",cambiaIdiomaEspañol);\n $(\"#BOTON_IDIOMA_INGLES\").off(\"click\",cambiaIdiomaIngles);\n $(\"#BOTON_IDIOMA_FRANCES\").off(\"click\",cambiaIdiomaFrances);\n\n $(\"#BOTON_IDIOMA_FRANCES\").on(\"click\",cambiaIdiomaFrances);\n $(\"#BOTON_IDIOMA_ESPAÑOL\").on(\"click\",cambiaIdiomaEspañol);\n $(\"#BOTON_IDIOMA_INGLES\").on(\"click\",cambiaIdiomaIngles);\n $(\"#\"+BOTON_ELAN).on(\"click\",dialogoElan);\n $(\"#\"+BOTON_CV).on(\"click\",dialogoCV);\n $(\"#\"+BOTON_TABLAS_ARMAS).on(\"click\",dialogoTablasArmas);\n $(\"#\"+BOTON_ARMA_INICIAL).on(\"click\",dialogoElegirArmaTodas);\n $(\"#\"+BOTON_BONOS_NATURALES).on(\"click\",dialogoBonosNaturales);\n $(\"#\"+BOTON_CREACION).on(\"click\",iniciarGeneracion);\n $(\"#\"+BOTON_FINALIZAR_CREACION).on(\"click\",finalizarGeneracion);\n $(\"#\"+BOTON_SUBIR_NIVEL).on(\"click\",subirNivel);\n $(\"#\"+BOTON_GUARDAR).on(\"click\",muestraDialogoGuardarPersonaje);\n $(\"#\"+BOTON_CARGAR).on(\"click\",muestraDialogoCargarPersonaje);\n $(\"#\"+BOTON_LOG).on(\"click\",mostrarLogCambios);\n $(\"#\"+BOTON_LICENCIA).on(\"click\",mostrarLicencia);\n $(\"#\"+BOTON_COMPRAR_EQUIPO).on(\"click\",muestraVentanaCompraEquipo);\n}", "title": "" }, { "docid": "2b1e0c198f8429defa5bf438b2b712b2", "score": "0.50652736", "text": "async buscarInmueblesIniciales(cantInmuebles = 3){\n return await ManejadorBD.leerInformacionColeccion(\"Inmuebles\", cantInmuebles)\n }", "title": "" }, { "docid": "bf5908b9906f8eac46b0c611b6367085", "score": "0.50628585", "text": "function dameMeses(){\n return [\n {\n nombre: \"Enero\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Febrero\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Marzo\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Abril\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Mayo\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Junio\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Julio\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Agosto\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Septiembre\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Octubre\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Noviembre\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n },\n {\n nombre: \"Diciembre\",\n datoIndicador: null,\n numeroAbsUno: \"\",\n numeroAbsDos: \"\",\n avanceEstudio: \"\",\n validado: false\n }\n ];\n }", "title": "" }, { "docid": "b712d2c7df11a89d17a26420fed758ab", "score": "0.5060798", "text": "async function main() {\n //preluare date din fisierul json prin apelarea functiei de mai sus\n const dataset = await getDate();\n\n let ani = [];\n let tari = [];\n //parcurgere vector de date si extragere ani si tari(fara duplicate)\n for (i = 0; i < dataset.length; i++) {\n if (!ani.includes(dataset[i].an)) {\n ani.push(dataset[i].an);\n }\n }\n for (i = 0; i < dataset.length; i++) {\n if (!tari.includes(dataset[i].tara)) {\n tari.push(dataset[i].tara);\n }\n }\n let select = document.getElementById(\"ani\");\n let selectTara = document.getElementById(\"selectTara\");\n //adaugare optiuni care ii spun utilizatorului ce sa selecteze\n select.add(new Option(\"Selecteaza an\"));\n selectTara.add(new Option(\"Selecteaza tara\"));\n //populare select corespunzator cu anii/tarile din array-uri\n for (let a in ani) {\n select.add(new Option(ani[a]));\n }\n for (let t in tari) {\n selectTara.add(new Option(tari[t]));\n }\n //preluare butoane\n let btnDrawTable = document.getElementById(\"btnDeseneazaTabel\");\n let btnDrawBublechart = document.getElementById(\"btnBubbleChart\");\n let btnBarchart = document.getElementById(\"btnChart\");\n\n let anSelectat = undefined;\n let taraSelectata = undefined;\n let dateAnSelectat = [];\n let dateTaraSelectata = [];\n\n //abonare la evenimentul de change => cand utilizatorul alege un an apar butoanele cu optiunile corespunzatoare si se salveaza anul \n select.addEventListener(\"change\", function () {\n anSelectat = this.value;\n btnDrawTable.style.display = \"inline-block\";\n btnDrawBublechart.style.display = \"inline-block\";\n //filtrez datele si le iau doar pe cele care corespund anului selectat\n dateAnSelectat = dataset.filter(e => e.an === anSelectat);\n\n });\n //abonare la evenimentul de change => cand utilizatorul alege o tara apare butonul cu optiunea corespunzatoare si se salveaza tara \n selectTara.addEventListener(\"change\", function () {\n taraSelectata = this.value;\n btnBarchart.style.display = \"inline-block\";\n //filtrez datele si le iau doar pe cele care corespund tarii selectate\n dateTaraSelectata = dataset.filter(el => el.tara === taraSelectata && el.valoare != null);\n })\n //tratare eveniment de click pe buton si situatie in care user-ul apasa pe un buton fara un an selectat\n btnDrawTable.addEventListener('click', function () {\n if (anSelectat !== \"Selecteaza an\") {\n creareTabel(dateAnSelectat); //apelez functia pentru a crea tabelul\n }\n else {\n alert(\"Selectati un an!\");\n }\n })\n //tratare eveniment de click pe buton si situatie in care user-ul apasa pe buton fara o tara selectata\n btnBarchart.addEventListener(\"click\", function () {\n if (taraSelectata !== \"Selecteaza tara\") {\n drawChart(dateTaraSelectata, taraSelectata); //apelez functia care deseneaza graficul\n }\n else alert(\"Selectati o tara!\");\n });\n btnDrawBublechart.addEventListener(\"click\", function () {\n if (anSelectat !== \"Selecteaza an\") {\n deseneazaBubbleChart(dateAnSelectat);\n } else alert(\"Selectati un an!\");\n });\n\n}", "title": "" }, { "docid": "3899f68aba84c01f7b1610ba628c940e", "score": "0.5058294", "text": "function SelectMisionAndAddDatatoSimulation(indexPos){\n \tvar mision = game.global.misions[indexPos];\n \tvar simulation = game.global.simulation;\n\n \t//Fijamos lo relacionado con la simulacion Propiamente\n \tsimulation.escenario = mision.escenario;\n \t//fijamos lo relacionado con el bando enemigo\n \t\t//Reseteamos los enemigos\n \t\tsimulation.enemys.resetToBaseAttribValue();\n \t\t//Fijamos las restricciones\n \t\tsimulation.enemys.restrictions = mision.enemys.restrictions;\n\n \t\t//CREA los heroes y los añade a la lista\n\n \t\tvar enemyTeamAux = [];\n \t\tfor(var i = 0; i< mision.enemys.team.length;i++){\n \t\t\tsimulation.enemys.addMember(new Hero(mision.enemys.team[i]));\n \t\t}\n\n \t\t\n \treturn simulation;\t\n }", "title": "" }, { "docid": "3d55983d4691c5a0f2136510c593e9a0", "score": "0.5058041", "text": "function setOptions(data) {\n \n document.getElementById(\"buffbl\").selectedIndex = data[1];\n document.getElementById(\"buffdrums\").selectedIndex = data[2];\n \n var dst = new ArrayBuffer(data.byteLength);\n new Uint8Array(dst).set(new Uint8Array(data));\n\n var buffView = new DataView(dst, 3);\n \n var idx = 0;\n\n var buffOpt1 = buffView.getUint8(idx, true); idx++;\n var buffOpt2 = buffView.getUint8(idx, true); idx++;\n\n document.getElementById(\"buffai\").checked = (buffOpt1 & 1) == 1;\n document.getElementById(\"buffgotw\").checked = (buffOpt1 & 1<<1) == 1<<1;\n document.getElementById(\"buffbk\").checked = (buffOpt1 & 1<<2) == 1<<2;\n document.getElementById(\"buffibow\").checked = (buffOpt1 & 1<<3) == 1<<3;\n document.getElementById(\"buffids\").checked = (buffOpt1 & 1<<4) == 1<<4;\n document.getElementById(\"buffmoon\").checked = (buffOpt1 & 1<<5) == 1<<5;\n document.getElementById(\"buffmoonrg\").checked = (buffOpt1 & 1<<6) == 1<<6;\n document.getElementById(\"buffeyenight\").checked = (buffOpt1 & 1<<7) == 1<<7;\n \n document.getElementById(\"bufftwilightowl\").checked = (buffOpt2 & 1) == 1;\n document.getElementById(\"sbufws\").checked = (buffOpt2 & 1<<1) == 1<<1;\n document.getElementById(\"debuffjow\").checked = (buffOpt2 & 1<<2) == 1<<2;\n document.getElementById(\"debuffisoc\").checked = (buffOpt2 & 1<<3) == 1<<3;\n document.getElementById(\"debuffmis\").checked = (buffOpt2 & 1<<4) == 1<<4;\n \n idx++; // water shield procs not implemented\n document.getElementById(\"buffspriest\").value = buffView.getUint16(idx, true); idx+=2;\n document.getElementById(\"sbufrace\").selectedIndex = buffView.getUint8(idx, true); idx++;\n\n var numCustom = buffView.getUint8(idx, true); idx++;\n if (numCustom > 0) {\n document.getElementById(\"custint\").value = buffView.getFloat64(7, true);\n // document.getElementById(\"custstm\").value = buffView.getFloat64(7+8*1);\n document.getElementById(\"custsc\").value = buffView.getFloat64(7+8*2, true);\n document.getElementById(\"custsh\").value = buffView.getFloat64(7+8*3, true);\n document.getElementById(\"custsp\").value = buffView.getFloat64(7+8*4, true);\n document.getElementById(\"custha\").value = buffView.getFloat64(7+8*5, true);\n document.getElementById(\"custmp5\").value = buffView.getFloat64(7+8*6, true);\n document.getElementById(\"custmana\").value = buffView.getFloat64(7+8*7, true);\n idx += numCustom*8;\n } else {\n document.getElementById(\"custint\").value = 0;\n // document.getElementById(\"custstm\").value = 0;\n document.getElementById(\"custsc\").value = 0;\n document.getElementById(\"custsh\").value = 0;\n document.getElementById(\"custsp\").value = 0;\n document.getElementById(\"custha\").value = 0;\n document.getElementById(\"custmp5\").value = 0;\n document.getElementById(\"custmana\").value = 0;\n }\n \n var consumOpt = buffView.getUint8(idx, true); idx++;\n document.getElementById(\"conbwo\").checked = (consumOpt & 1) == 1;\n document.getElementById(\"conmm\").checked = (consumOpt & 1<<1) == 1<<1;\n document.getElementById(\"confbl\").checked = (consumOpt & 1<<2) == 1<<2;\n document.getElementById(\"confmr\").checked = (consumOpt & 1<<3) == 1<<3;\n document.getElementById(\"conbb\").checked = (consumOpt & 1<<4) == 1<<4;\n document.getElementById(\"condp\").checked = (consumOpt & 1<<5) == 1<<5;\n document.getElementById(\"consmp\").checked = (consumOpt & 1<<6) == 1<<6;\n document.getElementById(\"condr\").checked = (consumOpt & 1<<7) == 1<<7;\n\n // talents\n idx += 9;\n\n document.getElementById(\"totwr\").selectedIndex = buffView.getUint8(idx, true); idx++;\n\tvar totemOpt = buffView.getUint8(idx, true); idx++;\n document.getElementById(\"totwoa\").checked = (totemOpt & 1) == 1;\n document.getElementById(\"totms\").checked = (totemOpt & 1<<1) == 1<<1;\n document.getElementById(\"totcycl2p\").checked = (totemOpt & 1<<2) == 1<<2;\n}", "title": "" }, { "docid": "5271d3c00c5966fecc7bc2b3f8fa9934", "score": "0.50484604", "text": "displayOptions(objArr, questionsArr) {\n const formControls = objArr.getElementsByClassName(\"form-control\");\n const inputGroupText = objArr.getElementsByClassName(\"input-group-text\");\n const questionBank = questionsArr.map(e => e.chinese);\n\n for (let i = 0; i < formControls.length; i++) {\n formControls[i].innerHTML = \"<option>Выберите правильный вариант</option>\";\n\n //grab innerText of question\n let question = inputGroupText[i].innerHTML;\n let rightIndex = questionBank.indexOf(question);\n\n //create arr for options and put right answer in\n let options = [];\n options.push(questionsArr[rightIndex].translation);\n\n //put other 4 options in\n for (let j = 1; j < 5; j++) {\n let randInd = Math.trunc(Math.random() * questionsArr.length);\n\n if (randInd !== rightIndex) {\n options.push(questionsArr[randInd].translation);\n }\n }\n\n model.shuffle(options);\n\n for (let k = 0; k < options.length; k++) {\n let elem = document.createElement(\"option\");\n elem.innerHTML = options[k];\n formControls[i].appendChild(elem);\n }\n }\n }", "title": "" }, { "docid": "109c55a5c91f71fcc72e02a992873718", "score": "0.5046783", "text": "function listar_embarcadores(data,dato_medidas,callback){\n console.log(data);\n var id_padre=$(\"#tipo_celulosa\");\n for(var i =0; i<data.length;i++){\n var dato= $(\"<option value=\"+data[i].id_unit+\" data-empresa=\"+data[i].company+\" >\"+data[i].empresa+\" \"+data[i].tipo+\"</option>\");\n id_padre.append (dato);\n }\n // SE GUARDA EN VARIABLES GLOABLES LOS VALORES DEL PRIMER UNIT POR DEFECTO\n largo_unit=data[0].largo;\n ancho_unit=data[0].ancho;\n console.log(dato_medidas);\n callback(dato_medidas,datos_puertos);\n dimensiones_linga();\n}", "title": "" }, { "docid": "7cde86b8cd4a049cbcccfbc0d04a4d62", "score": "0.50461733", "text": "eseguiCiclo() {\n if (this.matriceAttiva === 'A') {\n this.calcolaProssimaGenerazione(this.lifeA, this.lifeB);\n this.coloraCelleInBaseAMatrice(this.lifeB);\n this.matriceAttiva = 'B';\n }\n else {\n this.calcolaProssimaGenerazione(this.lifeB, this.lifeA);\n this.coloraCelleInBaseAMatrice(this.lifeA);\n this.matriceAttiva = 'A';\n }\n }", "title": "" }, { "docid": "7cde86b8cd4a049cbcccfbc0d04a4d62", "score": "0.50461733", "text": "eseguiCiclo() {\n if (this.matriceAttiva === 'A') {\n this.calcolaProssimaGenerazione(this.lifeA, this.lifeB);\n this.coloraCelleInBaseAMatrice(this.lifeB);\n this.matriceAttiva = 'B';\n }\n else {\n this.calcolaProssimaGenerazione(this.lifeB, this.lifeA);\n this.coloraCelleInBaseAMatrice(this.lifeA);\n this.matriceAttiva = 'A';\n }\n }", "title": "" }, { "docid": "722f2bf47b6e74230e5394359dde842b", "score": "0.5044067", "text": "function inicializarQuiz(){ //função que reseta todas as variaveis e sorteia as perguntas\r\n\t\t\tvetorEconomicas = [];\r\n\t\t\tvetorValores = [];\r\n\t\t\talternar = 0;\r\n\t\t\tordem = 0\r\n\t\t\tx = 0;\r\n\t\t\ty = 0;\r\n\t\t\tvetorHistoricoX = [0];\r\n\t\t\tvetorHistoricoY = [0];\r\n\t\t\ttotalPergunta = 0;\r\n\t\t\twhile(vetorEconomicas.length<5){\r\n\t\t\t\tvar random = Math.ceil(Math.random()*obj.perguntas.perguntasEco.length-1);\r\n\t\t\t\tif(vetorEconomicas.indexOf(random) > -1) continue;\r\n\t\t\t\tvetorEconomicas[vetorEconomicas.length] = random;\r\n\t\t\t}\r\n\t\t\twhile(vetorValores.length<5){\r\n\t\t\t\tvar random = Math.ceil(Math.random()*obj.perguntas.perguntasVal.length-1);\r\n\t\t\t\tif(vetorValores.indexOf(random) > -1) continue;\r\n\t\t\t\tvetorValores[vetorValores.length] = random;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "e3dc1518353d3e2faab2f803488c12b8", "score": "0.5040857", "text": "function equip(mes, type, user) {\r\n\tlet all = \"\";\r\n\t//afficher les type darme\r\n\tfor (let i = 0; i < joueur[mes.author.id].item.length; i++)\r\n\t{\r\n\t\tif (item[joueur[mes.author.id].item[i]].type == type)\r\n\t\t\tall += `solt ${i}-->${item[joueur[mes.author.id].item[i]].nom}\\n`\r\n\t}\r\n\tif (all) {\r\n\t\tmes.channel.send(all);\r\n\t\tif (!use[(mes.author.id)]) {\r\n\t\t\tok = true;\r\n\t\t\tty = type;\r\n\t\t\tvar me = mes.author.id;\r\n\t\t\tuse[me] = { time: true, type: type };\r\n\t\t\tmes.channel.send(\"tu a 30 seconde\");\r\n\t\t\tfuntim[me] = { exucute: setTimeout(function () { ok = false; use[(mes.author.id)].time = false; ty = \"\"; funtim[mes.author.id].time = false; mes.reply(\"temp ecoule\"); clear(); }, 30000), time: true };\r\n\t\t}\r\n\t\telse\r\n\t\t\tmes.channel.send(\"le temps nai pas fini\");\r\n\t}\r\n\telse\r\n\t\tmes.channel.send(\"ya pas ce type dequipment dans ton inventaire dsl\");\r\n}", "title": "" } ]
7bc6c42bb68579d40ee15024d6e1702c
Implements the parsing rules in the Directives section. Directives[Const] : Directive[?Const]+
[ { "docid": "98730907925b96a095b0d2a3746fb207", "score": "0.725667", "text": "function parseDirectives(lexer$$1, isConst) {\n var directives = [];\n while (peek(lexer$$1, lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer$$1, isConst));\n }\n return directives;\n}", "title": "" } ]
[ { "docid": "e04166f3564bce30349543a27b853f23", "score": "0.72365206", "text": "function parseDirectives(lexer, isConst) {\n\t var directives = [];\n\t while (peek(lexer, _lexer.TokenKind.AT)) {\n\t directives.push(parseDirective(lexer, isConst));\n\t }\n\t return directives;\n\t}", "title": "" }, { "docid": "2ba7dab666cce514d1d7af4955359478", "score": "0.7200485", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.7185122", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.7185122", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.7185122", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.7185122", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "7a0fce379dad720e46fd94bfdc4437e3", "score": "0.7178608", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "e287c1104349169bf527535541cc5552", "score": "0.7031504", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "98645af1a35aead22735d5b97f0b88ab", "score": "0.6945954", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "98645af1a35aead22735d5b97f0b88ab", "score": "0.6945954", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "d7ef6725c635052b6a8d86eb655732d6", "score": "0.69314444", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "0eafef93bfc8689db131aa53b6d0b38a", "score": "0.6800339", "text": "parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }", "title": "" }, { "docid": "a71cefd9d12f3f06a0870973501b56cf", "score": "0.6365464", "text": "function directives() {\n var i, p, pn;\n \n while (state.tokens.next.id === \"(string)\") {\n p = peek(0);\n if (p.id === \"(endline)\") {\n i = 1;\n do {\n pn = peek(i++);\n } while (pn.id === \"(endline)\");\n if (pn.id === \";\") {\n p = pn;\n } else if (pn.value === \"[\" || pn.value === \".\") {\n // string -> [ | . is a valid production\n return;\n } else if (!state.option.asi || pn.value === \"(\") {\n // string -> ( is not a valid production\n warning(\"W033\", state.tokens.next);\n }\n } else if (p.id === \".\" || p.id === \"[\") {\n return;\n } else if (p.id !== \";\") {\n warning(\"W033\", p);\n }\n \n advance();\n if (state.directive[state.tokens.curr.value]) {\n warning(\"W034\", state.tokens.curr, state.tokens.curr.value);\n }\n \n if (state.tokens.curr.value === \"use strict\") {\n if (!state.option[\"(explicitNewcap)\"]) {\n state.option.newcap = true;\n }\n state.option.undef = true;\n }\n \n // there's no directive negation, so always set to true\n state.directive[state.tokens.curr.value] = true;\n \n if (p.id === \";\") {\n advance(\";\");\n }\n }\n }", "title": "" }, { "docid": "02c56dc31ef1919a2fb2fb0ab0a3310a", "score": "0.56553245", "text": "parseMaybeConst () {\n const constToken = this.getToken();\n if(constToken.type === this.lexerClass.RK_CONST) {\n this.pos++;\n const typeString = this.parseType();\n return this.parseDeclaration(typeString, true);\n } else if(this.isVariableType(constToken)) {\n const typeString = this.parseType();\n return this.parseDeclaration(typeString);\n } else {\n throw SyntaxErrorFactory.token_missing_list(\n [this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);\n }\n\n }", "title": "" }, { "docid": "f9840c1199841c8efd6e0f09913893e6", "score": "0.55314326", "text": "function DirectiveType(){}", "title": "" }, { "docid": "d9a3b8700f4c47c6cbc14c225400b7db", "score": "0.54971236", "text": "function compileDirectiveFromMetadata(meta,constantPool,bindingParser){var _a=baseDirectiveFields(meta,constantPool,bindingParser),definitionMap=_a.definitionMap,statements=_a.statements;addFeatures(definitionMap,meta);var expression=importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);// On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n// string literal, which must be on one line.\nvar selectorForType=(meta.selector||'').replace(/\\n/g,'');var type=createTypeForDef(meta,Identifiers$1.DirectiveDefWithMeta);return{expression:expression,type:type,statements:statements};}", "title": "" }, { "docid": "286536e7748e20187bf65eef60a18554", "score": "0.5490562", "text": "function DirectiveType() {}", "title": "" }, { "docid": "231cb85f5f5c259fa78ff6e6f4f35c22", "score": "0.53676605", "text": "function parseDirectives(lexer) {\n\t var directives = [];\n\t while (peek(lexer, _lexer.TokenKind.AT)) {\n\t directives.push(parseDirective(lexer));\n\t }\n\t return directives;\n\t}", "title": "" }, { "docid": "d939e8d23bbb58dcb4b193d912871360", "score": "0.53490233", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n const expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n const type = createDirectiveType(meta);\n return { expression, type };\n}", "title": "" }, { "docid": "d939e8d23bbb58dcb4b193d912871360", "score": "0.53490233", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n const expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n const type = createDirectiveType(meta);\n return { expression, type };\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.53483814", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "c77da730ac26d978ff9cba8b943f502a", "score": "0.5270784", "text": "function DirectiveType() { }", "title": "" }, { "docid": "ff2dcdf7eb352f316df29a4d1012ccbc", "score": "0.5270337", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n var _a = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _a.definitionMap, statements = _a.statements;\n addFeatures(definitionMap, meta);\n var expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "ff2dcdf7eb352f316df29a4d1012ccbc", "score": "0.5270337", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n var _a = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _a.definitionMap, statements = _a.statements;\n addFeatures(definitionMap, meta);\n var expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "af599837ce4b240cbbe2b3841cf44286", "score": "0.5253394", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n var _baseDirectiveFields = baseDirectiveFields(meta, constantPool, bindingParser),\n definitionMap = _baseDirectiveFields.definitionMap,\n statements = _baseDirectiveFields.statements;\n\n addFeatures(definitionMap, meta);\n var expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n\n if (!meta.selector) {\n throw new Error(\"Directive \".concat(meta.name, \" has no selector, please add it!\"));\n }\n\n var type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return {\n expression: expression,\n type: type,\n statements: statements\n };\n }", "title": "" }, { "docid": "a9ba0649b5719ffc186591f32f3f780c", "score": "0.5251513", "text": "function parseDirectives(parser) {\n\t var directives = [];\n\t while (peek(parser, _lexer.TokenKind.AT)) {\n\t directives.push(parseDirective(parser));\n\t }\n\t return directives;\n\t}", "title": "" }, { "docid": "5c7914d00678772f2f7ae9197455f751", "score": "0.5250069", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n var definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n var expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n var typeParams = createDirectiveTypeParams(meta);\n var type = expressionType(importExpr(Identifiers$1.DirectiveDefWithMeta, typeParams));\n return {\n expression: expression,\n type: type\n };\n}", "title": "" }, { "docid": "e6a47b2f42e440a370f9ef5746f4f84d", "score": "0.5220499", "text": "function parseDirectives(parser) {\n var directives = [];\n while (peek(parser, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(parser));\n }\n return directives;\n}", "title": "" }, { "docid": "7faec899e824a9e6e1ee4a8ca6e0459c", "score": "0.52170503", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n var _a = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _a.definitionMap, statements = _a.statements;\n addFeatures(definitionMap, meta);\n var expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n if (!meta.selector) {\n throw new Error(\"Directive \" + meta.name + \" has no selector, please add it!\");\n }\n var type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "f5c043fa1c3d2c6185827318ee012ae4", "score": "0.5202359", "text": "function parseModifiers(permitInvalidConstAsModifier) {\n var flags = 0;\n var modifiers;\n while (true) {\n var modifierStart = scanner.getStartPos();\n var modifierKind = token();\n if (token() === 74 /* ConstKeyword */ && permitInvalidConstAsModifier) {\n // We need to ensure that any subsequent modifiers appear on the same line\n // so that when 'const' is a standalone declaration, we don't issue an error.\n if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {\n break;\n }\n }\n else {\n if (!parseAnyContextualModifier()) {\n break;\n }\n }\n if (!modifiers) {\n modifiers = [];\n modifiers.pos = modifierStart;\n }\n flags |= ts.modifierToFlag(modifierKind);\n modifiers.push(finishNode(createNode(modifierKind, modifierStart)));\n }\n if (modifiers) {\n modifiers.flags = flags;\n modifiers.end = scanner.getStartPos();\n }\n return modifiers;\n }", "title": "" }, { "docid": "da1e008942ce04cb1f884824dd8caf11", "score": "0.5174584", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n const { definitionMap, statements } = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n const expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n if (!meta.selector) {\n throw new Error(`Directive ${meta.name} has no selector, please add it!`);\n }\n const type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return { expression, type, statements };\n}", "title": "" }, { "docid": "da1e008942ce04cb1f884824dd8caf11", "score": "0.5174584", "text": "function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n const { definitionMap, statements } = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n const expression = importExpr(Identifiers$1.defineDirective).callFn([definitionMap.toLiteralMap()]);\n if (!meta.selector) {\n throw new Error(`Directive ${meta.name} has no selector, please add it!`);\n }\n const type = createTypeForDef(meta, Identifiers$1.DirectiveDefWithMeta);\n return { expression, type, statements };\n}", "title": "" }, { "docid": "1080c814490671b243573e6de0f55798", "score": "0.51677936", "text": "constructor ($compile, $mdUtil) {\n this.$compile= $compile;\n this.$mdUtil = $mdUtil;\n this.restrict='A';\n\n this.require = '^cdvyLearnMore';\n\n this.scope = {\n template: '=cdvyLearnMoreTemplate',\n compileScope: '=cdvyScope'\n };\n }", "title": "" }, { "docid": "404848fb12f95481e13c14b036fba404", "score": "0.5156455", "text": "function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n var _baseDirectiveFields2 = baseDirectiveFields(meta, constantPool, bindingParser),\n definitionMap = _baseDirectiveFields2.definitionMap,\n statements = _baseDirectiveFields2.statements;\n\n addFeatures(definitionMap, meta);\n var selector = meta.selector && CssSelector.parse(meta.selector);\n var firstSelector = selector && selector[0]; // e.g. `attr: [\"class\", \".my.app\"]`\n // This is optional an only included if the first selector of a component specifies attributes.\n\n if (firstSelector) {\n var selectorAttributes = firstSelector.getAttrs();\n\n if (selectorAttributes.length) {\n definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) {\n return value != null ? literal(value) : literal(undefined);\n })),\n /* forceShared */\n true));\n }\n } // Generate the CSS matcher that recognize directive\n\n\n var directiveMatcher = null;\n\n if (meta.directives.length > 0) {\n var matcher = new SelectorMatcher();\n var _iteratorNormalCompletion14 = true;\n var _didIteratorError14 = false;\n var _iteratorError14 = undefined;\n\n try {\n for (var _iterator14 = meta.directives[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) {\n var _step14$value = _step14.value,\n _selector = _step14$value.selector,\n _expression = _step14$value.expression;\n matcher.addSelectables(CssSelector.parse(_selector), _expression);\n }\n } catch (err) {\n _didIteratorError14 = true;\n _iteratorError14 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion14 && _iterator14.return != null) {\n _iterator14.return();\n }\n } finally {\n if (_didIteratorError14) {\n throw _iteratorError14;\n }\n }\n }\n\n directiveMatcher = matcher;\n } // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n\n\n var templateTypeName = meta.name;\n var templateName = templateTypeName ? \"\".concat(templateTypeName, \"_Template\") : null;\n var directivesUsed = new Set();\n var pipesUsed = new Set();\n var changeDetection = meta.changeDetection;\n var template = meta.template;\n var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.ROOT_SCOPE, 0, templateTypeName, null, null, templateName, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers$1.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []); // We need to provide this so that dynamically generated components know what\n // projected content blocks to pass through to the component when it is instantiated.\n\n var ngContentSelectors = templateBuilder.getNgContentSelectors();\n\n if (ngContentSelectors) {\n definitionMap.set('ngContentSelectors', ngContentSelectors);\n } // e.g. `consts: 2`\n\n\n definitionMap.set('consts', literal(templateBuilder.getConstCount())); // e.g. `vars: 2`\n\n definitionMap.set('vars', literal(templateBuilder.getVarCount()));\n definitionMap.set('template', templateFunctionExpression); // e.g. `directives: [MyDirective]`\n\n if (directivesUsed.size) {\n var directivesExpr = literalArr(Array.from(directivesUsed));\n\n if (meta.wrapDirectivesAndPipesInClosure) {\n directivesExpr = fn([], [new ReturnStatement(directivesExpr)]);\n }\n\n definitionMap.set('directives', directivesExpr);\n } // e.g. `pipes: [MyPipe]`\n\n\n if (pipesUsed.size) {\n var pipesExpr = literalArr(Array.from(pipesUsed));\n\n if (meta.wrapDirectivesAndPipesInClosure) {\n pipesExpr = fn([], [new ReturnStatement(pipesExpr)]);\n }\n\n definitionMap.set('pipes', pipesExpr);\n }\n\n if (meta.encapsulation === null) {\n meta.encapsulation = ViewEncapsulation.Emulated;\n } // e.g. `styles: [str1, str2]`\n\n\n if (meta.styles && meta.styles.length) {\n var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ? compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) : meta.styles;\n var strings = styleValues.map(function (str) {\n return literal(str);\n });\n definitionMap.set('styles', literalArr(strings));\n } else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n // If there is no style, don't generate css selectors on elements\n meta.encapsulation = ViewEncapsulation.None;\n } // Only set view encapsulation if it's not the default value\n\n\n if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n definitionMap.set('encapsulation', literal(meta.encapsulation));\n } // e.g. `animation: [trigger('123', [])]`\n\n\n if (meta.animations !== null) {\n definitionMap.set('data', literalMap([{\n key: 'animation',\n value: meta.animations,\n quoted: false\n }]));\n } // Only set the change detection flag if it's defined and it's not the default.\n\n\n if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n definitionMap.set('changeDetection', literal(changeDetection));\n } // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n\n\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var expression = importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);\n var type = createTypeForDef(meta, Identifiers$1.ComponentDefWithMeta);\n return {\n expression: expression,\n type: type,\n statements: statements\n };\n }", "title": "" }, { "docid": "6cf7f615a0c0005b3b058019079ddf6e", "score": "0.4998515", "text": "parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }", "title": "" }, { "docid": "ccd3fe0c439e8857bf4e47300c0b2173", "score": "0.491196", "text": "function compileDirectiveFromRender2(outputCtx,directive,reflector,bindingParser){var name=identifierName(directive.type);name||error(\"Cannot resolver the name of \"+directive.type);var definitionField=outputCtx.constantPool.propertyNameOf(1/* Directive */);var meta=directiveMetadataFromGlobalMetadata(directive,outputCtx,reflector);var res=compileDirectiveFromMetadata(meta,outputCtx.constantPool,bindingParser);// Create the partial class to be merged with the actual class.\noutputCtx.statements.push(new ClassStmt(name,null,[new ClassField(definitionField,INFERRED_TYPE,[StmtModifier.Static],res.expression)],[],new ClassMethod(null,[],[]),[]));}", "title": "" }, { "docid": "98af645615b30eeba021555d954f0b49", "score": "0.48803583", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n var name = identifierName(directive.type);\n name || error(\"Cannot resolver the name of \".concat(directive.type));\n var definitionField = outputCtx.constantPool.propertyNameOf(1\n /* Directive */\n );\n var meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n var res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser); // Create the partial class to be merged with the actual class.\n\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n }", "title": "" }, { "docid": "8d64fd57c5a4c701f21b9e6b54bf3df3", "score": "0.48454714", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__[\"specifiedDirectives\"];\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_DEFINITION || node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeDefinitionNode\"])(node) || Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeExtensionNode\"])(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "8d64fd57c5a4c701f21b9e6b54bf3df3", "score": "0.48454714", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__[\"specifiedDirectives\"];\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_DEFINITION || node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeDefinitionNode\"])(node) || Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeExtensionNode\"])(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "c46d298b076401640db773367f18ae69", "score": "0.4831217", "text": "function instantiateDirectivesDirectly() {\n ngDevMode && assertEqual(firstTemplatePass, false, \"Directives should only be instantiated directly after first template pass\");\n var count = previousOrParentTNode.flags & 4095 /* DirectiveCountMask */;\n if (isContentQueryHost(previousOrParentTNode) && currentQueries) {\n currentQueries = currentQueries.clone();\n }\n if (count > 0) {\n var start = previousOrParentTNode.flags >> 15 /* DirectiveStartingIndexShift */;\n var end = start + count;\n for (var i = start; i < end; i++) {\n var def = tView.data[i];\n // Component view must be set on node before the factory is created so\n // ChangeDetectorRefs have a way to store component view on creation.\n if (def.template) {\n addComponentLogic(def);\n }\n directiveCreate(i, def.factory(), def);\n }\n }\n}", "title": "" }, { "docid": "441b61f8026de060739f3158372b38b8", "score": "0.47915483", "text": "function parseDirectiveLocations(lexer) {\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "441b61f8026de060739f3158372b38b8", "score": "0.47915483", "text": "function parseDirectiveLocations(lexer) {\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "39f8b4f57f7b8f7f91c179ca0a41a6c8", "score": "0.47838706", "text": "parseDeclaration (typeString, isConst = false) {\n let initial = null;\n let dim1 = null;\n let dim2 = null;\n const idToken = this.getToken();\n const idString = this.parseID();\n this.checkVariableDuplicate(idString,idToken);\n // Check for array or vector\n // ID[int/IDi][int/IDj]\n if (this.checkOpenBrace(true)) {\n this.pos++;\n this.consumeNewLines();\n dim1 = this.parseArrayDimension();\n this.consumeNewLines();\n this.checkCloseBrace();\n this.pos++;\n if(this.checkOpenBrace(true)) {\n this.pos++;\n this.consumeNewLines();\n dim2 = this.parseArrayDimension();\n this.consumeNewLines();\n this.checkCloseBrace();\n this.pos++;\n }\n }\n\n const equalsToken = this.getToken();\n if(isConst && equalsToken.type !== this.lexerClass.EQUAL ) {\n throw SyntaxErrorFactory.const_not_init(idToken);\n }\n if(equalsToken.type === this.lexerClass.EQUAL) {\n this.pos++;\n initial = this.parseExpressionOR();\n }\n let declaration = null;\n let dimensions = 0;\n if (dim1 !== null) {\n dimensions++;\n if(dim2 !== null) {\n dimensions++;\n }\n declaration = new Commands.ArrayDeclaration(idString,\n new CompoundType(typeString, dimensions), dim1, dim2, initial, isConst);\n } else {\n declaration = new Commands.Declaration(idString, typeString, initial, isConst);\n }\n declaration.sourceInfo = SourceInfo.createSourceInfo(idToken);\n const commaToken = this.getToken();\n if(commaToken.type === this.lexerClass.COMMA) {\n this.pos++;\n this.consumeNewLines();\n return [declaration]\n .concat(this.parseDeclaration(typeString, isConst));\n } else {\n return [declaration]\n }\n }", "title": "" }, { "docid": "6e1e8e3362c9d1ecdf2f8cd26850113b", "score": "0.47604182", "text": "*next(token) {\n switch (token.type) {\n case 'directive':\n this.directives.add(token.source, (offset, message, warning) => {\n const pos = getErrorPos(token);\n pos[0] += offset;\n this.onError(pos, 'BAD_DIRECTIVE', message, warning);\n });\n this.prelude.push(token.source);\n this.atDirectives = true;\n break;\n case 'document': {\n const doc = composeDoc(this.options, this.directives, token, this.onError);\n if (this.atDirectives && !doc.directives.docStart)\n this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');\n this.decorate(doc, false);\n if (this.doc)\n yield this.doc;\n this.doc = doc;\n this.atDirectives = false;\n break;\n }\n case 'byte-order-mark':\n case 'space':\n break;\n case 'comment':\n case 'newline':\n this.prelude.push(token.source);\n break;\n case 'error': {\n const msg = token.source\n ? `${token.message}: ${JSON.stringify(token.source)}`\n : token.message;\n const error = new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);\n if (this.atDirectives || !this.doc)\n this.errors.push(error);\n else\n this.doc.errors.push(error);\n break;\n }\n case 'doc-end': {\n if (!this.doc) {\n const msg = 'Unexpected doc-end without preceding document';\n this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));\n break;\n }\n this.doc.directives.docEnd = true;\n const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n this.decorate(this.doc, true);\n if (end.comment) {\n const dc = this.doc.comment;\n this.doc.comment = dc ? `${dc}\\n${end.comment}` : end.comment;\n }\n this.doc.range[2] = end.offset;\n break;\n }\n default:\n this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));\n }\n }", "title": "" }, { "docid": "ade725a71c4c931fe8866a1c1a523845", "score": "0.47530332", "text": "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "title": "" }, { "docid": "ade725a71c4c931fe8866a1c1a523845", "score": "0.47530332", "text": "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "title": "" }, { "docid": "ade725a71c4c931fe8866a1c1a523845", "score": "0.47530332", "text": "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "title": "" }, { "docid": "7506a5707f4dd625a1c0f20bad043137", "score": "0.47461087", "text": "function parseSchemaDirectives(directives) {\n let schemaDirectives = [];\n\n if (\n !directives ||\n !(directives instanceof Object) ||\n Object.keys(directives).length === 0\n ) {\n return [];\n }\n\n for (let directiveName in directives) {\n let argsList = [],\n args = '';\n\n Object.keys(directives[directiveName]).map(key => {\n argsList.push(`${key}:\"${directives[directiveName][key]}\"`);\n });\n\n if (argsList.length > 0) {\n args = `(${argsList.join(',')})`;\n }\n\n schemaDirectives.push(`@${directiveName}${args}`);\n }\n\n return parse(`{ a: String ${schemaDirectives.join(' ')} }`).definitions[0]\n .selectionSet.selections[0].directives;\n}", "title": "" }, { "docid": "ec8437c00dfc96cf02837cdc38789c1d", "score": "0.4745472", "text": "function parseDirectiveLocations(lexer$$1) {\n // Optional leading pipe\n skip(lexer$$1, lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer$$1));\n } while (skip(lexer$$1, lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "639e2db85b0e55880d2192c3ab62d69f", "score": "0.47158036", "text": "buildHostAttrsInstruction(sourceSpan, attrs, constantPool) {\n if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {\n return {\n sourceSpan,\n reference: Identifiers$1.elementHostAttrs,\n allocateBindingSlots: 0,\n buildParams: () => {\n // params => elementHostAttrs(agetDirectiveContext()ttrs)\n this.populateInitialStylingAttrs(attrs);\n const attrArray = !attrs.some(attr => attr instanceof WrappedNodeExpr) ?\n getConstantLiteralFromArray(constantPool, attrs) :\n literalArr(attrs);\n return [attrArray];\n }\n };\n }\n return null;\n }", "title": "" }, { "docid": "ced15f0217cd6c98a1aa7acec161253f", "score": "0.4704621", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, TokenKind.PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, TokenKind.PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.4688274", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.4688274", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.4688274", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.4688274", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "34da29f48ab5dbc3f6766cc0ab5d7de6", "score": "0.4680319", "text": "function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n var e_1, _a;\n var _b = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _b.definitionMap, statements = _b.statements;\n addFeatures(definitionMap, meta);\n var selector = meta.selector && CssSelector.parse(meta.selector);\n var firstSelector = selector && selector[0];\n // e.g. `attr: [\"class\", \".my.app\"]`\n // This is optional an only included if the first selector of a component specifies attributes.\n if (firstSelector) {\n var selectorAttributes = firstSelector.getAttrs();\n if (selectorAttributes.length) {\n definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) { return value != null ? literal(value) : literal(undefined); })), \n /* forceShared */ true));\n }\n }\n // Generate the CSS matcher that recognize directive\n var directiveMatcher = null;\n if (meta.directives.length > 0) {\n var matcher = new SelectorMatcher();\n try {\n for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(meta.directives), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = _d.value, selector_1 = _e.selector, expression_1 = _e.expression;\n matcher.addSelectables(CssSelector.parse(selector_1), expression_1);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n directiveMatcher = matcher;\n }\n // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n var templateTypeName = meta.name;\n var templateName = templateTypeName ? templateTypeName + \"_Template\" : null;\n var directivesUsed = new Set();\n var pipesUsed = new Set();\n var changeDetection = meta.changeDetection;\n var template = meta.template;\n var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.ROOT_SCOPE, 0, templateTypeName, null, null, templateName, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers$1.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);\n // We need to provide this so that dynamically generated components know what\n // projected content blocks to pass through to the component when it is instantiated.\n var ngContentSelectors = templateBuilder.getNgContentSelectors();\n if (ngContentSelectors) {\n definitionMap.set('ngContentSelectors', ngContentSelectors);\n }\n // e.g. `consts: 2`\n definitionMap.set('consts', literal(templateBuilder.getConstCount()));\n // e.g. `vars: 2`\n definitionMap.set('vars', literal(templateBuilder.getVarCount()));\n definitionMap.set('template', templateFunctionExpression);\n // e.g. `directives: [MyDirective]`\n if (directivesUsed.size) {\n var directivesExpr = literalArr(Array.from(directivesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n directivesExpr = fn([], [new ReturnStatement(directivesExpr)]);\n }\n definitionMap.set('directives', directivesExpr);\n }\n // e.g. `pipes: [MyPipe]`\n if (pipesUsed.size) {\n var pipesExpr = literalArr(Array.from(pipesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n pipesExpr = fn([], [new ReturnStatement(pipesExpr)]);\n }\n definitionMap.set('pipes', pipesExpr);\n }\n if (meta.encapsulation === null) {\n meta.encapsulation = ViewEncapsulation.Emulated;\n }\n // e.g. `styles: [str1, str2]`\n if (meta.styles && meta.styles.length) {\n var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?\n compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :\n meta.styles;\n var strings = styleValues.map(function (str) { return literal(str); });\n definitionMap.set('styles', literalArr(strings));\n }\n else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n // If there is no style, don't generate css selectors on elements\n meta.encapsulation = ViewEncapsulation.None;\n }\n // Only set view encapsulation if it's not the default value\n if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n definitionMap.set('encapsulation', literal(meta.encapsulation));\n }\n // e.g. `animation: [trigger('123', [])]`\n if (meta.animations !== null) {\n definitionMap.set('data', literalMap([{ key: 'animation', value: meta.animations, quoted: false }]));\n }\n // Only set the change detection flag if it's defined and it's not the default.\n if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n definitionMap.set('changeDetection', literal(changeDetection));\n }\n // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var expression = importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);\n var type = createTypeForDef(meta, Identifiers$1.ComponentDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "1e2e5f2fa96c66e938922eb8611bd300", "score": "0.46793", "text": "function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n var e_1, _a;\n var _b = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _b.definitionMap, statements = _b.statements;\n addFeatures(definitionMap, meta);\n var selector = meta.selector && CssSelector.parse(meta.selector);\n var firstSelector = selector && selector[0];\n // e.g. `attr: [\"class\", \".my.app\"]`\n // This is optional an only included if the first selector of a component specifies attributes.\n if (firstSelector) {\n var selectorAttributes = firstSelector.getAttrs();\n if (selectorAttributes.length) {\n definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) { return value != null ? literal(value) : literal(undefined); })), \n /* forceShared */ true));\n }\n }\n // Generate the CSS matcher that recognize directive\n var directiveMatcher = null;\n if (meta.directives.length > 0) {\n var matcher = new SelectorMatcher();\n try {\n for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(meta.directives), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = _d.value, selector_1 = _e.selector, expression_1 = _e.expression;\n matcher.addSelectables(CssSelector.parse(selector_1), expression_1);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n directiveMatcher = matcher;\n }\n if (meta.viewQueries.length) {\n definitionMap.set('viewQuery', createViewQueriesFunction(meta, constantPool));\n }\n // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n var templateTypeName = meta.name;\n var templateName = templateTypeName ? templateTypeName + \"_Template\" : null;\n var directivesUsed = new Set();\n var pipesUsed = new Set();\n var changeDetection = meta.changeDetection;\n var template = meta.template;\n var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.ROOT_SCOPE, 0, templateTypeName, null, null, templateName, meta.viewQueries, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers$1.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);\n // e.g. `consts: 2`\n definitionMap.set('consts', literal(templateBuilder.getConstCount()));\n // e.g. `vars: 2`\n definitionMap.set('vars', literal(templateBuilder.getVarCount()));\n definitionMap.set('template', templateFunctionExpression);\n // e.g. `directives: [MyDirective]`\n if (directivesUsed.size) {\n var directivesExpr = literalArr(Array.from(directivesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n directivesExpr = fn([], [new ReturnStatement(directivesExpr)]);\n }\n definitionMap.set('directives', directivesExpr);\n }\n // e.g. `pipes: [MyPipe]`\n if (pipesUsed.size) {\n var pipesExpr = literalArr(Array.from(pipesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n pipesExpr = fn([], [new ReturnStatement(pipesExpr)]);\n }\n definitionMap.set('pipes', pipesExpr);\n }\n if (meta.encapsulation === null) {\n meta.encapsulation = ViewEncapsulation.Emulated;\n }\n // e.g. `styles: [str1, str2]`\n if (meta.styles && meta.styles.length) {\n var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?\n compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :\n meta.styles;\n var strings = styleValues.map(function (str) { return literal(str); });\n definitionMap.set('styles', literalArr(strings));\n }\n else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n // If there is no style, don't generate css selectors on elements\n meta.encapsulation = ViewEncapsulation.None;\n }\n // Only set view encapsulation if it's not the default value\n if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n definitionMap.set('encapsulation', literal(meta.encapsulation));\n }\n // e.g. `animation: [trigger('123', [])]`\n if (meta.animations !== null) {\n definitionMap.set('data', literalMap([{ key: 'animation', value: meta.animations, quoted: false }]));\n }\n // Only set the change detection flag if it's defined and it's not the default.\n if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n definitionMap.set('changeDetection', literal(changeDetection));\n }\n // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var expression = importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);\n var type = createTypeForDef(meta, Identifiers$1.ComponentDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "1e2e5f2fa96c66e938922eb8611bd300", "score": "0.46793", "text": "function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n var e_1, _a;\n var _b = baseDirectiveFields(meta, constantPool, bindingParser), definitionMap = _b.definitionMap, statements = _b.statements;\n addFeatures(definitionMap, meta);\n var selector = meta.selector && CssSelector.parse(meta.selector);\n var firstSelector = selector && selector[0];\n // e.g. `attr: [\"class\", \".my.app\"]`\n // This is optional an only included if the first selector of a component specifies attributes.\n if (firstSelector) {\n var selectorAttributes = firstSelector.getAttrs();\n if (selectorAttributes.length) {\n definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) { return value != null ? literal(value) : literal(undefined); })), \n /* forceShared */ true));\n }\n }\n // Generate the CSS matcher that recognize directive\n var directiveMatcher = null;\n if (meta.directives.length > 0) {\n var matcher = new SelectorMatcher();\n try {\n for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(meta.directives), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = _d.value, selector_1 = _e.selector, expression_1 = _e.expression;\n matcher.addSelectables(CssSelector.parse(selector_1), expression_1);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n directiveMatcher = matcher;\n }\n if (meta.viewQueries.length) {\n definitionMap.set('viewQuery', createViewQueriesFunction(meta, constantPool));\n }\n // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n var templateTypeName = meta.name;\n var templateName = templateTypeName ? templateTypeName + \"_Template\" : null;\n var directivesUsed = new Set();\n var pipesUsed = new Set();\n var changeDetection = meta.changeDetection;\n var template = meta.template;\n var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.ROOT_SCOPE, 0, templateTypeName, null, null, templateName, meta.viewQueries, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers$1.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);\n // e.g. `consts: 2`\n definitionMap.set('consts', literal(templateBuilder.getConstCount()));\n // e.g. `vars: 2`\n definitionMap.set('vars', literal(templateBuilder.getVarCount()));\n definitionMap.set('template', templateFunctionExpression);\n // e.g. `directives: [MyDirective]`\n if (directivesUsed.size) {\n var directivesExpr = literalArr(Array.from(directivesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n directivesExpr = fn([], [new ReturnStatement(directivesExpr)]);\n }\n definitionMap.set('directives', directivesExpr);\n }\n // e.g. `pipes: [MyPipe]`\n if (pipesUsed.size) {\n var pipesExpr = literalArr(Array.from(pipesUsed));\n if (meta.wrapDirectivesAndPipesInClosure) {\n pipesExpr = fn([], [new ReturnStatement(pipesExpr)]);\n }\n definitionMap.set('pipes', pipesExpr);\n }\n if (meta.encapsulation === null) {\n meta.encapsulation = ViewEncapsulation.Emulated;\n }\n // e.g. `styles: [str1, str2]`\n if (meta.styles && meta.styles.length) {\n var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?\n compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :\n meta.styles;\n var strings = styleValues.map(function (str) { return literal(str); });\n definitionMap.set('styles', literalArr(strings));\n }\n else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n // If there is no style, don't generate css selectors on elements\n meta.encapsulation = ViewEncapsulation.None;\n }\n // Only set view encapsulation if it's not the default value\n if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n definitionMap.set('encapsulation', literal(meta.encapsulation));\n }\n // e.g. `animation: [trigger('123', [])]`\n if (meta.animations !== null) {\n definitionMap.set('data', literalMap([{ key: 'animation', value: meta.animations, quoted: false }]));\n }\n // Only set the change detection flag if it's defined and it's not the default.\n if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n definitionMap.set('changeDetection', literal(changeDetection));\n }\n // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n // string literal, which must be on one line.\n var selectorForType = (meta.selector || '').replace(/\\n/g, '');\n var expression = importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);\n var type = createTypeForDef(meta, Identifiers$1.ComponentDefWithMeta);\n return { expression: expression, type: type, statements: statements };\n}", "title": "" }, { "docid": "1a1e50d65d1c50b6d2b66c3fa35cf997", "score": "0.467164", "text": "function compileDirective(type,directive){var ngDirectiveDef=null;Object.defineProperty(type,NG_DIRECTIVE_DEF,{get:function get(){if(ngDirectiveDef===null){var facade=directiveMetadata(type,directive);ngDirectiveDef=getCompilerFacade().compileDirective(angularCoreEnv,\"ng://\"+(type&&type.name)+\"/ngDirectiveDef.js\",facade);}return ngDirectiveDef;},// Make the property configurable in dev mode to allow overriding in tests\nconfigurable:!!ngDevMode});}", "title": "" }, { "docid": "45ff6ef3fa6e5fb9da88418eb9d0cdc1", "score": "0.4666659", "text": "function getDirectives(target){var context=loadLContext(target);if(context.directives===undefined){context.directives=getDirectivesAtNodeIndex(context.nodeIndex,context.lView,false);}return context.directives||[];}", "title": "" }, { "docid": "0e7cd284fca4c6214ae9aaa05d11e8d9", "score": "0.46633956", "text": "function TLD_directive(code)\n{\n\tif (code.indexOf(\"tagAttribute\") != -1)\n\t{\n\t\ttldData += jspattrOpenPattern;\n\n\t\tvar i = code.search(/name=\"([^\"]*)\"/i);\n\t\tif (i != -1)\n\t\t{\n\t\t\ttldData += jspnameOpenPattern;\n\t\t\ttldData += RegExp.$1;\n\t\t\ttldData += jspnameClosePattern;\n\t\t}\n\n\t\tvar i = code.search(/required=\"([^\"]*)\"/i);\n\t\tif (i != -1)\n\t\t{\n\t\t\ttldData += jsprequiredOpenPattern;\n\t\t\ttldData += RegExp.$1;\n\t\t\ttldData += jsprequiredClosePattern;\n\t\t}\n\n\t\tvar i = code.search(/rtexpr=\"([^\"]*)\"/i);\n\t\tif (i != -1)\n\t\t{\n\t\t\ttldData += jsprtexprOpenPattern;\n\t\t\ttldData += RegExp.$1;\n\t\t\ttldData += jsprtexprClosePattern;\n\t\t}\n\n\t\t//if rtexpr failed try to check rtexp\n\t\tif (i==-1)\n\t\t{\n\t\t\tvar i = code.search(/rtexp=\"([^\"]*)\"/i);\n\t\t\tif (i != -1)\n\t\t\t{\n\t\t\t\ttldData += jsprtexprOpenPattern;\n\t\t\t\ttldData += RegExp.$1;\n\t\t\t\ttldData += jsprtexprClosePattern;\n\t\t\t}\n\t\t}\n\n\t\ttldData += jspattrClosePattern;\n\t}\n}", "title": "" }, { "docid": "7bca0ae7bd3582cf0e1881eedf163062", "score": "0.46590897", "text": "function useDirective(binding) {\n return [binding.value, binding.arg, binding.modifiers];\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.46570918", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.46570918", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.46570918", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.46570918", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2281cf31c5d85b55b6098425b3b2f2b0", "score": "0.4653758", "text": "function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n var definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n addFeatures(definitionMap, meta);\n var selector = meta.selector && CssSelector.parse(meta.selector);\n var firstSelector = selector && selector[0]; // e.g. `attr: [\"class\", \".my.app\"]`\n // This is optional an only included if the first selector of a component specifies attributes.\n\n if (firstSelector) {\n var selectorAttributes = firstSelector.getAttrs();\n\n if (selectorAttributes.length) {\n definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) {\n return value != null ? literal(value) : literal(undefined);\n })),\n /* forceShared */\n true));\n }\n } // Generate the CSS matcher that recognize directive\n\n\n var directiveMatcher = null;\n\n if (meta.directives.length > 0) {\n var matcher = new SelectorMatcher();\n\n var _iterator18 = Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(meta.directives),\n _step18;\n\n try {\n for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {\n var _step18$value = _step18.value,\n _selector = _step18$value.selector,\n _expression = _step18$value.expression;\n matcher.addSelectables(CssSelector.parse(_selector), _expression);\n }\n } catch (err) {\n _iterator18.e(err);\n } finally {\n _iterator18.f();\n }\n\n directiveMatcher = matcher;\n } // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n\n\n var templateTypeName = meta.name;\n var templateName = templateTypeName ? \"\".concat(templateTypeName, \"_Template\") : null;\n var directivesUsed = new Set();\n var pipesUsed = new Set();\n var changeDetection = meta.changeDetection;\n var template = meta.template;\n var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers$1.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []); // We need to provide this so that dynamically generated components know what\n // projected content blocks to pass through to the component when it is instantiated.\n\n var ngContentSelectors = templateBuilder.getNgContentSelectors();\n\n if (ngContentSelectors) {\n definitionMap.set('ngContentSelectors', ngContentSelectors);\n } // e.g. `decls: 2`\n\n\n definitionMap.set('decls', literal(templateBuilder.getConstCount())); // e.g. `vars: 2`\n\n definitionMap.set('vars', literal(templateBuilder.getVarCount())); // Generate `consts` section of ComponentDef:\n // - either as an array:\n // `consts: [['one', 'two'], ['three', 'four']]`\n // - or as a factory function in case additional statements are present (to support i18n):\n // `consts: function() { var i18n_0; if (ngI18nClosureMode) {...} else {...} return [i18n_0]; }`\n\n var _templateBuilder$getC = templateBuilder.getConsts(),\n constExpressions = _templateBuilder$getC.constExpressions,\n prepareStatements = _templateBuilder$getC.prepareStatements;\n\n if (constExpressions.length > 0) {\n var constsExpr = literalArr(constExpressions); // Prepare statements are present - turn `consts` into a function.\n\n if (prepareStatements.length > 0) {\n constsExpr = fn([], [].concat(Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(prepareStatements), [new ReturnStatement(constsExpr)]));\n }\n\n definitionMap.set('consts', constsExpr);\n }\n\n definitionMap.set('template', templateFunctionExpression); // e.g. `directives: [MyDirective]`\n\n if (directivesUsed.size) {\n var directivesExpr = literalArr(Array.from(directivesUsed));\n\n if (meta.wrapDirectivesAndPipesInClosure) {\n directivesExpr = fn([], [new ReturnStatement(directivesExpr)]);\n }\n\n definitionMap.set('directives', directivesExpr);\n } // e.g. `pipes: [MyPipe]`\n\n\n if (pipesUsed.size) {\n var pipesExpr = literalArr(Array.from(pipesUsed));\n\n if (meta.wrapDirectivesAndPipesInClosure) {\n pipesExpr = fn([], [new ReturnStatement(pipesExpr)]);\n }\n\n definitionMap.set('pipes', pipesExpr);\n }\n\n if (meta.encapsulation === null) {\n meta.encapsulation = ViewEncapsulation.Emulated;\n } // e.g. `styles: [str1, str2]`\n\n\n if (meta.styles && meta.styles.length) {\n var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ? compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) : meta.styles;\n var strings = styleValues.map(function (str) {\n return constantPool.getConstLiteral(literal(str));\n });\n definitionMap.set('styles', literalArr(strings));\n } else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n // If there is no style, don't generate css selectors on elements\n meta.encapsulation = ViewEncapsulation.None;\n } // Only set view encapsulation if it's not the default value\n\n\n if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n definitionMap.set('encapsulation', literal(meta.encapsulation));\n } // e.g. `animation: [trigger('123', [])]`\n\n\n if (meta.animations !== null) {\n definitionMap.set('data', literalMap([{\n key: 'animation',\n value: meta.animations,\n quoted: false\n }]));\n } // Only set the change detection flag if it's defined and it's not the default.\n\n\n if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n definitionMap.set('changeDetection', literal(changeDetection));\n }\n\n var expression = importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);\n var typeParams = createDirectiveTypeParams(meta);\n typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));\n var type = expressionType(importExpr(Identifiers$1.ComponentDefWithMeta, typeParams));\n return {\n expression: expression,\n type: type\n };\n}", "title": "" }, { "docid": "3ead97aa325f90fbe66900baacdf2abf", "score": "0.46368313", "text": "function parseDirectiveLocations(lexer) {\n\t var locations = [];\n\t do {\n\t locations.push(parseName(lexer));\n\t } while (skip(lexer, _lexer.TokenKind.PIPE));\n\t return locations;\n\t}", "title": "" }, { "docid": "19648fffd794e700624dec4d34bc0bf5", "score": "0.46352145", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "25362f19d608f7372dab9d3492913692", "score": "0.46284658", "text": "buildHostAttrsInstruction(sourceSpan, attrs, constantPool) {\n if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {\n return {\n sourceSpan,\n reference: Identifiers$1.elementHostAttrs,\n allocateBindingSlots: 0,\n params: () => {\n // params => elementHostAttrs(attrs)\n this.populateInitialStylingAttrs(attrs);\n const attrArray = !attrs.some(attr => attr instanceof WrappedNodeExpr) ?\n getConstantLiteralFromArray(constantPool, attrs) :\n literalArr(attrs);\n return [attrArray];\n }\n };\n }\n return null;\n }", "title": "" }, { "docid": "2263507954b965beab7f98aa093c0e12", "score": "0.46062437", "text": "function compileComponentFromMetadata(meta,constantPool,bindingParser){var e_1,_a;var _b=baseDirectiveFields(meta,constantPool,bindingParser),definitionMap=_b.definitionMap,statements=_b.statements;addFeatures(definitionMap,meta);var selector=meta.selector&&CssSelector.parse(meta.selector);var firstSelector=selector&&selector[0];// e.g. `attr: [\"class\", \".my.app\"]`\n// This is optional an only included if the first selector of a component specifies attributes.\nif(firstSelector){var selectorAttributes=firstSelector.getAttrs();if(selectorAttributes.length){definitionMap.set('attrs',constantPool.getConstLiteral(literalArr(selectorAttributes.map(function(value){return value!=null?literal(value):literal(undefined);})),/* forceShared */true));}}// Generate the CSS matcher that recognize directive\nvar directiveMatcher=null;if(meta.directives.length>0){var matcher=new SelectorMatcher();try{for(var _c=Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(meta.directives),_d=_c.next();!_d.done;_d=_c.next()){var _e=_d.value,selector_1=_e.selector,expression_1=_e.expression;matcher.addSelectables(CssSelector.parse(selector_1),expression_1);}}catch(e_1_1){e_1={error:e_1_1};}finally{try{if(_d&&!_d.done&&(_a=_c[\"return\"]))_a.call(_c);}finally{if(e_1)throw e_1.error;}}directiveMatcher=matcher;}if(meta.viewQueries.length){definitionMap.set('viewQuery',createViewQueriesFunction(meta,constantPool));}// e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\nvar templateTypeName=meta.name;var templateName=templateTypeName?templateTypeName+\"_Template\":null;var directivesUsed=new Set();var pipesUsed=new Set();var changeDetection=meta.changeDetection;var template=meta.template;var templateBuilder=new TemplateDefinitionBuilder(constantPool,BindingScope.ROOT_SCOPE,0,templateTypeName,null,null,templateName,meta.viewQueries,directiveMatcher,directivesUsed,meta.pipes,pipesUsed,Identifiers$1.namespaceHTML,meta.relativeContextFilePath,meta.i18nUseExternalIds);var templateFunctionExpression=templateBuilder.buildTemplateFunction(template.nodes,[]);// e.g. `consts: 2`\ndefinitionMap.set('consts',literal(templateBuilder.getConstCount()));// e.g. `vars: 2`\ndefinitionMap.set('vars',literal(templateBuilder.getVarCount()));definitionMap.set('template',templateFunctionExpression);// e.g. `directives: [MyDirective]`\nif(directivesUsed.size){var directivesExpr=literalArr(Array.from(directivesUsed));if(meta.wrapDirectivesAndPipesInClosure){directivesExpr=fn([],[new ReturnStatement(directivesExpr)]);}definitionMap.set('directives',directivesExpr);}// e.g. `pipes: [MyPipe]`\nif(pipesUsed.size){var pipesExpr=literalArr(Array.from(pipesUsed));if(meta.wrapDirectivesAndPipesInClosure){pipesExpr=fn([],[new ReturnStatement(pipesExpr)]);}definitionMap.set('pipes',pipesExpr);}if(meta.encapsulation===null){meta.encapsulation=ViewEncapsulation.Emulated;}// e.g. `styles: [str1, str2]`\nif(meta.styles&&meta.styles.length){var styleValues=meta.encapsulation==ViewEncapsulation.Emulated?compileStyles(meta.styles,CONTENT_ATTR,HOST_ATTR):meta.styles;var strings=styleValues.map(function(str){return literal(str);});definitionMap.set('styles',literalArr(strings));}else if(meta.encapsulation===ViewEncapsulation.Emulated){// If there is no style, don't generate css selectors on elements\nmeta.encapsulation=ViewEncapsulation.None;}// Only set view encapsulation if it's not the default value\nif(meta.encapsulation!==ViewEncapsulation.Emulated){definitionMap.set('encapsulation',literal(meta.encapsulation));}// e.g. `animation: [trigger('123', [])]`\nif(meta.animations!==null){definitionMap.set('data',literalMap([{key:'animation',value:meta.animations,quoted:false}]));}// Only set the change detection flag if it's defined and it's not the default.\nif(changeDetection!=null&&changeDetection!==ChangeDetectionStrategy.Default){definitionMap.set('changeDetection',literal(changeDetection));}// On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n// string literal, which must be on one line.\nvar selectorForType=(meta.selector||'').replace(/\\n/g,'');var expression=importExpr(Identifiers$1.defineComponent).callFn([definitionMap.toLiteralMap()]);var type=createTypeForDef(meta,Identifiers$1.ComponentDefWithMeta);return{expression:expression,type:type,statements:statements};}", "title": "" }, { "docid": "a9fe61a5ab59f5eae8a5020ecdd6d4dd", "score": "0.45972183", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _GraphQLError.GraphQLError(\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "a9fe61a5ab59f5eae8a5020ecdd6d4dd", "score": "0.45972183", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _GraphQLError.GraphQLError(\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "f9c34a33f65454e585ddedd5e036bdcc", "score": "0.45762596", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "8c03b261d77c61ef98a0aeed1e8a6e80", "score": "0.4567234", "text": "enterDirective(ctx) {\n\t}", "title": "" }, { "docid": "1847172e00a81cc783daa3bd231947c2", "score": "0.45502287", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "1847172e00a81cc783daa3bd231947c2", "score": "0.45502287", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "1234d39d3fdbbc793b2da5f6c26eb0ad", "score": "0.45431882", "text": "function parseShaderDirective(str, shader, path, type) {\n let lines = str.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim().match(/#include.*?;$/)) {\n let found = lines[i];\n found = found.replace(/;\\s+/img, '');\n let shaderUrl = found.replace(/\";\\s/img, '').substring('#include'.length + 2, found.length - 1);\n shaderUrl = shaderUrl.replace(/\"/img, \"\");\n that.loadFile(path + shaderUrl, function (err, data) {\n if (err) return;\n if (data) {\n lines[i] = data;\n let str = lines.join('\\n');\n let parsed = str.replace(/\\s+\\n/img, '\\n');\n shader[type] = parsed;\n }\n });\n } else {\n let parsed = str.replace(/\\s+\\n/img, '\\n');\n shader[type] = parsed;\n }\n }\n }", "title": "" }, { "docid": "16f3583570ca7d32d584ff6778881b28", "score": "0.45397204", "text": "function getDirectives(element) {\n var context = loadLContext(element);\n\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n } // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n\n\n return context.directives === null ? [] : Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(context.directives);\n}", "title": "" }, { "docid": "3852321969085927733d08fcb5f79381", "score": "0.4535212", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "480a84747692a317ad74ae19b6c7e81d", "score": "0.4531395", "text": "buildElementStylingInstruction(sourceSpan, constantPool) {\n const reference = this._directiveExpr ? Identifiers$1.elementHostStyling : Identifiers$1.elementStyling;\n if (this.hasBindings) {\n return {\n sourceSpan,\n allocateBindingSlots: 0, reference,\n buildParams: () => {\n // a string array of every style-based binding\n const styleBindingProps = this._singleStyleInputs ? this._singleStyleInputs.map(i => literal(i.name)) : [];\n // a string array of every class-based binding\n const classBindingNames = this._singleClassInputs ? this._singleClassInputs.map(i => literal(i.name)) : [];\n // to salvage space in the AOT generated code, there is no point in passing\n // in `null` into a param if any follow-up params are not used. Therefore,\n // only when a trailing param is used then it will be filled with nulls in between\n // (otherwise a shorter amount of params will be filled). The code below helps\n // determine how many params are required in the expression code.\n //\n // HOST:\n // min params => elementHostStyling()\n // max params => elementHostStyling(classBindings, styleBindings, sanitizer)\n //\n // Template:\n // min params => elementStyling()\n // max params => elementStyling(classBindings, styleBindings, sanitizer)\n //\n const params = [];\n let expectedNumberOfArgs = 0;\n if (this._useDefaultSanitizer) {\n expectedNumberOfArgs = 3;\n }\n else if (styleBindingProps.length) {\n expectedNumberOfArgs = 2;\n }\n else if (classBindingNames.length) {\n expectedNumberOfArgs = 1;\n }\n addParam(params, classBindingNames.length > 0, getConstantLiteralFromArray(constantPool, classBindingNames), 1, expectedNumberOfArgs);\n addParam(params, styleBindingProps.length > 0, getConstantLiteralFromArray(constantPool, styleBindingProps), 2, expectedNumberOfArgs);\n addParam(params, this._useDefaultSanitizer, importExpr(Identifiers$1.defaultStyleSanitizer), 3, expectedNumberOfArgs);\n return params;\n }\n };\n }\n return null;\n }", "title": "" }, { "docid": "6ad186f0eba079e540af9fd420e04a93", "score": "0.452122", "text": "parseLexicalDeclaration() {\n const kind = this.currentToken === SyntaxKind.ConstKeyword ? 'const' : 'let'\n this.nextToken()\n const bindings = this.parseBindingList()\n this.parseOptionalSemicolon()\n return new types.VariableDeclaration(kind, bindings)\n }", "title": "" }, { "docid": "4bcb4773256a3365c23729794ab2e22b", "score": "0.45132452", "text": "function attrNoDirective(){return{controller:angular.noop};}", "title": "" }, { "docid": "bacc6b7124dbaa7aadb2131771c59a83", "score": "0.4504862", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n var name = identifierName(directive.type);\n name || error(\"Cannot resolver the name of \" + directive.type);\n var definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);\n var meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n var res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser);\n // Create the partial class to be merged with the actual class.\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n}", "title": "" }, { "docid": "bacc6b7124dbaa7aadb2131771c59a83", "score": "0.4504862", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n var name = identifierName(directive.type);\n name || error(\"Cannot resolver the name of \" + directive.type);\n var definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);\n var meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n var res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser);\n // Create the partial class to be merged with the actual class.\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n}", "title": "" }, { "docid": "bacc6b7124dbaa7aadb2131771c59a83", "score": "0.4504862", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n var name = identifierName(directive.type);\n name || error(\"Cannot resolver the name of \" + directive.type);\n var definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);\n var meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n var res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser);\n // Create the partial class to be merged with the actual class.\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n}", "title": "" }, { "docid": "e2b200abc368b0b168ee66277999e38c", "score": "0.45025444", "text": "function ConditionParser() {}", "title": "" }, { "docid": "4cc6e0e24996bdbacecbeabb5475eb33", "score": "0.44959152", "text": "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "title": "" }, { "docid": "4cc6e0e24996bdbacecbeabb5475eb33", "score": "0.44959152", "text": "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "title": "" }, { "docid": "e656cd0849975a26f0f1d00383bbd743", "score": "0.44851676", "text": "function translator_translateDirective(code, offset, part, type, openTag, closeTag, attributes, display, lockAttributes)\n{\n offset += this.offsetAdj;\n\n // begin for stored procedures\n if (part == \"script\") \n {\n if (type.length == 0 && openTag.length == 0 && \n closeTag.length == 0 && attributes.length==0 && display.length == 0)\n {\n if (this.translatorClass == \"MM_ASPSCRIPT\")\n {\n var translatedTag = this.isDefaultAndRuntimeParam(code);\n if (!translatedTag.length)\n {\n translatedTag = this.isRuntimeParam(code);\n if (!translatedTag.length)\n {\n translatedTag = this.isASPInitialization(code);\n }\n }\n if (translatedTag.length)\n {\n return this.parser.translateInitializationDirective(code, offset, translatedTag);\n }\n else\n {\n this.parser.translateUnrecognizedDirective(code, offset);\n return true;\n }\n }\n if (this.translatorClass == \"MM_JSPSCRIPT\")\n {\n var translatedTag = this.isPrepared(code, offset);\n if (translatedTag.length)\n {\n return this.parser.translatePreparedDirective(code, offset, translatedTag);\n }\n else\n {\n translatedTag = this.isCallable(code, offset);\n if (translatedTag.length)\n {\n return this.parser.translateCallableDirective(code, offset, translatedTag);\n }\n else\n {\n translatedTag = this.isObjectDeallocation(code, offset);\n if (translatedTag.length)\n {\n return this.parser.translateObjectDeallocationDirective(code, offset, translatedTag);\n }\n else\n {\n translatedTag = this.isAdvancedInitialization(code, offset);\n if (!translatedTag.length)\n {\n translatedTag = this.isInitialization(code);\n }\n if (translatedTag.length)\n {\n return this.parser.translateInitializationDirective(code, offset, translatedTag);\n }\n }\n }\n }\n }\n }\n }\n // end for stored procedures\n return this.parser.translateDirective(code, offset, part, type, openTag, closeTag, attributes, display, lockAttributes);\n}", "title": "" }, { "docid": "a296fc3b0125bdcea87143b4a971468d", "score": "0.4479856", "text": "function compileUsedDirectiveMetadata(meta) {\n const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?\n generateForwardRef :\n (expr) => expr;\n return toOptionalLiteralArray(meta.directives, directive => {\n const dirMeta = new DefinitionMap();\n dirMeta.set('type', wrapType(directive.type));\n dirMeta.set('selector', literal(directive.selector));\n dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));\n dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));\n dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));\n return dirMeta.toLiteralMap();\n });\n}", "title": "" }, { "docid": "a296fc3b0125bdcea87143b4a971468d", "score": "0.4479856", "text": "function compileUsedDirectiveMetadata(meta) {\n const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?\n generateForwardRef :\n (expr) => expr;\n return toOptionalLiteralArray(meta.directives, directive => {\n const dirMeta = new DefinitionMap();\n dirMeta.set('type', wrapType(directive.type));\n dirMeta.set('selector', literal(directive.selector));\n dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));\n dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));\n dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));\n return dirMeta.toLiteralMap();\n });\n}", "title": "" }, { "docid": "b7b7f6371942e47cacbc56e89adffd77", "score": "0.44671518", "text": "addDirective(directive) {\n const directives = _get(this.$output, 'Alexa.Directives', []);\n directives.push(directive);\n _set(this.$output, 'Alexa.Directives', directives);\n }", "title": "" }, { "docid": "5712d41967cb68d775f782ba7f08c01c", "score": "0.44614086", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n const name = identifierName(directive.type);\n name || error(`Cannot resolver the name of ${directive.type}`);\n const definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);\n const meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n const res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser);\n // Create the partial class to be merged with the actual class.\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n}", "title": "" }, { "docid": "5712d41967cb68d775f782ba7f08c01c", "score": "0.44614086", "text": "function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n const name = identifierName(directive.type);\n name || error(`Cannot resolver the name of ${directive.type}`);\n const definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);\n const meta = directiveMetadataFromGlobalMetadata(directive, outputCtx, reflector);\n const res = compileDirectiveFromMetadata(meta, outputCtx.constantPool, bindingParser);\n // Create the partial class to be merged with the actual class.\n outputCtx.statements.push(new ClassStmt(name, null, [new ClassField(definitionField, INFERRED_TYPE, [StmtModifier.Static], res.expression)], [], new ClassMethod(null, [], []), []));\n}", "title": "" } ]
42b7f9735715aea2264e6522a48b5298
=== enumeration test forin plain forin object forin plain myEnumerable forin object myEnumerable Object.keys plain Object.keys object Object.keys plain Object.keys object Object.getOwnPropertyNames plain 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 length byteLength byteOffset BYTES_PER_ELEMENT Object.getOwnPropertyNames object 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 length byteLength byteOffset BYTES_PER_ELEMENT ===
[ { "docid": "abdea70389e8a4ce7ce1e98b9e056752", "score": "0.77191347", "text": "function enumerationTest() {\n var pb = createPlain();\n var ab = createArrayBuffer();\n var k;\n\n // No enumerable properties by default.\n\n print('for-in plain');\n for (k in pb) {\n print(k);\n }\n print('for-in object');\n for (k in ab) {\n print(k);\n }\n\n // Add enumerable inherited property.\n\n ArrayBuffer.prototype.myEnumerable = 1;\n print('for-in plain');\n for (k in pb) {\n print(k);\n }\n print('for-in object');\n for (k in ab) {\n print(k);\n }\n delete ArrayBuffer.prototype.myEnumerable;\n\n // Object.keys() will include only own enumerable keys.\n\n print('Object.keys plain');\n Object.keys(pb).forEach(function (k) {\n print(k);\n });\n print('Object.keys object');\n Object.keys(ab).forEach(function (k) {\n print(k);\n });\n\n // Inherited properties not included.\n\n ArrayBuffer.prototype.myEnumerable = 1;\n print('Object.keys plain');\n Object.keys(pb).forEach(function (k) {\n print(k);\n });\n print('Object.keys object');\n Object.keys(ab).forEach(function (k) {\n print(k);\n });\n delete ArrayBuffer.prototype.myEnumerable;\n\n // Object.getOwnPropertyNames() will include all own properties,\n // including non-enumerable ones.\n\n print('Object.getOwnPropertyNames plain');\n Object.getOwnPropertyNames(pb).forEach(function (k) {\n print(k);\n });\n print('Object.getOwnPropertyNames object');\n Object.getOwnPropertyNames(ab).forEach(function (k) {\n print(k);\n });\n}", "title": "" } ]
[ { "docid": "8acec1e48c41c381dc9bda0b61c164be", "score": "0.66904056", "text": "function testIterator() {\n called++;\n assertEquals(obj, this);\n return arr[Symbol.iterator]();\n }", "title": "" }, { "docid": "ffda9a84eb5795f2ac145017a8236972", "score": "0.66797835", "text": "function src_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "7eeabb7ed328a96165ef439d413c8745", "score": "0.6560964", "text": "function vuex_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "8bde4393db64f22902c3ef651a63da65", "score": "0.649957", "text": "function Loginvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "7321545b0a01c1c9f8b01278b1fcfd2f", "score": "0.6467232", "text": "function Mainvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "435c5f090b01358feb784f29c85f76c7", "score": "0.6353064", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "51863f2f37ba013802f9a0e100652c13", "score": "0.6352959", "text": "function inputvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "a6e91647e22d944aa675597c2c4a5029", "score": "0.63448757", "text": "function testIterator() {\n assert(called !== \"@@iterator should be called only once\");\n called = true;\n assert(obj === this);\n return arr[Symbol.iterator]();\n }", "title": "" }, { "docid": "978b8ab3622a3472aaee3033f41c438f", "score": "0.63389635", "text": "function Enumerate(obj) {\n var e = [];\n if (Object(obj) !== obj) return e;\n var visited = new Set;\n while (obj !== null) {\n Object.getOwnPropertyNames(obj).forEach(function(name) {\n if (!visited.has(name)) {\n var desc = Object.getOwnPropertyDescriptor(obj, name);\n if (desc) {\n visited.add(name);\n if (desc.enumerable) e.push(name);\n }\n }\n });\n obj = Object.getPrototypeOf(obj);\n }\n return e[$$iterator]();\n }", "title": "" }, { "docid": "25f2b11348e451354451c2697337842b", "score": "0.63385004", "text": "function vmTextareavue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "c219b21cc0110b2c8ff9a926622ecd50", "score": "0.6335798", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "c219b21cc0110b2c8ff9a926622ecd50", "score": "0.6335798", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "c219b21cc0110b2c8ff9a926622ecd50", "score": "0.6335798", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "26b3827576fd6cfacc207cfcecfe719b", "score": "0.6308699", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "26b3827576fd6cfacc207cfcecfe719b", "score": "0.6308699", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "26b3827576fd6cfacc207cfcecfe719b", "score": "0.6308699", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "26b3827576fd6cfacc207cfcecfe719b", "score": "0.6308699", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "26b3827576fd6cfacc207cfcecfe719b", "score": "0.6308699", "text": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "3b94819b60ad8a2793a7cdf59e264031", "score": "0.6293849", "text": "function forIn(obj, fn, thisObj){\n var key, i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) checkDontEnum();\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n\n if (_hasDontEnumBug) {\n var ctor = obj.constructor,\n isProto = !!ctor && obj === ctor.prototype;\n\n while (key = _dontEnums[i++]) {\n // For constructor, if it is a prototype object the constructor\n // is always non-enumerable unless defined otherwise (and\n // enumerated above). For non-prototype objects, it will have\n // to be defined on this object, since it cannot be defined on\n // any prototype objects.\n //\n // For other [[DontEnum]] properties, check if the value is\n // different than Object prototype value.\n if (\n (key !== 'constructor' ||\n (!isProto && hasOwn(obj, key))) &&\n obj[key] !== Object.prototype[key]\n ) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "3b94819b60ad8a2793a7cdf59e264031", "score": "0.6293849", "text": "function forIn(obj, fn, thisObj){\n var key, i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) checkDontEnum();\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n\n if (_hasDontEnumBug) {\n var ctor = obj.constructor,\n isProto = !!ctor && obj === ctor.prototype;\n\n while (key = _dontEnums[i++]) {\n // For constructor, if it is a prototype object the constructor\n // is always non-enumerable unless defined otherwise (and\n // enumerated above). For non-prototype objects, it will have\n // to be defined on this object, since it cannot be defined on\n // any prototype objects.\n //\n // For other [[DontEnum]] properties, check if the value is\n // different than Object prototype value.\n if (\n (key !== 'constructor' ||\n (!isProto && hasOwn(obj, key))) &&\n obj[key] !== Object.prototype[key]\n ) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "39bffb035d7a43c8be745d6568012602", "score": "0.62740093", "text": "function notificationvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "5479494a8ae2f264d5f1b195a69f18d0", "score": "0.62636924", "text": "testForIn() {\n console.log('===Testing Objects and iterating over its props');\n console.log('=> Iterating over anotherStooge');\n for (let prop in this.anotherStooge) {\n // Avoiding prototype chain\n if (this.anotherStooge.hasOwnProperty(prop)) {\n const element = this.anotherStooge[prop];\n console.log(' Property ', prop, '=', element);\n }\n }\n\n console.log('=> Iterating over object and digging property chain');\n for (let prop in this.anotherStooge) {\n // Skips inherited funcs.\n if (typeof this.anotherStooge[prop] !== 'function') {\n const element = this.anotherStooge[prop];\n console.log(' Property ', prop, '=', element);\n }\n }\n\n console.log(\n '=> Iterating over object and digging property chain',\n 'controlling order'\n );\n\n const propNames = [\n 'propertyOne',\n 'propertyTwo',\n ]; // Use array to controll order over iteration\n\n for (let prop, i = 0; i < propNames.length; i++) {\n prop = propNames[i];\n const element = this.anotherStooge[prop];\n console.log(' Property ', prop, '=', element);\n }\n }", "title": "" }, { "docid": "898adbea3f0e79ed6ddf33079bb18929", "score": "0.6242955", "text": "function radiovue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "690a0d1d409aee62d15b77031956d350", "score": "0.6231918", "text": "function screens_Loginvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "f671720654aab5faed2a7ce4a19a8e50", "score": "0.6187291", "text": "function screens_vuex_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "e770430ecaff413a42740a5dfc786016", "score": "0.61864966", "text": "function Ql(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}", "title": "" }, { "docid": "91e149b520f42dd70d455ca3267707af", "score": "0.6183206", "text": "function GoogleLoginvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "a9519850ab0496726f310680dc4a1173", "score": "0.61816823", "text": "function modules_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "58ad01d4c43afa49fef8a3fa9ec780f4", "score": "0.6178831", "text": "function TestEnumerable(func, obj) {\n function props(x) {\n var array = [];\n for (var p in x) array.push(p);\n return array.sort();\n }\n assertArrayEquals([], props(func));\n assertArrayEquals([], props(func.prototype));\n if (obj)\n assertArrayEquals([], props(obj));\n}", "title": "" }, { "docid": "adfec1e0421285f153671b9570f89759", "score": "0.61512643", "text": "function test() {\n 'use strict';\n\n var obj = { prop1: 'foo', prop2: 'bar' };\n\n print(Reflect.ownKeys(obj));\n\n // Reflect.ownKeys() includes non-enumerable properties, unlike\n // Object.keys().\n Reflect.defineProperty(obj, 'prop1', { enumerable: false });\n print(Object.keys(obj));\n print(Reflect.ownKeys(obj));\n}", "title": "" }, { "docid": "ee93e46f552840b4616c41f97f4dea94", "score": "0.6139397", "text": "function CompulsoryPassword_Mainvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "c3736fb51f40076dd4fb25ece1840917", "score": "0.612591", "text": "function getPlainObjectKeys(object) {\n var enumerables = new Set();\n\n for (var key in object) enumerables.add(key); // *all* enumerables\n\n\n Object.getOwnPropertySymbols(object).forEach(function (k) {\n if (Object.getOwnPropertyDescriptor(object, k).enumerable) enumerables.add(k);\n }); // *own* symbols\n // Note: this implementation is missing enumerable, inherited, symbolic property names! That would however pretty expensive to add,\n // as there is no efficient iterator that returns *all* properties\n\n return Array.from(enumerables);\n}", "title": "" }, { "docid": "0cca520c863f50c552750b690302e94f", "score": "0.61080086", "text": "function switchvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "9ad353fa0b39308f4585b0dcd003d9a2", "score": "0.6088173", "text": "function Ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "73f4888c7e56acb90b2f353ec24d59b1", "score": "0.6086159", "text": "function getPlainObjectKeys(object) {\n var enumerables = new Set();\n for (var key in object)\n enumerables.add(key); // *all* enumerables\n Object.getOwnPropertySymbols(object).forEach(function (k) {\n if (Object.getOwnPropertyDescriptor(object, k).enumerable)\n enumerables.add(k);\n }); // *own* symbols\n // Note: this implementation is missing enumerable, inherited, symbolic property names! That would however pretty expensive to add,\n // as there is no efficient iterator that returns *all* properties\n return Array.from(enumerables);\n}", "title": "" }, { "docid": "73f4888c7e56acb90b2f353ec24d59b1", "score": "0.6086159", "text": "function getPlainObjectKeys(object) {\n var enumerables = new Set();\n for (var key in object)\n enumerables.add(key); // *all* enumerables\n Object.getOwnPropertySymbols(object).forEach(function (k) {\n if (Object.getOwnPropertyDescriptor(object, k).enumerable)\n enumerables.add(k);\n }); // *own* symbols\n // Note: this implementation is missing enumerable, inherited, symbolic property names! That would however pretty expensive to add,\n // as there is no efficient iterator that returns *all* properties\n return Array.from(enumerables);\n}", "title": "" }, { "docid": "8f7fe47555e9de7dbd1ea16101a6c24a", "score": "0.6084652", "text": "function __get_in_iter(obj) {\n if (obj == undefined) {\n console.trace();\n print_stack();\n throw new Error(\"Invalid iteration over undefined value\")\n }\n \n var keys = _my_object_keys(obj);\n return new arr_iter(keys);\n}", "title": "" }, { "docid": "7f0bfc7e8327ebbb09d247c570ea4de2", "score": "0.6074038", "text": "function forIn(obj, fn, thisObj){\n var key, i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) checkDontEnum();\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n if (_hasDontEnumBug) {\n while (key = _dontEnums[i++]) {\n // since we aren't using hasOwn check we need to make sure the\n // property was overwritten\n if (obj[key] !== Object.prototype[key]) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "3615ebbc8b0e25cce8cd029dfdf4464e", "score": "0.6065632", "text": "function vmRadiovue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "8c79392105669d5ca69ba80bb068af06", "score": "0.60645586", "text": "function forIn(obj, fn, thisObj){\n var key, i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) { checkDontEnum(); }\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n if (_hasDontEnumBug) {\n while (key = _dontEnums[i++]) {\n // since we aren't using hasOwn check we need to make sure the\n // property was overwritten\n if (obj[key] !== Object.prototype[key]) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "f05af123f456d96cb99bf9871eb70582", "score": "0.6059708", "text": "function forIn(obj, fn, thisObj) {\n var key,\n i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) {\n checkDontEnum();\n }\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n if (_hasDontEnumBug) {\n while (key = _dontEnums[i++]) {\n // since we aren't using hasOwn check we need to make sure the\n // property was overwritten\n if (obj[key] !== Object.prototype[key]) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "3868dea19ad9f93e41660954128de800", "score": "0.60516745", "text": "function tip_buttonvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "d6edc2dd3836964e0f08512ebee1470a", "score": "0.6050608", "text": "function search_tab_list_itemvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "0c876c6cd80e6463668cdf0e2b7b257f", "score": "0.6049521", "text": "function Qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}", "title": "" }, { "docid": "cf4e159f6440ba51bef083fea88187a7", "score": "0.6038893", "text": "function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}", "title": "" }, { "docid": "0f99bb3f486de73e84e8d4ca22b79cd3", "score": "0.6031799", "text": "function I(t) {\n var e = 0;\n for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\n return e;\n}", "title": "" }, { "docid": "41d109a9b719d62a8447422b646e5a61", "score": "0.60148084", "text": "function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "41d109a9b719d62a8447422b646e5a61", "score": "0.60148084", "text": "function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "f9aa579b7673f2b126c59097f96d9b01", "score": "0.6011378", "text": "function checkboxvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "932a9a866ae1763d57da577acac4b494", "score": "0.6002146", "text": "function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}", "title": "" }, { "docid": "72c0d144a4132a9de42ebd931f147747", "score": "0.59874153", "text": "function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "4e85eaf246bf0ea79f74941e2ef5d816", "score": "0.5985671", "text": "function Qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "771034c50f430cb87eb0fce11b030681", "score": "0.5984813", "text": "function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}", "title": "" }, { "docid": "045ffe721c1c3d431e93a3acf0b588b1", "score": "0.59802204", "text": "function Ai(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "045ffe721c1c3d431e93a3acf0b588b1", "score": "0.59802204", "text": "function Ai(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "65627d9b213ae7a586fabe80c1c0559f", "score": "0.5952178", "text": "function $rt_in(prop, obj)\n{\n if (!$rt_valIsObj(obj))\n throw TypeError('invalid object passed to \"in\" operator');\n\n // Until we went all the way through the prototype chain\n do\n {\n if ($rt_hasOwnProp(obj, prop))\n return true;\n\n obj = $ir_obj_get_proto(obj);\n\n } while ($ir_ne_refptr(obj, null));\n\n return false;\n}", "title": "" }, { "docid": "0581e0c7b7dfa52dbe9bd204d3408f0b", "score": "0.5943076", "text": "function vmCheckBoxvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "daccff28578a0c885e1834997afb03f5", "score": "0.59153533", "text": "function ObjectIterable(obj){\n this.obj = obj\n this.keys = keys(obj)\n}", "title": "" }, { "docid": "f7fce0aced42f86cc0cdbc61ad1a0cae", "score": "0.5913482", "text": "function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n }); // eslint-disable-next-line prefer-spread\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}", "title": "" }, { "docid": "7ace0431fc029b7ae333d853a44b791b", "score": "0.59108233", "text": "function vmTypeaheadvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "b24ad545b4138790bf9d71db4c07bede", "score": "0.5910256", "text": "function Ql(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "b24ad545b4138790bf9d71db4c07bede", "score": "0.5910256", "text": "function Ql(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "b24ad545b4138790bf9d71db4c07bede", "score": "0.5910256", "text": "function Ql(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "d1449edd7bbe806faae2f83ac5f2ef5f", "score": "0.5882429", "text": "function vmSwitchvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "4fb41d46dd9db6345e9657533544e046", "score": "0.5880373", "text": "function vmTypeaheadDatavue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "9f347c0c5c01b65d5fbd8605efba7496", "score": "0.58771074", "text": "function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o,\n };\n },\n };\n throw new TypeError(\n s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\"\n );\n }", "title": "" }, { "docid": "c05b90118cad3e2965a5f62dd2e25a7e", "score": "0.5869574", "text": "function FacebookLogin_oldvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "87e16602004db9be9cbfcd8e9e4016ec", "score": "0.58649135", "text": "function testcase() {\n var result = Object.getOwnPropertyNames(fnGlobalObject());\n var expResult = [\"NaN\", \"Infinity\", \"undefined\", \"eval\", \"parseInt\", \"parseFloat\", \"isNaN\", \"isFinite\", \"decodeURI\", \"decodeURIComponent\", \"encodeURI\", \"encodeURIComponent\", \"Object\", \"Function\", \"Array\", \"String\", \"Boolean\", \"Number\", \"Date\", \"Date\", \"RegExp\", \"Error\", \"EvalError\", \"RangeError\", \"ReferenceError\", \"SyntaxError\", \"TypeError\", \"URIError\", \"Math\", \"JSON\"];\n\n var result1 = {};\n for (var p in result) {\n result1[result[p]] = true;\n }\n\n for (var p1 in expResult) {\n if (!result1[expResult[p1]]) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "be37eb584a55713306a664d2c293a139", "score": "0.58526754", "text": "function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}", "title": "" }, { "docid": "3bb3d95ff9ed3689a2311a7a828f17c8", "score": "0.5851982", "text": "function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n }", "title": "" }, { "docid": "3ecb270c93067885965dec70e4283ea6", "score": "0.58434737", "text": "function vmTypeaheadItemvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "1dc348a769745736de8f2c6d9c7d2bc1", "score": "0.58410937", "text": "function isIterable(object) {\n return typeof object[Symbol.iterator] === \"function\"\n } // isIterable([1, 2, 3]) isIterable(\"Hello\") isIterable(new Map()) isIterable(new Set())", "title": "" }, { "docid": "687dce232d434aae5c23efd6332a9e92", "score": "0.58288974", "text": "function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "4b328f1e8e19f7355ce1a936e10bc76a", "score": "0.5823469", "text": "function keys(obj) {\n for (let x in obj) {\n if (obj.hasOwnProperty(x))\n yield x;\n }\n}", "title": "" }, { "docid": "019e500aa188c613f249b0a797cc0362", "score": "0.5816953", "text": "function vmSelectDatavue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "640a7e91d612104a95d5352452ad4afb", "score": "0.5813018", "text": "function vmInputNumbervue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "4866aceab919ddf00b5e3ef45127ca5a", "score": "0.580584", "text": "function __get_iter(obj) //, file, line, keyword)\n{\n if (obj == undefined) {\n console.trace();\n print_stack();\n throw new Error(\"Invalid iteration over undefined value\")\n }\n \n if (obj[Symbol.iterator] != undefined) {\n /*\n if (keyword == \"in\") {\n var hash = file + \":\"+line +\":\" + keyword\n \n if (!(hash in _forin_data)) {\n _forin_data[hash] = [file, line]\n }\n }\n //*/\n \n return obj[Symbol.iterator]();\n }\n}", "title": "" }, { "docid": "06613682e22aaded1dd0d0f42819d27f", "score": "0.5791347", "text": "function iterateOverNonEnumerable(obj, fn) {\n if (Object.getOwnPropertyNames) {\n var names = Object.getOwnPropertyNames(obj), name;\n while (name = names.pop()) {\n fn(name);\n }\n } else {\n testIterateOverObject(obj, fn);\n }\n }", "title": "" }, { "docid": "94a6a30499282fd9a64426a90ab9dbfa", "score": "0.577943", "text": "function GoogleLogin_oldvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "9750e4e12c76edcd011af35630f2541b", "score": "0.57753485", "text": "function ContextmenuItemvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "f408ff515f8b9c8eceed2501f2bcd93b", "score": "0.57730883", "text": "function i(e){var t=\"function\"===typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&\"number\"===typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}", "title": "" }, { "docid": "b053907d079d231aa09bdf41e2c0c9d6", "score": "0.5769867", "text": "function getOwnEnumPropSymbols(object) {\n return Object.getOwnPropertySymbols(object).filter(function (keySymbol) { return Object.prototype.propertyIsEnumerable.call(object, keySymbol); });\n}", "title": "" }, { "docid": "119174796800b945a77cf18402670353", "score": "0.5768181", "text": "function Buttonvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "4b5ff42ab92fbe6063ec41203964b571", "score": "0.5758624", "text": "function Yi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "bc67587e5bde8bcaaa09b5c4c38a895a", "score": "0.5757722", "text": "function test_container_operations()\n{\n function test_foreach()\n {\n if(Object.prototype.each === undefined) {\n test_note(\"Skipping Object.prototype.each test, feature not compiled.\");\n return;\n }\n const check_object = function(data) {\n const indexed = Array.isArray(data);\n const ref = [];\n if(!indexed) {\n // Enumerable properties only.\n Object.keys(data).filter(function(it){ ref.push([it, data[it]]); });\n } else {\n // Explicit old-school straight array indexing as reference.\n for(var i=0; i<data.length; ++i) { ref.push([i, data[i]]); }\n }\n test_note(\"data reference length = \" + ref.length);\n const res_each = [];\n data.each(function(val, key, me) {\n if(me !== data) test_fail(\"Unexpected this reference mismatch.\");\n res_each.push([key, val]);\n });\n test_note(\"Object.each length = \" + ref.length);\n const res_foreach = [];\n data.forEach(function(val, key, me) {\n if(me !== data) test_fail(\"Unexpected this reference mismatch.\");\n res_foreach.push([key, val]);\n });\n test_note(\"Checking for identical value contents ...\");\n test_note(\"Object.foreach length = \" + ref.length);\n test_note(\"ref = \" + JSON.stringify(ref));\n test_note(\"each = \" + JSON.stringify(res_each));\n test_note(\"foreach = \" + JSON.stringify(res_foreach));\n test_expect(ref.length == res_each.length);\n test_expect(ref.length == res_foreach.length);\n test_expect(JSON.stringify(ref) == JSON.stringify(res_each));\n test_expect(JSON.stringify(ref) == JSON.stringify(res_foreach));\n\n // Element check.\n for(var i=0; i<ref.length; ++i) {\n if(res_each[i][0] !== ref[i][0]) {\n test_fail(\"Unexpected key mismatch for res_each element \" + i);\n continue;\n } else if(res_foreach[i][0] !== ref[i][0]) {\n test_fail(\"Unexpected key mismatch for res_foreach element \" + i);\n continue;\n }\n const v1 = ref[i][1];\n const v2 = res_each[i][1];\n const v3 = res_foreach[i][1];\n if(v1 !== v2) {\n test_fail(\"Type mismatch of primitive for res_each element \" + i + \"(=\"+JSON.stringify(v1)+\"!==\"+JSON.stringify(v2)+\")\");\n } else if(v1 !== v3) {\n test_fail(\"Type mismatch of primitive for res_foreach element \" + i + \"(=\"+JSON.stringify(v1)+\"!==\"+JSON.stringify(v3)+\")\");\n } else{\n test_pass();\n }\n }\n }\n\n // Known value checks.\n check_object([]);\n check_object({});\n check_object([1,2,3,4,5]);\n check_object([1,\"-\",{a:1}]);\n check_object({a:1,b:2,c:3,d:4,e:5,f:[{a:\"-\",b:[1.0],}]});\n check_object([function(){return 0}, function(){return 1}]); // Note that JSON will convert functions to null, so the serialized string shall still match as well.\n // Null is an object, interpreter shall throw.\n try {\n null.each(function(){});\n test_fail(\"Expected en exception for null.each()\");\n } catch(ex) {\n test_pass(\"Ok, null.each() did throw\");\n }\n try {\n null.forEach(function(){});\n test_fail(\"Expected en exception for null.forEach()\");\n } catch(ex) {\n test_pass(\"Ok, null.forEach() did throw\");\n }\n\n // Protoype properties check, these shall not be included,\n // as with Object.keys().\n const derived = {a:1,b:2,c:3,d:4,e:5,f:[{a:\"-\",b:[1.0]}]};\n const base = {x:1, y:2, z:3};\n Object.setPrototypeOf(derived, base);\n test_expect((derived.x == 1) && (derived.y == 2) && (derived.z == 3));\n check_object(derived);\n }\n\n function test_any_none_all()\n {\n if((Object.prototype.any === undefined) || (Object.prototype.all === undefined) || (Object.prototype.none === undefined)) {\n test_note(\"Skipping Object.prototype.any/all/none test, feature not compiled.\");\n }\n\n // Array\n test_expect(!([].any(function(v){return !!v})) );\n test_expect( [1,2,3,4].any(function(v){return v==3}) );\n test_expect( [1,2,3,4].any(function(v){return v!=3}) );\n test_expect(![1,2,3,4].any(function(v){return v==0}) );\n\n test_expect(!([].some(function(v){return !!v})) );\n test_expect( [1,2,3,4].some(function(v){return v==3}) );\n test_expect( [1,2,3,4].some(function(v){return v!=3}) );\n test_expect(![1,2,3,4].some(function(v){return v==0}) );\n\n test_expect( ([].none(function(v){return !!v})) );\n test_expect( [1,2,3,4].none(function(v){return v==0}) );\n test_expect(![1,2,3,4].none(function(v){return v==1}) );\n test_expect(![1,2,3,4].none(function(v){return v!=1}) );\n\n test_expect( ([].all(function(v){return !!v})) );\n test_expect( [1,2,3,4].all(function(v){return v<5}) );\n test_expect(![1,2,3,4].all(function(v){return v<4}) );\n test_expect(![1,2,3,4].all(function(v){return v==1}) );\n\n test_expect( ([].every(function(v){return !!v})) );\n test_expect( [1,2,3,4].every(function(v){return v<5}) );\n test_expect(![1,2,3,4].every(function(v){return v<4}) );\n test_expect(![1,2,3,4].every(function(v){return v==1}) );\n\n // General plain object\n test_expect(!({}.any(function(v){return !!v})) );\n test_expect( {a:1,b:2,c:3,d:4}.any(function(v){return v==3}) );\n test_expect( {a:1,b:2,c:3,d:4}.any(function(v){return v!=3}) );\n test_expect(!{a:1,b:2,c:3,d:4}.any(function(v){return v==0}) );\n\n test_expect(!({}.some(function(v){return !!v})) );\n test_expect( {a:1,b:2,c:3,d:4}.some(function(v){return v==3}) );\n test_expect( {a:1,b:2,c:3,d:4}.some(function(v){return v!=3}) );\n test_expect(!{a:1,b:2,c:3,d:4}.some(function(v){return v==0}) );\n\n test_expect( ({}.none(function(v){return !!v})) );\n test_expect( {a:1,b:2,c:3,d:4}.none(function(v){return v==0}) );\n test_expect(!{a:1,b:2,c:3,d:4}.none(function(v){return v==1}) );\n test_expect(!{a:1,b:2,c:3,d:4}.none(function(v){return v!=1}) );\n\n test_expect( ({}.all(function(v){return !!v})) );\n test_expect( {a:1,b:2,c:3,d:4}.all(function(v){return v<5}) );\n test_expect(!{a:1,b:2,c:3,d:4}.all(function(v){return v<4}) );\n test_expect(!{a:1,b:2,c:3,d:4}.all(function(v){return v==1}) );\n\n test_expect( ({}.every(function(v){return !!v})) );\n test_expect( {a:1,b:2,c:3,d:4}.every(function(v){return v<5}) );\n test_expect(!{a:1,b:2,c:3,d:4}.every(function(v){return v<4}) );\n test_expect(!{a:1,b:2,c:3,d:4}.every(function(v){return v==1}) );\n\n // Key/this\n const obj = {a:1,b:2,c:3,d:4};\n test_expect( obj.every(function(v,k,o) {return (v>=1) && (v<=4) && (\"abcd\".indexOf(k)>=0) && (o===obj)}));\n test_expect( obj.all(function(v,k,o) {return (v>=1) && (v<=4) && (\"abcd\".indexOf(k)>=0) && (o===obj)}));\n test_expect( obj.any(function(v,k,o) {return (v>=1) && (v<=4) && (\"abcd\".indexOf(k)>=0) && (o===obj)}));\n test_expect( obj.some(function(v,k,o) {return (v>=1) && (v<=4) && (\"abcd\".indexOf(k)>=0) && (o===obj)}));\n test_expect( obj.none(function(v,k,o) {return (v<1) && (v>4) && (\"abcd\".indexOf(k)<0) && (o!==obj)}));\n }\n\n test_foreach();\n test_any_none_all();\n}", "title": "" }, { "docid": "634b740c0a32a22b1dd07a7262bcc974", "score": "0.5753001", "text": "function _t(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}", "title": "" }, { "docid": "3d8b3ef3c3db2ef0e211aaed6e93594d", "score": "0.5736245", "text": "function Button_oldvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "7d6ba7e8011a6334136d37233e0110dd", "score": "0.5735738", "text": "function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "6220f84ff93f9810c92929a9d33c7b7a", "score": "0.5723099", "text": "*[Symbol.iterator]() {\n for (let name of Object.keys(this._data)) {\n yield name;\n }\n }", "title": "" }, { "docid": "ea0161750e22be403db19cda42ebd492", "score": "0.5715736", "text": "function isIter(obj) {\n return ( (\"object\" == typeof obj)\n && (\"next\" in obj)\n && (\"function\" == typeof obj.next) );\n}", "title": "" }, { "docid": "e80a89b95bd626b84b0d851fe071554f", "score": "0.5714286", "text": "function vmDropDownvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "43711e882541dfd36c9a9decb150447e", "score": "0.57064724", "text": "function hierarchy_ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}", "title": "" }, { "docid": "77d41cf5a89588763145d00bd8cd6eed", "score": "0.5702917", "text": "function store_modules_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "b8c690b445c346d18c4c7b3cd36cb54d", "score": "0.5697888", "text": "function i(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}", "title": "" }, { "docid": "67635e682785328b168a44b960fa48cc", "score": "0.56953406", "text": "function xi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}", "title": "" }, { "docid": "fdd6d69d639bf8f3216d935e41b6de4f", "score": "0.56939936", "text": "function Ko(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "28afdeb5afada2d5ab19cd506135434a", "score": "0.56908685", "text": "function testBug462407() {\n for each (let i in [0, {}, 0, 1.5, {}, 0, 1.5, 0, 0]) { }\n return true;\n}", "title": "" }, { "docid": "1e30ddaa3d4782a3e1e708ce8d76f02a", "score": "0.56897295", "text": "function _keys (obj) {\n\t\tif (!_isObject(obj)) { return []; }\n\t\tif (nativeKeys) { return nativeKeys(obj); }\n\t\tvar keys = [];\n\t\tfor (var key in obj)\n\t\t\t{ if (_has(obj, key)) { keys.push(key); } }\n\t\t\t// Ahem, IE < 9.\n\t\tif (hasEnumBug) { collectNonEnumProps(obj, keys); }\n\t\treturn keys;\n\t}", "title": "" }, { "docid": "5d8fcd726b0b9d76226a4abfa79d831b", "score": "0.5686044", "text": "function allKeys(obj) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "9779b9840a7c16c254d92c4ff9d8df5b", "score": "0.56769073", "text": "function keys(obj) {\n\t if (!isObject(obj)) return [];\n\t if (nativeKeys) return nativeKeys(obj);\n\t var _keys = [];\n\t for (var key in obj) if (_has(obj, key)) _keys.push(key);\n\t // Ahem, IE < 9.\n\t if (hasEnumBug) collectNonEnumProps(obj, _keys);\n\t return _keys;\n\t }", "title": "" } ]
8636b0c67b03318858165b41fbb8b7f5
a function that takes in the unicode code point of a character, and returns the emoji at the corresponding emojiArr index if it's within bounds (az). If not within bounds, it returns 1.
[ { "docid": "9e6d68dc1382e585e1ea296bc8e749b5", "score": "0.62264556", "text": "function textToEmoji(currentCode) {\n //a-z\n if ((currentCode - 97) >= 0 && (currentCode - 97) <= 26) {\n return emojiArr[currentCode - 97];\n } else {\n return -1;\n }\n}", "title": "" } ]
[ { "docid": "b1f99242ba87cd470192aa73e67b3657", "score": "0.6214119", "text": "function indexOfSelectedEmoji(coords) {\n\n for (var i = 0; i < drawEvents.length; i++) {\n\n var evt = drawEvents[i];\n\n if (typeof evt.text === 'undefined') {\n continue;\n }\n\n // Presume it's centred around event x and y - handled by drawEmoji function\n var emojiLeft = evt.x - DEFAULT_EMOJI_SIZE * evt.scale / 2,\n emojiRight = evt.x + DEFAULT_EMOJI_SIZE * evt.scale / 2,\n emojiTop = evt.y - DEFAULT_EMOJI_SIZE * evt.scale / 2,\n emojiBottom = evt.y + DEFAULT_EMOJI_SIZE * evt.scale / 2;\n\n // DEBUGGING\n //ctx.strokeRect(emojiLeft, emojiTop, emojiRight-emojiLeft, emojiBottom-emojiTop);\n\n if (coords.x >= emojiLeft && coords.x <= emojiRight && coords.y >= emojiTop && coords.y <= emojiBottom) {\n return i;\n }\n }\n\n return -1;\n}", "title": "" }, { "docid": "566a66168339800074c1cfbee5bf6bae", "score": "0.6151609", "text": "function codePointAt(str, idx){\n\t\t\t\tif(idx === undefined){\n\t\t\t\t\tidx = 0;\n\t\t\t\t}\n\t\t\t\tvar code = str.charCodeAt(idx);\n\n\t\t\t\t// if a high surrogate\n\t\t\t\tif (0xD800 <= code && code <= 0xDBFF && \n\t\t\t\t\tidx < str.length - 1){\n\t\t\t\t\tvar hi = code;\n\t\t\t\t\tvar low = str.charCodeAt(idx + 1);\n\t\t\t\t\tif (0xDC00 <= low && low <= 0xDFFF){\n\t\t\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n\t\t\t\t\t}\n\t\t\t\t\treturn hi;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if a low surrogate\n\t\t\t\tif (0xDC00 <= code && code <= 0xDFFF &&\n\t\t\t\t\tidx >= 1){\n\t\t\t\t\tvar hi = str.charCodeAt(idx - 1);\n\t\t\t\t\tvar low = code;\n\t\t\t\t\tif (0xD800 <= hi && hi <= 0xDBFF){\n\t\t\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n\t\t\t\t\t}\n\t\t\t\t\treturn low;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//just return the char if an unmatched surrogate half or a \n\t\t\t\t//single-char codepoint\n\t\t\t\treturn code;\n\t\t\t}", "title": "" }, { "docid": "f4276eccec3b61ed1418d202c707b928", "score": "0.613499", "text": "function fromCodePoint(point) {\n if (typeof point != 'string')\n return undefined;\n else if (point in CHAR)\n return point;\n var probe = (typeof point == 'string') && point.match(/^U\\+(.*)$/);\n return probe ? String.fromCharCode(parseInt(probe[1], 16)) : undefined;\n }", "title": "" }, { "docid": "f8d3f292be782afb23d105be812db066", "score": "0.60232425", "text": "_characterToIndex(word) {\n if (word.length === 0) {\n throw new Error(\"passed empty string\");\n }\n\n const index = word.toLowerCase().charCodeAt(0);\n\n if (index < 0 || index >= ASCII_CODES) {\n throw new Error(\"Can't handle word: \" + word);\n }\n\n return index;\n }", "title": "" }, { "docid": "37d59b4a9487d3970c3d72c0fbd8cd25", "score": "0.5994998", "text": "function findChar(char) {\n for (var y = 0; y < map.height; y++) {\n for (var x = 0; x < map.width; x++) {\n if (map.map[y][x].toLowerCase() == char.toLowerCase()) {\n return {\n x: x,\n y: y\n };\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "323c43b2df35c482a8b350f84f6f8be5", "score": "0.5993769", "text": "function atChar(chars) { return at(char(chars)); }", "title": "" }, { "docid": "1f94c614ef2b06179e18dd106b53cbca", "score": "0.5954295", "text": "function getFirstCharIndex(font) {\n return Math.max(0, Math.min(0xffff, Math.abs(_.minBy(Object.keys(font.codePoints), function (point) {\n return parseInt(point, 10);\n }))));\n}", "title": "" }, { "docid": "c80809c3461249e601d5012e18aa7e3c", "score": "0.5947321", "text": "function stbtt_FindGlyphIndex(info, unicode_codepoint) {\n var data = info.data, index_map = info.index_map;\n\n var format = ttUSHORT(data, index_map + 0);\n if (format == 0) {\n var bytes = ttUSHORT(data, index_map + 2);\n if (unicode_codepoint < bytes - 6) {\n return data[index_map + 6 + unicode_codepoint];\n\t\t}\n return 0;\n } else if (format == 6) {\n var first = ttUSHORT(data, index_map + 6),\n count = ttUSHORT(data, index_map + 8);\n if (unicode_codepoint >= first && unicode_codepoint < first + count) {\n return ttUSHORT(data, index_map + 10 + (unicode_codepoint - first) * 2);\n\t\t}\n return 0;\n } else if (format == 2) {\n return 0;\n } else if (format == 4) {\n var segcount = ttUSHORT(data, index_map + 6) >> 1,\n searchRange = ttUSHORT(data, index_map + 8) >> 1,\n entrySelector = ttUSHORT(data, index_map + 10),\n rangeShift = ttUSHORT(data, index_map + 12) >> 1,\n\t\t\tendCount = index_map + 14,\n search = endCount;\n\n if (unicode_codepoint > 0xffff) {\n return 0;\n }\n\n if (unicode_codepoint >= ttUSHORT(data, search + rangeShift * 2)) {\n search += rangeShift * 2;\n }\n\n search -= 2;\n while (entrySelector) {\n searchRange >>= 1;\n var end = ttUSHORT(data, search + searchRange * 2);\n if (unicode_codepoint > end) {\n search += searchRange * 2;\n }\n --entrySelector;\n }\n search += 2;\n\n\t\tvar offset, start, item = (search - endCount) >>> 1;\n\n\t\tstart = ttUSHORT(data, index_map + 14 + segcount * 2 + 2 + 2 * item);\n\t\tif (unicode_codepoint < start) {\n\t\t\treturn 0;\n\t\t}\n\n\t\toffset = ttUSHORT(data, index_map + 14 + segcount * 6 + 2 + 2 * item);\n\t\tif (offset == 0) {\n\t\t\treturn unicode_codepoint + ttSHORT(data, index_map + 14 + segcount * 4 + 2 + 2 * item);\n\t\t}\n\t\treturn ttUSHORT(data, offset + (unicode_codepoint - start) * 2 +\n\t\t\t\t\t\t\t\tindex_map + 14 + segcount * 6 + 2 +\t2 * item);\n } else if (format == 12 || format == 13) {\n var ngroups = ttULONG(data, index_map + 12),\n\t\t\tlow = 0, high = ngroups;\n while (low < high) {\n var mid = low + ((high - low) >> 1);\n var start_char = ttULONG(data, index_map + 16 + mid * 12);\n var end_char = ttULONG(data, index_map + 16 + mid * 12 + 4);\n if (unicode_codepoint < start_char) {\n high = mid;\n } else if (unicode_codepoint > end_char) {\n low = mid + 1;\n } else {\n var start_glyph = ttULONG(data, index_map + 16 + mid * 12 + 8);\n if (format == 12) {\n return start_glyph + unicode_codepoint - start_char;\n\t\t\t\t} else {\n return start_glyph;\n }\n }\n }\n return 0;\n }\n return 0;\n}", "title": "" }, { "docid": "c612662614da45f6c5c7524c7c61a942", "score": "0.59308606", "text": "function characPosit(character){\n\t\t//your code is here\n\t\tvar newChar = character.toLowerCase();\n\t\tvar arr = [\"a\" , \"b\" , \"c\" , \"d\" , \"e\" , \"f\" ,\"g\" , \"h\" , \"i\" , \"j\" , \"k\" , \"l\" , \"m\" , \"n\" ,\"o\" ,\"p\" , \"q\" , \"r\" , \"s\" , \"t\" , \"v\" , \"w\" , \"x\" , \"y\" , \"z\"]\n\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif(arr[i] === newChar){\n\t\t\t\treturn i+1\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "52f6f4ab5e617e0fbda941cce9e42538", "score": "0.592149", "text": "function characPosit(character){\n<<<<<<< HEAD\n\tvar array=['a','b','c','d','e','f','g','h','i','j','k','l','m'\n\t,'n','o','p','q','r','s','t','u','v','w','x','y','z']\n\tfor(var i=0;i<array.length;i++)\n if(character===array[i]){\n \t f=i+1 \n }\n return \"Position of alphabet: \"+f\n=======\n\t\t//your code is here\n>>>>>>> 7db2f0e1948a6a9bcfd4a56b9a5e6f98d350c1ab\n\t}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "5edb8325a563f6c32ba573c0b540c6d3", "score": "0.5892194", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "title": "" }, { "docid": "2f9b5d46adea36c2f9782cca7a61acaa", "score": "0.58920395", "text": "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n }", "title": "" }, { "docid": "6775a6babfe29490c340a1e723646be2", "score": "0.58767277", "text": "function indexOfClosestCodePoint(codePoint) {\n for (var i=0; i<EXPANDED_VALID_CODEPOINTS.length; i++) {\n if (EXPANDED_VALID_CODEPOINTS[i] >= codePoint) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "f9663f6b85dcbfec1a6e702fb4024423", "score": "0.5873244", "text": "function codePointAt(str, idx) {\n idx = idx || 0;\n var code = str.charCodeAt(idx); // if a high surrogate\n\n if (0xD800 <= code && code <= 0xDBFF && idx < str.length - 1) {\n var hi = code;\n var low = str.charCodeAt(idx + 1);\n\n if (0xDC00 <= low && low <= 0xDFFF) {\n return (hi - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000;\n }\n\n return hi;\n } // if a low surrogate\n\n\n if (0xDC00 <= code && code <= 0xDFFF && idx >= 1) {\n var _hi = str.charCodeAt(idx - 1);\n\n var _low = code;\n\n if (0xD800 <= _hi && _hi <= 0xDBFF) {\n return (_hi - 0xD800) * 0x400 + (_low - 0xDC00) + 0x10000;\n }\n\n return _low;\n } //just return the char if an unmatched surrogate half or a\n //single-char codepoint\n\n\n return code;\n} // Private function, returns whether a break is allowed between the", "title": "" }, { "docid": "fc803eb0099187d8c0640f63de0c2a66", "score": "0.5863603", "text": "function positionInAlphabet(myChar){\n const alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n const lowCaseChar = myChar.toLowerCase()\n return alphabet.findIndex((index) => index === lowCaseChar) + 1\n}", "title": "" }, { "docid": "f8c76c5bc8f69f1b8a1c74e58826cb4e", "score": "0.58219373", "text": "function findChar(inChar)\n{\n /*\n Loop through the constant array for the number of holes.\n The constant array has 3 elements.\n */\n for (var index = 0; index < 4; index += 1)\n {\n /*\n If the index reaches 3, the submitted character is not found in the constant array\n and it is assumed the submitted character has 0 holes.\n */\n if (index === 3)\n {\n return 0;\n }\n\n /*\n If the submitted character matches one of the characters in the 0 element\n of the constant array, the submitted character has 0 holes. Return the 0 index.\n If the submitted character matches one of the characters in the 1 element\n of the constant array, the submitted character has 1 hole. Return the 1 index.\n If the submitted character matches one of the characters in the 2 element\n of the constant array, the submitted character has 2 holes. Return the 2 index.\n */\n if (strArrHOLES[index].includes(inChar))\n {\n return index;\n\n }\n\n }\n\n}", "title": "" }, { "docid": "4a01853eaa52f9546107d140facff8c3", "score": "0.5702457", "text": "function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n}", "title": "" }, { "docid": "a4406241ccebb67a6624ca6b31fd9a3d", "score": "0.5699604", "text": "function mapCharToCode(chr)\n{\n if(chr === ' ')\n return 0;\n else\n return chr.charCodeAt(0) - 'a'.charCodeAt(0) + 1;\n}", "title": "" }, { "docid": "61f303faf770a4698cf9e8887a937e27", "score": "0.56585234", "text": "function getIndexOf(char, str) {\n for (var i = 0; i < str.length; i++){\n var letter = str[i];\n if (letter === char){\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "9be84da94c7a9dc9367e9065d0eb1c77", "score": "0.56369025", "text": "function getEmoji(val) {\n if (val <= 25) {\n return \"😢\";\n } else if (val <= 40) {\n return \"☹\";\n } else if (val <= 45) {\n return \"😟\";\n } else if (val <= 55) {\n return \"😐\";\n } else if (val <= 60) {\n return \"🙂\";\n } else if (val <= 75) {\n return \"😊\";\n } else if (val <= 100) {\n return \"😀\";\n } else {\n return \"⛔\";\n }\n}", "title": "" }, { "docid": "9df6f76f350a6efa93cca8736fe6b1aa", "score": "0.5634991", "text": "function getLastCharIndex(font) {\n return Math.max(0, Math.min(0xffff, Math.abs(_.maxBy(Object.keys(font.codePoints), function (point) {\n return parseInt(point, 10);\n }))));\n}", "title": "" }, { "docid": "daddc31eed1cde2f80ba9934bb9690f2", "score": "0.5603188", "text": "function atobLookup(chr) {\n if (/[A-Z]/.test(chr)) {\n return chr.charCodeAt(0) - \"A\".charCodeAt(0);\n }\n if (/[a-z]/.test(chr)) {\n return chr.charCodeAt(0) - \"a\".charCodeAt(0) + 26;\n }\n if (/[0-9]/.test(chr)) {\n return chr.charCodeAt(0) - \"0\".charCodeAt(0) + 52;\n }\n if (chr === \"+\") {\n return 62;\n }\n if (chr === \"/\") {\n return 63;\n }\n // Throw exception; should not be hit in tests\n return undefined;\n}", "title": "" }, { "docid": "8bae0d79604c8e282041ec2ca126ff79", "score": "0.55914927", "text": "function findEmoji(json) {\n\tvar emoji = \"\";\n\tvar max = 0;\n\n\tfor (var key in json) {\n\t\tif (json[key] >= max) {\n\t\t\tmax = json[key];\n\t\t\temoji = key;\n\t\t}\n\t}\n\n\treturn emoji;\n}", "title": "" }, { "docid": "3403c3dd773587b3d8a38d1c3902e1cd", "score": "0.5580088", "text": "function atobLookup(chr) {\n if (/[A-Z]/.test(chr)) {\n return chr.charCodeAt(0) - \"A\".charCodeAt(0);\n }\n\n if (/[a-z]/.test(chr)) {\n return chr.charCodeAt(0) - \"a\".charCodeAt(0) + 26;\n }\n\n if (/[0-9]/.test(chr)) {\n return chr.charCodeAt(0) - \"0\".charCodeAt(0) + 52;\n }\n\n if (chr === \"+\") {\n return 62;\n }\n\n if (chr === \"/\") {\n return 63;\n } // Throw exception; should not be hit in tests\n\n\n return undefined;\n}", "title": "" }, { "docid": "2eca8986de6b265ecb79302edf8f2669", "score": "0.5568787", "text": "function getIndexOf(char, str) {\n for(var i = 0; i < str.length; i++) { // for loop to iterate through the length of the string \n var letter = str[i]; // create a letter variable to store the string at each index value\n if(char === letter) { // if statementto check if the char we pass in our argument is equal to a letter \n // stored in our string\n return i; // if the statement is true theindex value of where the letter was stored will be returned \n }\n }\n return -1; // if the string is empty -1 will bereturned \n}", "title": "" }, { "docid": "f156f81502a4177fa1e73ded2036c6f6", "score": "0.5554485", "text": "function full_char_code_at(str, i) {\n\t\t\t\tconst code = str.charCodeAt(i);\n\t\t\t\tif (code <= 0xd7ff || code >= 0xe000)\n\t\t\t\t\t\treturn code;\n\t\t\t\tconst next = str.charCodeAt(i + 1);\n\t\t\t\treturn (code << 10) + next - 0x35fdc00;\n\t\t}", "title": "" }, { "docid": "ca73de66c50f4608172ed6f2a97363b4", "score": "0.5532682", "text": "function positionOfChar(a, b) {\n var c;\n for (var i = 0; i < a.length; i++) {\n if (b === a[i]) {\n c = i;\n break;\n // i = a.length;\n } else {\n c = -1;\n }\n\n }\n return c;\n}", "title": "" }, { "docid": "03ecdb3b77c367c27dc505a07c312f03", "score": "0.55297685", "text": "function findChar(str, idx) {\n return str[idx];\n}", "title": "" }, { "docid": "47b3745cfa7c3fa6e3b64f1d59590cc5", "score": "0.5497002", "text": "function atobLookup(chr) {\n if (/[A-Z]/.test(chr)) {\n return chr.charCodeAt(0) - 'A'.charCodeAt(0);\n }\n if (/[a-z]/.test(chr)) {\n return chr.charCodeAt(0) - 'a'.charCodeAt(0) + 26;\n }\n if (/[0-9]/.test(chr)) {\n return chr.charCodeAt(0) - '0'.charCodeAt(0) + 52;\n }\n if (chr == '+') {\n return 62;\n }\n if (chr == '/') {\n return 63;\n }\n // Throw exception; should not be hit in tests\n}", "title": "" }, { "docid": "a728552dce26841cd6bb8006b3cbc600", "score": "0.54848355", "text": "function charCodeAt(str, index) {\n return index < str.length ? str.charCodeAt(index) : 0;\n}", "title": "" }, { "docid": "d730e8523085ceb307d256ea4a485a3c", "score": "0.54759777", "text": "function checkLetter(arr, l) {\n\n let x = arr.indexOf(l.toUpperCase());\n let y = arr.indexOf(l.toLowerCase());\n if (x == -1 && y == -1) {\n return -1;\n }\n else {\n return 1;\n }\n\n}", "title": "" }, { "docid": "72c61c6e11fd42f748577e5ef1d68cf6", "score": "0.5473401", "text": "function js_idx_to_char_idx (js_idx, text) {\n var char_idx = js_idx;\n for (var i = 0; i + 1 < text.length && i < js_idx; i++) {\n var char_code = text.charCodeAt(i);\n // check for surrogate pair\n if (char_code >= 0xD800 && char_code <= 0xDBFF) {\n var next_char_code = text.charCodeAt(i+1);\n if (next_char_code >= 0xDC00 && next_char_code <= 0xDFFF) {\n char_idx--;\n i++;\n }\n }\n }\n return char_idx;\n }", "title": "" }, { "docid": "bff07e3313c838e2ba0d51e8cf8f6fff", "score": "0.5472148", "text": "function get6thChar(str) {\r\n\treturn charAt(5)\r\n // TODO: your code here\r\n}", "title": "" }, { "docid": "b403bd91f2cc5c0c4c6188ae86adb502", "score": "0.5464365", "text": "function indexOf(piece) {\r\n \"use strict\";\r\n if (piece === \"P\") {\r\n return 0;\r\n }\r\n if (piece === \"N\") {\r\n return 1;\r\n }\r\n if (piece === \"B\") {\r\n return 2;\r\n }\r\n if (piece === \"R\") {\r\n return 3;\r\n }\r\n if (piece === \"Q\") {\r\n return 4;\r\n }\r\n if (piece === \"K\") {\r\n return 5;\r\n }\r\n if (piece === \"p\") {\r\n return 6;\r\n }\r\n if (piece === \"n\") {\r\n return 7;\r\n }\r\n if (piece === \"b\") {\r\n return 8;\r\n }\r\n if (piece === \"r\") {\r\n return 9;\r\n }\r\n if (piece === \"q\") {\r\n return 10;\r\n }\r\n if (piece === \"k\") {\r\n return 11;\r\n } else {\r\n return -1;\r\n }\r\n}", "title": "" }, { "docid": "eaa6f299b32d634b6e67c838fd5bea2f", "score": "0.546343", "text": "function emojiMsg(arg) {\r\n var a = null;\r\n switch(arg) {\r\n case `9`:\r\n a = \":red_circle:\";\r\n break;\r\n case `2`:\r\n a = \":green_circle:\";\r\n break;\r\n case `0`:\r\n a = \":hourglass:\";\r\n break;\r\n case `0`:\r\n a = \":pause_button:\";\r\n break;\r\n default:\r\n a = `:grey_question:`\r\n break;\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "62f49c67446de9fd86f59afb32b62870", "score": "0.54591864", "text": "function value(letter) {\n// alphabet\n var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n letter = letter.toLowerCase();\n console.log(letter);\n return alphabet.indexOf(letter);\n}", "title": "" }, { "docid": "49a5f0862726e600a259a66fe6963f7a", "score": "0.5448212", "text": "function emojiFunc(name) {\n const euEmote = client.emojis.get(emoji.eu);\n const naEmote = client.emojis.get(emoji.na);\n const ruEmote = client.emojis.get(emoji.ru);\n const asiaEmote = client.emojis.get(emoji.asia);\n const xboxEmote = client.emojis.get(emoji.xbox);\n const psEmote = client.emojis.get(emoji.ps);\n const blitzEmote = client.emojis.get(emoji.blitz);\n if (name == \"EU\") return euEmote;\n if (name == \"NA\") return naEmote;\n if (name == \"RU\") return ruEmote;\n if (name == \"ASIA\") return asiaEmote;\n if (name == \"Xbox\") return xboxEmote;\n if (name == \"Playstation\") return psEmote;\n if (name == \"Blitz\") return blitzEmote;\n}", "title": "" }, { "docid": "929d16fe4e5c1b19b0960ef1f83e9062", "score": "0.5440089", "text": "function emojinr(d){\n var nr = d3.scaleThreshold()\n .domain(COLOR_MAP.domain())\n .range(['1','2','3','4','5','6']); \n\n if(nr(d))\n return nr(d);\n else\n return \"X\"\n}", "title": "" }, { "docid": "716eeb200a084c3969d3e2fe9bdbecd1", "score": "0.54265004", "text": "function StringCodePointAt(pos) {\n CHECK_OBJECT_COERCIBLE(this, \"String.prototype.codePointAt\");\n\n var string = TO_STRING_INLINE(this);\n var size = string.length;\n pos = TO_INTEGER(pos);\n if (pos < 0 || pos >= size) {\n return UNDEFINED;\n }\n var first = %_StringCharCodeAt(string, pos);\n if (first < 0xD800 || first > 0xDBFF || pos + 1 == size) {\n return first;\n }\n var second = %_StringCharCodeAt(string, pos + 1);\n if (second < 0xDC00 || second > 0xDFFF) {\n return first;\n }\n return (first - 0xD800) * 0x400 + second + 0x2400;\n}", "title": "" }, { "docid": "384816ab7adae01a51474f68cc68ca4a", "score": "0.54192394", "text": "function getCharCode(string, char) {\n\tvar charCode = 0;\n\tfor (var i = string.length-1 ; i >= 0; i--)\n\t\tif (char == string.toLowerCase()[i]) charCode = i;\n\treturn charCode;\n}", "title": "" }, { "docid": "5d96415f3bcf54350d4edd8162dae65c", "score": "0.54130125", "text": "function charCodeAt(str, d) {\n if (d < str.length) {\n return str.charCodeAt(d)\n } else {\n return -1\n }\n }", "title": "" }, { "docid": "d086129ac39638103df2de593434e844", "score": "0.54102045", "text": "function validChar(positionOnBoard) {\r\n \"use strict\";\r\n //console.log(string);\r\n if (positionOnBoard === 'P' || positionOnBoard === 'R' || positionOnBoard === 'N' || positionOnBoard === 'B' || positionOnBoard === 'Q' || positionOnBoard === 'K' || positionOnBoard === 'p' || positionOnBoard === 'r' || positionOnBoard === 'n' || positionOnBoard === 'b' || positionOnBoard === 'q' || positionOnBoard === 'k' || positionOnBoard === '.') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3a885bc37b8ec462d86f33c85be4f622", "score": "0.5409519", "text": "function codePointAt(s, i) {\n return codepoint(s.charCodeAt(i));\n }", "title": "" }, { "docid": "25820be5baee25ebf3abef954d60e494", "score": "0.5408473", "text": "function mapChar(char, cipher) {\n return cipher.indexOf(char.toLowerCase());\n}", "title": "" }, { "docid": "35be97c8e83531c59679d1d79ffecf96", "score": "0.5404484", "text": "function charCode(str, index) {\n return index < str.length ? str.charCodeAt(index) : 0;\n}", "title": "" }, { "docid": "35be97c8e83531c59679d1d79ffecf96", "score": "0.5404484", "text": "function charCode(str, index) {\n return index < str.length ? str.charCodeAt(index) : 0;\n}", "title": "" }, { "docid": "f67dd0bbed89036658ac2d89e1ed4819", "score": "0.5362885", "text": "function funcIndexOf(value,char) {\n for(var x = 0; x < value.length; x++) {\n if(value[x] == char) {\n var index = x;\n document.write(index + \"<br>\" + \"<br>\" + \"<hr>\" );\n break\n }\n }\n}", "title": "" }, { "docid": "bcabdd582ee87aa09426087d0a2c0288", "score": "0.53527534", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n \n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "bcabdd582ee87aa09426087d0a2c0288", "score": "0.53527534", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n \n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "734ad6eca5b3babfcb8621c65f7ca030", "score": "0.5336875", "text": "function obf(char){\n if(char.toLowerCase() === \"a\") {\n return 4;\n }\n else if(char.toLowerCase() === \"e\") {\n return 3;\n }\n else if(char.toLowerCase() === \"o\") {\n return 0;\n }\n else if(char.toLowerCase() === \"l\") {\n return 1;\n }\n else{\n return char;\n }\n}", "title": "" }, { "docid": "f8630903c5efb47fda406295916129e4", "score": "0.5333549", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n \n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n \n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "91eb206ad44d52cf9ae2ac76bca146e7", "score": "0.532961", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n\n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "91eb206ad44d52cf9ae2ac76bca146e7", "score": "0.532961", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n\n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "91eb206ad44d52cf9ae2ac76bca146e7", "score": "0.532961", "text": "function readCodePoint() {\n var ch = input.charCodeAt(tokPos), code;\n\n if (ch === 123) {\n if (options.ecmaVersion < 6) unexpected();\n ++tokPos;\n code = readHexChar(input.indexOf('}', tokPos) - tokPos);\n ++tokPos;\n if (code > 0x10FFFF) unexpected();\n } else {\n code = readHexChar(4);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n var cu1 = ((code - 0x10000) >> 10) + 0xD800;\n var cu2 = ((code - 0x10000) & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n }", "title": "" }, { "docid": "1b598ada9a146c98fbb79c9b1fe41579", "score": "0.53260255", "text": "function cc(s) {\n if (s.length != 1)\n throw new RangeError(\"Invalid string length\");\n return s.codePointAt(0);\n }", "title": "" }, { "docid": "3c76b04d75fa113d1416d19c56dc59c4", "score": "0.5301956", "text": "function firstVowelSpot(str) {\n var VOWLES = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n var strToArr = str.split(\"\");\n\n for (var i in strToArr) {\n for (var v in VOWLES) {\n if (VOWLES[v] == strToArr[i]) {\n return i;\n }\n }\n }\n}", "title": "" }, { "docid": "2567b8ca4a3c30b7abc6ac3c4c929d67", "score": "0.5294805", "text": "function checkEmoji(s) {\n let hexCode = s.charCodeAt();\n let dec = parseInt(hexCode, 16);\n if (isNaN(hexCode)) {\n console.error('checkEmoji: input empty')\n return;\n }\n if (dec < 349015) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "9220cad648e2194eda358eba9c2c4991", "score": "0.52934057", "text": "function findChar( str, char ) {\n\n for ( var i = 0; i < str.length; i++ ) {\n if ( str[ i ] == char ) {\n console.log( i );\n return;\n }\n }\n\n console.log( 'Character was not found.' );\n\n}", "title": "" }, { "docid": "d20dce02afbc42ed68ba4d565462b7db", "score": "0.52902895", "text": "function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }", "title": "" }, { "docid": "d20dce02afbc42ed68ba4d565462b7db", "score": "0.52902895", "text": "function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }", "title": "" }, { "docid": "d20dce02afbc42ed68ba4d565462b7db", "score": "0.52902895", "text": "function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }", "title": "" }, { "docid": "9c160597ed30357cd19f40841c57f7ce", "score": "0.52864116", "text": "static progCharFromCell(cell) {\n if (cell.classList.contains(\"cell-black\")) {\n return \"_\";\n } else if (isDummy(cell)) {\n return \"*\"\n } else if (cell.classList.contains(\"cell-correct\")) {\n return getGuess(cell).innerText.toUpperCase();\n } else {\n if (getGuess(cell).innerText == \"\") return \"_\";\n return getGuess(cell).innerText.toLowerCase();\n }\n\n }", "title": "" }, { "docid": "1894fc196b6213ecc4dce1d6de4ef13c", "score": "0.5281132", "text": "function base64_charIndex(c) {\r\n if (c == \"+\") return 62\r\n if (c == \"/\") return 63\r\n return b64u.indexOf(c)\r\n}", "title": "" }, { "docid": "576c2200878a1aba00ae05313c0ba49f", "score": "0.527867", "text": "function charToNoteIndex(s, offset){\n // Get ASCII value of char\n var i = s.charCodeAt(0);\n\n // make musical letters uppercase\n if (i < 104 && i > 96){\n i -= 32;\n }\n // not a musical letter\n else if(i < 65 || i > 71){\n return null;\n }\n // refer to letter notes as in range 0-6 \n i -= 65;\n\n // space out to # of half steps from A\n switch(i){\n case 0: i = 0; break; // A\n // skip A#\n case 1: i = 2; break; // B\n case 2: i = 3; break; // C\n // skip C#\n case 3: i = 5; break; // D\n // skip D#\n case 4: i = 7; break; // E\n case 5: i = 8; break; // F\n // skip F#\n case 6: i = 10; break; // G\n // skip G#\n }\n\n // adjust for sharp or flat note\n i += offset;\n\n return i;\n }", "title": "" }, { "docid": "b6acc2bb1931ce08ac9bcea0c621a6f8", "score": "0.52745247", "text": "function offsetOf( buf, ch, base, bound ) {\n for (var i = base; i < bound; i++) if (buf[i] === ch) return i;\n return -1;\n}", "title": "" }, { "docid": "701cba4f569f650bb3af21d6ecba78ab", "score": "0.52698237", "text": "function charAt1(x) {\n return \"abc\".charAt(x);\n}", "title": "" }, { "docid": "0d7811d1546ddb00e61a1afed2925bae", "score": "0.5260565", "text": "function occPos(str, n) {\n var charPosition = 0;\n for (var i = 0; i < str.length; i++) {\n if (str[i] === n) {\n charPosition = i;\n break;\n } else {\n charPosition = -1;\n }\n }\n return charPosition;\n}", "title": "" }, { "docid": "bccdf9849bd46bfa9efa02d04606630b", "score": "0.5260456", "text": "function isUnicodeLetter(code) {\n for (var i = 0; i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[i++]) {\n return false;\n }\n if (code <= unicodeLetterTable[i++]) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "bccdf9849bd46bfa9efa02d04606630b", "score": "0.5260456", "text": "function isUnicodeLetter(code) {\n for (var i = 0; i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[i++]) {\n return false;\n }\n if (code <= unicodeLetterTable[i++]) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "e817a3a02f326616408b35791d6a12cd", "score": "0.5253482", "text": "function isUnicodeLetter(ch) {\n var cc = ch.charCodeAt(0);\n for (var i = 0; i < unicodeLetterTable.length; i++) {\n if (cc < unicodeLetterTable[i][0])\n return false;\n if (cc <= unicodeLetterTable[i][1])\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.52532524", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.52532524", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.52532524", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "5fc153642b547a1dba547d24bd3077c8", "score": "0.52506995", "text": "function stringIndexOf (word, char) {\n for (let i = 0; i < word.length; i++) {\n if(word[i] === char) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "e27ba6afb2ab599b5d114d069fbf2016", "score": "0.5249425", "text": "function alphabetPosition(text) {\r\n \r\nconst alphabet = {\r\n\ta : 1,\r\n\tb : 2,\r\n\tc : 3,\r\n\td : 4,\r\n\te : 5,\r\n\tf : 6,\r\n\tg : 7,\r\n\th : 8,\r\n\ti : 9,\r\n\tj : 10,\r\n\tk : 11,\r\n\tl : 12,\r\n\tm : 13,\r\n\tn : 14,\r\n\to : 15,\r\n\tp : 16,\r\n\tq : 17,\r\n\tr : 18,\r\n\ts : 19,\r\n\tt : 20,\r\n\tu : 21,\r\n\tv : 22,\r\n\tw : 23,\r\n\tx : 24,\r\n\ty : 25,\r\n\tz : 26\r\n}\r\n\r\n\r\n}", "title": "" }, { "docid": "d3030a9497c53836c389c6724c63c88d", "score": "0.52466863", "text": "function jsIndexToCharIndex(jsIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return jsIdx;\n }\n let charIdx = jsIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n let charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n let nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n charIdx--;\n i++;\n }\n }\n }\n return charIdx;\n }", "title": "" }, { "docid": "ee113f4e4331226dfead66e60c77ed79", "score": "0.52417046", "text": "function charA_M(char) {\n let code = char[0].toLowerCase().charCodeAt(0);\n return code >= 97 && code <= 109;\n}", "title": "" }, { "docid": "ba2c2dcefcb96796befed77f163edc01", "score": "0.52331173", "text": "getOffset (i, j, substr, string) {\n let m = 0\n let n = substr.length\n let offset = 0\n for(let k = 0; k <= string.length - substr.length; k++) {\n if(string.substr(m, n) === substr) offset++\n if(m === i) return offset\n m++\n }\n return 0\n }", "title": "" }, { "docid": "2137bd7bd6fe803cd888ff599f108e82", "score": "0.5230199", "text": "function alphabetPosition(text) {\n \nreturn text\n .toUpperCase()\n .match(/[a-z]/gi)\n .map( (c) => c.charCodeAt() - 64)\n .join(' ');\n}", "title": "" }, { "docid": "5239ff4fae539a55f5b35f228cbeeb46", "score": "0.52226657", "text": "function findPosition(word, letter)\n{\n var position=[];\n for (i=0; i<word.length; i++)\n {\n if(word[i]===letter)\n {\n position.push(i);\n }\n }\n return position;\n}", "title": "" }, { "docid": "032d0d6589e89ba0e3f6ff72f98e2495", "score": "0.52123976", "text": "function charIndexToJsIndex(charIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return charIdx;\n }\n let jsIdx = charIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n let charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n let nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n jsIdx++;\n i++;\n }\n }\n }\n return jsIdx;\n }", "title": "" }, { "docid": "cd882ee1cf5ec1444798fbf78b066069", "score": "0.52109474", "text": "function charFirstOccurance(word, char) {\n if (typeof word !== \"string\") {\n return false;\n }\n var place = \"\";\n for (var i = 0; i < word.length; i++){\n if (word[i] === char) {\n place = i;\n return place;\n break;\n }\n\n }\n retur -1;\n}", "title": "" }, { "docid": "4d31ccae0614641ecab7ff65a4a9f943", "score": "0.52072245", "text": "function firstPosition(string, letter) {\n for (var i = 0; i < string.length; i++) {\n if (letter === string[i]) {\n return i + 1;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "dcbaed2985702257e3936466108ac034", "score": "0.51933134", "text": "function utf8Len(codePoint) {\r\n if(codePoint >= 0xD800 && codePoint <= 0xDFFF) {\r\n throw new Error(\"Illegal argument: \"+codePoint);\r\n }\r\n if(codePoint < 0) { throw new Error(\"Illegal argument: \"+codePoint); }\r\n if(codePoint <= 0x7F) { return 1; }\r\n if(codePoint <= 0x7FF) { return 2; }\r\n if(codePoint <= 0xFFFF) { return 3; }\r\n if(codePoint <= 0x1FFFFF) { return 4; }\r\n if(codePoint <= 0x3FFFFFF) { return 5; }\r\n if(codePoint <= 0x7FFFFFFF) { return 6; }\r\n throw new Error(\"Illegal argument: \"+codePoint);\r\n}", "title": "" }, { "docid": "c27a87573c99411077f3b9147239922d", "score": "0.5190649", "text": "function getUnicodeCharacter(cp) {\n\n if (cp >= 0 && cp <= 0xD7FF || cp >= 0xE000 && cp <= 0xFFFF) {\n return String.fromCharCode(cp);\n } else if (cp >= 0x10000 && cp <= 0x10FFFF) {\n\n // we substract 0x10000 from cp to get a 20-bits number\n // in the range 0..0xFFFF\n cp -= 0x10000;\n\n // we add 0xD800 to the number formed by the first 10 bits\n // to give the first byte\n var first = ((0xffc00 & cp) >> 10) + 0xD800\n\n // we add 0xDC00 to the number formed by the low 10 bits\n // to give the second byte\n var second = (0x3ff & cp) + 0xDC00;\n\n return String.fromCharCode(first) + String.fromCharCode(second);\n }\n }", "title": "" }, { "docid": "972c147f22774471f68ebcd346165c32", "score": "0.5188143", "text": "function Segundo(str, singleCharacter) {\n for (var i = 0; i<str.length; i++) {\n if (str.includes(singleCharacter)) {\n return(`the character is at position ${str.indexOf(singleCharacter)}`);\n } else {\n return(\"character not found\");\n }\n }\n}", "title": "" }, { "docid": "9eb1198ce3823c0fb6bb0bdd2f1775ee", "score": "0.5185662", "text": "function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }", "title": "" }, { "docid": "9eb1198ce3823c0fb6bb0bdd2f1775ee", "score": "0.5185662", "text": "function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }", "title": "" }, { "docid": "9eb1198ce3823c0fb6bb0bdd2f1775ee", "score": "0.5185662", "text": "function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }", "title": "" }, { "docid": "e7916fd611de499edf8b794aa19007cb", "score": "0.5174542", "text": "function firstNotRepeatingCharacterUsingMap(s) {\n\n var map = new Array(26).fill(0);\n for(var i in s) {\n var val = s.charCodeAt(i);\n map[val] = map[val] ? Infinity : +i+1;\n }\n\n //Return the character at the minimum index.\n //If there is no such character, return '_'.\n return s[Math.min(...map.filter( val => val ))-1] || \"_\";\n\n}", "title": "" }, { "docid": "0e22faef9e8549bbe80634140a9d0b3c", "score": "0.5170904", "text": "function firstVowelIndex(string){\n if (string.charAt(0) === \"y\"){\n for (i=1;i<string.length;i++){\n let letter = string.charAt(i);\n if(isVowel(letter, vowels)){ \n return i;\n };\n };\n } else {\n for (i=0;i<string.length;i++){\n let letter = string.charAt(i);\n if(isVowel(letter, vowels)){ \n return i;\n };\n };\n };\n }", "title": "" }, { "docid": "4dcc7f7cf4c58c7969d4f4e7a2b0c363", "score": "0.5170507", "text": "function squareValue(index) {\n\t\tvar char = squares[index];\n\n\t\treturn char === '' ? 0 : char === playerSymbol ? 1 : 2;\n\t}", "title": "" }, { "docid": "4a42c72e77977ccdfbd0277a59f43539", "score": "0.51703936", "text": "function charCode(chr) {\n var esc = /^\\\\[xu](.+)/.exec(chr);\n return esc ?\n dec(esc[1]) :\n chr.charCodeAt(chr.charAt(0) === '\\\\' ? 1 : 0);\n }", "title": "" }, { "docid": "d82b2e97072304aa5870ecde9b99992e", "score": "0.5160296", "text": "function getSquareFromPos(pos) {\n return String.fromCharCode(65 + pos[1]) + (Math.min(9, pos[0] + 1));\n}", "title": "" }, { "docid": "dbcfe3efbde1a6adc40354752891966f", "score": "0.5156934", "text": "function firstNotRepeatingCharacterES6(s) {\n var arr = s.split(\"\");\n\n for(var i = 0; i < arr.length; i++){\n var chr = arr[i];\n if( arr.indexOf(arr[i]) == arr.lastIndexOf(arr[i])){\n return arr[i]\n }\n }\n\n return \"_\"; // value of none in program\n}", "title": "" } ]
bc0f29ddf66f799ce224017b3f73db57
Fonction mimant le fadeOut de jQuery
[ { "docid": "b855758441f35652d213fd91455ea7de", "score": "0.6804329", "text": "function fadeOut(el) {\n var opacity = 1,\n timer = setInterval(function() {\n opacity -= 50 / 400;\n\n if( opacity <= 0 ) {\n clearInterval(timer);\n opacity = 0;\n el.style.display = \"none\";\n }\n\n el.style.opacity = opacity;\n el.style.filter = \"alpha(opacity=\" + opacity * 100 + \")\";\n }, 50);\n}", "title": "" } ]
[ { "docid": "9459a90da50fdf7b0112d0b437a0d6ad", "score": "0.8046436", "text": "function fuera() {\r\n $('.caja').fadeOut(1500);\r\n}", "title": "" }, { "docid": "46eadb3e97ae02bac2c69ed3f2de688f", "score": "0.796147", "text": "function fadeOut() {\n $(\"#fade\").fadeOut(); \n\n}", "title": "" }, { "docid": "4f20125e91b012e30957f365d4360dee", "score": "0.77728194", "text": "fadeOut(duration = 0.1, callback = null) {\n this.style.opacity = '1';\n this.style.display = null;\n this.animate({ opacity: 0 }, duration, () => {\n this.visible = false;\n if (latte._isFunction(callback))\n callback();\n });\n //$(this.element).animate({ opacity: 0}, duration, 'swing', () => {\n //\n // this.visible = false;\n //\n // if('function' == typeof callback)\n // callback();\n //});\n }", "title": "" }, { "docid": "d1a04370b27c3ecfb212d9c6f36995c2", "score": "0.7580707", "text": "function fadeOut(){\n var item, viewPort, time, top, x, y, z;\n viewPort = $(this).height();\n y = $(this).scrollTop();\n \n $(\".fadeOut\").each(function(i){\n top = $(\".fadeOut\")[i].getAttribute(\"data-top\");\n time = $(\".fadeOut\")[i].getAttribute(\"data-duration\");\n x = $($(\".fadeOut\")[i]).offset().top - top;\n z = x - y;\n \n \n if(viewPort >= z){\n $($(\".fadeOut\")[i]).css({opacity: 1, transition: time});\n }\n }); \n }", "title": "" }, { "docid": "7442eb35ecb232147553d90d6b8d527e", "score": "0.74235415", "text": "function onFadeOut()\r\n\t{\r\n\t\tstate = 'fadeOut';\r\n\t\tevents.dispatch('fadeOutComplete');\r\n\t\t//console.log('AbstractContainersManager.onFadeOut',this.content.name);\r\n\t}", "title": "" }, { "docid": "1a82151d897a82aca9e045105be68a23", "score": "0.7418165", "text": "function hola()\n\n{\n\n\t$(\"#edit_cli\").fadeOut(\"medium\");\n\n}", "title": "" }, { "docid": "b3203021f1b7c3d7665d0a60478ec32a", "score": "0.7401652", "text": "function fadeOut() {\n anime({\n targets: [\".logo\", \".burger\", \".navbar-right\", \".home-text1\", \".home-text2\", \".home-text3\", \".arrow-button\", \".socials\"],\n keyframes: [\n {\n opacity: 0,\n translateY: 50,\n easing: \"easeInCubic\",\n duration: 300,\n },\n ],\n });\n}", "title": "" }, { "docid": "261e2ef7765164cd480f11c871945c7e", "score": "0.73897845", "text": "function retourApp2(){\r\n\t$(\"#slideAr\").fadeOut('slow');\r\n}", "title": "" }, { "docid": "811a34d96fad4160a1aed1997e8cae1c", "score": "0.73875415", "text": "function teardownFade() {\n fader.removeClass(\"show fadeOut\");\n }", "title": "" }, { "docid": "bf4bb20c43eb58314065429746e53014", "score": "0.73627776", "text": "function fadeOut(element,time, onEndCallback){\n fadeAnimation(element,time,0, undefined, onEndCallback);\n}", "title": "" }, { "docid": "5482a3401021ef2f5173c126b115c4b3", "score": "0.7318962", "text": "fadeOut(duration = 0.1, callback = null) {\n this.each((e) => {\n e.fadeOut(duration, callback);\n });\n }", "title": "" }, { "docid": "0bda25ff071fad74c46bd042d8bd3ac2", "score": "0.7304085", "text": "function message_fade_out() {\n $(\"#msg\").fadeOut(1600);\n}", "title": "" }, { "docid": "8e584a50a162f7de968f8a92bcf0dab4", "score": "0.72806394", "text": "function fadeOut() {\n div.style.transition = \"opacity 0.3s ease-out\";\n div.style.opacity = \"0\";\n active = false;\n\n // To allow the transition to happen, set the zIndex with a delay\n setTimeout(function() {div.style.zIndex = \"-1\";}, 200);\n }", "title": "" }, { "docid": "316c8dc2fa5c2d4f740c354d670a6e27", "score": "0.72791356", "text": "function bofffContactsFadeOut(e)\n{\n\tanimation.fadeAndRemove($.view_bofffContacts, 200,$.view_bofffContacts);\n}", "title": "" }, { "docid": "9bef56e0c2ac704ac2c2a7ff532bf0e0", "score": "0.7260748", "text": "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 6000 );\n }", "title": "" }, { "docid": "f30717d723bab2d005027f3f138a0a22", "score": "0.72421426", "text": "function callback() {\r\n setTimeout(function() {\r\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\r\n }, 1000 );\r\n }", "title": "" }, { "docid": "3fa5367971fc1057008ec305a7dacd4b", "score": "0.7236211", "text": "function fadeOut(target) {\n target.style.opacity = 0;\n}", "title": "" }, { "docid": "616004fde13371714f55bec5bfbf89e9", "score": "0.7229066", "text": "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect:visible\").removeAttr(\"style\").fadeOut();\r\n }, 1000);\r\n }", "title": "" }, { "docid": "8ac0a6acab5a0e7165c0ce062560f3a3", "score": "0.7222385", "text": "function hide($elem, fn) {\n options.fadeDuration ? $elem.fadeOut(options.fadeDuration, fn) : $elem.hide();\n }", "title": "" }, { "docid": "ba669d8aa2f58b0427e594ce669e1954", "score": "0.7192162", "text": "function fadeOut(s, speed) {\n\t (function fade(){\n\t \tif((s.opacity -= 0.1) < 0.1) {\n\t \t\ts.display = 'none';\n\t \t} else {\n\t \t\tsetTimeout(fade,speed);\n\t \t}\n\t })();\n\t}", "title": "" }, { "docid": "13d69b2914177bc24dca6808f649b8ba", "score": "0.7167213", "text": "function fadeOut()\n{\n\t_pricingChart.classList.remove(FADE_IN_CLASS);\n}", "title": "" }, { "docid": "792f68a34f4558bb6ec574833cabed4b", "score": "0.71476", "text": "function fadeOut(a){return a.style.opacity=1,function b(){(a.style.opacity-=.1)<0?a.style.display=\"none\":requestAnimationFrame(b)}(),!0}", "title": "" }, { "docid": "61e1e90328e10df669f524550e37180e", "score": "0.71419495", "text": "function fechaModal (){\n $('.filter, .modal').fadeOut(200);\n}", "title": "" }, { "docid": "56781fa7606adf4a8e041dc1fd8e4ba8", "score": "0.71229565", "text": "function fadeMyDiv() {\n $(\"#myDiv\").fadeOut('slow');\n}", "title": "" }, { "docid": "c2720b94f95eac532b2e2b47708b82fa", "score": "0.7094594", "text": "function ocultar(){\n\t\t$(\"#gatuna\").fadeOut(20);\n\t\t$(\"#clicame\").fadeOut(20);\n\t\t$(\"#planetarojo\").fadeOut(3000);\n\t\t$(\"#planetaverde\").fadeOut(3000);\n\t\t$(\"#tellamoasi\").fadeOut(2000);\n\t\t$('#capa').fadeOut(28500);\n\t\t$('#nave').fadeOut(18500);\n\t\t$('section').fadeOut(1000);\n\t\t$('aside').fadeOut(1800);\n\t\t$('velocimetro').fadeOut(500);\n\t\t$('#sateliterotando').fadeOut(500);\n\t\t$('sat').fadeOut(500);\n\t\t$(\"#astroajustes\").fadeIn(20000);\n\t\t$(\"#rotando\").fadeIn(20000);\n\t\n\t\t}", "title": "" }, { "docid": "69d81ee09b0d339ec15dda16b41ceb5a", "score": "0.7079288", "text": "function fadeOut(el, duration) {\n var s = el.style, step = 25/(duration || 300);\n s.opacity = s.opacity || 1;\n (function fade() { (s.opacity -= step) < 0 ? s.display = \"none\" : setTimeout(fade, 25); })();\n}", "title": "" }, { "docid": "81609ffc329a052ea9d3ca3997f93183", "score": "0.70756614", "text": "function fadeOut(){\n\t\topacity = opacity - 0.02;\n\t\tloader.style.opacity = opacity;\n\t\tif (opacity > 0){\n\t\t\twindow.requestAnimationFrame(fadeOut);\n\t\t}\n\t\telse{\n\t\t\tloader.style.display = \"none\";\n\t\t\tloader.style.opacity = 0;\n\t\t\tclearInterval(fade_out_func);\n\t\t}\n\t}", "title": "" }, { "docid": "5abe67f247c0871886c14262eeaadd8a", "score": "0.7074476", "text": "function elimninartoast(toastAutogen_consecutivoE) {\n $('#' + toastAutogen_consecutivoE + '_toastall').fadeOut(\"slow\");\n}", "title": "" }, { "docid": "3312c461d79b4eaefeaf0cf3c91d991d", "score": "0.7068486", "text": "function fadeMessage() {\n $('.flash_message').fadeOut(500);\n}", "title": "" }, { "docid": "6a457f636f85d5478c3aad6f20ba0fcf", "score": "0.7060384", "text": "function teardownFade() {\n\n divFader.removeClass(\"show fadeOut\");\n //primary.addClass(\"fadeIn\");\n\n }", "title": "" }, { "docid": "c492e20c1bbdec467a274d036cf7263f", "score": "0.70497566", "text": "function callback() {\n\tsetTimeout(function() {\n\t$( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n\t}, 1000 );\n}", "title": "" }, { "docid": "d7f12a25c4387f2a799f17786766d02f", "score": "0.7004605", "text": "function fadeOut(element) {\n addClass(element, classes.fade);\n addClass(element, classes.fadeOut);\n }", "title": "" }, { "docid": "e3655cc524a0f40cd8b258c1e3d5d342", "score": "0.6987233", "text": "function closeAlert(div) {\n $(div).fadeOut();\n}", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "e2f4c4dac726023887d699b8c42c1d6a", "score": "0.6966579", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "56df77e6419c7b8663b76f34275f862c", "score": "0.68832535", "text": "function animationFadeOutElement(selector, callback) {\n\t$(selector).animate({'opacity': '0'}, 1000, 'linear', () => {\n\t\tif (callback) callback();\n\t});\n}", "title": "" }, { "docid": "c3fa78c7370112d378a741e29f717000", "score": "0.6881039", "text": "function fadeOut(el) {\n\tvar duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;\n\tvar callback = arguments[2];\n\n\tif (!el.style.opacity) {\n\t\tel.style.opacity = 1;\n\t}\n\n\tvar start = null;\n\t_window2.default.requestAnimationFrame(function animate(timestamp) {\n\t\tstart = start || timestamp;\n\t\tvar progress = timestamp - start;\n\t\tvar opacity = parseFloat(1 - progress / duration, 2);\n\t\tel.style.opacity = opacity < 0 ? 0 : opacity;\n\t\tif (progress > duration) {\n\t\t\tif (callback && typeof callback === 'function') {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} else {\n\t\t\t_window2.default.requestAnimationFrame(animate);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "422608dd0bd2e3863fddae799b48918c", "score": "0.6876565", "text": "function sfsihidemepopup()\r\n{\r\n\tSFSI(\".sfsi_FrntInner_chg\").fadeOut();\r\n}", "title": "" }, { "docid": "bc27f2b64d5a420786c5bc1af876d155", "score": "0.68729573", "text": "function fadeOut(element) {\n var op = 1; // initial opacity\n var timer = setInterval(function() {\n if (op <= 0.1) {\n clearInterval(timer);\n element.style.display = 'none';\n }\n\n element.style.opacity = op;\n element.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op -= op * 0.1;\n }, 50);\n}", "title": "" }, { "docid": "ff91469242c91d895892902c43bb9d14", "score": "0.68675125", "text": "function loading_hide() { \n$('#loading').fadeOut(); \n}", "title": "" }, { "docid": "c7edef2911a93088d8c72b259c5191b1", "score": "0.68644947", "text": "function fadeOut(element, speed){\n element.style.opacity = 1;\n (function fade() {\n if ((element.style.opacity -= speed) < 0) {\n element.style.display = \"none\";\n return \"done\"\n } else {\n requestAnimationFrame(fade);\n }\n })();\n}", "title": "" }, { "docid": "aebe0b1e4a2fefdc743ffa860fa8b121", "score": "0.6858354", "text": "function fadeOutAndRemove(element) {\n element.fadeOut(function() {\n $(this).remove();\n });\n }", "title": "" }, { "docid": "3c2a91c0b3a09f17fd693548fb1a0cf5", "score": "0.6842094", "text": "function fadeOut(el){\r\n el.style.opacity = 1; //element opacity\r\n let decrementOpacity = setInterval(function(){ //function for decrement element opacity from 1 to 0 and display \"none\"\r\n el.style.opacity = el.style.opacity - 0.05;\r\n if (el.style.opacity <=0.05){\r\n clearInterval(decrementOpacity);\r\n getPreLoader.style.display = \"none\"; //if opacity <=0.05 we stop decrement and hide element\r\n }\r\n }, 20); //every 20 milliseconds decrement opacity\r\n}", "title": "" }, { "docid": "72ac7b463b54e286ee64cbd71b373479", "score": "0.6840564", "text": "function doFadeOut(){\n\t\tif (opacity > 0){\n\t\t\topacity -= speed;\n\t\t\telement.style.opacity = (opacity/100);\n\t\t\telement.style.filter = \"alpha(opacity='\"+opacity+\"')\";//IE SUCKS\n\t\t} else {\n\t\t\ttry{\n\t\t\t\telement.parentNode.removeChild(element);\n\t\t\t\tendFade();\n\t\t\t} catch (e){\n\t\t\t\t//\n\t\t\t};\n\t\t};\n\t\t\n\t}", "title": "" }, { "docid": "63418b947460a94ce37635ff2c4f3449", "score": "0.6827631", "text": "function fadeOut(el){\n el.style.opacity = 1;\n\n (function fade() {\n if ((el.style.opacity -= .01) < 0) {\n el.style.display = \"none\";\n } else {\n requestAnimationFrame(fade);\n }\n })();\n}", "title": "" }, { "docid": "6d9b0fe930c9edfc93a3a6a2f0b8c12f", "score": "0.6823984", "text": "function fadeQuestion () {\n\t\t$('#question').fadeOut(fadespeed);\n\t}", "title": "" }, { "docid": "1849fb89612b35c670408f0dacb6c5c0", "score": "0.680465", "text": "function fadeOut (element, cb) {\n if (element.style.opacity && element.style.opacity > 0.05) {\n element.style.opacity = element.style.opacity - 0.05\n } else if (element.style.opacity && element.style.opacity <= 0.1) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n if (cb) cb()\n }\n } else {\n element.style.opacity = 0.9\n }\n setTimeout(() => fadeOut.apply(this, [element, cb]), 1000 / 30\n )\n}", "title": "" }, { "docid": "1849fb89612b35c670408f0dacb6c5c0", "score": "0.680465", "text": "function fadeOut (element, cb) {\n if (element.style.opacity && element.style.opacity > 0.05) {\n element.style.opacity = element.style.opacity - 0.05\n } else if (element.style.opacity && element.style.opacity <= 0.1) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n if (cb) cb()\n }\n } else {\n element.style.opacity = 0.9\n }\n setTimeout(() => fadeOut.apply(this, [element, cb]), 1000 / 30\n )\n}", "title": "" }, { "docid": "3368dfdc538171b2f0e3e4bbc2f6a74f", "score": "0.6799744", "text": "function alienDisappear() {\n $('.aliens').addClass('animated fadeOutUp'); \n $('.aliens').delay(1000).hide('fast', takeOff); \n }", "title": "" }, { "docid": "6283b9b4aa236a4968f23b8a8150b582", "score": "0.67906225", "text": "function fadeOut(el) {\n el.style.opacity = 1;\n\n (function fade() {\n if ((el.style.opacity -= .1) < 0) {\n el.style.display = \"none\";\n } else {\n requestAnimationFrame(fade);\n }\n })();\n}", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.67859745", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.67859745", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "9764aba794a7b6814c96ac6c706e86ba", "score": "0.67852634", "text": "function fadeOut(fadeTarget) {\n var fadeEffect = setInterval(function () {\n if (!fadeTarget.style.opacity) {\n fadeTarget.style.opacity = 1\n }\n \n if (fadeTarget.style.opacity < 0.1) {\n clearInterval(fadeEffect)\n } else {\n fadeTarget.style.opacity -= 0.1\n }\n }, FADE_TIME)\n}", "title": "" }, { "docid": "ac7db91795097c8d631bc1bd841f0e85", "score": "0.67724705", "text": "function remove_overlay(duration) {\r\n $('#overlay').fadeOut(duration);\r\n}", "title": "" }, { "docid": "c186718ea21a9f3c2ad4f9866996a7d7", "score": "0.67643005", "text": "hide () {\n if (this.options.playSound) {\n window.Utilities.woosh()\n }\n window.$(this.tag).fadeOut(this.options.animationSpeed)\n $.when(window.$('#' + this.backgroundID).fadeOut(this.options.animationSpeed)).done(function () {\n window.$('#' + this.backgroundID).remove()\n })\n }", "title": "" }, { "docid": "db92efd7ba3cea05f482660f22dad478", "score": "0.67618966", "text": "function fadeOutLoadingScreen() {\n // Loading screen fadeout\n $('.loading-screen').fadeOut();\n}", "title": "" }, { "docid": "04d05b30613ab26c5a653d8f2a8dbb98", "score": "0.67526597", "text": "function my_callback_tu_motchieu(value) {\n $(\".l-tu\").fadeOut(700, function() {\n $(\".l-tu\").html(value); \n });\n $(\".l-tu\").fadeIn(600);\n}", "title": "" }, { "docid": "be8114d554dac9f8d15b29b787cc905f", "score": "0.6744208", "text": "function closeModal() {\n fadeOut(modal);\n}", "title": "" }, { "docid": "60a19c044b92acb65ede8626c4a89271", "score": "0.67296374", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "60a19c044b92acb65ede8626c4a89271", "score": "0.67296374", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "60a19c044b92acb65ede8626c4a89271", "score": "0.67296374", "text": "get fadeOut() {\n return this._fadeOut;\n }", "title": "" }, { "docid": "54e7cb822ce9dde846d84c1b81627ecf", "score": "0.6719812", "text": "fadeOutDisplay() {\n if (this.active === false) {\n animateCSS(overlay, 'fadeOut', () => {\n overlay.style.display = \"none\";\n this.active = true;\n });\n }\n }", "title": "" }, { "docid": "c87c215c216d4315c8c9c8d35be1915c", "score": "0.6716895", "text": "function divClicked() {\n $(this).fadeOut(); // Tell the div cliked to fade out\n}", "title": "" }, { "docid": "7fa647afe7db5d90de25f4070c3b1e6a", "score": "0.67130566", "text": "function hideHelpers(){\n $(\".helper\").fadeOut(\"slow\");\n }", "title": "" }, { "docid": "7ea682ad68e28ef8ed5b7a8624e076be", "score": "0.6711289", "text": "function disappearError(){\r\n\tvar opacitaFinale = 0;\r\n\tvar fadingInterval = 50;\r\n\tsetTimeout(function(){fadeOut(document.getElementById('divLoginError'), opacitaFinale, fadingInterval);}, 2000);\r\n}", "title": "" }, { "docid": "df1b25f1670b7172f9a441a5eed47f1c", "score": "0.6679516", "text": "function animation_fadeOutOpacity($selector) {\n var tm = new TimelineMax({paused: true});\n tm.to($selector, 0.5, {opacity: '0', ease: Quad.easeOut },'0');\n tm.play();\n}", "title": "" }, { "docid": "210ce1c4ce7e56e6f2bb220338386650", "score": "0.66735446", "text": "function fadeOut() {\n fadeIn.style.opacity = '0';\n \n}", "title": "" }, { "docid": "c7f69619f8f30bdd13a572a4f6bfeb20", "score": "0.6672661", "text": "fadeOut(duration) {\r\n var $element,\r\n _self = this;\r\n\r\n // cache element\r\n if ( this.getState('full') ) {\r\n\r\n // get element\r\n $element = this.$el;\r\n } else {\r\n\r\n // get partial element\r\n $element = this.$( '#page-content' );\r\n }\r\n\r\n return new Promise(function(resolve, reject){\r\n\r\n // hide element\r\n $element\r\n .hide( duration || _self.getState('fadeOutMs') || 10 )\r\n .promise()\r\n .done(function(){\r\n\r\n // unsubscribe all events\r\n _self.unsubscribe();\r\n\r\n // resolve promise\r\n resolve();\r\n })\r\n .fail(function( err ){\r\n\r\n // log\r\n console.log( err );\r\n\r\n // reject error\r\n reject( err );\r\n });\r\n });\r\n }", "title": "" }, { "docid": "3cf66d7b3518379905381e7384a009a7", "score": "0.6662202", "text": "function showPopup() {\n //On fait d'abord disparaitre notre boutton choisir\n $(\".choisirCompte\").fadeOut('fast', function() {\n $(this).hide();\n });\n\n //On fait en sorte qu'aucun compte de s'affiche quand on click sur choisir un compte\n $(\".comptes\").hide();\n\n popup();\n\n}", "title": "" }, { "docid": "9a6de78520619fde076e0f8a27b21703", "score": "0.66463083", "text": "function hideOverlays(){\n $(\"#overlay\").fadeOut(\"fast\");\n }", "title": "" }, { "docid": "09e16144336d5d771467a797536ca0fa", "score": "0.6643793", "text": "function hideMessage () {\n\t$(\"#message-container\").fadeOut('slow');\n}", "title": "" }, { "docid": "29e4d7aadfa313c84ad0669d654a8f4e", "score": "0.664064", "text": "function callback() {\r\n //$( \"#effect1:none\" ).removeAttr( \"style\" ).fadeOut();\r\n $( \"#effect1\" ).toggle( selectedEffect, options, 500 );\r\n}", "title": "" }, { "docid": "8637f1caeda49c3f6be2f895b3c994cf", "score": "0.6609794", "text": "fadeOut(time, toggle = false) {\n if (toggle && this.selector.classList.contains(\"fadeOut-active\")) {\n this.selector.style.opacity = 1;\n this.selector.classList.remove(\"fadeOut-active\");\n\n } else {\n this.selector.style.transition = `${time}s ease`;\n this.selector.style.opacity = 0;\n this.selector.classList.add(\"fadeOut-active\");\n }\n }", "title": "" }, { "docid": "9481bebe057a98ee4406fe4cbe693f38", "score": "0.65960205", "text": "function fadeOut(elementName){\n\t\t\te = getElement(elementName);\n\t\t\n\t\t\topacity = e.style.MozOpacity;\n\t\t\topacity-=0.10;\n\t\t\t\n\t\t\te.style.MozOpacity=opacity;\n\t\t\te.style.Opacity=opacity;\n\t\t\t\n\t\t\tif(opacity > 0) {\n\t\t\t\tsetInterval(\"fadeOut('\" + elementName + \"')\", 200);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6a412e79b3accf5f73f5bbfcb826faa4", "score": "0.6570162", "text": "function msgFadeOut() {\n if (startTime == 0)\n startTime = Date.now();\n\n /* Has animDuration passed? */\n if (Date.now() - startTime <= animDuration) {\n /* No -- continue animation */\n setTimeout(msgFadeOut, 50);\n msgDiv.style.opacity = (animDuration - Date.now() + startTime)\n / animDuration;\n }\n else {\n /*\n * Yes - reset animation start time, hide the div, and remove the\n * document click event handler (thus disabling the script\n * functionality).\n */\n startTime = 0;\n msgDiv.style.display = 'none';\n document.removeEventListener('click', docClick, false);\n enabled = false;\n }\n }", "title": "" }, { "docid": "e4388202358cff08e122ff1d526c251a", "score": "0.65629804", "text": "function fadeOut(element, duration, timing, endHandler) {\r\n\t if (cssTransitionsSupported) {\r\n\t if (!timing) {\r\n\t timing = \"ease\";\r\n\t }\r\n\t setupTransition(element, \"opacity\", duration, timing);\r\n\t setOpacity(element, 0);\r\n\r\n\t element.addEventListener(\"webkitTransitionEnd\", $.proxy(function () {\r\n\t clearTransition(element);\r\n\t element.style.display = \"none\";\r\n\t setOpacity(element, 1);\r\n\t if (endHandler) {\r\n\t endHandler();\r\n\t }\r\n\t }, this), false);\r\n\t }\r\n\t else {\r\n\t //jQuery(element).animate({left: + x + \"px\"}), duration, 'linear', endHandler);\r\n\t }\r\n\t}", "title": "" }, { "docid": "a1e7cbfa039a8d4fcc9ffa5d363faf1a", "score": "0.65566015", "text": "function modalOut() {\n interval = setInterval(fadeOut, 7);\n}", "title": "" }, { "docid": "3e26e5a40e1acce68094e7ee396c01c9", "score": "0.65521723", "text": "function MetroUnLoading() \n{\n\n $(\".divMessageBox\").fadeOut(300,function(){\n $(this).remove();\n });\n\n $(\".LoadingBoxContainer\").fadeOut(300,function(){\n $(this).remove();\n }); \n}", "title": "" }, { "docid": "38654fd1b393998f222ff302e23f58ba", "score": "0.65425813", "text": "function hide_loader(){\n $(\"#loader\").delay(3000).fadeOut();\n}", "title": "" }, { "docid": "51a3420286392f101c34dabd3b0ee4af", "score": "0.65385306", "text": "function charaFadeOut(itemID, charMove, funct) {\n\tgsap.to(itemID, {delay: .2, x: charMove, opacity: 0, ease: \"power1.in\", duration: fadeOutTime, onComplete: funct});\n}", "title": "" }, { "docid": "c90bf9d90b610f53f8150bcaae0cce0c", "score": "0.6537903", "text": "function fecharModalResultadoAlerta(){\n $('.modal_janela_pg_resultados').fadeOut('fast');\n $('.telaoscura').fadeOut('fast');\n $('.modal-janela').fadeOut('fast');\n $('html, body').removeAttr('style');\n }", "title": "" }, { "docid": "c09e53b43e621358cdb71deb58bbbf82", "score": "0.65347505", "text": "function SmartUnLoading() {\n\n $(\".divMessageBox\").fadeOut(300, function () {\n $(this).remove();\n });\n\n $(\".LoadingBoxContainer\").fadeOut(300, function () {\n $(this).remove();\n });\n}", "title": "" }, { "docid": "c09e53b43e621358cdb71deb58bbbf82", "score": "0.65347505", "text": "function SmartUnLoading() {\n\n $(\".divMessageBox\").fadeOut(300, function () {\n $(this).remove();\n });\n\n $(\".LoadingBoxContainer\").fadeOut(300, function () {\n $(this).remove();\n });\n}", "title": "" }, { "docid": "5910e0f4cbf045c81488e7d19b7e161e", "score": "0.6528907", "text": "function onDialogExit(){\n $( this).closest( '.commonDialog').fadeOut( 300, function(){\n $( '.containerMask' ).fadeOut( 200 );\n });\n}", "title": "" }, { "docid": "189006755261402ff4bcdc3caf63223a", "score": "0.65264595", "text": "function fader(){\n $(\"#title,#voices,#timerChooser,#action,#glyphs,#description\").fadeOut(ceremony.settings.longPause, function() {\n $(\"#action\").fadeIn(ceremony.settings.longPause, function() {});\n });\n}", "title": "" }, { "docid": "d9f83adc44e85a68831b2019a3067e07", "score": "0.6521963", "text": "function callback() {\r\n setTimeout(function() {\r\n $( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\r\n }, 1000 );\r\n }", "title": "" }, { "docid": "633ad71a2e6d44cea4a5c9214097b30b", "score": "0.6519521", "text": "fadeOut () {\n foreach(registerFadeOut, this.arrows)\n\n function registerFadeOut (arrow) {\n arrow.fadeOut(() => {\n arrow.destroy()\n })\n }\n }", "title": "" }, { "docid": "3755315236ef0c535093968bc22d82a3", "score": "0.6518667", "text": "function hideDisplay(title, option) {\r\n\t$(\"#initialDisplay\").fadeOut(400, function() {\r\n\t\t$(title + \", \" + option).remove();\r\n\t});\r\n}", "title": "" }, { "docid": "5bd335b7b20988ae0c42adc2616717a9", "score": "0.6505613", "text": "function callback() {\r\n setTimeout(function() {\r\n $( \"#e-effect\" ).removeAttr( \"style\" ).hide().fadeIn();\r\n }, 1000 );\r\n }", "title": "" }, { "docid": "6738cb3f3ecdddaa6fa07c8e88f048e7", "score": "0.65001345", "text": "function fade(fadeIn) {\n vanish('about');\n vanish('education');\n vanish('projects');\n vanish('questions');\n conjure(fadeIn);\n}", "title": "" }, { "docid": "7cdebcb38439db2ed9a478c2f93ff8e4", "score": "0.6492492", "text": "function goHome (){\n $('body').fadeOut( 1000, homeRedir());\n }", "title": "" }, { "docid": "da8764515f1f2911790989d3d45ee759", "score": "0.64912355", "text": "function esconderAjudaDrag( event ) {\n $( \"#divTooltip\" ).fadeOut();\n}", "title": "" }, { "docid": "bea112e4c39064da8dfa0d1642077001", "score": "0.6468066", "text": "function callback() {\n setTimeout(function() {\n $( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n }, 1000 );\n }", "title": "" }, { "docid": "83c26ba14a60f147c953cacdc95ad3f9", "score": "0.64640176", "text": "function hideTask() {\n $('#input').fadeOut();\n $('#gameInst').fadeOut();\n}", "title": "" }, { "docid": "f4bca5d0af5dba971dd9e57ee4806952", "score": "0.6460205", "text": "function myFadeOut(element, howLong)\n{\n // Creates the Animation Which Carries the Element from Opacity 1 to Opacity 0.\n element.animate([\n {opacity: 1}, \n {opacity: 0}\n ], { \n // How long the Element's Transition from Opacity 1 to Opacity 0 Should Take.\n duration: howLong,\n // Amount of Times to Produce the Animation.\n iterations: 1\n });\n up1ButtonVisible = true;\n element.style.opacity = 0;\n}", "title": "" }, { "docid": "390d766092518e592aff8759bdc15fd9", "score": "0.6455502", "text": "function callback(id) {\n setTimeout(function() {\n $(id).fadeOut(500, function() {\n $(id + \":visible\").removeAttr(\"style\");\n });\n }, 2000);\n}", "title": "" } ]
d09c1b1595bb228a0357e32d7f92bf03
a function to capitalise the first letter of every word in a sentence
[ { "docid": "6037555cf9499d9cf36e42a161231c8e", "score": "0.0", "text": "function JadenCase (str) {\n strArray = str.split(\" \");\n var newStr = \"\";\n for(var i = 0;i<strArray.length;i++){\n var FirstLetter = strArray[i].charAt(0);\n var UCFirstLetter = FirstLetter.toUpperCase();\n var stringWithoutFirstLetter = strArray[i].slice(1);\n newStr = newStr + UCFirstLetter + stringWithoutFirstLetter + \" \";\n }\n console.log(newStr.trim());\n return newStr.trim();\n}", "title": "" } ]
[ { "docid": "d213b95d6ff7d9d795fa6479e9eeebdc", "score": "0.83076245", "text": "function capitalizeAll(sentence){\n var wordArray = sentence.split(' ')\n wordArray.forEach( (val, ind) => {\n wordArray[ind] = val.charAt(0).toUpperCase() + val.substring(1)\n }) \n\n return wordArray.join(' ')\n}", "title": "" }, { "docid": "86920df7cf1763c4447a873f803cd79f", "score": "0.82642853", "text": "function capitalize_words(string) {}", "title": "" }, { "docid": "317784c81f47aea75f7f86350a5bdc70", "score": "0.8178663", "text": "function capitalization(sentence) {\n let temp = sentence.split(\" \");\n let modifiedTemp = temp.map(item => {\n let res = item[0].toUpperCase() + item.substring(1);\n return res;\n });\n return modifiedTemp.join(\" \");\n}", "title": "" }, { "docid": "7e93480c19061b5c4f905fb6d6562f33", "score": "0.8034534", "text": "function capitalize(sentence) {\n console.log(\"input:\", sentence);\n let wordsArray = sentence.split(\" \"); // split the sentence by spaces\n let capsArray = [];\n\n for (let i of wordsArray) {\n let caps = i[0].toUpperCase() + i.slice(1); // capitalize the first letter and append it to rest of the characters.\n capsArray.push(caps);\n }\n\n return capsArray.join(\" \"); // join by space.\n}", "title": "" }, { "docid": "2f316181ae5bb61ff8be667ee16a9a11", "score": "0.8024519", "text": "function capitalIdea(aString){\n return aString.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "8fb49a80c9d65b41e4c0d65948e0a0ab", "score": "0.7982086", "text": "function capitalizeWordInSentence(str){\n str = str.split(' ');\n for (var i=0; i<str.length; i++){\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "title": "" }, { "docid": "76159693a463a5eab14858fbb4ca10fa", "score": "0.79812175", "text": "function capitalizeFirstLetter(str){\n var newwordss =[];\n str.split(' ').forEach(a => {\n a= (a.toUpperCase().slice(0,1) + a.toLowerCase().slice(1) + ' ' );\n newwordss.push(a)\n });\n return newwordss.join('').trim();\n}", "title": "" }, { "docid": "0dc6e82cbe8ff641392c61e1c96227ab", "score": "0.79809266", "text": "function capitalizeAllWords(string) {\n // capitilize all words in a string\n //console.log(string);\nvar str = string.split(\" \");\n// loop through the string and capitilize all of the first letters of the words\nfor(let i = 0; i < str.length; i++){\n str[i] = str[i][0].toUpperCase() + str[i].substring(1);\n // join the string with a space\n} return str.join(\" \");\n\n}", "title": "" }, { "docid": "4e23fcadc556cb05035e783ecf7da0df", "score": "0.7957394", "text": "function capitalize(word){\r\n return word[0].toLocaleUpperCase() + word.slice(1);\r\n}", "title": "" }, { "docid": "0a09171eb229408b2d9bd403c40a47d5", "score": "0.7943035", "text": "function capitalizeEachWord(str) {\r\n return str.replace(/\\w\\S*/g, function(txt) {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n });\r\n}", "title": "" }, { "docid": "da7670c63d53a5f47cbd9171d9d84699", "score": "0.7939959", "text": "function capitalize1(str){\n let result = str[0].toUpperCase() //A short sentence\n\n for(let i = 1; i < str.length; i++){\n if(str[i - 1] === ' '){\n result += str[i].toUpperCase()\n }else{\n result += str[i] \n }\n }\n\n return result\n}", "title": "" }, { "docid": "d236574414c6cc64216cd604604893fb", "score": "0.7937541", "text": "function CapitalizeFirst(str) {\n // Split the string into an array of strings\n let splittedArray = str.split(\" \");\n let a = [];\n\n // Loop through all the strings in the array\n for (let i = 0; i < splittedArray.length; i++) {\n let currentString = splittedArray[i];\n\n // If we are currently at the first string of the array (First word of the sentence)\n if (i === 0) {\n // temporary string\n let tempString = \"\";\n\n // Get the first letter of the string and capitalize it\n tempString += currentString[i][0].toUpperCase();\n\n // Loop through the string and\n // add the rest of the letters to tempString\n for (let y = 1; y < currentString.length; y++) {\n tempString += currentString[y];\n }\n\n // Set our current string with the new (capitalized) string\n currentString = tempString;\n }\n\n // Add it to the array\n a.push(currentString);\n }\n\n // Combine the array into one string\n return a.join(\" \");\n }", "title": "" }, { "docid": "dcba8fd45ac733bd01b5ec455ad24e99", "score": "0.79067445", "text": "function capitalize_Words(inString) {\n return inString.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + \n txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "092d213677326a02b781021026ce0f94", "score": "0.79037005", "text": "function setFirstLetterUpperCase(text) {\n\tif(text == null) {\n\t\tthrow new Error('Text cannot be null.');\n\t}\n if(text == \"\") {\n return \"\";\n\t}\n\n var words = text.split(\" \");\n for (var i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].substring(1);\n }\n var finalText = words.join(\" \");\n return finalText;\n}", "title": "" }, { "docid": "f0301470e73592200f375c69d1d49fd8", "score": "0.7868873", "text": "function capitalizeEachWord(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "c7e60f7c8c2effeaaf591fd0567821f0", "score": "0.7859678", "text": "function capitalizeWords(str) {\n return str.replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "362b5403545e97dead316ff3c4405134", "score": "0.7858343", "text": "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "title": "" }, { "docid": "2054c246885c7964ce84b1045aa02eb2", "score": "0.7855394", "text": "function capitalizeAllWords(string) {\n var splitString = string.toLowerCase().split(' ');\n for (let i = 0; i < splitString.length; i++) {\n \n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1); \n \n \n }\n \n return splitString.join(' '); \n}", "title": "" }, { "docid": "25d654a12e3ebf12d50d82bfd86bdd48", "score": "0.7837472", "text": "function titleCase(str) {\r\n \r\n //1.lowerCase the given sentence.\r\n str = str.toLowerCase();\r\n \r\n //2.Split the given srting.\r\n str = str.split(' ');\r\n \r\n //3. for loop iterates through the words and cpatalizes the first letter.\r\n for(var i = 0; i < str.length; i++){\r\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\r\n \r\n }\r\n \r\n //Return the string by joining it.\r\n return str.join(' ');\r\n \r\n}", "title": "" }, { "docid": "0b854ec07d7083b775f0343e8bd7594e", "score": "0.78071445", "text": "function titleCase(titleString)\r\n{\r\n var wordsArray = titleString.split(\" \"); // first split the sentence into an array of strings(words)\r\n for (var i in wordsArray) // for each word position in array\r\n {\r\n wordsArray[i] = wordsArray[i].charAt(0).toUpperCase()+wordsArray[i].slice(1); // set the word at that position to capitalized first letter and rest of the word\r\n }\r\n\r\n var returnTitle = wordsArray.join(\" \"); // now convert the array back to a string with space as a delimiter and assign it to a new var called returnstring\r\n\r\n return returnTitle; // return the string with uppercase first letters\r\n}", "title": "" }, { "docid": "cd1eb70e568ac2524df94bdbd5f19343", "score": "0.7799021", "text": "static capitalize(string){\n return string.split(\" \").map(word => word.charAt(0).toUpperCase() + word.substring(1)).join(' ')\n\n }", "title": "" }, { "docid": "ac45eb8598c76539a61dff65e9dd8c13", "score": "0.77824634", "text": "static capital(word) {\n return word.charAt(0).toUpperCase() + word.slice(1)\n }", "title": "" }, { "docid": "6c2cac7c2bb4fd0713e965ea238f8b96", "score": "0.77728075", "text": "function capitalizar(str) {\n return str.replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "f4b3f2c5ecb595556ef18563dd533a52", "score": "0.77544206", "text": "function capitalizeSentence(string) {\n\tvar strArr = string.split(/[\\s_]+/);\n\tfor (var word in strArr) {\n\t\tstrArr[word] = capitalize(strArr[word]);\n\t}\n\treturn strArr.join(\" \");\n}", "title": "" }, { "docid": "280a05cc0794e090a0a383e750ac0835", "score": "0.77487856", "text": "function capitalizeAllWords(string) {\n //split string into array\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i][0].toUpperCase() + splitStr[i].slice(1);\n }\n //return splitstr joined back together\n return splitStr.join(\" \");\n}", "title": "" }, { "docid": "db3c805dc90e7747934fe307ce3826f7", "score": "0.77480847", "text": "function capitalize2(str){\n const words = []\n\n for(let word of str.split(' ')){ //['a','short','sentence']\n words.push(word[0].toUpperCase() + word.slice(1))\n }\n\n return words.join(' ')\n}", "title": "" }, { "docid": "598ad8e4351efef71fbe4f35d6b9506a", "score": "0.7747533", "text": "function capitaLetter(word) {\n return word.split(' ').map(function(element){\n var wordArray = element.split('')\n wordArray[0] = wordArray[0].toUpperCase();\n return wordArray.join('')\n }).join(' ')\n}", "title": "" }, { "docid": "9a8b8b7018a5527939b41b7b3e27d642", "score": "0.7745528", "text": "function capitalize(str){\n // Map each word in the string.\n // Concatinate the first letter uppercase with the rest of the word.\n // Join it back together after the mapping has taken place.\n return str.split(\" \").map((el)=>{\n //e.g \"C\" + \"ode\"\n return el.charAt(0).toUpperCase() + el.substring(1);\n }).join(\" \");\n}", "title": "" }, { "docid": "c3e9bda2fabcd52728820476f0c42ba5", "score": "0.77432346", "text": "function capitalizeEach(string) {\n //your code here!\n // string.split(\" \") splits the string of words and indexes them in an array\n // .map goes through each index (word)\n // x[0].toUpperCase() takes the 0 index of x (first letter of the current word in the array) and uppercases it\n // x.slice(1) slices x (current word in the array) at the first index to separate the first letter from the rest of the word\n var capLetter0 = string.split(\" \").map(function(x){\n return x[0].toUpperCase() + x.slice(1);\n })\n\n return capLetter0.join(\" \")\n}", "title": "" }, { "docid": "0a49e9ca1528c44dee7a82c6fe04c2ee", "score": "0.773281", "text": "function capitalizeWords (strInput){\n var strToArr = strInput.split(' ');\n var firstLetterUpp = strToArr.map(elem => \n `${elem[0].toUpperCase()}${elem.slice(1)}`\n );\n return firstLetterUpp.join(' ');\n}", "title": "" }, { "docid": "5a1493b74b7e33a0cd29b09939316c92", "score": "0.7729984", "text": "function p05_Capitalize([input]) {\r\n input = input.toLowerCase().split(' ');\r\n let result = [];\r\n\r\n for (let word of input) {\r\n let newWord = word.replace(word[0], word[0].toUpperCase());\r\n result.push(newWord);\r\n }\r\n\r\n console.log(result.join(' '));\r\n}", "title": "" }, { "docid": "cc1adf7e5a0e5d3e3366d5832180766b", "score": "0.77139443", "text": "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substr(1,string.length);\n \n}", "title": "" }, { "docid": "2e11bf5554581eafb9a8710ff25fd878", "score": "0.77098644", "text": "function capitalizeFirstLetter(word) {\n return word.charAt(0).toUpperCase() + word.slice(1);\n }", "title": "" }, { "docid": "7e5daa28eeba33bd462a4856c16c0b1e", "score": "0.77026427", "text": "function titleCase(str) {\n \n function replaceFirstChar(word, firstLetter){\n var newWord = firstLetter + word.substring(1,word.length);\n return newWord;\n }\n \n str = str.toLowerCase().split(' ');\n for(var i = 0; i < str.length; i++){\n if(str[i] !== ''){\n var upCase = str[i].charAt(0).toUpperCase();\n str[i] = replaceFirstChar(str[i], upCase);\n }\n }\n \n return str.join(' ');\n}", "title": "" }, { "docid": "cd7d78272e3535960b8de0cec9f2c37d", "score": "0.76907706", "text": "function f(str) { \n var arrOfWords = str.toLowerCase().split(\" \");\n for (let i = 0; i < arrOfWords.length; i++) {\n arrOfWords[i] = arrOfWords[i].charAt(0).toUpperCase() + arrOfWords[i].slice(1); \n } \n return arrOfWords.join(\" \");\n }", "title": "" }, { "docid": "ef7c03f39a8a4e097d0d303be1b86d48", "score": "0.76868194", "text": "function LetterCapitalize(str) { \n str = str.split('')\n str[0] = str[0].toUpperCase();\n for(var i =0;i<str.length;i++){\n if(str[i] === ' '){\n str[i+1] = str[i+1].toUpperCase();\n }\n }\n return str.join(''); \n}", "title": "" }, { "docid": "803b660bf3bb41bb5b919e618cd84674", "score": "0.7685613", "text": "function capitalize(str) {\n let strArr = str.split(' ')\n let newArr = []\n for (let word of strArr) {\n word = word[0].toUpperCase() + word.slice(1)\n newArr.push(word)\n }\n return newArr.join(' ')\n}", "title": "" }, { "docid": "db5fc3b33242b4719248f423dcfaeb01", "score": "0.7682669", "text": "function f(str) {\n var words = str.split(\" \")\n var ret = \"\";\n for(var i = 0; i < words.length; i++) {\n ret = ret + words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase()+\" \"\n \n }\n return ret;\n }", "title": "" }, { "docid": "1b549f1c7b5e414fc7b54607e4c673ea", "score": "0.76807225", "text": "function capitalize(sen) {\n var arr = sen.split(' ');\n for (var i in arr) {\n arr[i] = arr[i][0].toUpperCase() + arr[i].slice(1);\n}\nreturn arr.join(' ');\n}", "title": "" }, { "docid": "358742e2d4ec6432c896996eebac1097", "score": "0.76732945", "text": "function letterCapitalize(str){\n\treturn str.replace(/\\b[a-z]/g, function(c){return c.toUpperCase()});\n\t/* /\\b[a-z]/g is a regex to globally (/g) replace the lower case ([a-z]) first letters (\\b) in\n\tthe words with uppercase */\n}", "title": "" }, { "docid": "6f24bf8d4c7148f8d5cc6c56e749eabf", "score": "0.7669684", "text": "function decapitalize(s) {\n return s[0].toLowerCase() + s.slice(1);\n }", "title": "" }, { "docid": "ddf6b41739a104dbd9f94bdd922660c2", "score": "0.765883", "text": "function capitalizeWords(str) {\n return str.replace(/\\w\\S*/g,function(txt){\n return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase();\n });\n }", "title": "" }, { "docid": "26644bbadbd57f8eea11722d60694524", "score": "0.76584774", "text": "function capitalizeLetters(str) \n\n{\n\nreturn str.\n//conevrt to lowercase\ntoLowerCase()\n//Space is used as delimiter to seperate by words\n.split(' ')\n//Takes function\n //changes first character to uppercase and adds everyhting following the uppercase letter \n.map((word) => word[0].toUpperCase() + word.substr(1))\n//Put it back into a string\n.join(' ')\n}", "title": "" }, { "docid": "6ca93cfa45e0582fd3a735f81b30c6c8", "score": "0.7654793", "text": "function capitalizeIt(text){\n text = text.toLowerCase()\n text = text.split(\"\")\n text[0] = text[0].toUpperCase()\n\n for (let i = 0; i < text.length; i++) {\n if (text[i] === \" \") {\n text[i + 1] = text[i + 1].toUpperCase()\n }\n }\n\n console.log(text.join(\"\")) \n}", "title": "" }, { "docid": "19c815a3dbae372a6e52fa2c75087e5d", "score": "0.76510143", "text": "function capitalize(words) {\n words = words.split(' ');\n for(var i = 0; i <words.length; i++) {\n words[i] = words[i].split('');\n words[i][0] = words[i][0].toUpperCase();\n words[i] = words[i].join('');\n }\nreturn words.join(' ');\n\n}", "title": "" }, { "docid": "ae0582c39ad9515762acfab2dcb3b67a", "score": "0.7648747", "text": "function captitalize(str) {\n // https://stackoverflow.com/questions/5122402/uppercase-first-letter-of-variable\n str = str.toLowerCase().replace(/\\b[a-z]/g, function (letter) {\n return letter.toUpperCase();\n });\n return str;\n}", "title": "" }, { "docid": "128de42ca8c081dee07f7a5a073e4ad8", "score": "0.7643722", "text": "function titleCase(txt)\n{\n splitString = txt.split(' ');\n returnvalue = '';\n for (i of splitString)\n {\n returnvalue = returnvalue + i.charAt(0).toUpperCase() + i.substr(1).toLowerCase() + ' ';\n }\n \n return returnvalue;\n \n}", "title": "" }, { "docid": "4158427bb0ccab647cba26adc9f12cbc", "score": "0.7642158", "text": "function capitalize(word) {\r\n word.toLowerCase().slice(1)\r\n return word.toUpperCase().charAt(0) + word.toLowerCase().slice(1);\r\n }", "title": "" }, { "docid": "a45e36650d370d5910ecacea85eeb76c", "score": "0.76355255", "text": "function replaceWordFirstLetter(str) {\n var reg = /\\b(\\w)|\\s(\\w)/g;\n return str.replace(reg, function(m) {\n return m.toUpperCase()\n });\n}", "title": "" }, { "docid": "ae4fa4b55cf309695442de6cadf42c10", "score": "0.7634805", "text": "function capitalize(word) {\n var newWord = word[0].toUpperCase();\n for (var i = 1; i < word.length; i++) {\n newWord += word[i].toLowerCase();\n }\n return newWord;\n}", "title": "" }, { "docid": "95105391a8b9f2a7ac186fb679b64346", "score": "0.76297593", "text": "function capitalize(word) {\n\t\t//captilze each word by converting the first element to uppercase and appending the rest of the string\n\t\treturn word[0].toUpperCase() + word.slice(1, word.length).toLowerCase();\n\t}", "title": "" }, { "docid": "574928d4cf3af78051bc84c24857680c", "score": "0.7629196", "text": "function toTitleCase(str) {\n return str.replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()\n })\n}//toTitleCase", "title": "" }, { "docid": "02985221bf79993451b531f3b96c5c1c", "score": "0.76128227", "text": "function titleCase(word) {\n var splitStr = word.toLowerCase().split(\"the quick brown fox\");\n \n for (var i = 0; i < splitStr.length; i++) {\n if (splitStr.length[i] < splitStr.length) {\n splitStr[i].charAt(0).toUpperCase();\n }\n document.write(splitStr)\n }\n \n return word;\n }", "title": "" }, { "docid": "2139f655a884dddf820124123cfaac06", "score": "0.7611626", "text": "toCapital(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() \n + txt.substr(1).toLowerCase();});\n }", "title": "" }, { "docid": "db4aa4e4aefb2dadbc3a12baec7efb54", "score": "0.7603703", "text": "function capitalizeAllWords(string) {\n //return capitalizeWord(string);\n var split = string.split(\" \");\n \n var output = \"\";\n \n for (var i = 0; i < split.length; i++) {\n output += capitalizeWord(split[i]) + \" \";\n }\n return output.trim();\n}", "title": "" }, { "docid": "a56f2fb60105a057626b4eca8ecf97b7", "score": "0.76033956", "text": "function capitalise ( s ) {\n\t return s.slice(0,1).toUpperCase() + s.slice(1);\n\t }", "title": "" }, { "docid": "ed5bfc76d1cc926b6e20016bce03f19f", "score": "0.7602371", "text": "function transformToTitleCase(word) {\n if (word.charAt(0) != word.charAt(0).toUpperCase()) {\n var firstLetter = (word.charAt(0).toUpperCase());\n return word.replace(word.charAt(0), firstLetter);\n }\n }", "title": "" }, { "docid": "dfd2b4e08780efedaeb1ca54c44b812e", "score": "0.75984377", "text": "function titleCase(str) { \n return str.toLowerCase().split(' ').map(function(word) { \n return (word.charAt(0).toUpperCase() + word.slice(1)); \n }).join(' '); \n }", "title": "" }, { "docid": "e5b7cfef8cde90354c2f973a07e169d0", "score": "0.7595481", "text": "function capitalize(inputStr) {\n var splits = inputStr.split(\" \");\n var outputStr = \"\";\n\n for (let i = 0; i < splits.length; i++) {\n let word = splits[i];\n let firstLetter = word.substring(0, 1).toUpperCase();\n let Remainder = word.substring(1, word.length)\n outputStr += firstLetter + Remainder + \" \";\n }\n\n console.log(outputStr)\n}", "title": "" }, { "docid": "01962e93fe0a7a4ff1ce77d9589e0618", "score": "0.7595363", "text": "function capWord(str) {\n var splitStr = str.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n // You do not need to check if i is larger than splitStr length, as your for does that for you\n // Assign it back to the array\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n // Directly return the joined string\n return splitStr.join(' ');\n}", "title": "" }, { "docid": "1b35f15ecce5ae7538c6e26c58912062", "score": "0.75903386", "text": "function capitalizeAllWords(string) { // func w/ string as param \n let stringz = string.split(\" \"); // split into new strings \n for(let i = 0; i < stringz.length; i++){ // for loop over strings \n stringz[i] = capitalizeWord(stringz[i]); // Using capitialize word, to capitalize indiv strings \n }\n return stringz.join(\" \");// joining said strings once uppercased.\n \n}", "title": "" }, { "docid": "2afb2aac85ecd67dc2a08ea0e49114b2", "score": "0.7581629", "text": "function captFirstLetter(text){\n let newText = text.toLowerCase()//convert all letters to lowercase\n .split(' ')//split them at every space\n .map((element) => element.charAt(0).toUpperCase() + element.substring(1))//capitalize first letter of each element\n .join(' ');//rejoin the elements with a space in between\n\n return newText;\n}", "title": "" }, { "docid": "6515a6a5be01c24cc52f46a477535c6a", "score": "0.7580248", "text": "function capFirst(word){\n var newWord = word.charAt(0).toUpperCase() + word.substring(1)\n return newWord\n}", "title": "" }, { "docid": "c4820d0bcca0df412763904ed4ff6951", "score": "0.7580118", "text": "function capitalizeWord(string) {\n // take string of one word and return the word with its first letter capitalized\n //returning first letter capitalized plus the original string without first value (\"s\")\n return string[0].toUpperCase() + string.slice(1); \n \n}", "title": "" }, { "docid": "76df2057cee83a93a10475992f2be82b", "score": "0.75745493", "text": "function titleCase(str) {\n //Splitting the sentence into an array of words; the array is stored in variable res\n str = str.split(\" \");\n //Setting an empty string\n let newStr = [] \n //Looping through the string one word at a time\n for (let i = 0; i < str.length; i++) {\n //Assigning the word to variable w\n let w = str[i];\n //Slicing off everything but the first letter and assigning it to r\n let r = w.slice(1);\n //Making everything but first letter lowercase\n r = r.toLowerCase();\n //Adding the first letter which we capitalize to the remaining letters, which are already lowercase\n let n = (str[i].charAt(0).toUpperCase()) + r;\n //Adding the completed word to a new string\n newStr.push(n); \n }\n //joining together the words and assigning it to the original variable str\n str = newStr.join(\" \")\n return str;\n}", "title": "" }, { "docid": "ea4db356f4711aee5d4f486360de5816", "score": "0.75732535", "text": "function letterCapitalize( str ) {\n\n\tvar newStr, word, \n\t\tstrArr = str.split(' ');\n\n\tfor ( var i = 0; i < strArr.length; i++ ) {\n\t\tword = strArr[i][0].toUpperCase();\n\t\tstrArr[i] = word + strArr[i].slice(1);\n\t}\n\n\tnewStr = strArr.join(' ');\n\n\treturn newStr;\n}", "title": "" }, { "docid": "ff8ec228665d0f85ea07014575e9a270", "score": "0.7568445", "text": "function toTitleCase() {\n return this.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "f027f0fbe4455cadce585422c3fe362a", "score": "0.7563046", "text": "function capitalizeFirstLetter(text) {\n return text[0].toUpperCase() + text.slice(1);\n}", "title": "" }, { "docid": "e3b2e0b69ffe36cbc5d11c6932fd8d4c", "score": "0.7562813", "text": "function titleCase(str){\n var words = str.toLowerCase().split(' ');\n return words.map(function(item, index){\n var word = item.split('');\n word[0] = word[0].toUpperCase();\n return word.join('');\n }).join(' ');\n}", "title": "" }, { "docid": "48fa1b283e2fee93e94311852b61a348", "score": "0.75627536", "text": "function capitalizeAllWords(string) { \n \n var word = \"\"\n var arr = string.split(\" \");\n \n for (var i = 0; i < arr.length; i++){\n var capLetter = arr[i][0].toUpperCase()\n capLetter += arr[i].slice(1) + \" \"\n word += capLetter\n }\n return word.trim() \n}", "title": "" }, { "docid": "461558e19c099033ad1380b111a61ec5", "score": "0.75600725", "text": "function p05CapitalizeTheWords(text) {\n let textArr = text.toLowerCase().split(' ');\n\n let result = textArr.map(e => {\n let start = e.substr(0, 1).toUpperCase();\n return e = start + e.substr(1);\n });\n\n console.log(result.join(' ').trim());\n}", "title": "" }, { "docid": "f9b22a7de72bca9bc1f865a553867bd7", "score": "0.75541025", "text": "function titleCase(str) {\n let wordsArr = str.split(\" \");\n let capArr = [];\n for (let text of wordsArr) {\n text = text[0].toUpperCase() + text.slice(1, text.length).toLowerCase();\n capArr.push(text);\n }\n return capArr.join(\" \");\n\n}", "title": "" }, { "docid": "5d719a2a65cb1f5779b2b85701fe7491", "score": "0.7551447", "text": "function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "fb99317e4ddaf04505da5fabe185993a", "score": "0.7545987", "text": "function camelCaser (str) {\n\tlet words = str.split(' ');\n\n let camelWords = words.map((word, i) => {\n \tif (i ===0) {\n \t\t\t///first word\n \treturn word.toLowerCase();\n } else {\n //title case the word\n \tlet chars = word.splt('');\n let newChars = chars.map((char,i) => {\n \tif (i === 0) {\n \treturn char.toUpperCase();\n }\n else {\n \treturn char.toLowerCase();\n }\n });\n \treturn newChars.join('');\n }\n});\n\treturn camelWords.join('');\n\n}", "title": "" }, { "docid": "32192e7570143b6b1c43b0f0b0b66be5", "score": "0.75453234", "text": "function LetterCapitalize(str) { \n\n // code goes here\n var strArr = str.split(\" \");\n for(var i = 0; i < strArr.length; i++){\n strArr[i] = strArr[i].split(\"\")\n strArr[i][0] = strArr[i][0].toUpperCase()\n strArr[i] = strArr[i].join(\"\")\n }\n strArr = strArr.join(\" \");\n return strArr; \n\n}", "title": "" }, { "docid": "f497cc33c76b560d90bb27a67a52fb14", "score": "0.75422907", "text": "function titleCase(str) {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "91eea7cd52c8639dc57d1a244ca07f27", "score": "0.7528889", "text": "function titleCase(str) {\n\n // Make strings all lowercase and store words into an array\n var sentence = str\n .toLowerCase()\n .split(' ');\n\n // Iterate through array and capitalise first letter of word.\n for (i = 0; i < sentence.length; i++) {\n\n //split individual word into another array\n sentence[i] = sentence[i].split('');\n\n // Get first letter back from array and turn into capital\n sentence[i][0] = sentence[i][0].toUpperCase();\n\n // flip array word back into string into original array.\n sentence[i] = sentence[i].join('');\n }\n\n // flip array back to string with spaces between words.\n str = sentence.join(' ');\n\n console.log(str + \" using split function\");\n\n return str;\n}", "title": "" }, { "docid": "00c8d255fbe7ad58fe0cff7f472ee6e8", "score": "0.7524847", "text": "function LetterCapitalize(str) {\n\n strArr = str.split(' ');\n newStr = [];\n strArr.forEach(function(word){\n capWord = word.charAt(0).toUpperCase() + word.slice(1);\n newStr.push(capWord);\n });\n return console.log(newStr.join(' '));\n\n}", "title": "" }, { "docid": "39bd60172cf8abe78cda6e15b0cd8dbd", "score": "0.7522297", "text": "function capitalizeWords(string){\n return string.toUpperCase()\n\n}", "title": "" }, { "docid": "d1b75b119767027ee5b835f16b71b207", "score": "0.7518903", "text": "function camel() {\n // https://github.com/sstephenson/prototype/blob/1fb9728/src/lang/string.js#L560\n return this.getWords().join(' ').replace(/\\s+(.)?/g, function(match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n }", "title": "" }, { "docid": "1f6f724e15f2600f1b12eb5fa594d35e", "score": "0.75177526", "text": "function LetterCapitalize(str){\n var arr = str.split(' ');\n for(var i = 0, n = arr.length; i < n; i++){\n arr[i] = arr[i][0].toUpperCase() + arr[i].slice(1);\n }\n return arr.join(' '); \n}", "title": "" }, { "docid": "66ecf108abc9b65a3bb94cad5ec0c9a0", "score": "0.7515836", "text": "function capitalizeWord(string) {\n \n var restOfWord = \"\"\n for (var i = 1; i < string.length; i++){\n restOfWord += string[i]\n }\n return string[0].toUpperCase() + restOfWord\n}", "title": "" }, { "docid": "9abf064814521746c3d9a8187b21acb4", "score": "0.7514395", "text": "function titleCase(str) {\n let array = str.toLowerCase().split(\" \");\n let newSentence = \"\";\n\n for (let i = 0; i < array.length; i++) {\n newSentence += array[i][0].toUpperCase() + array[i].substr(1) + \" \";\n }\n str = newSentence;\n return str;\n}", "title": "" }, { "docid": "e446b2d116468fc3118fae5d7abee6fc", "score": "0.75132394", "text": "function LetterCapitalize(str) { \n\t\t\n\tvar Letter=str.split(\" \");\n\n\t\tfor (var i=0; i<Letter.length; i++){\n\t\t\tLetter[i]=Letter[i].charAt(0).toUpperCase() + Letter[i].substring(1);\n\t\t} \n\treturn Letter.join(\" \"); \n\t}", "title": "" }, { "docid": "dbb547d380448e0aa48475aa3400b325", "score": "0.7510856", "text": "function titleCase(str) {\n let array = str.toLowerCase().split(' ');\n​\n for (let i = 0; i < array.length; i++) {\n array[i] = array[i][0].toUpperCase() + array[i].substr(1);\n }\n str = array.join(' ');\n return str;\n }", "title": "" }, { "docid": "590d3a1a103c514c667b44a0f1532c7a", "score": "0.75093853", "text": "function capitalize(str) {\n let capitalizedString = []\n for(let currWord of str.split(' ')) {\n capitalizedString.push(currWord[0].toUpperCase() + currWord.substring(1))\n }\n console.log(capitalizedString)\n return capitalizedString.join(' ')\n}", "title": "" }, { "docid": "743fddf979b02347073802bde50b1294", "score": "0.7508513", "text": "function capitalize(str) {\n}", "title": "" }, { "docid": "04b6f5ed3e46dc28ca5fa89b59314aad", "score": "0.750742", "text": "function titlise(title) {\n return (title.split(' ').map((word) =>\n (word.charAt(0).toUpperCase() + word.substr(1))).join(' '));\n}", "title": "" }, { "docid": "368a1c0642049ad82bcc122a0c28dd86", "score": "0.7502708", "text": "function capitalize(str) {\n let words = str.split(' ');\n const ans = [];\n for(word of words) {\n let remain = word.slice(1);\n ans.push(word[0].toUpperCase()+remain);\n }\n return ans.join(' ');\n}", "title": "" }, { "docid": "0ab3efd203f62eab00f2b002ec89c852", "score": "0.75006306", "text": "function capitalize(word) {\n return word.charAt(0).toUpperCase() + word.slice(1)\n}", "title": "" }, { "docid": "4de9d599e43fa9cbf9c84072c97ea4e2", "score": "0.7496985", "text": "function capitalizeWords(string){\n words = string.split(\" \");\n for(let letter = 0; letter < words.length; letter++){\n words[letter] = words[letter][0].toUpperCase() + words[letter].substring(1);\n }\n return words.join(\" \");\n}", "title": "" }, { "docid": "8a277b682fb891328dc40d40ba9f4f89", "score": "0.7486721", "text": "function stringCapitalize(string) {\n var splitWord = string.split(\" \")\n for (var i = 0; i < splitWord.length; i++) {\n splitWord[i] = splitWord[i].charAt(0).toUpperCase() + splitWord[i].slice(1);\n }\n joined = splitWord.join(\" \")\n console.log(joined);\n}", "title": "" }, { "docid": "07831460a23f4152d6be8b1bacb63ba4", "score": "0.7485703", "text": "function capitalizeSentence(e) {\n let array = e.split(' ');\n console.log(array)\n var capitalizedSentence = '';\n for (var i = 0; i < array.length; i++) {\n let Word = array[i]\n let text = ''\n for (j = 0; j < Word.length; j++) {\n if (j === 0) {\n text += Word[j].toUpperCase()\n } else {\n text += Word[j].toLowerCase()\n }\n }\n capitalizedSentence += text + ' ';\n }\n return capitalizedSentence\n }", "title": "" }, { "docid": "bb1ca6ae11cc293635438793a1d566c6", "score": "0.748471", "text": "function capitalizeLetters(str) {\r\n \r\n // Note: the Spaces .split('') & .join('') VS .split(' ') & .join(' ') makes a ton of difference. \r\n return str.toLowerCase().split(' ').map(function (word) {\r\n return word[0].toUpperCase() + word.substring(1) // using substring attache the reminder do the Word\r\n }).join(' ')\r\n \r\n}", "title": "" }, { "docid": "597b8b38d79cd2aa6a14312369c48f6d", "score": "0.7482939", "text": "function capitalize1(str) {\n const words = []\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1))\n }\n return words.join(' ')\n}", "title": "" }, { "docid": "377563d0ad4624cec5abe6cb0e5625cd", "score": "0.748226", "text": "function titleCase(str) {\n\n let words = str.toLowerCase().split(\" \");\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i].charAt().toUpperCase() + words[i].slice(1);\n\n }\n\n return words.join(\" \");\n\n}", "title": "" }, { "docid": "7b5afe1ad0af1250119c82e4112c610a", "score": "0.74822026", "text": "function capitalizeAllWords(string) {\n //take a string of words and return a string with all the words capitalized\n //split string into array. for loop and x[i][0].toUpperCase() then return that joined back to string\n var stringArray = string.split(\" \"); //string as array with word at each index\n //loop over this array and x[i][0].toUpperCase() + stringArray[i].substring(1) ... reassign each index\n for (var i = 0; i < stringArray.length; i++){\n stringArray[i] = stringArray[i][0].toUpperCase() + stringArray[i].substring(1);\n }\nreturn stringArray.join(\" \");\n \n}", "title": "" }, { "docid": "b34187bfaa6790f19d2c477d21c1fb45", "score": "0.7478706", "text": "static titleize(sentence) {\n let exceptions = [ 'the', 'a', 'an', 'but', 'of', 'and', 'for', 'at', 'by', 'from' ]\n let result = [];\n let arrayOfWords = sentence.split( \" \" )\n for ( let n = 0; n < arrayOfWords.length; n++ ) {\n if ( n == 0 ) {\n result.push( this.capitalize( arrayOfWords[ n ] ) )\n } else {\n if ( exceptions.includes( arrayOfWords[ n ] ) ) {\n result.push( arrayOfWords[ n ] )\n } else {\n result.push( this.capitalize( arrayOfWords[ n ] ) )\n }\n }\n\n }\n return result.join( \" \" );\n }", "title": "" }, { "docid": "b104764248fc4fe7a9c3a9ed6f0a6874", "score": "0.74738204", "text": "function capitalizeAllWords(string) {\n let capsArray = string.split(' ');\n let result = capsArray.map(element => element[0].toUpperCase() + element.slice(1));\n return result.join(' ');\n}", "title": "" }, { "docid": "b7388e5e1e296c44075308756b9dc9b3", "score": "0.7468491", "text": "function titleCase(input) {\n var lowerCase = input.toLowerCase(); // turns all characters in string to lowercase\n var splitCharacters = lowerCase.split(\" \"); // splits all words of string into substrings inside of an array\n var manipulateCharacters = splitCharacters.map(function (mapWords) {\n // creates a new array which calls our function to manipulate each array element.\n return mapWords[0].toUpperCase() + mapWords.slice(1); // mapWords is the value of each substring, we use the upperCase method on each first character[0] // adds the rest of the substring to the newly manipulated string ex. T + yler; T = mapWords[0].toUpperCase; yler = mapwords.slice[1]\n });\n return manipulateCharacters.join(\" \"); // all substring now have the first letter capitalized, use join put them back into one string seperated by spaces.\n}", "title": "" }, { "docid": "5f681c978c24d727c00dad467cf8c308", "score": "0.74673676", "text": "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()})\n}", "title": "" } ]
7274eda15a6c0e454f4e4be45f74fb7f
Used to schedule change detection on the whole application. Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run. It is usually called indirectly by calling `markDirty` when the view needs to be rerendered. Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple `scheduleTick` requests. The scheduling function can be overridden in `renderComponent`'s `scheduler` option.
[ { "docid": "67ce28157b147e83a8b9d0e24ded127d", "score": "0.57327443", "text": "function scheduleTick(rootContext, flags) {\n var nothingScheduled = rootContext.flags === 0 /* Empty */;\n rootContext.flags |= flags;\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n var res_1;\n rootContext.clean = new Promise(function (r) { return res_1 = r; });\n rootContext.scheduler(function () {\n if (rootContext.flags & 1 /* DetectChanges */) {\n rootContext.flags &= ~1 /* DetectChanges */;\n tickRootContext(rootContext);\n }\n if (rootContext.flags & 2 /* FlushPlayers */) {\n rootContext.flags &= ~2 /* FlushPlayers */;\n var playerHandler = rootContext.playerHandler;\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n rootContext.clean = _CLEAN_PROMISE;\n res_1(null);\n });\n }\n}", "title": "" } ]
[ { "docid": "5d0a6a8efce6f80b49acf98f2fed0505", "score": "0.6753339", "text": "schedule() {\n const now = this.context.getOutputTimestamp().contextTime\n\n // This is how far ahead things are currently scheduled\n const ahead = this.position - this.currentPosition\n\n // Number of ms needed to schedule to maintain scheduleAhead\n const schedulingNeeded = this.scheduleAhead - ahead / this.bpms\n\n const nextSchedule = clamp(0, ahead, this.scheduleSize) / this.bpms\n\n // Number of beats going to be scheduled in this function call\n const beats = clamp(0, schedulingNeeded * this.bpms, this.scheduleBeatsSize)\n this.emit('schedule', {\n beat: this.position,\n after: ahead,\n at: now + ahead,\n beats,\n now,\n })\n this.position += beats\n this.timerID = window.setTimeout(this.schedule.bind(this), nextSchedule)\n }", "title": "" }, { "docid": "ba0bd13416234be552c31a34f69b87e5", "score": "0.623812", "text": "function scheduleTick(rootContext, flags) {\n var nothingScheduled = rootContext.flags === 0\n /* Empty */\n ;\n\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n // https://github.com/angular/angular/issues/39296\n // should only attach the flags when really scheduling a tick\n rootContext.flags |= flags;\n var res;\n rootContext.clean = new Promise(function (r) {\n return res = r;\n });\n rootContext.scheduler(function () {\n if (rootContext.flags & 1\n /* DetectChanges */\n ) {\n rootContext.flags &= ~1\n /* DetectChanges */\n ;\n tickRootContext(rootContext);\n }\n\n if (rootContext.flags & 2\n /* FlushPlayers */\n ) {\n rootContext.flags &= ~2\n /* FlushPlayers */\n ;\n var playerHandler = rootContext.playerHandler;\n\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n\n rootContext.clean = _CLEAN_PROMISE;\n res(null);\n });\n }\n }", "title": "" }, { "docid": "ba0bd13416234be552c31a34f69b87e5", "score": "0.623812", "text": "function scheduleTick(rootContext, flags) {\n var nothingScheduled = rootContext.flags === 0\n /* Empty */\n ;\n\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n // https://github.com/angular/angular/issues/39296\n // should only attach the flags when really scheduling a tick\n rootContext.flags |= flags;\n var res;\n rootContext.clean = new Promise(function (r) {\n return res = r;\n });\n rootContext.scheduler(function () {\n if (rootContext.flags & 1\n /* DetectChanges */\n ) {\n rootContext.flags &= ~1\n /* DetectChanges */\n ;\n tickRootContext(rootContext);\n }\n\n if (rootContext.flags & 2\n /* FlushPlayers */\n ) {\n rootContext.flags &= ~2\n /* FlushPlayers */\n ;\n var playerHandler = rootContext.playerHandler;\n\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n\n rootContext.clean = _CLEAN_PROMISE;\n res(null);\n });\n }\n }", "title": "" }, { "docid": "8a6c90d720159215920e69b4c6039325", "score": "0.6154285", "text": "function scheduleTick(rootContext, flags) {\n const nothingScheduled = rootContext.flags === 0\n /* Empty */\n ;\n\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n // https://github.com/angular/angular/issues/39296\n // should only attach the flags when really scheduling a tick\n rootContext.flags |= flags;\n let res;\n rootContext.clean = new Promise(r => res = r);\n rootContext.scheduler(() => {\n if (rootContext.flags & 1\n /* DetectChanges */\n ) {\n rootContext.flags &= ~1\n /* DetectChanges */\n ;\n tickRootContext(rootContext);\n }\n\n if (rootContext.flags & 2\n /* FlushPlayers */\n ) {\n rootContext.flags &= ~2\n /* FlushPlayers */\n ;\n const playerHandler = rootContext.playerHandler;\n\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n\n rootContext.clean = _CLEAN_PROMISE;\n res(null);\n });\n }\n}", "title": "" }, { "docid": "7137e1c182ef1a6b43099485b27d282e", "score": "0.6127303", "text": "static scheduleRenderTask() {\n\t\tif (!renderTaskId) {\n\t\t\t// renderTaskId = window.setTimeout(RenderScheduler.renderWebComponents, 3000); // Task\n\t\t\t// renderTaskId = Promise.resolve().then(RenderScheduler.renderWebComponents); // Micro task\n\t\t\trenderTaskId = window.requestAnimationFrame(RenderScheduler.renderWebComponents); // AF\n\t\t}\n\t}", "title": "" }, { "docid": "b37a8add4f37e3a65f96d0096c07c8a0", "score": "0.6076879", "text": "_requestTick() {\n if( !this._ticking ) {\n // console.log( '- - - - - RAF - - - - -' );\n requestAnimationFrame( this._update.bind( this ) );\n // console.log( '/- - - - - RAF - - - - -/' );\n }\n\n this._ticking = true;\n }", "title": "" }, { "docid": "7d00aff373f1c4ff2499112223c2892f", "score": "0.607603", "text": "function scheduleTick(rootContext, flags) {\n const nothingScheduled = rootContext.flags === 0 /* Empty */;\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n // https://github.com/angular/angular/issues/39296\n // should only attach the flags when really scheduling a tick\n rootContext.flags |= flags;\n let res;\n rootContext.clean = new Promise((r) => res = r);\n rootContext.scheduler(() => {\n if (rootContext.flags & 1 /* DetectChanges */) {\n rootContext.flags &= ~1 /* DetectChanges */;\n tickRootContext(rootContext);\n }\n if (rootContext.flags & 2 /* FlushPlayers */) {\n rootContext.flags &= ~2 /* FlushPlayers */;\n const playerHandler = rootContext.playerHandler;\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n rootContext.clean = _CLEAN_PROMISE;\n res(null);\n });\n }\n}", "title": "" }, { "docid": "7d00aff373f1c4ff2499112223c2892f", "score": "0.607603", "text": "function scheduleTick(rootContext, flags) {\n const nothingScheduled = rootContext.flags === 0 /* Empty */;\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n // https://github.com/angular/angular/issues/39296\n // should only attach the flags when really scheduling a tick\n rootContext.flags |= flags;\n let res;\n rootContext.clean = new Promise((r) => res = r);\n rootContext.scheduler(() => {\n if (rootContext.flags & 1 /* DetectChanges */) {\n rootContext.flags &= ~1 /* DetectChanges */;\n tickRootContext(rootContext);\n }\n if (rootContext.flags & 2 /* FlushPlayers */) {\n rootContext.flags &= ~2 /* FlushPlayers */;\n const playerHandler = rootContext.playerHandler;\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n rootContext.clean = _CLEAN_PROMISE;\n res(null);\n });\n }\n}", "title": "" }, { "docid": "d05b089e3a4812c551eb3b72f65c91f8", "score": "0.6063628", "text": "scheduleBeforeRender(taskFn) {\n // TODO(gkalpak): Implement a better way of accessing `requestAnimationFrame()`\n // (e.g. accounting for vendor prefix, SSR-compatibility, etc).\n if (typeof window === 'undefined') {\n // For SSR just schedule immediately.\n return scheduler.schedule(taskFn, 0);\n }\n if (typeof window.requestAnimationFrame === 'undefined') {\n const frameMs = 16;\n return scheduler.schedule(taskFn, frameMs);\n }\n const id = window.requestAnimationFrame(taskFn);\n return () => window.cancelAnimationFrame(id);\n }", "title": "" }, { "docid": "c5ae57b99946cb69d197854f857aa530", "score": "0.6061027", "text": "tick() {\n this.props.onTick();\n window.requestAnimationFrame(() => this.tick());\n }", "title": "" }, { "docid": "0eec8395234aca3eebd5eaae79259631", "score": "0.5994088", "text": "schedule_() {\n if (this.scheduledImmediateInvocation_) {\n return;\n }\n const nextTask = this.nextTask_();\n if (!nextTask) {\n return;\n }\n if (nextTask.immediateTriggerCondition_()) {\n this.scheduledImmediateInvocation_ = true;\n this.executeAsap_(/* idleDeadline */ null);\n return;\n }\n // If requestIdleCallback exists, schedule a task with it, but\n // do not wait longer than two seconds.\n if (nextTask.useRequestIdleCallback_() && this.win_.requestIdleCallback) {\n onIdle(\n this.win_,\n // Wait until we have a budget of at least 15ms.\n // 15ms is a magic number. Budgets are higher when the user\n // is completely idle (around 40), but that occurs too\n // rarely to be usable. 15ms budgets can happen during scrolling\n // but only if the device is doing super, super well, and no\n // real processing is done between frames.\n 15 /* minimumTimeRemaining */,\n 2000 /* timeout */,\n this.boundExecute_\n );\n return;\n }\n this.requestMacroTask_();\n }", "title": "" }, { "docid": "8432d4c4cbb91dff46bcce882754dec3", "score": "0.57936203", "text": "_scheduleUpdate() {\n this.stopUpdates(); // stop any existing updates\n this._updateEnabled = true;\n this._timer = setTimeout(this.update.bind(this), this.config.frequency * 1000);\n }", "title": "" }, { "docid": "5da4f00bba56835593feb91bf2a03680", "score": "0.57924587", "text": "function flushSchedulerQueue(){flushing=true;var watcher,id,vm;// Sort queue before flush.\n// This ensures that:\n// 1. Components are updated from parent to child. (because parent is always\n// created before the child)\n// 2. A component's user watchers are run before its render watcher (because\n// user watchers are created before the render watcher)\n// 3. If a component is destroyed during a parent component's watcher run,\n// its watchers can be skipped.\nqueue.sort(function(a,b){return a.id-b.id;});// do not cache length because more watchers might be pushed\n// as we run existing watchers\nfor(index=0;index<queue.length;index++){watcher=queue[index];id=watcher.id;has[id]=null;watcher.run();// in dev build, check and stop circular updates.\nif(\"development\"!=='production'&&has[id]!=null){circular[id]=(circular[id]||0)+1;if(circular[id]>config._maxUpdateCount){warn('You may have an infinite update loop '+(watcher.user?\"in watcher with expression \\\"\"+watcher.expression+\"\\\"\":\"in a component render function.\"),watcher.vm);break;}}}// call updated hooks\nindex=queue.length;while(index--){watcher=queue[index];vm=watcher.vm;if(vm._watcher===watcher&&vm._isMounted){callHook(vm,'updated');}}// devtool hook\n/* istanbul ignore if */if(devtools&&config.devtools){devtools.emit('flush');}resetSchedulerState();}", "title": "" }, { "docid": "bea51e259afdc230ddba5e38478b2629", "score": "0.5779796", "text": "function scheduler () {\n\n if (config.on == false) return;\n\n var now = moment();\n now.millisecond(0);\n now.second(0);\n\n var thisminute = now.minute();\n if (thisminute == lastScheduleCheck) return;\n lastScheduleCheck = thisminute;\n\n // Rain sensor(s) handling.\n // In this design, rain detection does not abort an active program\n // on its track, it only disables launching new programs.\n // We check the status of the rain sensor(s) even if the rain timer\n // is armed: this pushes the timer to one day after the end of the rain.\n // The rationale is that we hope that this will make the controller's\n // behavior more predictable. This is just a (debatable) choice.\n\n if (config.raindelay) {\n if (hardware.rainSensor() || weather.rainsensor()) {\n var nextTimer = rainDelayInterval + now;\n if (nextTimer > rainTimer) {\n rainTimer = nextTimer;\n }\n }\n if (rainTimer > +now) return;\n }\n\n scheduleProgramList (config.programs, now);\n scheduleProgramList (calendar.programs(), now);\n}", "title": "" }, { "docid": "3b8c3baddf49cbdad7f74419c931c0da", "score": "0.57536775", "text": "scheduler() {\n if (this.status === StatusEnum.PAUSED ||\n this.status === StatusEnum.FINISHED) {\n return;\n }\n\n let timestamp, hz;\n if (this.lastFrequencyPair.length != 0) {\n [timestamp, hz] = this.lastFrequencyPair;\n this.lastFrequencyPair = [];\n }\n else {\n [timestamp, hz] = this.nextNote();\n }\n\n while (timestamp < this.context.currentTime + this.scheduleAhead) {\n this.tuneInstrument(hz, timestamp);\n [timestamp, hz] = this.nextNote();\n }\n // Context is suspended at construction, freezing currentTime at 0,\n // and enabling scheduling of notes at 0 seconds.\n if (this.status === StatusEnum.NOT_STARTED) {\n this.instrumentOn();\n this.context.resume();\n this.status = StatusEnum.PLAYING;\n }\n\n this.lastFrequencyPair = [timestamp, hz];\n window.setTimeout(this.scheduler.bind(this), this.cooldownPeriod);\n }", "title": "" }, { "docid": "7a30ad145381a3b2800ddaa367e85fe2", "score": "0.5728609", "text": "function flushSchedulerQueue(){flushing = true;var watcher,id,vm; // Sort queue before flush.\n// This ensures that:\n// 1. Components are updated from parent to child. (because parent is always\n// created before the child)\n// 2. A component's user watchers are run before its render watcher (because\n// user watchers are created before the render watcher)\n// 3. If a component is destroyed during a parent component's watcher run,\n// its watchers can be skipped.\nqueue.sort(function(a,b){return a.id - b.id;}); // do not cache length because more watchers might be pushed\n// as we run existing watchers\nfor(index = 0;index < queue.length;index++) {watcher = queue[index];id = watcher.id;has$1[id] = null;watcher.run(); // in dev build, check and stop circular updates.\nif(process.env.NODE_ENV !== 'production' && has$1[id] != null){circular[id] = (circular[id] || 0) + 1;if(circular[id] > config._maxUpdateCount){warn('You may have an infinite update loop ' + (watcher.user?\"in watcher with expression \\\"\" + watcher.expression + \"\\\"\":\"in a component render function.\"),watcher.vm);break;}}} // call updated hooks\nindex = queue.length;while(index--) {watcher = queue[index];vm = watcher.vm;if(vm._watcher === watcher && vm._isMounted){callHook(vm,'updated');}} // devtool hook\n/* istanbul ignore if */if(devtools && config.devtools){devtools.emit('flush');}resetSchedulerState();}", "title": "" }, { "docid": "35bb75ff56f84fc02d78dd69940264bc", "score": "0.5678183", "text": "schedule() {\n this.__manager.schedule(this);\n }", "title": "" }, { "docid": "e073159868cd17bdf1ab8ed4f1d038d0", "score": "0.56321824", "text": "scheduleFlush() {\n this.logger.info('TraceWriter#scheduleFlush: Performing periodic flush.');\n this.flushBuffer();\n // Do it again after delay\n if (this.isActive) {\n // 'global.setTimeout' avoids TS2339 on this line.\n // It helps disambiguate the Node runtime setTimeout function from\n // WindowOrWorkerGlobalScope.setTimeout, which returns an integer.\n global\n .setTimeout(this.scheduleFlush.bind(this), this.config.flushDelaySeconds * 1000)\n .unref();\n }\n }", "title": "" }, { "docid": "173496ecb2e18e1046595c6fb6e43762", "score": "0.55756783", "text": "function scheduleTick(rootContext) {\n if (rootContext.clean == _CLEAN_PROMISE) {\n var res_1;\n rootContext.clean = new Promise(function (r) { return res_1 = r; });\n rootContext.scheduler(function () {\n tick(rootContext.component);\n res_1(null);\n rootContext.clean = _CLEAN_PROMISE;\n });\n }\n}", "title": "" }, { "docid": "1c610d945c7b7bdb85e0253c29c8d183", "score": "0.555176", "text": "scheduleDOMUpdate(f) { this.centralScheduler.set(f) }", "title": "" }, { "docid": "31d7e2a04324f025c611adae9f06cc88", "score": "0.5526845", "text": "function flushSchedulerQueue(){currentFlushTimestamp=getNow();flushing=true;var watcher,id;// Sort queue before flush.\n// This ensures that:\n// 1. Components are updated from parent to child. (because parent is always\n// created before the child)\n// 2. A component's user watchers are run before its render watcher (because\n// user watchers are created before the render watcher)\n// 3. If a component is destroyed during a parent component's watcher run,\n// its watchers can be skipped.\nqueue.sort(function(a,b){return a.id-b.id;});// do not cache length because more watchers might be pushed\n// as we run existing watchers\nfor(index=0;index<queue.length;index++){watcher=queue[index];if(watcher.before){watcher.before();}id=watcher.id;has[id]=null;watcher.run();// in dev build, check and stop circular updates.\nif(has[id]!=null){circular[id]=(circular[id]||0)+1;if(circular[id]>MAX_UPDATE_COUNT){warn('You may have an infinite update loop '+(watcher.user?\"in watcher with expression \\\"\"+watcher.expression+\"\\\"\":\"in a component render function.\"),watcher.vm);break;}}}// keep copies of post queues before resetting state\nvar activatedQueue=activatedChildren.slice();var updatedQueue=queue.slice();resetSchedulerState();// call component updated and activated hooks\ncallActivatedHooks(activatedQueue);callUpdatedHooks(updatedQueue);// devtool hook\n/* istanbul ignore if */if(devtools&&config.devtools){devtools.emit('flush');}}", "title": "" }, { "docid": "406d1990550a4e609e2391e26975146b", "score": "0.552555", "text": "function flushSchedulerQueue(){currentFlushTimestamp=getNow();flushing=true;var watcher,id;// Sort queue before flush.\n// This ensures that:\n// 1. Components are updated from parent to child. (because parent is always\n// created before the child)\n// 2. A component's user watchers are run before its render watcher (because\n// user watchers are created before the render watcher)\n// 3. If a component is destroyed during a parent component's watcher run,\n// its watchers can be skipped.\nqueue.sort(function(a,b){return a.id-b.id;});// do not cache length because more watchers might be pushed\n// as we run existing watchers\nfor(index=0;index<queue.length;index++){watcher=queue[index];if(watcher.before){watcher.before();}id=watcher.id;has[id]=null;watcher.run();// in dev build, check and stop circular updates.\nif( true&&has[id]!=null){circular[id]=(circular[id]||0)+1;if(circular[id]>MAX_UPDATE_COUNT){warn('You may have an infinite update loop '+(watcher.user?\"in watcher with expression \\\"\"+watcher.expression+\"\\\"\":\"in a component render function.\"),watcher.vm);break;}}}// keep copies of post queues before resetting state\nvar activatedQueue=activatedChildren.slice();var updatedQueue=queue.slice();resetSchedulerState();// call component updated and activated hooks\ncallActivatedHooks(activatedQueue);callUpdatedHooks(updatedQueue);// devtool hook\n/* istanbul ignore if */if(devtools&&config.devtools){devtools.emit('flush');}}", "title": "" }, { "docid": "ff9a76db083eeb0a6dc2f4220fa963cb", "score": "0.5524468", "text": "function requestTick() {\n if( !ticking ) {\n requestAnimationFrame(update);\n }\n ticking = true;\n }", "title": "" }, { "docid": "e04d0b3b928a4481a677aa3381e1019d", "score": "0.5520209", "text": "_update() {\n const now = Date.now();\n const delta = (now - this.then) / 1000;\n\n this.then = now;\n this.ticks += 1;\n\n const detail = {\n delta,\n ticks: this.ticks\n };\n\n // create and fire tick events and execute callbacks\n this.onPreTick(delta, this.ticks);\n broadcast(this.screen, \"pretick\", detail);\n\n this.onTick(delta, this.ticks);\n broadcast(this.screen, \"tick\", detail);\n\n this.onPostTick(delta, this.ticks);\n broadcast(this.screen, \"tick\", detail);\n\n this.opts.window.requestAnimationFrame(this._update);\n }", "title": "" }, { "docid": "20d8dbd0b568e0a108988db0352194b8", "score": "0.5518866", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n _babel_runtime_corejs3_core_js_stable_instance_sort__WEBPACK_IMPORTED_MODULE_20___default()(queue).call(queue, function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_35___default()(activatedChildren).call(activatedChildren);\n\n var updatedQueue = _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_35___default()(queue).call(queue);\n\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "ac2ea429ee5648368d51e73b4cdab962", "score": "0.5516424", "text": "function flushSchedulerQueue () {\nflushing = true;\nvar watcher, id;\n// Sort queue before flush.\n// This ensures that:\n// 1. Components are updated from parent to child. (because parent is always\n// created before the child)\n// 2. A component's user watchers are run before its render watcher (because\n// user watchers are created before the render watcher)\n// 3. If a component is destroyed during a parent component's watcher run,\n// its watchers can be skipped.\nqueue.sort(function (a, b) { return a.id - b.id; });\n// do not cache length because more watchers might be pushed\n// as we run existing watchers\nfor (index = 0; index < queue.length; index++) {\nwatcher = queue[index];\nid = watcher.id;\nhas[id] = null;\nwatcher.run();\n// in dev build, check and stop circular updates.\nif (\"development\" !== 'production' && has[id] != null) {\ncircular[id] = (circular[id] || 0) + 1;\nif (circular[id] > MAX_UPDATE_COUNT) {\nwarn(\n'You may have an infinite update loop ' + (\nwatcher.user\n? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n: \"in a component render function.\"\n),\nwatcher.vm\n);\nbreak\n}\n}\n}\n// keep copies of post queues before resetting state\nvar activatedQueue = activatedChildren.slice();\nvar updatedQueue = queue.slice();\nresetSchedulerState();\n// call component updated and activated hooks\ncallActivatedHooks(activatedQueue);\ncallUpdatedHooks(updatedQueue);\n// devtool hook\n/* istanbul ignore if */\nif (devtools && config.devtools) {\ndevtools.emit('flush');\n}\n}", "title": "" }, { "docid": "443919e48e943661d6171f119e97a00c", "score": "0.5516159", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n _babel_runtime_corejs3_core_js_stable_instance_sort__WEBPACK_IMPORTED_MODULE_20___default()(queue).call(queue, function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_37___default()(activatedChildren).call(activatedChildren);\n\n var updatedQueue = _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_37___default()(queue).call(queue);\n\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "15872b9d003ab1601ca225e2935bd89e", "score": "0.55087817", "text": "tick() {\n NG_DEV_MODE && this.warnIfDestroyed();\n if (this._runningTick) {\n throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n try {\n this._runningTick = true;\n for (let view of this._views) {\n view.detectChanges();\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n }\n }", "title": "" }, { "docid": "d643aff2d20384e98e7101d04ff50f12", "score": "0.5501879", "text": "_shouldEngineTick() {\n requestAnimationFrame(() => {\n let now = Date.now();\n let elapsed = now - this.then;\n\n if (elapsed > this.fpsInterval) {\n this.then = now;\n this._tick();\n return;\n }\n\n this._shouldEngineTick();\n });\n }", "title": "" }, { "docid": "14f82f7e226a89686e1b05ecfcb7d005", "score": "0.5491711", "text": "tick() {\n this[registryKey].forEach((timer, id) => {\n if (timer.running) {\n timer.tick()\n }\n })\n }", "title": "" }, { "docid": "27e2ee926a3d1fbf321f4bd6ce7d7582", "score": "0.54802305", "text": "tick() {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n\n try {\n this._runningTick = true;\n\n for (let view of this._views) {\n view.detectChanges();\n } // Note that we have still left the `isDevMode()` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n }\n }", "title": "" }, { "docid": "c670e41009a2f8052fd5fd430ae0101a", "score": "0.54776794", "text": "schedule(func) {\n if (this.tasks.indexOf(func) === -1) this.tasks.push(func);\n if (this.$raf) return;\n this.$raf = window.requestAnimationFrame(this.raf);\n }", "title": "" }, { "docid": "c670e41009a2f8052fd5fd430ae0101a", "score": "0.54776794", "text": "schedule(func) {\n if (this.tasks.indexOf(func) === -1) this.tasks.push(func);\n if (this.$raf) return;\n this.$raf = window.requestAnimationFrame(this.raf);\n }", "title": "" }, { "docid": "5672249942e15f76b759e048596b88fb", "score": "0.5450492", "text": "tick() {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n try {\n this._runningTick = true;\n for (let view of this._views) {\n view.detectChanges();\n }\n // Note that we have still left the `isDevMode()` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n }\n catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n }\n finally {\n this._runningTick = false;\n }\n }", "title": "" }, { "docid": "5672249942e15f76b759e048596b88fb", "score": "0.5450492", "text": "tick() {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n try {\n this._runningTick = true;\n for (let view of this._views) {\n view.detectChanges();\n }\n // Note that we have still left the `isDevMode()` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n }\n catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n }\n finally {\n this._runningTick = false;\n }\n }", "title": "" }, { "docid": "557143207c3b0565efecce04940f5d48", "score": "0.5392483", "text": "function fireAsync() {\n\t\tif (!scheduled) {\n\t\t\tscheduled = true;\n\t\t\t// TODO: just do `mountRedraw.redraw()` here and elide the timer\n\t\t\t// dependency. Note that this will muck with tests a *lot*, so it's\n\t\t\t// not as easy of a change as it sounds.\n\t\t\tcallAsync(resolveRoute);\n\t\t}\n\t}", "title": "" }, { "docid": "cb00f9689166480473d8f37cc6599fe1", "score": "0.5381503", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "cb00f9689166480473d8f37cc6599fe1", "score": "0.5381503", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "b00f9e90ce85595ed44b93955a46d162", "score": "0.5379308", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // call updated hooks\n index = queue.length;\n while (index--) {\n watcher = queue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n\n resetSchedulerState();\n}", "title": "" }, { "docid": "9fbe134c0ae68b85a6f8fd279a70cc44", "score": "0.53789103", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n \n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n \n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ('development' !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n \n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n \n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n \n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n }", "title": "" }, { "docid": "096ca89dde3defc8fcf9d5407a4a4d3c", "score": "0.5374995", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has$1[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // call updated hooks\n index = queue.length;\n while (index--) {\n watcher = queue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n\n resetSchedulerState();\n}", "title": "" }, { "docid": "7b4c15b8ab751c661f2a2547a7d23a48", "score": "0.5363877", "text": "function flushSchedulerQueue(){flushing = true;var watcher,id; // Sort queue before flush.\n\t// This ensures that:\n\t// 1. Components are updated from parent to child. (because parent is always\n\t// created before the child)\n\t// 2. A component's user watchers are run before its render watcher (because\n\t// user watchers are created before the render watcher)\n\t// 3. If a component is destroyed during a parent component's watcher run,\n\t// its watchers can be skipped.\n\tqueue.sort(function(a,b){return a.id - b.id;}); // do not cache length because more watchers might be pushed\n\t// as we run existing watchers\n\tfor(index = 0;index < queue.length;index++) {watcher = queue[index];id = watcher.id;has[id] = null;watcher.run(); // in dev build, check and stop circular updates.\n\tif((\"develop\") !== 'production' && has[id] != null){circular[id] = (circular[id] || 0) + 1;if(circular[id] > MAX_UPDATE_COUNT){warn('You may have an infinite update loop ' + (watcher.user?\"in watcher with expression \\\"\" + watcher.expression + \"\\\"\":\"in a component render function.\"),watcher.vm);break;}}} // keep copies of post queues before resetting state\n\tvar activatedQueue=activatedChildren.slice();var updatedQueue=queue.slice();resetSchedulerState(); // call component updated and activated hooks\n\tcallActivatedHooks(activatedQueue);callUpdatedHooks(updatedQueue); // devtool hook\n\t/* istanbul ignore if */if(devtools && config.devtools){devtools.emit('flush');}}", "title": "" }, { "docid": "cf252e3984850e7d80d10e043bf445e5", "score": "0.53617936", "text": "tick() {\n this._tickableObjectsArray.forEach((object,index) =>{\n object.tick();\n });\n\n let paintEvent = new CustomEvent('REPAINT_CANVAS',{'detail':this._tickableObjectsArray});\n document.dispatchEvent(paintEvent);\n\n // Set timeout\n setTimeout(this.tick.bind(this), 20);\n\n }", "title": "" }, { "docid": "ac631bd1e7db0a167ff26b47a98f443b", "score": "0.5361539", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // call updated hooks\n index = queue.length;\n while (index--) {\n watcher = queue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n\n resetSchedulerState();\n}", "title": "" }, { "docid": "4b29b1e9a40871830f45320ff00f8b25", "score": "0.5351042", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "4b29b1e9a40871830f45320ff00f8b25", "score": "0.5351042", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "4b29b1e9a40871830f45320ff00f8b25", "score": "0.5351042", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "4b29b1e9a40871830f45320ff00f8b25", "score": "0.5351042", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id, vm;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // reset scheduler before updated hook called\n var oldQueue = queue.slice();\n resetSchedulerState();\n\n // call updated hooks\n index = oldQueue.length;\n while (index--) {\n watcher = oldQueue[index];\n vm = watcher.vm;\n if (vm._watcher === watcher && vm._isMounted) {\n callHook(vm, 'updated');\n }\n }\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "e68f259f6284d08120f12a8b7542f702", "score": "0.5317739", "text": "componentDidMount() {\n\t\tconsole.log(\"Clock\", \"componentDidMount\");\n\t\tthis.timerID = setInterval(() => {\n\t\t this.tick();\n\t\t}, 1000);\n\t }", "title": "" }, { "docid": "9b7f3bdfe3e3f34ebaa084855fd503da", "score": "0.5312047", "text": "tickWillRender(/*time*/) {}", "title": "" }, { "docid": "891521f82d926cfaa7cf51e36d75bb93", "score": "0.53091115", "text": "componentDidMount() {\n this.tickTask = setInterval(this.tick, 60 * 1000);\n }", "title": "" }, { "docid": "69ac33c4d8b5c2c92450a46e21373018", "score": "0.5304656", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue$1.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue$1.length; index++) {\n watcher = queue$1[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (\"production\" !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue$1.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdateHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config$1.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "832e5f07928650de91866195d73c04f0", "score": "0.530278", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has$1[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if ( true && has$1[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "9433f8d728e92c214c8deca2d864fa72", "score": "0.52962554", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "9433f8d728e92c214c8deca2d864fa72", "score": "0.52962554", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "43a8baf7410b4a9d06e03d9638b60c1e", "score": "0.5290486", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if (has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "fbfecf28141edfe324f9613c16a8e8cf", "score": "0.52759296", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n \n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n \n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (\"development\" !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n \n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n \n resetSchedulerState();\n \n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n \n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n }", "title": "" }, { "docid": "3f565a1ac977ca90892130364348376d", "score": "0.5273052", "text": "function _tick(){\n\t\t//Note: the \"this\" context within the 'tick' event listener is the forceSimulation itself\n\t\tlet nodes = this.nodes(); //this.nodes() === force.nodes()\n\n\t\t//On each tick/update of the simulation, repaint canvas\n\t\t_redraw(nodes);\n\t}", "title": "" }, { "docid": "bf858d88d5542d4a9f697289d1c14d77", "score": "0.52627075", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if (\"production\" !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "44c5d1808e2fb9679074770eb3fdfbbf", "score": "0.52618706", "text": "function flushSchedulerQueue () {\n\t flushing = true;\n\t var watcher, id, vm;\n\n\t // Sort queue before flush.\n\t // This ensures that:\n\t // 1. Components are updated from parent to child. (because parent is always\n\t // created before the child)\n\t // 2. A component's user watchers are run before its render watcher (because\n\t // user watchers are created before the render watcher)\n\t // 3. If a component is destroyed during a parent component's watcher run,\n\t // its watchers can be skipped.\n\t queue.sort(function (a, b) { return a.id - b.id; });\n\n\t // do not cache length because more watchers might be pushed\n\t // as we run existing watchers\n\t for (index = 0; index < queue.length; index++) {\n\t watcher = queue[index];\n\t id = watcher.id;\n\t has$1[id] = null;\n\t watcher.run();\n\t // in dev build, check and stop circular updates.\n\t if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {\n\t circular[id] = (circular[id] || 0) + 1;\n\t if (circular[id] > config._maxUpdateCount) {\n\t warn(\n\t 'You may have an infinite update loop ' + (\n\t watcher.user\n\t ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n\t : \"in a component render function.\"\n\t ),\n\t watcher.vm\n\t );\n\t break\n\t }\n\t }\n\t }\n\n\t // call updated hooks\n\t index = queue.length;\n\t while (index--) {\n\t watcher = queue[index];\n\t vm = watcher.vm;\n\t if (vm._watcher === watcher && vm._isMounted) {\n\t callHook(vm, 'updated');\n\t }\n\t }\n\n\t // devtool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\n\t resetSchedulerState();\n\t}", "title": "" }, { "docid": "52ef1fbccfc812bd23076ee777bd4592", "score": "0.5261398", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "486b5903229b72af35b480143d220539", "score": "0.5258472", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if (\"development\" !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "486b5903229b72af35b480143d220539", "score": "0.5258472", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id; // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n\n queue.sort(function (a, b) {\n return a.id - b.id;\n }); // do not cache length because more watchers might be pushed\n // as we run existing watchers\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n\n if (watcher.before) {\n watcher.before();\n }\n\n id = watcher.id;\n has[id] = null;\n watcher.run(); // in dev build, check and stop circular updates.\n\n if (\"development\" !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn('You may have an infinite update loop ' + (watcher.user ? \"in watcher with expression \\\"\" + watcher.expression + \"\\\"\" : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n } // keep copies of post queues before resetting state\n\n\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState(); // call component updated and activated hooks\n\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue); // devtool hook\n\n /* istanbul ignore if */\n\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "0a3add2c696ba7f05a3ede62bc248157", "score": "0.5258243", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now$1()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "e06a291758fce9d519e24cd09fa1f7aa", "score": "0.5253011", "text": "function scheduled(input, scheduler) {\n\t if (input != null) {\n\t if (isInteropObservable(input)) {\n\t return scheduleObservable(input, scheduler);\n\t }\n\t else if (isPromise(input)) {\n\t return schedulePromise(input, scheduler);\n\t }\n\t else if (isArrayLike(input)) {\n\t return scheduleArray(input, scheduler);\n\t }\n\t else if (isIterable(input) || typeof input === 'string') {\n\t return scheduleIterable(input, scheduler);\n\t }\n\t }\n\t throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n\t}", "title": "" }, { "docid": "2691374370fcc1161f515f42d305e3d9", "score": "0.525154", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n if (watcher.before) {\n watcher.before();\n }\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "2691374370fcc1161f515f42d305e3d9", "score": "0.525154", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n if (watcher.before) {\n watcher.before();\n }\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "2691374370fcc1161f515f42d305e3d9", "score": "0.525154", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n if (watcher.before) {\n watcher.before();\n }\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "9571168cf23c1a84ad5cd43ec55753ab", "score": "0.52470905", "text": "function flushSchedulerQueue() {\n currentFlushTimestamp = getNow();\n flushing = true;\n var watcher, id;\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(sortCompareFn);\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index$1 = 0; index$1 < queue.length; index$1++) {\n watcher = queue[index$1];\n if (watcher.before) {\n watcher.before();\n }\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn$2('You may have an infinite update loop ' +\n (watcher.user\n ? \"in watcher with expression \\\"\".concat(watcher.expression, \"\\\"\")\n : \"in a component render function.\"), watcher.vm);\n break;\n }\n }\n }\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n resetSchedulerState();\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n cleanupDeps();\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "4670569fa3a95696cf67a3d2c0c460ec", "score": "0.52256227", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if ( true && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "35381168f9898c5276474cc5c649f114", "score": "0.5223611", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index$1 = 0; index$1 < queue.length; index$1++) {\n watcher = queue[index$1];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdateHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "849a352e4fad99b017e8469b69222a0d", "score": "0.5212992", "text": "function scheduleRun(info, synclet) {\n var milliFreq = parseInt(synclet.frequency) * 1000;\n\n function run() {\n executeSynclet(info, synclet);\n }\n if(info.config && info.config.nextRun === -1) {\n // the synclet is paging and needs to run again immediately\n synclet.nextRun = new Date();\n process.nextTick(run);\n } else {\n if(info.config && info.config.nextRun > 0)\n synclet.nextRun = new Date(info.config.nextRun);\n else\n synclet.nextRun = new Date(synclet.nextRun);\n\n if(!(synclet.nextRun > 0)) //check to make sure it is a valid date\n synclet.nextRun = new Date();\n\n var timeout = (synclet.nextRun.getTime() - Date.now());\n timeout = timeout % milliFreq;\n if(timeout <= 0)\n timeout += milliFreq;\n\n // schedule a timeout with +- 5% randomness\n timeout = timeout + (((Math.random() - 0.5) * 0.1) * milliFreq);\n synclet.nextRun = new Date(Date.now() + timeout);\n\n setTimeout(run, timeout);\n }\n}", "title": "" }, { "docid": "8a5b5bd103415246820f5e51b6d02a67", "score": "0.52125907", "text": "function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if ((0,isPromise/* isPromise */.t)(input)) {\n return schedulePromise(input, scheduler);\n }\n else if ((0,isArrayLike/* isArrayLike */.z)(input)) {\n return (0,scheduleArray/* scheduleArray */.r)(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "11e678b1aeb7c15ea7ad318f34251f6f", "score": "0.52119714", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdateHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "df89e836ae5d32a9a65e47f440ca8ced", "score": "0.52089524", "text": "componentWillMount() {\n console.log('> componentWillMount() is called on Clock');\n this.tick();\n this.setState({\n timer: window.setInterval(this.tick.bind(this), 20)\n });\n }", "title": "" }, { "docid": "a63eea834ab176c230beb57de5cc2224", "score": "0.5208696", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTime();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "a63eea834ab176c230beb57de5cc2224", "score": "0.5208696", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTime();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" }, { "docid": "026efad5b66b7f374f157a7a86d860b3", "score": "0.52067024", "text": "function flushSchedulerQueue () {\n flushing = true;\n var watcher, id;\n\n // Sort queue before flush.\n // This ensures that:\n // 1. Components are updated from parent to child. (because parent is always\n // created before the child)\n // 2. A component's user watchers are run before its render watcher (because\n // user watchers are created before the render watcher)\n // 3. If a component is destroyed during a parent component's watcher run,\n // its watchers can be skipped.\n queue.sort(function (a, b) { return a.id - b.id; });\n\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index];\n id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (false) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > MAX_UPDATE_COUNT) {\n warn(\n 'You may have an infinite update loop ' + (\n watcher.user\n ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n : \"in a component render function.\"\n ),\n watcher.vm\n );\n break\n }\n }\n }\n\n // keep copies of post queues before resetting state\n var activatedQueue = activatedChildren.slice();\n var updatedQueue = queue.slice();\n\n resetSchedulerState();\n\n // call component updated and activated hooks\n callActivatedHooks(activatedQueue);\n callUpdatedHooks(updatedQueue);\n\n // devtool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n}", "title": "" } ]
ef76a47417905e80503bd41ccfa335d6
Called when the extension is deactivated (maybe multiple times)
[ { "docid": "f8d54a32065a066c3934d5923f1c1ea5", "score": "0.0", "text": "function disable() {\n statusArea_entry.destroy();\n timer.stop();\n}", "title": "" } ]
[ { "docid": "2ef16cb1c2c5d34765f6703da6bfa6f5", "score": "0.82104814", "text": "function deactivate() {\n console.log(\"Extension Deactivated\");\n}", "title": "" }, { "docid": "4a3c143c21cc55de0f914528e7a97335", "score": "0.77663386", "text": "function deactivate() {\r\n exports.output.appendLine(\"Deactivating extension.\");\r\n}", "title": "" }, { "docid": "2b02c834db739effb9a07fb1dc598b34", "score": "0.74447185", "text": "onDeactivate() {\r\n\r\n }", "title": "" }, { "docid": "318c9b1c01cb9087df724415d9b5ec0c", "score": "0.7371959", "text": "disconnectedCallback() {\n if (this.__observer && this.__observer.disconnect)\n this.__observer.disconnect();\n this.removeEventListener(\"a11y-tab-changed\", e => this.updateItems());\n this._unsetBreakpoints();\n super.disconnectedCallback();\n }", "title": "" }, { "docid": "ed37c86e3b6df1236963c78cdfd499f4", "score": "0.7303074", "text": "function deactivate () {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7239561", "text": "function deactivate() {}", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.72238487", "text": "function deactivate() { }", "title": "" } ]
3d352781f51fc8982f331541ff81b30a
Registers a loaded module. Should only be called from generated NgModuleFactory code.
[ { "docid": "15da34f4673f47759d8c3e15a121ba83", "score": "0.561538", "text": "function registerModuleFactory(id, factory) {\n var existing = moduleFactories.get(id);\n if (existing) {\n throw new Error(\"Duplicate module registered for \" + id + \" - \" + existing.moduleType.name + \" vs \" + factory.moduleType.name);\n }\n moduleFactories.set(id, factory);\n}", "title": "" } ]
[ { "docid": "cad135f6f40c44dc6ef47009bb791539", "score": "0.64505196", "text": "register(name, moduleClass, params = {}) {\n if (!params.hasOwnProperty('name')) {\n params.name = name\n }\n const module = new moduleClass(params)\n this._registry.set('modules', name, module)\n }", "title": "" }, { "docid": "069c00c7a9c98702195a65850bcaa8bd", "score": "0.61042005", "text": "function registerModuleFactory(id, factory) {\n var existing = modules.get(id);\n assertNotExisting(id, existing && existing.moduleType);\n modules.set(id, factory);\n}", "title": "" }, { "docid": "236cc924e305b426ff3fe9ee6300b1b4", "score": "0.6081611", "text": "function registerModule(ref, callback) {\n\t var id = ref.id;\n\t var name = ref.name;\n\t var dependencies = ref.dependencies; if ( dependencies === void 0 ) dependencies = [];\n\t var init = ref.init; if ( init === void 0 ) init = function(){};\n\t var getTransferables = ref.getTransferables; if ( getTransferables === void 0 ) getTransferables = null;\n\r\n\t // Only register once\r\n\t if (modules[id]) { return }\r\n\r\n\t try {\r\n\t // If any dependencies are modules, ensure they're registered and grab their value\r\n\t dependencies = dependencies.map(function (dep) {\r\n\t if (dep && dep.isWorkerModule) {\r\n\t registerModule(dep, function (depResult) {\r\n\t if (depResult instanceof Error) { throw depResult }\r\n\t });\r\n\t dep = modules[dep.id].value;\r\n\t }\r\n\t return dep\r\n\t });\r\n\r\n\t // Rehydrate functions\r\n\t init = rehydrate((\"<\" + name + \">.init\"), init);\r\n\t if (getTransferables) {\r\n\t getTransferables = rehydrate((\"<\" + name + \">.getTransferables\"), getTransferables);\r\n\t }\r\n\r\n\t // Initialize the module and store its value\r\n\t var value = null;\r\n\t if (typeof init === 'function') {\r\n\t value = init.apply(void 0, dependencies);\r\n\t } else {\r\n\t console.error('worker module init function failed to rehydrate');\r\n\t }\r\n\t modules[id] = {\r\n\t id: id,\r\n\t value: value,\r\n\t getTransferables: getTransferables\r\n\t };\r\n\t callback(value);\r\n\t } catch(err) {\r\n\t if (!(err && err.noLog)) {\r\n\t console.error(err);\r\n\t }\r\n\t callback(err);\r\n\t }\r\n\t }", "title": "" }, { "docid": "dc4ed3420c209a6fd7d152ffd7a5e745", "score": "0.6009847", "text": "function loadModule($module) {\n $module.appendTo(elem);\n elem.wrap(container);\n /* jshint indent:false */\n $compile(elem.contents())(newScope);\n elem.removeClass(\"ng-cloak\");\n }", "title": "" }, { "docid": "4ce86fb2f5dfd0cb62aa8e3ab6a8d742", "score": "0.6005739", "text": "function registerModuleFactory(id, factory) {\n var existing = modules.get(id);\n assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);\n modules.set(id, factory);\n }", "title": "" }, { "docid": "4ce86fb2f5dfd0cb62aa8e3ab6a8d742", "score": "0.6005739", "text": "function registerModuleFactory(id, factory) {\n var existing = modules.get(id);\n assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);\n modules.set(id, factory);\n }", "title": "" }, { "docid": "fde34aaf229e4ca0b8106d2c9a83450e", "score": "0.600038", "text": "function registerModule(moduleName, dependencies) {\n // Create angular module\n angular.module(moduleName, dependencies || []);\n // Add the module to the AngularJS configuration file\n angular.module(applicationModuleName).requires.push(moduleName);\n }", "title": "" }, { "docid": "755f658489abf3948215cacba6c87105", "score": "0.5977852", "text": "function addModule(moduleBased, module) {\n function addIndividualModule(module) {\n if (!mapNames[module.moduleName]) {\n mapNames[module.moduleName] = true;\n allModules.push(module);\n _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__[\"ModuleRegistry\"].register(module, moduleBased);\n }\n }\n addIndividualModule(module);\n if (module.dependantModules) {\n module.dependantModules.forEach(addModule.bind(null, moduleBased));\n }\n }", "title": "" }, { "docid": "13a5206575667d8c6f13f3e3231bc9ae", "score": "0.5925993", "text": "function registerModuleFactory(id, factory) {\n const existing = modules.get(id);\n assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);\n modules.set(id, factory);\n}", "title": "" }, { "docid": "d1afa5e9240ac2d57b5e4e4623697773", "score": "0.58846253", "text": "function registerModuleFactory(id,factory){var existing=moduleFactories.get(id);if(existing){throw new Error(\"Duplicate module registered for \"+id+\" - \"+existing.moduleType.name+\" vs \"+factory.moduleType.name);}moduleFactories.set(id,factory);}", "title": "" }, { "docid": "d36bc18ceb2bbbc654323d3a9024befb", "score": "0.5791112", "text": "register() {\n if (!window.require) {\n window.require = (modulesToLoad, callback) => {\n var promises = [];\n modulesToLoad.forEach((module) => {\n if (module.startsWith(\"text!\")) {\n promises.push(this.loader.loadText(module.substr(5)));\n } else {\n promises.push(this.loader.loadModule(module));\n }\n });\n\n Promise.all(promises).then((r) => {\n var results = [];\n r.forEach((element) => {\n var props = Object.keys(element);\n if (props.length === 1 && typeof element[props[0]] === \"function\") {\n results.push(element[props[0]]);\n } else {\n results.push(element);\n }\n });\n\n callback.apply(this, results);\n });\n };\n }\n }", "title": "" }, { "docid": "2b792609cd0551f171cbf48dcf363970", "score": "0.5743548", "text": "function addModule(module) {\n function addIndividualModule(module) {\n if (!mapNames[module.moduleName]) {\n mapNames[module.moduleName] = true;\n allModules.push(module);\n ModuleRegistry.register(module);\n }\n }\n addIndividualModule(module);\n if (module.dependantModules) {\n module.dependantModules.forEach(addModule);\n }\n }", "title": "" }, { "docid": "a5c8753bfe4bed9e7ac0613426f20571", "score": "0.5628659", "text": "registerLiveModule({module, registerFn}) {\n\n const moduleName = module.$name\n\n // Create a namespace for each module in our `state` variable in our container.\n\n this.createContainerStateNamespace(moduleName)\n\n // Register plugin.\n\n const live = new Outlet(this.container)\n live.moduleName = moduleName\n registerFn.call(module, live)\n\n }", "title": "" }, { "docid": "bd1ee5656261a9786504313e3313aa5a", "score": "0.562408", "text": "function registerModuleFactory(id, factory) {\n\t var existing = moduleFactories.get(id);\n\t if (existing) {\n\t throw new Error(\"Duplicate module registered for \" + id + \" - \" + existing.moduleType.name + \" vs \" + factory.moduleType.name);\n\t }\n\t moduleFactories.set(id, factory);\n\t }", "title": "" }, { "docid": "2d156e01e808dad5e77f9bee65bd57b3", "score": "0.54257375", "text": "function setLoaded() {\n if (moduleManager) {\n moduleManager.setLoaded();\n }\n}", "title": "" }, { "docid": "3a56fdda8e957a33e41af1eba55f2e30", "score": "0.53848326", "text": "register(/**Object*/ module) {\n\t\tthis.components.add(module);\n\t}", "title": "" }, { "docid": "555625ffb983075ecc087765213508ca", "score": "0.5381968", "text": "registerModule(id, options) {\n if (id in gRegisteredModules) {\n return;\n }\n\n if (!options) {\n throw new Error(\"ActorRegistry.registerModule requires an options argument\");\n }\n const {prefix, constructor, type} = options;\n if (typeof (prefix) !== \"string\") {\n throw new Error(`Lazy actor definition for '${id}' requires a string ` +\n `'prefix' option.`);\n }\n if (typeof (constructor) !== \"string\") {\n throw new Error(`Lazy actor definition for '${id}' requires a string ` +\n `'constructor' option.`);\n }\n if (!(\"global\" in type) && !(\"target\" in type)) {\n throw new Error(`Lazy actor definition for '${id}' requires a dictionary ` +\n `'type' option whose attributes can be 'global' or 'target'.`);\n }\n const name = prefix + \"Actor\";\n const mod = {\n id,\n prefix,\n constructorName: constructor,\n type,\n globalActor: type.global,\n targetScopedActor: type.target,\n };\n gRegisteredModules[id] = mod;\n if (mod.targetScopedActor) {\n this.addTargetScopedActor(mod, name);\n }\n if (mod.globalActor) {\n this.addGlobalActor(mod, name);\n }\n }", "title": "" }, { "docid": "b6e050a30491306f67eeb52bfac5c305", "score": "0.53491336", "text": "createModuleStoreInstance(storeName) {\n const storeModule = {\n namespaced: true,\n ...this.moduleStoreInstance\n }\n\n // we initialize the new dynamic module in the global store:\n store.registerModule(storeName, storeModule)\n }", "title": "" }, { "docid": "2d9ccfdff1a1038d952ef5567845a84d", "score": "0.5296726", "text": "function loadNg1Module(ngModule, appModule) {\n var module = Object.assign({}, BLANK_MODULE, appModule);\n ngModule.config(['$stateProvider', function ($stateProvider) { return module.states.forEach(function (state) { return $stateProvider.state(state); }); }]);\n Object.keys(module.components).forEach(function (name) { return ngModule.component(name, module.components[name]); });\n Object.keys(module.directives).forEach(function (name) { return ngModule.directive(name, module.directives[name]); });\n Object.keys(module.services).forEach(function (name) { return ngModule.service(name, module.services[name]); });\n Object.keys(module.filters).forEach(function (name) { return ngModule.filter(name, module.filters[name]); });\n module.configBlocks.forEach(function (configBlock) { return ngModule.config(configBlock); });\n module.runBlocks.forEach(function (runBlock) { return ngModule.run(runBlock); });\n return ngModule;\n}", "title": "" }, { "docid": "817e5ef80a75004a200575f9f37fcde6", "score": "0.5283261", "text": "function makeDefineVirtualModule(loader, load, addDep, args){\n\n\t\tfunction namer(loadName){\n\t\t\tvar baseName = loadName.substr(0, loadName.indexOf(\"!\"));\n\n\t\t\treturn function(part, plugin){\n\t\t\t\treturn baseName + \"/\" + part + (plugin ? (\".\" + plugin) : \"\");\n\t\t\t};\n\t\t}\n\n\t\tfunction addresser(loadAddress){\n\t\t\treturn function(part, plugin){\n\t\t\t\tvar base = loadAddress + \".\" + part;\n\t\t\t\treturn base + (plugin ? (\".\" + plugin) : \"\");\n\t\t\t};\n\t\t}\n\n\t\tvar name = namer(load.name);\n\t\tvar address = addresser(load.address);\n\n\t\t// A function for disposing of modules during live-reload\n\t\tvar disposeModule = function(moduleName){\n\t\t\tif(loader.has(moduleName))\n\t\t\t\tloader[\"delete\"](moduleName);\n\t\t};\n\t\tif(loader.liveReloadInstalled || loader.has(\"live-reload\")) {\n\t\t\tloader.import(\"live-reload\", { name: module.id }).then(function(reload){\n\t\t\t\tdisposeModule = reload.disposeModule || disposeModule;\n\t\t\t});\n\t\t}\n\n\t\treturn function(defn){\n\t\t\tif(defn.condition) {\n\t\t\t\tif(defn.arg) {\n\t\t\t\t\t// viewModel\n\t\t\t\t\targs.push(defn.arg);\n\t\t\t\t}\n\n\t\t\t\tvar moduleName = typeof defn.name === \"function\" ?\n\t\t\t\t\tdefn.name(name) : name(defn.name);\n\t\t\t\tvar moduleAddress = typeof defn.address === \"function\" ?\n\t\t\t\t\tdefn.address(address) : address(defn.address);\n\n\t\t\t\t// from=\"something.js\"\n\t\t\t\tif(defn.from) {\n\t\t\t\t\taddDep(defn.from, false);\n\t\t\t\t}\n\n\t\t\t\telse if(defn.getLoad) {\n\t\t\t\t\tvar moduleSource = defn.source();\n\t\t\t\t\treturn defn.getLoad(moduleName).then(function(newLoad){\n\t\t\t\t\t\tmoduleName = newLoad.name || moduleName;\n\n\t\t\t\t\t\t// For live-reload\n\t\t\t\t\t\tdisposeModule(moduleName);\n\n\t\t\t\t\t\tloader.define(moduleName, moduleSource, {\n\t\t\t\t\t\t\tmetadata: newLoad.metadata,\n\t\t\t\t\t\t\taddress: moduleAddress\n\t\t\t\t\t\t});\n\t\t\t\t\t\taddDep(moduleName);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\telse if(defn.source) {\n\t\t\t\t\taddDep(moduleName);\n\n\t\t\t\t\tif(loader.has(moduleName))\n\t\t\t\t\t\tloader[\"delete\"](moduleName);\n\n\t\t\t\t\tloader.define(moduleName, defn.source, {\n\t\t\t\t\t\taddress: address(defn.name)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7d14cab737e74916d417c47a34863ffa", "score": "0.5260248", "text": "function enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({ moduleType: moduleType, ngModule: ngModule });\n}", "title": "" }, { "docid": "0fb3c2c106afe71880c2db66a099b0fd", "score": "0.52528244", "text": "function moduleLoaded(libModule) {\r\n if (dso.global) {\r\n mergeLibSymbols(libModule);\r\n }\r\n dso.module = libModule;\r\n }", "title": "" }, { "docid": "69762615226fb3a8d41120dabf23e95a", "score": "0.5252161", "text": "function enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({ moduleType, ngModule });\n}", "title": "" }, { "docid": "18fac79251cff0203bf79a863b2b7550", "score": "0.5243515", "text": "function loadModule(module) {\n //Load module\n $.getScript(\"modules/\"+module+\"/\"+module+\".js\", function(data, textStatus, jqxhr) {\n //Store the module in loaded array\n loadedModules.push(module);\n //Execute the module\n window[module + \"_init\"]();\n });\n}", "title": "" }, { "docid": "84879b5f7dbeeb3598376222406f8b12", "score": "0.5209666", "text": "addModules() {\n }", "title": "" }, { "docid": "387f111a66ff6d4821c5b925b09bb32a", "score": "0.5198494", "text": "function enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({\n moduleType: moduleType,\n ngModule: ngModule\n });\n }", "title": "" }, { "docid": "387f111a66ff6d4821c5b925b09bb32a", "score": "0.5198494", "text": "function enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({\n moduleType: moduleType,\n ngModule: ngModule\n });\n }", "title": "" }, { "docid": "51e8a8121cf7c30d80e741f003faea0a", "score": "0.51711017", "text": "function loadModule(name, path) {\n require.cache[name] = {\n id: name,\n filename: name,\n loaded: true,\n exports: require(path)\n };\n \n var Module = require('module');\n var realResolve = Module._resolveFilename;\n Module._resolveFilename = function fakeResolve(request, parent) {\n if (request === name) {\n return name;\n }\n return realResolve(request, parent);\n };\n}", "title": "" }, { "docid": "eaf62c3cef33ae882f151276a95f6cd1", "score": "0.51345867", "text": "function register ( /* type, name, constructorOrDependencies, constructor */ ) {\n\n\t\tvar args = [].slice.call(arguments);\n\t\tvar moduleType = args[0];\n\t\tvar moduleName = args[1];\n\t\tvar dependencies = [];\n\t\tvar constructorFunction;\n\n\t\t// PREVENT FROM REDEFNING AN EXISTING MODULE\n\t\tif ( moduleName in bottle.container ) { throw Error('Redefining a component/service is not allowed.') }\n\n\t\t// IF SECOND\n\t\tif ( Array.isArray(args[2]) ) {\n\t\t\tdependencies = dependencies.concat(args[2]);\n\t\t\tconstructorFunction = args[3];\n\t\t}\n\t\telse {\n\t\t\tconstructorFunction = args[2];\n\t\t}\n\n\t\tconstructorFunction.prototype.name = moduleName;\n\t\tconstructorFunction.prototype.type = moduleType;\n\n\t\tbottle.service.apply(bottle, [moduleName, constructorFunction].concat(dependencies))\n\n\t}", "title": "" }, { "docid": "b3779efd6c9f57a47b28421e151797b2", "score": "0.5134337", "text": "function moduleLoaded(libModule) {\n if (dso.global) {\n mergeLibSymbols(libModule, lib);\n }\n dso.module = libModule;\n }", "title": "" }, { "docid": "7f9f2d975606cd0b39fb91b23a41dca0", "score": "0.5115073", "text": "function CustomModuleLoader() {\n HasteModuleLoader.apply(this, arguments); // super\n }", "title": "" }, { "docid": "d2d10fc59a2646f6ad1c3a1685a3d6ff", "score": "0.50745493", "text": "loadModuleStore(context) {\n // load module store\n if (typeof this.loadStore === 'function') {\n this.moduleStore = this.loadStore(context)\n this.createModuleStore(context)\n }\n }", "title": "" }, { "docid": "e99ce859829b5e4e3a3d5ad8ee74a8a9", "score": "0.5041599", "text": "function registerDeclarative (loader, load, link, declare) {\r\n var moduleObj = link.moduleObj;\r\n var importerSetters = load.importerSetters;\r\n\r\n var definedExports = false;\r\n\r\n // closure especially not based on link to allow link record disposal\r\n var declared = declare.call(envGlobal, function (name, value) {\r\n if (typeof name === 'object') {\r\n var changed = false;\r\n for (var p in name) {\r\n value = name[p];\r\n if (p !== '__useDefault' && (!(p in moduleObj) || moduleObj[p] !== value)) {\r\n changed = true;\r\n moduleObj[p] = value;\r\n }\r\n }\r\n if (changed === false)\r\n return value;\r\n }\r\n else {\r\n if ((definedExports || name in moduleObj) && moduleObj[name] === value)\r\n return value;\r\n moduleObj[name] = value;\r\n }\r\n\r\n for (var i = 0; i < importerSetters.length; i++)\r\n importerSetters[i](moduleObj);\r\n\r\n return value;\r\n }, new ContextualLoader(loader, load.key));\r\n\r\n link.setters = declared.setters || [];\r\n link.execute = declared.execute;\r\n if (declared.exports) {\r\n link.moduleObj = moduleObj = declared.exports;\r\n definedExports = true;\r\n }\r\n }", "title": "" }, { "docid": "782a33a09fac56a8224823a436fc6f77", "score": "0.5019698", "text": "use(moduleName, cb) {\n if (cb) {\n const moduleInfo = typeof moduleName === 'string' ? mparse.parseInfo(moduleName) : moduleName;\n if (!moduleInfo) {\n const message = Vue.prototype.$text('InvalidModuleName');\n throw new Error(`${message}: ${moduleName}`);\n }\n const relativeName = moduleInfo.relativeName;\n const module = this._get(relativeName);\n if (module) return cb(module);\n const moduleRepo = modulesRepo.modules[relativeName];\n if (!moduleRepo) {\n const message = Vue.prototype.$text('ModuleNotExists');\n throw new Error(`${message}: ${relativeName}`);\n }\n if (loadingQueue.push(relativeName, cb)) {\n try {\n if (moduleRepo.info.sync) {\n this._require(relativeName, module => loadingQueue.pop(relativeName, module));\n } else {\n this._import(relativeName)\n .then(module => loadingQueue.pop(relativeName, module))\n .catch(err => {\n loadingQueue.pop(relativeName, null, err);\n });\n }\n } catch (err) {\n loadingQueue.pop(relativeName, null, err);\n }\n }\n } else {\n return new Promise((resolve, reject) => {\n try {\n this.use(moduleName, (module, err) => {\n if (err) return reject(err);\n resolve(module);\n });\n } catch (err) {\n reject(err);\n }\n });\n }\n }", "title": "" }, { "docid": "77c7140508301f6a33710c73f8e74d1e", "score": "0.5014848", "text": "function register(ngModule) {\n\n if (!ngModule) {\n throw 'The given Angular module must not be null!';\n }\n if (!ngModule.directive || typeof ngModule.directive !== 'function') {\n throw 'Expected directive to be a function!';\n }\n\n // register the directive.\n ngModule.directive('badgerly', function () {\n return {\n restrict: 'EA',\n scope: {\n color: '@',\n size: '@',\n shape: '@',\n ribbon: '@',\n type: '@',\n border: '@'\n },\n transclude: true,\n template: '<div class=\"badge {{size}}\">'+\n '<div ng-show=\"type === \\'lanyard\\'\" class=\"lanyard\">'+\n '<div class=\"ribbon left {{ribbon}}\"></div>'+\n '<div class=\"ribbon right {{ribbon}}\"></div>'+\n '</div>'+\n '<div ng-show=\"type !== \\'lanyard\\'\" class=\"ribbon {{ribbon}}\">'+\n '</div>'+\n '<div class=\"{{shape}} {{color}}{{ (border === \\'yes\\' ? \\' border\\' : \\'\\') }}\" ng-transclude>'+\n '</div>'+\n '</div>'\n }\n });\n }", "title": "" }, { "docid": "2605ab3f6c247e9ee5d68e9aa5fb72e9", "score": "0.5005093", "text": "function importModule(dst, moduleName, isApp) {\r\n var subscope;\r\n if (modulesBeingLoaded[moduleName]) {\r\n // already loading this module\r\n internalError(\"Cyclic module dependency: \"+moduleName);\r\n }\r\n if (moduleObjects[moduleName]) {\r\n subscope = moduleObjects[moduleName];\r\n } else {\r\n modulesBeingLoaded[moduleName] = true;\r\n if (isApp)\r\n\tsubscope = appjet._native.importApp(moduleName);\r\n else \r\n\tsubscope = appjet._native.runLibrary('lib/'+moduleName);\r\n if (!subscope) {\r\n\tapiError(\"No such module: \"+moduleName);\r\n }\r\n moduleObjects[moduleName] = subscope; // cache\r\n delete modulesBeingLoaded[moduleName];\r\n }\r\n copyScope(subscope, dst);\r\n }", "title": "" }, { "docid": "e95f4d4caca037400263b10c19b6af92", "score": "0.49990922", "text": "function define(name, deps, fn) {\n if (modules[name]) {\n throw new Error(\"Module '\" + name + \"' already exists!!\");\n }\n deps = deps || [];\n deps = deps.map(function(depName) {\n if (!modules[depName]) {\n throw new Error(\"Dependency not found - \" + depName);\n } else if (depName == name) {\n throw new Error(\"A module cannot be dependent on itself\");\n }\n return modules[depName];\n });\n var newModule = fn.apply(null, deps);\n if (!newModule) {\n throw new Error(\"The module constructor for \" + name + \" returned an undefined value!!\");\n } else {\n modules[name] = newModule;\n }\n return newModule;\n }", "title": "" }, { "docid": "fcbbc0b4f8e8f00da8f8357ac95b4e6e", "score": "0.4993782", "text": "function define(name, dependencies, body) {\n\t\tif (!(dependencies instanceof Array)) {\n\t\t\tdependencies = [dependencies];\n\t\t}\n\t\tif (MODULES[name]) {\n\t\t\tthrow \"Module already defined\";\n\t\t}\n\t\tMODULES[name] = new Module(name, dependencies, body);\n\t}", "title": "" }, { "docid": "dbc537f4ae62de968db1f38df4bfd99e", "score": "0.49846774", "text": "function resolveModule(factory, deps)\n {\n if (!deps) {\n return factory();\n }\n\n return loadAll(deps).then(function(resolvedDeps) {\n loaded[name] = factory.apply(global, resolvedDeps);\n return loaded[name];\n });\n }", "title": "" }, { "docid": "eaccf5a71bedf776847969baa54362d9", "score": "0.4982829", "text": "function loadComponent(scope, module) {\n return async () => {\n // Initializes the share scope. This fills it with known provided modules from this build and all remotes\n await __webpack_init_sharing__(\"default\");\n const container = window[scope]; // or get the container somewhere else\n console.log('container', container);\n // Initialize the container, it may provide shared modules\n await container.init(__webpack_share_scopes__.default);\n const factory = await window[scope].get(module);\n const Module = factory();\n return Module;\n };\n}", "title": "" }, { "docid": "840b1d9acb1a9f3181de8f3917bb77f2", "score": "0.4977285", "text": "function module_init() {\n angular.module('nl.group_cache', [])\n .service('nlGroupCache', NlGroupCache);\n}", "title": "" }, { "docid": "d2c71f11e0035e8f8ae217f97f601170", "score": "0.49762595", "text": "function load(deps, factory) {\n if (!isArray(deps)) {\n if (typeof(deps) == 'function') {\n factory = deps;\n deps = [];\n } else {\n var argc = arguments.length;\n deps = Array.prototype.slice.call(arguments, 0, argc-1);\n factory = arguments[argc-1];\n }\n }\n \n log(\"ModuleJS: \"+self['id']+\": `module.load(\"+deps+\")` being called\");\n self._loadCalled = true;\n\n var _modules = [];\n for (var i=0, l=deps.length; i<l; i++) {\n var m = getModule(absolutize(parsed, deps[i]));\n if (!m['loaded']) {\n m['addListener'](function() {\n checkDeps(_modules, factory);\n });\n }\n _modules.push(m);\n }\n checkDeps(_modules, factory);\n return _modules;\n }", "title": "" }, { "docid": "3a5b4fe0de6a467f6d01ffd7abc2bda1", "score": "0.4958807", "text": "function InitialLoadModule()\n {\n registerHandlers();\n // GEEK: Load files that are used later, \n setTimeout('loadOtherFiles();',500);\n // Set a debugger option.\n if( isDebugMode() )\n {\n console.info(\"We are in DEBUG MODE\");\n }\n \n }", "title": "" }, { "docid": "3ac9b4d0aa5222f8dd1066165684fdef", "score": "0.495492", "text": "function addModule(deps, scripts, path, interval)\n\t\t\t{\n\t\t\t\tvar depsReady = true;\n\n\t\t\t\tfor(var i = 0; i < deps.length; ++i)\n\t\t\t\t\tif(!(depsReady = depsReady * hasChild(window, deps[i])))\n\t\t\t\t\t\tif(interval > timeout) //throw an error if the dependency is not loaded within 1000ms (the number is 500 as we have to add the previous waits too)\n\t\t\t\t\t\t\tthrow ('Could not load dependency: ' + deps[i]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\tif(depsReady)\n\t\t\t\t\tfor(var i in scripts)\n\t\t\t\t\t\taddScript(path + scripts[i] + '.js');\n\t\t\t\t\t\t//console.log(path + scripts[i] + '.js');\n\n\t\t\t\telse\n\t\t\t\t\tsetTimeout(function()\n\t\t\t\t\t{\n\t\t\t\t\t\taddModule(deps, scripts, path, interval = interval * 2);\n\n\t\t\t\t\t}, interval);\n\t\t\t}", "title": "" }, { "docid": "ce20849ab0e0deb46a938a89b6648848", "score": "0.49391526", "text": "function registerDeclarative (loader, load, link, declare) {\n var moduleObj = link.moduleObj;\n var importerSetters = load.importerSetters;\n\n var locked = false;\n\n // closure especially not based on link to allow link record disposal\n var declared = declare.call(envGlobal, function (name, value) {\n // export setter propogation with locking to avoid cycles\n if (locked)\n return;\n\n if (typeof name === 'object') {\n for (var p in name)\n if (p !== '__useDefault')\n moduleObj[p] = name[p];\n }\n else {\n moduleObj[name] = value;\n }\n\n locked = true;\n for (var i = 0; i < importerSetters.length; i++)\n importerSetters[i](moduleObj);\n locked = false;\n\n return value;\n }, new ContextualLoader(loader, load.key));\n\n link.setters = declared.setters;\n link.execute = declared.execute;\n if (declared.exports)\n link.moduleObj = moduleObj = declared.exports;\n}", "title": "" }, { "docid": "b8c66238401b978a0c8334c71f16a04a", "score": "0.49166584", "text": "function module_init() {\n\tangular.module('nl.nittiolesson.page_voice', [])\n\t.service('NittioLessonAddPageVoice', NittioLessonAddPageVoiceDlg);\n}", "title": "" }, { "docid": "0fb30c5f7f7a9f008a40714de36359d7", "score": "0.49037468", "text": "function injectDummy() {\n if (!appInfo.isPrototype) {\n return;\n }\n\n ngModules.push(require('dummy/dummy'));\n}", "title": "" }, { "docid": "5cd25e8246d904d4f356ff6aa8924042", "score": "0.4894917", "text": "function registerNativeModule(uri, f) {\n if (typeof uri !== 'string') {\n throw new SlumberError(\n \"Tried to register a native module where uri was not string: \" +\n uri);\n }\n if (typeof f !== 'function' || f.length !== 0) {\n throw new SlumberError(\n \"The second argument to 'registerNativeModule' must be a function \" +\n \"that accepts zero arguments and returns a scope object: \" + f);\n }\n if (importSources.has(uri) || nativeSources.has(uri)) {\n throw new SlumberError(\n \"A module with uri = \" + uri + \" is already registered\");\n }\n nativeSources.set(uri, f);\n}", "title": "" }, { "docid": "26c13a9e784920184c022fb88c296ff7", "score": "0.4893241", "text": "function _initModule(){\n //console.log('[ neatFramework_JSON_module.js ] : ' + 'initiating module ..'); // debug message > module is registered\n consoleLog('[ neatFramework_JSON_MODULE.js ] : ' + 'initiating module ..', 'color: #1DCFD8;');\n _initial_setup_module_init(); // actually init the module's 'initial setup' config/params (..)\n }", "title": "" }, { "docid": "6f74a99dfd3b2998e6f81b8a20cc0b03", "score": "0.4882463", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n } // This uses a switch for static require analysis\n\n\n switch (moduleName) {\n case 'charset':\n module = charset;\n break;\n\n case 'encoding':\n module = encoding;\n break;\n\n case 'language':\n module = language;\n break;\n\n case 'mediaType':\n module = mediaType;\n break;\n\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n } // Store to prevent invoking require()\n\n\n modules[moduleName] = module;\n return module;\n}", "title": "" }, { "docid": "2e02463980bd7ff5409efa435669b696", "score": "0.48824003", "text": "function ModuleWithProviders(){}", "title": "" }, { "docid": "ec4ec903b695db38afac1ab2104fdb2f", "score": "0.48782358", "text": "function createModule(id) {\n var self = this;\n var parsed = parseUri(id);\n self['id'] = id;\n // Set up the 'exports' object\n self['exports'] = {};\n // Set up the 'module' object\n self['module'] = {\n 'provide': provide,\n 'exports': self['exports'],\n 'load': load,\n 'define': define,\n 'id': id\n };\n\n // The 'module.load' function. Accepts an array of module ids that are\n // dependencies. If/Once they're all loaded, the 'factory' function is invoked\n // `module.load` is allowed to be called multiple times in a module, but only\n // a call during the top-level execution of the script will have it's 'exports'\n // properly visisble to other modules.\n // The low-level 'Module' instances are returned in an Array\n function load(deps, factory) {\n if (!isArray(deps)) {\n if (typeof(deps) == 'function') {\n factory = deps;\n deps = [];\n } else {\n var argc = arguments.length;\n deps = Array.prototype.slice.call(arguments, 0, argc-1);\n factory = arguments[argc-1];\n }\n }\n \n log(\"ModuleJS: \"+self['id']+\": `module.load(\"+deps+\")` being called\");\n self._loadCalled = true;\n\n var _modules = [];\n for (var i=0, l=deps.length; i<l; i++) {\n var m = getModule(absolutize(parsed, deps[i]));\n if (!m['loaded']) {\n m['addListener'](function() {\n checkDeps(_modules, factory);\n });\n }\n _modules.push(m);\n }\n checkDeps(_modules, factory);\n return _modules;\n }\n\n // Called during `module.load`, and once for every dependency that still\n // needs to be loaded's load callback\n function checkDeps(_modules, factory) {\n var loaded = true;\n for (var i=0, l = _modules.length; i<l; i++) {\n var m = _modules[i];\n if (!m['loaded']) {\n loaded = false;\n break;\n }\n }\n if (loaded) {\n if (factory) {\n executeFactory(_modules, factory); \n }\n if (self._notifyLoaded) // Not on the global 'main' module\n self._notifyLoaded();\n }\n }\n\n // Executes the specifies factory function with the specified module dependencies\n function executeFactory(_modules, factory) {\n log(\"ModuleJS: \"+self['id']+\": Executing Module Factory\");\n\n // At this point, we know that any deps are loaded, so get the\n // 'exports' object from the loaded Module instance.\n var deps = [];\n for (var i=0, l=_modules.length; i<l; i++) {\n deps[i] = _modules[i]['exports'];\n }\n var depsName = randomVarName();\n var factoryName = randomVarName();\n self['global'][depsName] = deps;\n self['global'][factoryName] = factory;\n // Eval in the module's isolated Sandbox\n var rtn = self.eval('(function() { '+\n 'var rtn = this[\"'+factoryName+'\"].apply(exports, this[\"'+depsName+'\"]); '+\n 'try {'+\n 'delete this[\"'+depsName+'\"];'+\n 'delete this[\"'+factoryName+'\"];'+\n '} catch(e){}'+\n 'return rtn; })()');\n if (!!self['global'][depsName]) {\n self['global'][depsName] = undefined;\n }\n if (!!self['global'][factoryName]) {\n self['global'][factoryName] = undefined;\n }\n if (self['module']['exports'] !== self['exports']) {\n // 'module.exports' property was directly set\n log(\"ModuleJS: \"+self['id']+\": `module.exports` was set inside factory\");\n self['exports'] = self['module']['exports'];\n } else if (!!rtn && rtn !== self['exports']) {\n // something was 'return'ed from the factory function\n log(\"ModuleJS: \"+self['id']+\": Object returned from factory function\");\n self['exports'] = rtn;\n }\n }\n\n\n }", "title": "" }, { "docid": "1d76fae5fc159fa723ebfb75eeace563", "score": "0.48769864", "text": "ensureRecord () {\n const S = this.System;\n const records = S._loader.moduleRecords;\n if (records[this.id]) return records[this.id];\n\n // see SystemJS getOrCreateModuleRecord\n return records[this.id] = {\n name: this.id,\n exports: S.newModule({}),\n dependencies: [],\n importers: [],\n setters: []\n };\n }", "title": "" }, { "docid": "4e67cdaf5f32476dcc2006894ecd17a7", "score": "0.4864487", "text": "function module_init() {\n angular.module('nl.module', []).config(configFn)\n .controller('nl.LessonPlayer', LessonPlayerCtrl)\n}", "title": "" }, { "docid": "f921b9131c7ce293991ff9711287c189", "score": "0.48429108", "text": "load() {\n let moduleOptions = this.app.storage.getModuleOptionsByName(this.name);\n if(moduleOptions) {\n if(!moduleOptions.storage) {\n moduleOptions.storage = {};\n this.save();\n }\n this.optionsStorage = moduleOptions.storage;\n } else {\n throw \"Module Not Installed: \" + this.name;\n }\n }", "title": "" }, { "docid": "9f5804181c38af81f9afe21a5fa216d1", "score": "0.48113889", "text": "function loadModule(moduleName) {\n\t var module = modules[moduleName];\n\n\t if (module !== undefined) {\n\t return module;\n\t }\n\n\t // This uses a switch for static require analysis\n\t switch (moduleName) {\n\t case 'charset':\n\t module = __webpack_require__(84);\n\t break;\n\t case 'encoding':\n\t module = __webpack_require__(85);\n\t break;\n\t case 'language':\n\t module = __webpack_require__(86);\n\t break;\n\t case 'mediaType':\n\t module = __webpack_require__(87);\n\t break;\n\t default:\n\t throw new Error('Cannot find module \\'' + moduleName + '\\'');\n\t }\n\n\t // Store to prevent invoking require()\n\t modules[moduleName] = module;\n\n\t return module;\n\t}", "title": "" }, { "docid": "ecc402e458d3a265f0f23d98fc91da37", "score": "0.48006633", "text": "function loadModule(moduleName) {\n\t var module = modules[moduleName];\n\n\t if (module !== undefined) {\n\t return module;\n\t }\n\n\t // This uses a switch for static require analysis\n\t switch (moduleName) {\n\t case 'charset':\n\t module = __webpack_require__(70);\n\t break;\n\t case 'encoding':\n\t module = __webpack_require__(71);\n\t break;\n\t case 'language':\n\t module = __webpack_require__(72);\n\t break;\n\t case 'mediaType':\n\t module = __webpack_require__(73);\n\t break;\n\t default:\n\t throw new Error('Cannot find module \\'' + moduleName + '\\'');\n\t }\n\n\t // Store to prevent invoking require()\n\t modules[moduleName] = module;\n\n\t return module;\n\t}", "title": "" }, { "docid": "b4d293ae28b9c8a3aea1838ec443224e", "score": "0.4800527", "text": "load(moduleName, path, className){\n\n var ModuleClass;\n if (path instanceof Function) {\n this._logger.debug('## Detecting module type for %s. Class-Function detected.', moduleName);\n ModuleClass = path;\n } else {\n this._logger.debug('## Detecting module type for %s. Local path detected \\'%s\\'', moduleName, path);\n ModuleClass = require(path);\n }\n\n // Initializing module\n var moduleInstance = new ModuleClass();\n\n // Set modules Map\n this._modules[moduleName] = moduleInstance;\n this._moduleQueue.push({name: moduleName, module: moduleInstance});\n this[moduleName] = moduleInstance;\n }", "title": "" }, { "docid": "4bf1bb26ec4f6756ec7fa781e68f44fa", "score": "0.47990182", "text": "function makeDependencyModule(name, lib, ngApp){\n var dependencyModule = {\n name : name\n ,factory: function(){\n ngApp.factory.apply(null, arguments);\n return dependencyModule;\n }\n ,directive: function(){\n ngApp.directive.apply(null, arguments);\n return dependencyModule;\n }\n ,filter: function(){\n ngApp.filter.apply(null, arguments);\n return dependencyModule;\n }\n ,controller: function(){\n ngApp.controller.apply(null, arguments);\n return dependencyModule;\n }\n ,provider: function(){\n ngApp.provider.apply(null, arguments);\n return dependencyModule;\n }\n ,service: function(){\n ngApp.service.apply(null, arguments);\n return dependencyModule\n }\n ,run: function(block){\n lib.preRegister(function runModule(config, settings){\n lib.injector.invoke(block);\n });\n return dependencyModule;\n }\n ,value: function(){\n ngApp.value.apply(null, arguments);\n return dependencyModule;\n }\n ,contant: function(){\n ngApp.constant.apply(null, arguments);\n return dependencyModule;\n }\n ,animation: function(){\n ngApp.animation.apply(null, arguments);\n return dependencyModule;\n }\n // TODO only config() is not working\n ,config: function(block){\n console.warn('Feature is not available. Config is not supported for modules registered after this ComponentModule. Use angular._module, or adding directly to initial dependencies.',block);\n // console.warn('Invoking config and if done async this will prob fail')\n // lib.preRegister(function runModule(config, settings){\n // lib.injector.invoke(block);\n // });\n return dependencyModule;\n }\n }\n}", "title": "" }, { "docid": "d9f08ca8c754be244410fd73df403e53", "score": "0.47937438", "text": "function registerModulePath(sModuleNamePrefix, vUrlPrefix) {\n\t\tLoaderExtensions.registerResourcePath(sModuleNamePrefix.replace(/\\./g, \"/\"), vUrlPrefix);\n\t}", "title": "" }, { "docid": "7d29cc92f058b04da819fd44df53e371", "score": "0.47929904", "text": "function loadModule(moduleName) {\n\t var module = modules[moduleName];\n\n\t if (module !== undefined) {\n\t return module;\n\t }\n\n\t // This uses a switch for static require analysis\n\t switch (moduleName) {\n\t case 'charset':\n\t module = __webpack_require__(623);\n\t break;\n\t case 'encoding':\n\t module = __webpack_require__(624);\n\t break;\n\t case 'language':\n\t module = __webpack_require__(625);\n\t break;\n\t case 'mediaType':\n\t module = __webpack_require__(626);\n\t break;\n\t default:\n\t throw new Error('Cannot find module \\'' + moduleName + '\\'');\n\t }\n\n\t // Store to prevent invoking require()\n\t modules[moduleName] = module;\n\n\t return module;\n\t}", "title": "" }, { "docid": "8da72e73ef440da6a1495ff4e2ec798f", "score": "0.47882807", "text": "function define(id, url, dependencies, factory) {\n\t\tcheckLegalId(id);\n\t\tcheckLegalId(url);\n\t\treturn cacheModule[id] = cacheModule[url] = new Module(id, dependencies, factory);\n\t}", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.4780636", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.4780636", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "4cf5f5cacf6a26c8343f123f23c1cb3e", "score": "0.47664267", "text": "function start() {\n loadModuleRegistry()\n .then(() => {\n subscriber.subscribe('module.check');\n subscriber.on('message', notifyModuleUpdate);\n });\n}", "title": "" }, { "docid": "3bb4a2268d17d412157c30868623500d", "score": "0.47561604", "text": "function load(module, ready) {\n\t\tif (isReady(module)) {\n\t\t\tready.call();\n\t\t} else {\n\t\t\tonReady(module, ready);\n\t\t\tif (STACK.indexOf(module) < 0) {\n\t\t\t\tSTACK.push(module);\n\t\t\t\tloadScript(module);\n\t\t\t} else if (MODULES[module]) {\n\t\t\t\tthrow \"Circular module dependency: \" + module;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "449096efef00d874db526faa47ebe01b", "score": "0.47551247", "text": "testLoadWhenInitializing() {\n const mm = getModuleManager({'a': []});\n mm.setLoader(createSuccessfulNonBatchLoader(mm));\n\n const info = {'a': {ctor: AModule, count: 0}};\n function AModule() {\n ++info['a'].count;\n BaseModule.call(this);\n }\n goog.inherits(AModule, BaseModule);\n AModule.prototype.initialize = () => {\n mm.load('a');\n };\n mm.setLoader(createSuccessfulNonBatchLoaderWithConstructor(mm, info));\n mm.preloadModule('a');\n clock.tick(5);\n assertEquals(info['a'].count, 1);\n }", "title": "" }, { "docid": "9b641a072f4caefe08bdb55e5f9977cb", "score": "0.4745901", "text": "function ngLoaded() {\n if (!window.angular) {\n return false;\n }\n try {\n window.angular.module('ng');\n } catch (e) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "d124a1d8cbae1cb73be234158d100f66", "score": "0.47442204", "text": "function ModuleWithProviders() {}", "title": "" }, { "docid": "9d7f8d44b56acd324930a5c3cf7ec611", "score": "0.4732157", "text": "function requireOne(modulePath) {\n // Module already loaded? Return it straight away.\n if (defined[modulePath]) {\n return Promise.resolve(defined[modulePath]);\n }\n\n // There's already a `define` in the window, and it's not ours.\n if (!define.amd || !define.amd.fetchamd) {\n throw new Error('Incompatible mix of defines found in page.');\n }\n\n // Insert a global define method, because that's what AMD scripts look\n // for. This may interfere with other scripts, so we try to keep it\n // global for as short a time as possible.\n window.define = define;\n modulesCount += 1;\n\n return scriptLoad(modulePath)\n .then(() => {\n modulesCount -= 1;\n\n if (modulesCount === 0) {\n // Remove it so it has less chance to interfere with anything.\n window.define = undefined;\n }\n\n // Make a copy because we may clobber it fetching extra deps.\n const thisDefine = { ...lastDefine };\n\n // Fetch any extra dependencies if required\n if (thisDefine.deps && thisDefine.deps.length) {\n throw new Error(\n `fetchamd: don't use second level dependencies: ${modulePath}`,\n );\n }\n\n if (thisDefine) {\n // Apply the factory.\n // https://github.com/amdjs/amdjs-api/wiki/AMD#factory-\n if (typeof thisDefine.factory === 'function') {\n // factory, is a fn that should be executed to\n // instantiate the module. Tt should only be\n // executed once.\n defined[modulePath] = thisDefine.factory.apply(this, []);\n } else if (typeof thisDefine.factory === 'object') {\n // If the factory argument is an object, that object\n // should be assigned as the exported value.\n defined[modulePath] = thisDefine.factory;\n }\n }\n\n // Reply with the last define we defined.\n return defined[modulePath];\n });\n }", "title": "" }, { "docid": "26f251f3b45572f4e0191fa04948df6b", "score": "0.47105008", "text": "function initModule(mage, name, cb) {\n\tif (!mage.isConfigured()) {\n\t\treturn cb(new MageNotConfiguredError());\n\t} else if (mage[name]) {\n\t\treturn cb(new Error('Cannot register module \"' + name + '\". This is a reserved name.'));\n\t}\n\n\tvar mod = {};\n\tmodules[name] = mage[name] = mod;\n\n\tvar commands = mage.config.server.commandCenter.commands[name];\n\n\tif (commands && commands.length > 0) {\n\t\tfor (var j = 0; j < commands.length; j += 1) {\n\t\t\tvar cmd = commands[j];\n\n\t\t\tmod[cmd.name] = createUserCommand(mage.commandCenter, name, cmd.name, cmd.params || []);\n\t\t}\n\t}\n\n\tmage.emit('created.' + name, mod);\n\n\treturn cb(null);\n}", "title": "" }, { "docid": "a2fcdc03d653953066cad7acc8c0e5a8", "score": "0.4710261", "text": "testLoadWhenLoaded() {\n const mm = getModuleManager({'a': [], 'b': [], 'c': []});\n mm.setLoader(createSuccessfulNonBatchLoader(mm));\n\n let calledBack = false;\n let error = null;\n\n mm.preloadModule('b', 2);\n clock.tick(10);\n\n assertFalse('module \"b\" should be done loading', mm.isModuleLoading('b'));\n\n const d = mm.load('b');\n d.then(\n (ctx) => {\n calledBack = true;\n },\n (err) => {\n error = err;\n });\n\n clock.tick(1);\n assertTrue(calledBack);\n assertNull(error);\n }", "title": "" }, { "docid": "fdb40d14a965e8415d2d94364b7ddc83", "score": "0.47065717", "text": "function registerNativeModulePods(name, dependencyConfig, iOSProject) {\n const podLines = (0, _readPodfile.default)(iOSProject.podfile);\n const linesToAddEntry = getLinesToAddEntry(podLines, iOSProject);\n (0, _addPodEntry.default)(podLines, linesToAddEntry, dependencyConfig.podspec, name);\n (0, _savePodFile.default)(iOSProject.podfile, podLines);\n}", "title": "" }, { "docid": "693a3135bfe38b49fe1802a92af172a6", "score": "0.47033498", "text": "createModuleNode(node, name) {\n if (Object.keys(this._modules).includes(name)) {\n return this._modules[name];\n }\n\n const module = new _module.default(node, name);\n this._modules[name] = module;\n return module;\n }", "title": "" }, { "docid": "b0810e9f92d76b5af5004fb00aa4238a", "score": "0.47004223", "text": "function AngularModule() {\n }", "title": "" }, { "docid": "647e97cece604bc3312a604faf1026ba", "score": "0.46853718", "text": "function initModuleFn () { }", "title": "" }, { "docid": "525a0b56284a06d444d78efb97a2457c", "score": "0.46843517", "text": "function register(moduleName, unexpectedParameter) {\n //if (TRACKING) console.log('Entering register()');\n if (TYPE_CHECKING) {\n if (typeof moduleName === 'undefined') {\n throw new Error('MediaWiki:Common/throw 5: The parameter \"moduleName\" is missing.');\n }\n if (typeof moduleName !== 'string') {\n throw new Error('MediaWiki:Common/throw 6: Expected that the type of parameter \"moduleName\"'\n + ' is \"string\" but it\\'s \"' + typeof moduleName + '\".');\n }\n if (typeof unexpectedParameter !== 'undefined') {\n throw new Error('MediaWiki:Common/throw 7: Expected 1 parameter, but got more parameters ' +\n 'than that.');\n }\n }\n mNamesOfModulesToInclude.push(moduleName);\n //if (TRACKING) console.log('Leaving register()');\n }", "title": "" }, { "docid": "585c39ca558aa1359e9010a34b05deee", "score": "0.46711063", "text": "function register(){\r\n // TODO \r\n }", "title": "" }, { "docid": "1ef49ace62c8c96215c69a5928027aea", "score": "0.46690026", "text": "function actuallyAdd(moduleName, indent ){\n\n hotplate.log( i(indent) + \"Called actuallyAdd() on %s\", moduleName );\n // hotplate.log( i(indent) + \"loadStatus is: \", loadStatus );\n if( loadStatus[ moduleName ] == 'NOT_ADDED' ){\n hotplate.log( i(indent) + \"Initialising module %s, since it hadn't been initialised yet\", moduleName );\n loadStatus[ moduleName ] = 'ADDED';\n hotplate.log( i(indent) + \"Module %s set as 'ADDED'\", moduleName );\n orderedList.push(moduleName);\n } else {\n hotplate.log( i(indent) + \"Module %s not initialised, as its status was %s, nothing to do!\", moduleName, loadStatus[ moduleName ]);\n }\n }", "title": "" }, { "docid": "34e3096438f1891488161686ee860d90", "score": "0.4660771", "text": "function loadModules() {\r\n for(var i = 0; i < iceModules.length; i++) {\r\n var file = iceFolder + iceModules[i];\r\n if(fs.isFile(file)){\r\n phantom.injectJs(file);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "537c83d6d0bc0562fd0abc903d00f4f2", "score": "0.46597236", "text": "importModule(name) { todo(\"importModule\") }", "title": "" }, { "docid": "2ecafcdef3e26b9a14a6225dcabb32a1", "score": "0.46576968", "text": "function loadModule() {\n // The first thread to load a given module needs to allocate the static\n // table and memory regions. Later threads re-use the same table region\n // and can ignore the memory region (since memory is shared between\n // threads already).\n var needsAllocation = !handle || !HEAP8[(((handle)+(24))>>0)];\n if (needsAllocation) {\n // alignments are powers of 2\n var memAlign = Math.pow(2, metadata.memoryAlign);\n // finalize alignments and verify them\n memAlign = Math.max(memAlign, STACK_ALIGN); // we at least need stack alignment\n // prepare memory\n var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0; // TODO: add to cleanups\n var tableBase = metadata.tableSize ? wasmTable.length : 0;\n if (handle) {\n HEAP8[(((handle)+(24))>>0)] = 1;\n HEAPU32[(((handle)+(28))>>2)] = memoryBase;\n HEAP32[(((handle)+(32))>>2)] = metadata.memorySize;\n HEAPU32[(((handle)+(36))>>2)] = tableBase;\n HEAP32[(((handle)+(40))>>2)] = metadata.tableSize;\n }\n } else {\n memoryBase = HEAPU32[(((handle)+(28))>>2)];\n tableBase = HEAPU32[(((handle)+(36))>>2)];\n }\n \n var tableGrowthNeeded = tableBase + metadata.tableSize - wasmTable.length;\n if (tableGrowthNeeded > 0) {\n wasmTable.grow(tableGrowthNeeded);\n }\n \n // This is the export map that we ultimately return. We declare it here\n // so it can be used within resolveSymbol. We resolve symbols against\n // this local symbol map in the case there they are not present on the\n // global Module object. We need this fallback because:\n // a) Modules sometime need to import their own symbols\n // b) Symbols from side modules are not always added to the global namespace.\n var moduleExports;\n \n function resolveSymbol(sym) {\n var resolved = resolveGlobalSymbol(sym, false);\n if (!resolved) {\n resolved = moduleExports[sym];\n }\n return resolved;\n }\n \n // TODO kill ↓↓↓ (except \"symbols local to this module\", it will likely be\n // not needed if we require that if A wants symbols from B it has to link\n // to B explicitly: similarly to -Wl,--no-undefined)\n //\n // wasm dynamic libraries are pure wasm, so they cannot assist in\n // their own loading. When side module A wants to import something\n // provided by a side module B that is loaded later, we need to\n // add a layer of indirection, but worse, we can't even tell what\n // to add the indirection for, without inspecting what A's imports\n // are. To do that here, we use a JS proxy (another option would\n // be to inspect the binary directly).\n var proxyHandler = {\n 'get': function(stubs, prop) {\n // symbols that should be local to this module\n switch (prop) {\n case '__memory_base':\n return memoryBase;\n case '__table_base':\n return tableBase;\n }\n if (prop in asmLibraryArg) {\n // No stub needed, symbol already exists in symbol table\n return asmLibraryArg[prop];\n }\n // Return a stub function that will resolve the symbol\n // when first called.\n if (!(prop in stubs)) {\n var resolved;\n stubs[prop] = function() {\n if (!resolved) resolved = resolveSymbol(prop);\n return resolved.apply(null, arguments);\n };\n }\n return stubs[prop];\n }\n };\n var proxy = new Proxy({}, proxyHandler);\n var info = {\n 'GOT.mem': new Proxy({}, GOTHandler),\n 'GOT.func': new Proxy({}, GOTHandler),\n 'env': proxy,\n wasi_snapshot_preview1: proxy,\n };\n \n function postInstantiation(instance) {\n // add new entries to functionsInTableMap\n updateTableMap(tableBase, metadata.tableSize);\n moduleExports = relocateExports(instance.exports, memoryBase);\n if (!flags.allowUndefined) {\n reportUndefinedSymbols();\n }\n \n // initialize the module\n var init = moduleExports['__wasm_call_ctors'];\n if (init) {\n if (runtimeInitialized) {\n init();\n } else {\n // we aren't ready to run compiled code yet\n __ATINIT__.push(init);\n }\n }\n return moduleExports;\n }\n \n if (flags.loadAsync) {\n if (binary instanceof WebAssembly.Module) {\n var instance = new WebAssembly.Instance(binary, info);\n return Promise.resolve(postInstantiation(instance));\n }\n return WebAssembly.instantiate(binary, info).then(function(result) {\n return postInstantiation(result.instance);\n });\n }\n \n var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary);\n var instance = new WebAssembly.Instance(module, info);\n return postInstantiation(instance);\n }", "title": "" }, { "docid": "a003e6d95052c2d08d48706d86ccb483", "score": "0.46560693", "text": "function angularModule(angular) {\n var prevCallback = Raven._globalOptions.dataCallback;\n angularPlugin(Raven, angular);\n\n // Hack: Ensure that both our data callback and the one provided by\n // the Angular plugin are run when submitting errors.\n //\n // The Angular plugin replaces any previously installed\n // data callback with its own which does not in turn call the\n // previously registered callback that we registered when calling\n // Raven.config().\n //\n // See https://github.com/getsentry/raven-js/issues/522\n var angularCallback = Raven._globalOptions.dataCallback;\n Raven.setDataCallback(function (data) {\n return angularCallback(prevCallback(data));\n });\n return angular.module('ngRaven');\n}", "title": "" }, { "docid": "1f669596d3d30ba9e3524db091933dae", "score": "0.46523836", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = require('./lib/charset');\n break;\n case 'encoding':\n module = require('./lib/encoding');\n break;\n case 'language':\n module = require('./lib/language');\n break;\n case 'mediaType':\n module = require('./lib/mediaType');\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n }", "title": "" }, { "docid": "939225ebd537a6059d85e25e78ec4b39", "score": "0.464874", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(420);\n break;\n case 'encoding':\n module = __webpack_require__(421);\n break;\n case 'language':\n module = __webpack_require__(422);\n break;\n case 'mediaType':\n module = __webpack_require__(423);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "title": "" }, { "docid": "36b0b1b4009bae9e94daf3b98b271cba", "score": "0.4648078", "text": "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "title": "" }, { "docid": "36b0b1b4009bae9e94daf3b98b271cba", "score": "0.4648078", "text": "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "title": "" }, { "docid": "2fc946f954b287c9b0eaaf71cfcc579a", "score": "0.4645317", "text": "function inject(id, exports) {\n var module = getModuleDescriptor(id);\n module.exports = exports;\n module.location = URL.resolve(config.location, id);\n module.directory = URL.resolve(module.location, \"./\");\n module.injected = true;\n delete module.redirect;\n delete module.mappingRedirect;\n }", "title": "" }, { "docid": "7ef32691a27d4dec18bccc2077511b17", "score": "0.4639495", "text": "function addComponent(appContext, isProvider, moduleRuntimeInfo, annotationValues, functionRuntimeInfo) {\n var usedAnnotations = AnnotatoinHelper.flattenAnnotations(annotationValues);\n if(usedAnnotations.length == 0 && !isProvider){\n usedAnnotations.push(moduleRuntimeInfo.name);\n }\n var toAdd = new ComponentInformation();\n toAdd.moduleName = moduleRuntimeInfo.name;\n if (isProvider && functionRuntimeInfo) {\n toAdd.functionName = functionRuntimeInfo.name;\n } else if (moduleRuntimeInfo.isCallable) {\n toAdd.functionName = \"\";\n } else if(!isProvider){\n toAdd.functionName = undefined;\n }else{\n throw new Error(\"cannot add module \" + moduleRuntimeInfo.name + \" as component\");\n }\n toAdd.isProvider = isProvider;\n toAdd.names = usedAnnotations;\n usedAnnotations.forEach(function (element) {\n //if (appContext.appDependencyLoader.hasModule(element)) {\n // throw new Error(\"there is a already a provider for module \" + element\n // + \" at \" + moduleRuntimeInfo.fileInfo.path);\n //}\n if (components[element] !== undefined) {\n throw new Error(\"there is a already a component with name \" + element\n + \". component module address: \" + components[element].fileInfo.path);\n }\n components[element] = toAdd;\n });\n //console.log(\"components\", usedAnnotations, annotationValues, JSON.stringify(components));\n}", "title": "" }, { "docid": "f1f185a258a0cba972b535742d89fbdc", "score": "0.4635958", "text": "function getModuleFactory(id){var factory=moduleFactories.get(id);if(!factory)throw new Error(\"No module with ID \"+id+\" loaded\");return factory;}", "title": "" }, { "docid": "dcf02c63c20a8db4bca4d07b1290ae66", "score": "0.46354002", "text": "function addNgbModuleToAppModule(options) {\n return (host) => {\n const workspace = config_1.getWorkspace(host);\n const project = project_1.getProject(workspace, options.project || workspace.defaultProject);\n const buildOptions = project_2.getProjectTargetOptions(project, 'build');\n const modulePath = ng_ast_utils_1.getAppModulePath(host, buildOptions.main);\n const text = host.read(modulePath);\n if (text === null) {\n throw new schematics_1.SchematicsException(`File '${modulePath}' does not exist.`);\n }\n const source = ts.createSourceFile(modulePath, text.toString('utf-8'), ts.ScriptTarget.Latest, true);\n const changes = ast_utils_1.addImportToModule(source, modulePath, NG_BOOTSTRAP_MODULE_NAME, NG_BOOTSTRAP_PACKAGE_NAME);\n const recorder = host.beginUpdate(modulePath);\n for (const change of changes) {\n if (change instanceof change_1.InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n return host;\n };\n}", "title": "" }, { "docid": "4b06cdac58b4ca420e894aab1707e944", "score": "0.46346292", "text": "function addNgbModuleToAppModule(options) {\n return (host) => __awaiter(this, void 0, void 0, function* () {\n const workspace = yield workspace_1.getWorkspace(host);\n const projectName = options.project || workspace.extensions.defaultProject;\n const project = workspace.projects.get(projectName);\n if (!project) {\n throw new schematics_1.SchematicsException(messages.noProject(projectName));\n }\n const buildOptions = project_1.getProjectTargetOptions(project, 'build');\n const modulePath = ng_ast_utils_1.getAppModulePath(host, buildOptions.main);\n const text = host.read(modulePath);\n if (text === null) {\n throw new schematics_1.SchematicsException(`File '${modulePath}' does not exist.`);\n }\n const source = ts.createSourceFile(modulePath, text.toString('utf-8'), ts.ScriptTarget.Latest, true);\n const changes = ast_utils_1.addImportToModule(source, modulePath, NG_BOOTSTRAP_MODULE_NAME, NG_BOOTSTRAP_PACKAGE_NAME);\n const recorder = host.beginUpdate(modulePath);\n for (const change of changes) {\n if (change instanceof change_1.InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n });\n}", "title": "" }, { "docid": "cb53d56b7ecf56cb5f2038b97d99416f", "score": "0.46288627", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(145);\n break;\n case 'encoding':\n module = __webpack_require__(146);\n break;\n case 'language':\n module = __webpack_require__(147);\n break;\n case 'mediaType':\n module = __webpack_require__(148);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "title": "" }, { "docid": "9889de2bc2ee120e09df25a0f176faff", "score": "0.46283016", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n } // This uses a switch for static require analysis\n\n\n switch (moduleName) {\n case 'charset':\n module = require('./lib/charset');\n break;\n\n case 'encoding':\n module = require('./lib/encoding');\n break;\n\n case 'language':\n module = require('./lib/language');\n break;\n\n case 'mediaType':\n module = require('./lib/mediaType');\n break;\n\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n } // Store to prevent invoking require()\n\n\n modules[moduleName] = module;\n return module;\n}", "title": "" }, { "docid": "8ff50ef14a346c45dbb05ed63b0b92ff", "score": "0.46246842", "text": "function loadModuleApp() {\n var Root;\n import('./Root').then(function(appModule) {\n Root = appModule.default;\n ReactDOM.render(<Root />, document.getElementById('root'));\n });\n //.then(function(itemsModule) {\n //let pandaMenu = new Menu({\n //title: 'Меню панды 3',\n //items: itemsModule.menuItems,\n //});\n ////ReactDOM.render(<App />, document.getElementById('root'));\n //document.body.appendChild(pandaMenu.container);\n //});\n}", "title": "" }, { "docid": "65a15c9d823b7eedc7c91eda584c892d", "score": "0.46164563", "text": "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(383);\n break;\n case 'encoding':\n module = __webpack_require__(384);\n break;\n case 'language':\n module = __webpack_require__(385);\n break;\n case 'mediaType':\n module = __webpack_require__(386);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "title": "" } ]
b6ab60c8e363cfedd250cf9e0298bdf6
Standard/simple iteration through an event's collected dispatches.
[ { "docid": "1dacf68fe770830006edacaf46f94ae5", "score": "0.0", "text": "function executeDispatchesInOrder(event, executeDispatch) {\n forEachEventDispatch(event, executeDispatch);\n event._dispatchListeners = null;\n event._dispatchIDs = null;\n}", "title": "" } ]
[ { "docid": "20e982752013c6da4a6c777135227be8", "score": "0.6318283", "text": "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "c7475a6375735797c6408a6bba2a433f", "score": "0.6119329", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "c7475a6375735797c6408a6bba2a433f", "score": "0.6119329", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "58cc26b67dd3791a4cf35f8bbcc9503e", "score": "0.6116609", "text": "function forEachEventDispatch(event, cb) {\r\n var dispatchListeners = event._dispatchListeners;\r\n var dispatchIDs = event._dispatchIDs;\r\n if (\"production\" !== \"development\") {\r\n validateEventDispatches(event);\r\n }\r\n if (Array.isArray(dispatchListeners)) {\r\n for (var i = 0; i < dispatchListeners.length; i++) {\r\n if (event.isPropagationStopped()) {\r\n break;\r\n }\r\n // Listeners and IDs are two parallel arrays that are always in sync.\r\n cb(event, dispatchListeners[i], dispatchIDs[i]);\r\n }\r\n } else if (dispatchListeners) {\r\n cb(event, dispatchListeners, dispatchIDs);\r\n }\r\n}", "title": "" }, { "docid": "b56f1eb279975304e6c1bc64fe53eb78", "score": "0.61139715", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (true) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "944dea55b1b5462e6c9b1529779e156e", "score": "0.61029595", "text": "onIteration() {}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "8beac27644d06509f6710ebedeeaaa9d", "score": "0.60619074", "text": "call(eventArgs) {\n if (!Object.keys(this.handlers).length) {\n return\n }\n\n const dispatchedEvent = new DispatchedEvent\n\n for (let priority in this.handlers) {\n if (!this.handlers.hasOwnProperty(priority)) {\n continue\n }\n\n // TODO why isPropagationStopped used twice? Is it if propagation will be stopped in time of iteration?\n if (dispatchedEvent.isPropagationStopped()) {\n continue\n }\n\n this.handlers[priority].forEach((handler) => {\n // TODO why isPropagationStopped used twice?\n // if (dispatchedEvent.isPropagationStopped()) {\n // break\n // }\n\n // TODO why whe not using ...eventArgs?\n // TODO why we passing dispatchedEvent? We never use it!?\n handler(eventArgs, dispatchedEvent)\n })\n }\n }", "title": "" }, { "docid": "a71d07050920b2c487080c92b8e48ae6", "score": "0.6014608", "text": "trigger(eventName) {\n if (this.events[eventName]) {\n // // My Solution\n // this.events[eventName].forEach(callback => callback());\n\n // Solution 1\n for (let cb of this.events[eventName]) {\n cb();\n }\n }\n }", "title": "" }, { "docid": "5f8790de1cd46ea01c709c18298ca499", "score": "0.59167045", "text": "function e() {\n var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\n for (var i in t(this, e), r(this, \"events\", {}), n) n[i] && this.subscribe(i, n[i]);\n }", "title": "" }, { "docid": "b85b8d049d8fcd5e344859ca9faaff77", "score": "0.5786388", "text": "function patchViaCapturingAllTheEvents() {\r\n var _loop_1 = function (i) {\r\n var property = eventNames[i];\r\n var onproperty = 'on' + property;\r\n self.addEventListener(property, function (event) {\r\n var elt = event.target, bound, source;\r\n if (elt) {\r\n source = elt.constructor['name'] + '.' + onproperty;\r\n }\r\n else {\r\n source = 'unknown.' + onproperty;\r\n }\r\n while (elt) {\r\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\r\n bound = wrapWithCurrentZone(elt[onproperty], source);\r\n bound[unboundKey] = elt[onproperty];\r\n elt[onproperty] = bound;\r\n }\r\n elt = elt.parentElement;\r\n }\r\n }, true);\r\n };\r\n for (var i = 0; i < eventNames.length; i++) {\r\n _loop_1(i);\r\n }\r\n}", "title": "" }, { "docid": "3c54ce9e41dcf25a952b4511ac9d705d", "score": "0.57735765", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function _loop_1(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target,\n bound,\n source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n } else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n }", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.5766144", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.5766144", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.5766144", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "26d4b130c991489dac141ac6eee0aa21", "score": "0.57634485", "text": "async deferredEventDispatcher() {\n await wait(kDeferredEventReadIntervalMs);\n\n while (!this.disposed_) {\n const events = getDeferredEvents();\n for (const { type, event } of events) {\n try {\n this.handleSingleEvent(type, event);\n } catch (exception) {\n console.log(exception);\n }\n }\n\n await wait(kDeferredEventReadIntervalMs);\n }\n }", "title": "" }, { "docid": "60e0f827b1f27325f81633c78836b76b", "score": "0.57251835", "text": "function executeDispatchesInOrder(event,cb){forEachEventDispatch(event,cb);event._dispatchListeners = null;event._dispatchIDs = null;}", "title": "" }, { "docid": "eb04add915f9d6859b6e8bccb9dce53a", "score": "0.57210845", "text": "function patchViaCapturingAllTheEvents() {\n\t var _loop_1 = function (i) {\n\t var property = eventNames[i];\n\t var onproperty = 'on' + property;\n\t self.addEventListener(property, function (event) {\n\t var elt = event.target, bound, source;\n\t if (elt) {\n\t source = elt.constructor['name'] + '.' + onproperty;\n\t }\n\t else {\n\t source = 'unknown.' + onproperty;\n\t }\n\t while (elt) {\n\t if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n\t bound = Zone.current.wrap(elt[onproperty], source);\n\t bound[unboundKey] = elt[onproperty];\n\t elt[onproperty] = bound;\n\t }\n\t elt = elt.parentElement;\n\t }\n\t }, true);\n\t };\n\t for (var i = 0; i < eventNames.length; i++) {\n\t _loop_1(i);\n\t }\n\t \n\t}", "title": "" }, { "docid": "d3c2392616d962f32ca14030a6e64c53", "score": "0.56633157", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function _loop_1(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target,\n bound,\n source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n } else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n }", "title": "" }, { "docid": "4763025877fd51208c099f5eef7f53ec", "score": "0.5623957", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "4763025877fd51208c099f5eef7f53ec", "score": "0.5623957", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "4763025877fd51208c099f5eef7f53ec", "score": "0.5623957", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "32a76cd73aaae5c1487ff18870d9da8c", "score": "0.5596695", "text": "fire(type, evt) {\n let evts = (this._events = this._events || []);\n let cbs = evts[type];\n if (!cbs) cbs = evts[type] = [];\n evt.data = evt.data || {};\n this._each((index, elem) => {\n cbs.forEach(cb => cb.call(elem, evt));\n });\n }", "title": "" }, { "docid": "4d0be5045020706ed5af37e7058c50de", "score": "0.55931807", "text": "emit(key, ...args) {\n const event = this.events[key];\n if (event) {\n for (let cb of event) {\n cb(...args);\n }\n }\n }", "title": "" }, { "docid": "30a21969875299cd1aca726a614ee86a", "score": "0.55691624", "text": "trigger(eventName) {\n if (this.events[eventName]) {\n for (let cb of this.events[eventName]) {\n cb();\n }\n }\n }", "title": "" }, { "docid": "d40d8ff5f6b3f0f6410db3303985de0f", "score": "0.55262285", "text": "function regularEvents() {\n\n if( typeof pys_events == 'undefined' ) {\n return;\n }\n\n for( var i = 0; i < pys_events.length; i++ ) {\n\n var eventData = pys_events[i];\n\n if( eventData.hasOwnProperty('delay') == false || eventData.delay == 0 ) {\n\n fbq( eventData.type, eventData.name, eventData.params );\n\n } else {\n\n setTimeout( function( type, name, params ) {\n fbq( type, name, params );\n }, eventData.delay * 1000, eventData.type, eventData.name, eventData.params );\n\n }\n\n }\n\n }", "title": "" }, { "docid": "f8eb26127b1938d324ab652e550f1beb", "score": "0.5525167", "text": "function each() {\n try {\n //variable to determine whether loop successfully completed or not\n let loopSuccess = true;\n //check if provided array is of type ARRAY or not\n if (require('../extras/utils').typeOf(array) === require('../extras/constants').ARRAY) {\n //looping through our array\n for (let i = 0; i < array.length; i++) {\n //performing task providing element and/or its position\n void (task(array[i], i));\n //using deasync for blocking mechanism via event loop\n deasync.loopWhile(function () {\n return wait\n });\n //resetting our wait flag\n wait = true;\n //checking if there is an error , then break our loop and emit event\n if (error) {\n void (myEmitter.emit('event', error));\n error = undefined; //resetting variable\n [isAttached, isOn] = [false, false]; //resetting variables\n loopSuccess = false;\n break;\n }\n }\n if (loopSuccess) {\n //loop finishes successfully\n void (myEmitter.emit('event', undefined));\n }\n\n } else {\n //data type is not an array\n void (myEmitter.emit('event', `provided data is not an array`));\n }\n } catch (error) {\n void (myEmitter.emit('event', error));\n }\n}", "title": "" }, { "docid": "0d39f64735c6198a4f91eff0006a9ffc", "score": "0.5513794", "text": "function printEvents(data) {\n data.forEach(function (event) {\n printEvent(event);\n })\n }", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.55030125", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.55030125", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.55030125", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "30bc634b7a4a2f74476d00f5d62633cd", "score": "0.5501223", "text": "function regularEvents() {\n\n if (typeof pys_events == 'undefined') {\n return;\n }\n\n for (var i = 0; i < pys_events.length; i++) {\n\n var eventData = pys_events[i];\n\n if (eventData.hasOwnProperty('delay') == false || eventData.delay == 0) {\n\n fbq(eventData.type, eventData.name, eventData.params);\n\n } else {\n\n setTimeout(function (type, name, params) {\n fbq(type, name, params);\n }, eventData.delay * 1000, eventData.type, eventData.name, eventData.params);\n\n }\n\n }\n\n }", "title": "" }, { "docid": "84b7c5baf8f919f6db3a997ad4a34f8d", "score": "0.55007696", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "688e2bd4219a905606b83d52fa3717bb", "score": "0.5497028", "text": "function kn__consumeEvents()\n{\n while (kn.leaderWindow.kn__queue &&\n kn.leaderWindow.kn__queue[kn.TFN_])\n {\n // dequeue\n var q = kn.leaderWindow.kn__queue[kn.TFN_];\n kn.leaderWindow.kn__queue[kn.TFN_] = q.next;\n\n // shallow-copy the event to avoid radioactivity\n var evt = _kn_object();\n\n for (var header in q.event)\n {\n evt[header] = q.event[header];\n }\n\n // dispatch it\n kn__routeEvent(evt);\n }\n}", "title": "" }, { "docid": "05d697f74ff0edd7a2b03c8135091ad2", "score": "0.5496777", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "85e4b117a8831b37421b9a0362af9a9f", "score": "0.5492424", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(\n event._dispatchListeners,\n listener,\n );\n event._dispatchInstances = accumulateInto(\n event._dispatchInstances,\n inst,\n );\n }\n }\n }", "title": "" }, { "docid": "b9c973cbbf2723f65ef8c52e5d316502", "score": "0.5480086", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "cf2fb1fd5547fad77d6549acb32914b4", "score": "0.5473437", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto(\n event._dispatchListeners,\n listener\n );\n event._dispatchInstances = accumulateInto(\n event._dispatchInstances,\n inst\n );\n }\n }\n }", "title": "" }, { "docid": "b5d6d6efffc8695567634d203a15e750", "score": "0.5469118", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto_1(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto_1(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "b5d6d6efffc8695567634d203a15e750", "score": "0.5469118", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto_1(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto_1(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" } ]
23e2d9f5b8848d58a99dfe961b2e41ec
! my solve clunky and brute forcey, with slice i think the method is O(n^2) but at least i didn't go deeper!!
[ { "docid": "d602bb64cf3cff5db43f3dfc66b6eaeb", "score": "0.0", "text": "function needler(haystack, needle) {\n if (needle.length === 0) return 0;\n if (needle.length > haystack.length) return -1;\n\n let savedIndex = -1;\n let tempString = '';\n let window = needle.length;\n\n // first loop to grab initial tempString\n for (let i = 0; i < needle.length; i++) {\n tempString += haystack[i];\n }\n\n if (tempString === needle) return 0;\n\n // loop over haystack, haystack[i]\n for (let j = window; j < haystack.length + 1; j++) {\n // remove first letter and add new letter of temp string\n console.log(tempString, j);\n if (tempString === needle) {\n return j - window;\n }\n tempString = tempString.slice(1, window);\n tempString += haystack[j];\n }\n return savedIndex;\n}", "title": "" } ]
[ { "docid": "cefa2851f778d539bcb759fd566fad87", "score": "0.65172046", "text": "function part2(input) {\n let data = input.split('').map(el => parseInt(el));\n const max = lodash.max(data);\n data = lodash.concat(data, lodash.range(max+1, 1000000+1));\n const sortedAllData = [...data].sort((a, b) => a - b);\n let i=0;\n \n for (; i<10000000; i++) {\n if (i % 100000 === 0) console.log(i/100000);\n const currentValue = data[0];\n const pickup = [data[1], data[2], data[3]];\n data = lodash.drop(data, 4);\n //console.log('CURRENT VALUE', currentValue, 'PICKUP', pickup);\n //console.log('DATA', data);\n //const dataSort = lodash.difference(sortedAllData, pickup);\n //if (i % 1 === 0) console.log(i, 'difference', dataSort);\n \n let destination = lodash.nth(sortedAllData, lodash.findLastIndex(sortedAllData, el => !pickup.includes(el), lodash.sortedIndexOf(sortedAllData, currentValue - 1)));\n //console.log('destination before', destination);\n if (pickup.includes(destination)) {\n const dataSort = lodash.difference(sortedAllData, pickup);\n destination = lodash.indexOf(data, dataSort[dataSort.length-1])\n }\n else {\n destination = lodash.indexOf(data, destination);\n }\n //if (i % 100000 === 0) console.log(i, 'destination', destination);\n const firstPart = lodash.slice(data, 0, destination+1);\n //console.log('FIRST PART', firstPart);\n const secondPart = lodash.slice(data, destination+1);\n //console.log('SECOND PART', secondPart);\n\n data = lodash.concat(firstPart, pickup, secondPart, currentValue);\n //console.log('DATA END', data);\n //if (i % 100000 === 0) console.log(i, 'replace');\n }\n\n const index1 = lodash.indexOf(data, 1);\n \n if (index1+2 < data.length) {\n console.log(data[index1+1], data[index1+2], data[index1+1]*data[index1+2]);\n }\n else if (index1+1 < data.length) {\n console.log(data[index1+1], data[0], data[index1+1]*data[0]);\n }\n else {\n console.log(data[0], data[1], data[0]*data[1]);\n }\n\n}", "title": "" }, { "docid": "c8aeb86a7146b8b8f4eb153fa9b75307", "score": "0.64468104", "text": "function possible(m,n,arr){\r\n let newArr=[]\r\n let x=arr[0]\r\n let y=arr[1]\r\n let t=1\r\n for(let i=0;i<m;i++){\r\n let result=x.slice(0,t).concat(y.slice(t-1))\r\n newArr.push(result)\r\n t++\r\n }\r\n newArr.push(x.slice(0).concat(y.slice(-1)))\r\n console.log(newArr)\r\n }", "title": "" }, { "docid": "63aa37a1cbc7cab36d8569d538015294", "score": "0.6229523", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n/* Task Description\n An array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)],\n which means that exactly one element is missing. Your goal is to find that missing element. \n/* Assumptions:\n - N is an integer within the range [0..100,000];\n - the elements of A are all distinct;\n - each element of array A is an integer within the range [1..(N + 1)].\n*/\n // declaring (i)initial and (f)inal index and (m)edian\n let i, f, m;\n // sort the array \n A.sort((a, b)=>a - b);\n //check if the first element is not 1 and then return 1\n if (A[0] !== 1) {\n return 1;\n };\n //check if the length of array A is 1, since it passed the previous if, the element is the number 1\n if (A.length === 1) {\n return 2\n } else {\n i = 0;\n f = A.length - 1;\n m = Math.ceil((f - i) / 2);\n while (f - i > 0 && f < A.length) {\n if (A[m] - A[m-1] === 2 && A[m] - m ===2) {\n // found it \n return A[m-1] + 1;\n } else if (A[m] - A[m-1] === 1 && A[m] - m === 1) {\n // cut to the right\n i = m + 1;\n m = Math.ceil((f - i) / 2) + i;\n } else {\n // cut to the left\n f = m - 1;\n m = Math.ceil((f - i) / 2) + i;\n }\n };\n if (i > f && m < A.length) {\n return A[A.length-1] + 1;\n } else if (m >= A.length - 1) {\n if (A[m] - A[m-1] === 2 && A[m] - m === 2) {\n // found it \n return A[m-1] + 1;\n } else {\n return A[A.length-1] + 1;\n }\n } else {\n return A[m] - 1;\n }\n }\n}", "title": "" }, { "docid": "10bc0387865897618d89e542756dd9b0", "score": "0.6202706", "text": "function solution(K, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var arrLength = A.length;\n var tempMin = 0;\n var tempMax = 0;\n var arrSlices = [];\n\n for(let i = 0; i < arrLength; i ++) {\n for(let j = i + 1; j <= arrLength; j ++) {\n tempMin = Math.min(...A.slice(i, j));\n tempMax = Math.max(...A.slice(i, j));\n // console.log(tempMin, tempMax);\n if((tempMax - tempMin) <= K) {\n arrSlices.push([i , j-1]);\n }\n }\n }\n\n return arrSlices.length;\n\n}", "title": "" }, { "docid": "336081493b39e8c2fee125f4f4bda5f7", "score": "0.6166224", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length <= 5) {\n return false;\n };\n let pos1 = 1; \n let pos2;\n if (A.length % 2 !== 0) {\n pos2 = (A.length - 1) / 2;\n } else {\n pos2 = A.length / 2;\n };\n let server1 = A.slice(0, pos1);\n console.log(server1);\n let server2 = A.slice(pos1 + 1, pos2);\n console.log(server2);\n let server3 = A.slice(pos2 + 1);\n console.log(server3);\n console.log('------------');\n let sumServer1 = server1.reduce((acc, currVal) => acc + currVal, 0);\n let sumServer2 = server2.reduce((acc, currVal) => acc + currVal, 0);\n let sumServer3 = server3.reduce((acc, currVal) => acc + currVal, 0);\n while (pos2 !== A.length - 2 && sumServer1 !== sumServer2 && sumServer1 !== sumServer3) {\n pos1 = pos1 + 1;\n if (pos2 - pos1 === 1) {\n pos2 = pos2 + 1;\n pos1 = 1;\n }\n server1 = A.slice(0, pos1);\n server2 = A.slice(pos1 + 1, pos2);\n server3 = A.slice(pos2 + 1);\n sumServer1 = server1.reduce((acc, currVal) => acc + currVal, 0);\n sumServer2 = server2.reduce((acc, currVal) => acc + currVal, 0);\n sumServer3 = server3.reduce((acc, currVal) => acc + currVal, 0);\n console.log(A);\n console.log(server1);\n console.log(server2);\n console.log(server3);\n console.log('------------');\n };\n console.log('pos1 = ' + pos1 + ' pos2 = ' + pos2);\n return (sumServer1 === sumServer2 && sumServer1 === sumServer3);\n}", "title": "" }, { "docid": "af007f17769f4fe3b131502ea1525865", "score": "0.6090748", "text": "function arrayManipulation(n, queries) {\n let array = Array(n).fill(0)\n console.log(array)\n \n for (let i = 0, j=0; i <= queries.length-1; i ++){\n \n \n while (array.indexOf() >= array[queries[i][0]] && array.indexOf() <= array[queries[i][1]]) {\n array.indexOf() += queries[i][2]\n console.log(array)\n } \n \n // >= queries.indexAt[i][0] && array.indexAt[j] <= queries.indexAt[i][1]) {\n // console.log('wooh!') \n // j++\n // }\n } \n // return Math.max(array)\n}", "title": "" }, { "docid": "9ca6f867739001ea03cca94bd5ea3c92", "score": "0.60605997", "text": "function minCutPalidrome2(str){\n\tvar INT_MAX = 10000;\n\tvar n = str.length;\n\tvar Pal = create2DArray(n); // set if str[i..j] is palindrome\n\tvar Cut = create2DArray(n); //Minimum number of cuts needed for palindrome partitioning of substring str[i..j] \n\tconsole.log(Pal,Cut)\n\tfor(var i = 0;i<n;i++){\n\t\tPal[i][i] = true;\n\t\tCut[i][i] = 0;\n\t}\n\t// now for each possible length we will set values in Pan and cut\n\tfor(var L = 2; L<= n;L++){\n\t\t// For substring of length L, set different possible starting indexes\n\t\tfor(var i = 0; i< n-L+1;i++){\n\t\t\t\t// end index\n\t\t\t\tvar j = i + L - 1;\n\t\t\t\tif(L==2){\n\t\t\t\t\tPal[i][j] = (str[i] == str[j]);\n\t\t\t\t}else\n\t\t\t\t\tPal[i][j] = (str[i] == str[j])&&Pal[i+1][j-1];\n\t\t\t\t// if palindrome no cut\n\t\t\t\tif(Pal[i][j]) Cut[i][j]\t= 0;\n\t\t\t\telse{\n\t\t\t\t\tCut[i][j] = INT_MAX;\n\t\t\t\t\tfor (k=i; k<=j-1; k++)\n Cut[i][j] = Math.min(Cut[i][j], Cut[i][k] + Cut[k+1][j]+1);\n\t\t\t\t}\n\t\t}\n\t}\n//\tconsole.log(Cut)\n\treturn Cut[0][n-1];\n}", "title": "" }, { "docid": "148ef9923fe5bf1aa8f0359d41e79d9c", "score": "0.6051103", "text": "function minCutPalidrome3(str){\n\tvar INT_MAX = 10000;\n\tvar n = str.length;\n\tvar Pal = create2DArray(n); // set if str[i..j] is palindrome\n\tvar Cut = []; // Minimum number of cuts needed for palindrome partitioning of substring str[0..i] \n\tconsole.log(Pal,Cut)\n\tfor(var i = 0;i<n;i++){\n\t\tPal[i][i] = true;\n\t}\n\t// now for each possible length we will set values in Pan and cut\n\tfor(var L = 2; L<= n;L++){\n\t\t// For substring of length L, set different possible starting indexes\n\t\tfor(var i = 0; i< n-L+1;i++){\n\t\t\t\t// end index\n\t\t\t\tvar j = i + L - 1;\n\t\t\t\tif(L==2){\n\t\t\t\t\tPal[i][j] = (str[i] == str[j]);\n\t\t\t\t}else\n\t\t\t\t\tPal[i][j] = (str[i] == str[j])&&Pal[i+1][j-1];\n\t\t\t\t// if palindrome no cut\n\t\t}\n\t}\n\tfor (i=0; i<n; i++)\n {\n if (Pal[0][i] == true)\n Cut[i] = 0;\n else\n {\n Cut[i] = INT_MAX;\n for(j=0;j<i;j++)\n {\n if(Pal[j+1][i] == true && 1+Cut[j]<Cut[i])\n Cut[i]=1+Cut[j];\n }\n }\n }\t\t\t\t\n\t// console.log(Cut)\n\treturn Cut[n-1];\n}", "title": "" }, { "docid": "10dcd6014d6f58ae7c9d65db040f5f3d", "score": "0.6037188", "text": "function part1(){\n \n // let stepsGone = 0;\n // let getBotLim = function() { if(stepsGone >= 25){botLim = 25;}else{botLim=stepsGone;} return botLim;}\n // for(i=0;i<inputInt.length;i++){\n // if(i)\n // stepsGone++;\n \n // checkSum(i, stepsGone-1,stepsGone - 1 - getBotLim);\n // }\n \n \n function checkSum(preamble) {\n for(let i = preamble - 25; i < preamble - 1; i++) {\n console.log(i)\n for(let j = preamble - 24; j < preamble; j++) {\n if(+inputInt[i] + +inputInt[j] === +inputInt[preamble] && +inputInt[i] !== +inputInt[preamble] && +inputInt[j] !== +inputInt[preamble]) {\n return true;\n }\n }\n }\n return false;\n }\n console.log(preamble);\n \n while(keepGoing) {\n if (!checkSum(preamble)) {\n keepGoing = false;\n console.log('found it !' +inputInt[preamble]);// 1124361034 \n foundIt = true;\n \n } else {\n preamble++;\n };\n }\n \n if(foundIt){return inputInt[preamble]; }\n }", "title": "" }, { "docid": "56fdc6685da257f16b2b911d70ab60a2", "score": "0.5964242", "text": "function arrayManipulation(n, queries) {\n //var a = new Array(n);\n //for (var i = 0; i < n; i++) { a[i] = 0;}\n var len = queries.length;\n var temp = new Array(3); \n var tempNext = new Array(3);\n var pushed = new Array(3);\n var ind = 0;\n\n function sortem(arr) {\n var len = arr.length;\n for (var i = 0; i < len; i++) {\n var small = 10 ** 7;\n for (var j = i; j < len; j++) {\n temp = arr[j];\n if (temp[0] < small) { small = temp[0]; ind = j; }\n }\n [arr[i], arr[ind]] = [arr[ind], arr[i]];\n\n }\n return arr;\n }\n\n\n for (var i = 0; i < queries.length; i++){\n queries = sortem(queries);\n temp = queries[i];\n\n if (temp[0] === temp[1]) { continue;}\n var j = i + 1; \n tempNext = queries[j];\n if (tempNext[0] > temp[1]) {\n continue;\n }\n //if (tempNext[0] == temp[0] && tempNext[1] == temp[1]) { continue; }\n if (temp[1] < tempNext[1]) {\n queries[j] = [tempNext[0],temp[1],tempNext[2]+temp[2]];\n pushed = [temp[1] + 1, tempNext[1], tempNext[2]];\n queries.push(pushed);\n queries.splice(i, 1);\n i--;\n continue;\n\n } else if (tempNext[1] === temp[1]) {\n queries[j] = [tempNext[0], tempNext[1], tempNext[2] + temp[2]];\n queries.splice(i, 1);\n i--;\n continue;\n } else if (temp[1] > tempNext[1]) {\n queries[j] = [tempNext[0], tempNext[1], tempNext[2] + temp[2]];\n pushed = [tempNext[1]+1, temp[1], temp[2] ];\n queries.push(pushed);\n queries.splice(i, 1);\n i--;\n continue;\n }\n \n \n\n }\n\n queries = sortem(queries);\n //console.log(queries.length);\n //console.log(queries);\n var len = queries.length;\n var b = new Array(len);\n for (var k = 0; k < len; k++){ \n b[k] = queries[k][2];\n }\n return Math.max(...b);\n\n /* First Solution - Slow\n for (var j = 1; j < len; j++){\n temp = queries[j];\n var s = temp[0]-1 ;\n var e = temp[1]-1 ;\n var v = temp[2]; \n\n for (var k = s; k <= e; k++){\n a[k] += v;\n }\n }\n\n //a = a.filter(Boolean);\n return Math.max(...a);\n*/\n\n}", "title": "" }, { "docid": "3a76c85cc124f5ab6ba0e88662b7d313", "score": "0.5954319", "text": "function subsetSum(nums, target, indiceActual = 0, sumaActual = 0, indices = [], resultado = []) {\n // Your code here:\n\n for (var i = indiceActual; i < nums.length; i++) {\n\n //si decido no argegarlo\n if (i < sums.lenght - 1) subsetSums(nums, target, i + 1, sumaActual, indices, resultado)\n\n //si decide agregarlo al array\n if (i > target) return;\n else if (sumaActual + i === target) {\n sumaActual = i + sumaActual;\n indices.push(i);\n resultado.push(indices);\n return\n }\n else {\n sumaActual = i + sumaActual;\n indices.push(i);\n subsetSums(nums, target, i, sumaActual, indices, resultado)\n return\n }\n\n }\n\n console.log(resultado)\n\n}", "title": "" }, { "docid": "4d9f8098a8940168697d43ba944b1853", "score": "0.58950055", "text": "function select(array, k, left = 0, right = array.length - 1) {\n while (right > left) {\n // Use select recursively to sample a smaller set of size s\n // the arbitrary constants 600 and 0.5 are used in the original\n // version to minimize execution time.\n if (right - left > 600) {\n const n = right - left + 1;\n const i = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * Math.sign(i - n / 2);\n const newLeft = Math.max(left, Math.floor(k - i * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - i) * s / n + sd));\n select(array, k, newLeft, newRight);\n }\n // partition the elements between left and right around t\n const t = array[k];\n let i = left;\n let j = right;\n tf.util.swap(array, left, k);\n if (comparePair(array[right], t) > 0) {\n tf.util.swap(array, left, right);\n }\n while (i < j) {\n tf.util.swap(array, i, j);\n i++;\n j--;\n while (comparePair(array[i], t) < 0) {\n i = i + 1;\n }\n while (comparePair(array[j], t) > 0) {\n j = j - 1;\n }\n }\n if (comparePair(array[left], t) === 0) {\n tf.util.swap(array, left, j);\n }\n else {\n j = j + 1;\n tf.util.swap(array, j, right);\n }\n // Adjust left and right towards the boundaries of the subset\n // containing the (k - left + 1)th smallest element.\n if (j <= k) {\n left = j + 1;\n }\n if (k <= j) {\n right = j - 1;\n }\n }\n}", "title": "" }, { "docid": "cbcb0b4970e4c2abc7bc9b145da590f7", "score": "0.58820516", "text": "function s(nums) {\n const res = [];\n helper(0, []);\n return res;\n\n function helper(i, list = []) {\n res.push(list.slice());\n for (let j = i; j < nums.length; j++) {\n if (j > i && nums[i - 1] === nums[i]) contineu;\n list.push(nums[j]);\n helper(j + 1, list);\n list.pop();\n }\n }\n}", "title": "" }, { "docid": "284fd3b93665bd24546f8061c8419e79", "score": "0.58406425", "text": "function contiguousSum(array){\n let lower = 0;\n while(lower < array.length){\n let upper = 0;\n while(upper < array.length){\n let current = array.slice(lower, upper);\n if(sumOfArray(current) === answerOne && array[lower] != answerOne){\n console.log(Math.min(...current) + Math.max(...current));\n }\n upper++;\n }\n lower++;\n }\n}", "title": "" }, { "docid": "878558218db039434b1a6027bba29b9d", "score": "0.58163893", "text": "function main() {\n let a = readLine();\n let b = readLine();\n const N = a.length;\n let dp = new Array(2);\n dp[0] = new Array(N);\n dp[1] = new Array(N);\n let cur = 0, next = 1;\n for (let i = N - 1; i >= 0; i--) {\n for (let j = N - 1; j >= 0; j--) {\n let result = 0;\n if (i + 1 < N) result = dp[next][j];\n if (j + 1 < N) result = Math.max(result, dp[cur][j + 1]);\n if (a[i] === b[j]) {\n let nextResult = 0;\n if (i + 1 < N && j + 1 < N) nextResult = dp[next][j + 1];\n result = Math.max(result, nextResult + 1);\n }\n dp[cur][j] = result;\n }\n let tmp = cur;\n cur = next;\n next = tmp;\n }\n console.log(dp[next][0]);\n}", "title": "" }, { "docid": "1e0fb2dbef9a1cd8e61ef533595f9ac2", "score": "0.58145463", "text": "function solution(d){\n // Сделаем из числа массив\n var arr = (d+'').split('');\n //console.log('Вот массив цифр');\n // console.log(arr);\n var arrStorage = [];\n var arrTmp = [];\n\n // Запустим цикл, начнем с девяток. Будем искать числа\n outer: for (var n=9;n>0; n--) {\n if (arr.indexOf(n + '') === -1) break;\n for (;;) {\n if (arr.indexOf(n + '') >= 0) { // Понеслась\n for (var j = 0; j < 5; j++) { //Делаем цикл из 5 итераций - берем n и 4 следующих цифры, делаем из них число\n arrTmp.push(arr[arr.indexOf(n + '') + j]); // Закинули 5 цифр во временный массив\n }\n arrStorage.push(+(arrTmp.join('')));\n arrTmp = [];\n delete arr[arr.indexOf(n + '')];\n if (arr.indexOf(n + '') === -1) break outer;\n } else break;\n }\n }\n console.log(arrStorage);\n // Теперь найдем максимальное из чисел в arrStorage\n return Math.max.apply(null, arrStorage);\n\n\n\n}", "title": "" }, { "docid": "3043e677ccefc77a287ed3784b3f2392", "score": "0.5782072", "text": "function select$1(array, k, left = 0, right = array.length - 1) {\n while (right > left) {\n // Use select recursively to sample a smaller set of size s\n // the arbitrary constants 600 and 0.5 are used in the original\n // version to minimize execution time.\n if (right - left > 600) {\n const n = right - left + 1;\n const i = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * Math.sign(i - n / 2);\n const newLeft = Math.max(left, Math.floor(k - i * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - i) * s / n + sd));\n select$1(array, k, newLeft, newRight);\n }\n // partition the elements between left and right around t\n const t = array[k];\n let i = left;\n let j = right;\n tfjsCore.util.swap(array, left, k);\n if (comparePair(array[right], t) > 0) {\n tfjsCore.util.swap(array, left, right);\n }\n while (i < j) {\n tfjsCore.util.swap(array, i, j);\n i++;\n j--;\n while (comparePair(array[i], t) < 0) {\n i = i + 1;\n }\n while (comparePair(array[j], t) > 0) {\n j = j - 1;\n }\n }\n if (comparePair(array[left], t) === 0) {\n tfjsCore.util.swap(array, left, j);\n }\n else {\n j = j + 1;\n tfjsCore.util.swap(array, j, right);\n }\n // Adjust left and right towards the boundaries of the subset\n // containing the (k - left + 1)th smallest element.\n if (j <= k) {\n left = j + 1;\n }\n if (k <= j) {\n right = j - 1;\n }\n }\n }", "title": "" }, { "docid": "736b46bbe644adf2d3f9c4067f9d0873", "score": "0.57553446", "text": "function select(array, k, left, right) {\n if (left === void 0) { left = 0; }\n if (right === void 0) { right = array.length - 1; }\n while (right > left) {\n // Use select recursively to sample a smaller set of size s\n // the arbitrary constants 600 and 0.5 are used in the original\n // version to minimize execution time.\n if (right - left > 600) {\n var n = right - left + 1;\n var i_1 = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * Math.sign(i_1 - n / 2);\n var newLeft = Math.max(left, Math.floor(k - i_1 * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - i_1) * s / n + sd));\n select(array, k, newLeft, newRight);\n }\n // partition the elements between left and right around t\n var t = array[k];\n var i = left;\n var j = right;\n tfjsCore.util.swap(array, left, k);\n if (comparePair(array[right], t) > 0) {\n tfjsCore.util.swap(array, left, right);\n }\n while (i < j) {\n tfjsCore.util.swap(array, i, j);\n i++;\n j--;\n while (comparePair(array[i], t) < 0) {\n i = i + 1;\n }\n while (comparePair(array[j], t) > 0) {\n j = j - 1;\n }\n }\n if (comparePair(array[left], t) === 0) {\n tfjsCore.util.swap(array, left, j);\n }\n else {\n j = j + 1;\n tfjsCore.util.swap(array, j, right);\n }\n // Adjust left and right towards the boundaries of the subset\n // containing the (k - left + 1)th smallest element.\n if (j <= k) {\n left = j + 1;\n }\n if (k <= j) {\n right = j - 1;\n }\n }\n}", "title": "" }, { "docid": "52e872c81bf0ae23828be2d1dd5c52a4", "score": "0.5751469", "text": "findTriplets(arr, n){\n arr.sort((a, b) => a - b);\n \n let [i, j, k, temp] = [0, 0, 0, 0];\n \n for(i = 0; i < n - 2; i++) {\n k = i + 1;\n j = n - 1;\n \n while (k < j) {\n temp = arr[i] + arr[k] + arr[j];\n if (temp == 0) {\n return true;\n } else if (temp < 0) {\n k += 1;\n } else {\n j -= 1;\n }\n }\n }\n \n return false;\n \n }", "title": "" }, { "docid": "27304fc35a85665c9a6de325b7f04f92", "score": "0.5748826", "text": "function subsequenceSum(arr, n) {\n\tlet firstIndex = 0;\n\tlet lastIndex = 1;\n\tlet sum = arr[firstIndex] + arr[lastIndex];\n\n\twhile (arr[lastIndex]) {\n\t\tif (sum === n) {\n\t\t\treturn [firstIndex, lastIndex];\n\t\t} else if (sum < n) {\n\t\t\tlastIndex++;\n\t\t\tsum += arr[lastIndex];\n\t\t} else {\n\t\t\tsum -= arr[firstIndex] ;\n\t\t\tfirstIndex++;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "24424c58431c12ffe0fadb44f9768aaf", "score": "0.57272965", "text": "function f2 (arr, k) {\n let windowStart = 0, windowEnd = 0, windowSum = 0, minLength = 9999;\n for(;windowEnd<arr.length;windowEnd++) {\n windowSum += arr[windowEnd];\n while(windowSum > k) {\n minLength = Math.min(windowEnd - windowStart + 1, minLength);\n windowSum -= arr[windowStart];\n windowStart++;\n }\n }\n return minLength==9999?-1:minLength;\n}", "title": "" }, { "docid": "d34ce16bab762d101c330267619aaedc", "score": "0.57123554", "text": "function dfs(index){\r\n // border condition\r\n // if subset's len is equal to k then push to res and return\r\n if(subset.length === k){\r\n res.push(subset.slice());\r\n return;\r\n }\r\n // iterate from current number to n (index - n)\r\n for(let i = index; i <= n; ++i){\r\n // current number exists in the combination\r\n subset.push(i);\r\n // run dfs further based on current num exists\r\n dfs(i+1);\r\n // current number doesn't exist in the combination, pop out from the stack\r\n subset.pop();\r\n }\r\n }", "title": "" }, { "docid": "23cda52df97be4497326367f9e78d85d", "score": "0.57005084", "text": "function twoSum(nums, target) {\n let a = 0;\n let b = 0;\n for (let i = 0; i < nums.length; i++) {\n a = nums[i];\n b = target - nums[i];\n\n if (nums.includes(b)) {\n const arr = [];\n\n if (a === b) {\n const tempArr = nums.slice();\n arr.push(nums.indexOf(a));\n tempArr.splice(nums.indexOf(a), 1, \"taken\");\n arr.push(tempArr.indexOf(b));\n return arr;\n }\n arr.push(nums.indexOf(a));\n arr.push(nums.indexOf(b));\n return arr;\n }\n }\n}", "title": "" }, { "docid": "5d0e02c90b0d8844432cd1160620e874", "score": "0.5681617", "text": "function doThing(nums) {\n nums.sort()\n let result = []\n for (var i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) {\n break\n }\n if (i > 0 && nums[i] === nums[i - 1]) {\n continue\n }\n let flagBegin = i\n let flagEnd = nums.length - 1\n while (flagBegin < flagEnd) {\n if (nums[i] === -(nums[flagBegin] + nums[flagEnd])) {\n let list = [nums[i], nums[flagBegin], nums[flagEnd]]\n result.push(list)\n flagBegin++\n flagEnd--\n } else if (nums[i] < -(nums[flagBegin] + nums[flagEnd])) {\n flagBegin++\n } else {\n flagEnd--\n }\n }\n\n }\n return result\n}", "title": "" }, { "docid": "afd17f6e2765c4421c19715598bc889f", "score": "0.5678833", "text": "function fairCut(k, arr) {\n function getDifferenceValue(liArr, arr) {\n arr = arr.filter(element => element !== IMPOSSIBLE_VALUE);\n let sum = 0;\n for (let v1 of liArr) {\n sum += arr.reduce((agg, cur) => agg + Math.abs(cur - v1), 0);\n }\n\n return sum;\n }\n\n const ARR_LEN = arr.length, IMPOSSIBLE_VALUE = -1;\n arr.sort((a, b) => a - b);\n k = Math.min(k, ARR_LEN - k);\n let liArr = [];\n if (k === 1) {\n let middle = Math.floor(ARR_LEN / 2);\n liArr.push(arr[middle]);\n arr[middle] = IMPOSSIBLE_VALUE;\n\n return getDifferenceValue(liArr, arr);\n } else { // k > 1\n let middle = Math.floor(ARR_LEN / 2), leftIndex = middle, rightIndex = middle;\n liArr.push(arr[middle]);\n arr[middle] = IMPOSSIBLE_VALUE;\n k--;\n while (k > 1) {\n leftIndex -= 2;\n liArr.push(arr[leftIndex]);\n arr[leftIndex] = IMPOSSIBLE_VALUE;\n\n rightIndex += 2;\n liArr.push(arr[rightIndex]);\n arr[rightIndex] = IMPOSSIBLE_VALUE;\n k -= 2;\n }\n if (k === 1) {\n leftIndex -= 2;\n rightIndex += 2;\n let leftValid = (leftIndex >= 0), rightValid = (rightIndex < ARR_LEN);\n if (leftValid && rightValid) {\n let arrCopy = arr.slice(), liArrCopy = liArr.slice();\n liArrCopy.push(arr[leftIndex]);\n arrCopy[leftIndex] = IMPOSSIBLE_VALUE;\n let leftFairValue = getDifferenceValue(liArrCopy, arrCopy);\n\n liArr.push(arr[rightIndex]);\n arr[rightIndex] = IMPOSSIBLE_VALUE;\n let rightFairValue = getDifferenceValue(liArr, arr);\n\n return Math.min(leftFairValue, rightFairValue);\n } else if (leftValid) {\n liArr.push(arr[leftIndex]);\n arr[leftIndex] = IMPOSSIBLE_VALUE;\n return getDifferenceValue(liArr, arr);\n }\n else if (rightValid) {\n liArr.push(arr[rightIndex]);\n arr[rightIndex] = IMPOSSIBLE_VALUE;\n return getDifferenceValue(liArr, arr);\n }\n }\n else\n return getDifferenceValue(liArr, arr);\n }\n}", "title": "" }, { "docid": "85cd99627708ef5c359a8d668cd5e67b", "score": "0.56726474", "text": "function findSubarray() {\n let map = [];\n\n function addToResult(array) {\n map = array;\n }\n\n function isBiggest(array)\n {\n if (array.length > map.length)\n return true;\n \n false;\n }\n \n return function(array) {\n let elements = [];\n for (let i = 0; i < array.length; i++) {\n for (let j = i; j < array.length; j++) {\n \n if(elements.indexOf(array[j]) < 0)\n { \n elements.push(array[j]);\n \n } else\n {\n elements = [array[j]];\n }\n \n if (isBiggest(elements))\n addToResult(Array.from(elements));\n }\n }\n\n return map;\n };\n}", "title": "" }, { "docid": "f0d829c2cc9779e472035a490b3ecfd7", "score": "0.56682825", "text": "function find(nums, ordering, goal){\n let results=[0,0,0,0,0,0]\n let strs=[\"\",\"\",\"\",\"\",\"\",\"\"]\n results[0]=nums[ordering[0]]\n strs[0]=\"\"+nums[ordering[0]]\n for(let op1=0; op1<4; op1++){\n let outp=operate(results[0],nums[ordering[1]],op1, goal, 1+1, strs[0])\n // console.log(outp)\n results[1]=outp[0]\n strs[1] = outp[1]\n for(let op2=0; op2<4; op2++){\n let outp=operate(results[1],nums[ordering[2]],op2, goal, 2+1, strs[1])\n results[2]=outp[0]\n strs[2] = outp[1]\n\n for(let op3=0; op3<4; op3++){\n let outp=operate(results[2],nums[ordering[3]],op3, goal, 3+1, strs[2])\n results[3]=outp[0]\n strs[3] = outp[1]\n\n for(let op4=0; op4<4; op4++){\n let outp=operate(results[3],nums[ordering[4]],op4, goal, 4+1, strs[3])\n results[4]=outp[0]\n strs[4] = outp[1]\n\n for(let op5=0; op5<4; op5++){\n let outp=operate(results[4],nums[ordering[5]],op5, goal, 5+1, strs[4])\n results[5]=outp[0]\n strs[5] = outp[1]\n\n\n //account for using other 2 separately\n outp = operate(nums[ordering[4]], nums[ordering[5]], op4, goal, 2, \"\"+nums[ordering[4]])\n let tmpResults = outp[0]\n let tmpStr = outp[1]\n\n operate(results[3], tmpResults,op5, goal, 6, strs[3], \"(\"+tmpStr+\")\")\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "b742089b622c259e4f74ddbbc77893f1", "score": "0.56568885", "text": "function chunkSolution2(array, size){\n\tlet startIndex = 0;\n\tlet output = [];\n\n\twhile(startIndex < array.length){\n\n\t\toutput.push(array.slice(startIndex, startIndex + size));\n\n\t\tstartIndex += size;\n\t}\n\n\treturn output;\t\n}", "title": "" }, { "docid": "af6875d6faf1c1ae6f9068706566b2cb", "score": "0.56488335", "text": "function _backtrack(tempList, sum, start) {\n // base case: if sum === target push tempList to output\n if (sum === n && tempList.length === k) {\n output.push([...tempList]);\n // else if sum > target, return\n } else if (sum > n || tempList.length >= k) {\n return;\n // else loop through start to n\n } else {\n for (let i = start; i <= 9; i++) {\n // push number to tempList and add to sum\n tempList.push(i);\n // call helper with tempList, sum, and i+1\n _backtrack(tempList, sum + i, i + 1);\n // pop number from tempList and subtract from sum\n tempList.pop();\n }\n }\n }", "title": "" }, { "docid": "453a510c407fbb1f60304291f4d9950a", "score": "0.564081", "text": "function subArraySum(arr,s) {\n for(i=0; i< arr.length; i++) {\n for(j=0; j< arr.length; i++) {\n if(i !== j && arr[i] + arr[j] === s) {\n return [j, i];\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "1f78b0a0868bb4801d17b640b26ac6c5", "score": "0.5634492", "text": "function subCojunt(array,limit,offset){\n\t var result = [];\n\n //parseamos para tener posibilidad de operaciones aritmeticas\n \t var limitint = parseInt(limit,10);\n \t var offsetint = parseInt(offset,10);\n\n\n \t if(!isEmptyObject(array)){\n if (offsetint<= array.length-1){\n\n //esta es la que pagina y devuelve el conjunto\n for(var i=offsetint;i<limitint+offsetint;i++){\n result.push(array[i]);\n \n if (i==array.length-1){\n \tbreak\n \t\t }\n }\n }\n \t}\n return result;\n\n\n\n}", "title": "" }, { "docid": "20af0626fe5bf8006c597d9880c1d678", "score": "0.5617682", "text": "indicesOfSorted(noodle, sList, els) {\n var inds = new Array(sList.length);\n var min = 0;\n var max = sList.length - 1;\n var halfLen = Math.ceil((els.length - 1) / 2);\n var i;\n var iInv;\n for (i = 0; i < halfLen;) {\n min = noodle.sList.indexOfPlus(noodle, sList, els[i], min, max);\n i++;\n iInv = els.length - i;\n max = noodle.sList.indexOfPlus(noodle, sList, els[iInv], min, max);\n\n inds[i] = min;\n inds[iInv] = max;\n }\n if (iInv - i === 2) {\n inds[halfLen] = noodle.sList.indexOfPlus(noodle, sList, els[halfLen], min, max);\n }\n return inds;\n\n\n\n\n /* var list = sList.list;\n var mid;\n var min = 0;\n var max = list.length - 1;\n var minComp;\n var maxComp;\n\n while (min <= max) {\n mid = Math.floor((min + max) / 2);\n minComp = compare(minEl, list[mid]);\n maxComp = compare(maxEl, list[mid]);\n //If minEl < list[mid]\n if (minComp > 0) {\n min = mid;\n }\n //If el > list[mid]\n if (comp > 0) {\n min = mid + 1;\n }\n //If el == list[mid]\n else {\n return mid;\n }\n }\n return -1;*/\n }", "title": "" }, { "docid": "7c41393010a4231d858c17eb5b12d01d", "score": "0.56175345", "text": "function solution(A) {\n // A = [4, 2, 2, 5, 1, 5, 8]\n let n = A.length;\n let minAverage = 1e9;\n let ansInd = 0;\n for (let P = 0; P < n - 1; P++) {\n let slice2 = (A[P] + A[P + 1]) / 2;\n if (minAverage > slice2) {\n minAverage = slice2;\n ansInd = P;\n }\n if (P < n - 2) {\n let slice3 = (A[P] + A[P + 1] + A[P + 2]) / 3;\n if (minAverage > slice3) {\n minAverage = slice3;\n ansInd = P;\n }\n }\n }\n return ansInd;\n}", "title": "" }, { "docid": "2a2fdaaec20124ba76f8d3e48776a2d0", "score": "0.5593465", "text": "function fonk() {\n for (let index = 1; index <= Math.ceil(array.length / 2); index++) {\n var tmpSum = 0;\n if (index == 1) {\n //1 elemanlı tüm dizi indisleri arraye eklendi\n for (let index2 = 0; index2 < array.length; index2++) {\n subArrayFilteredIndex.push(index2.toString()); //diziye ekle tek elemanlı sub str indislerini\n const element = [];\n element.push(index2.toString());\n checkSumIndex(element, array);\n }\n } else {\n //son eleman gezme\n subArray = subArrayCompress.slice(0, index); //sıkışık bir dizi alınır\n lastMember(index);\n }\n }\n\n var str = \"En büyük toplamlı dizi(ler)\";\n maxSubArrayIndisArray.forEach(element => {\n str += \"<br>\"+realSubArray[element];\n });\n\n var str2 = \"<br>Tüm komşusuz diziler.<br>\";\n\n realSubArray.forEach(element => {\n str2 += \"<br>\" + element;\n });\n\n var str3 = \"Ana dizimiz<br>\" + array.toString();\n\n document.getElementById(\"add1\").innerHTML = str3;\n document.getElementById(\"add2\").innerHTML = \"Toplam <br>\"+maxSubArraySum;\n\n document.getElementById(\"add3\").innerHTML = str;\n document.getElementById(\"add4\").innerHTML = str2;\n}", "title": "" }, { "docid": "d9f37e8c5f66286a52c269e368c9dec8", "score": "0.55891013", "text": "function s(nums, target) {\n let l = 0;\n let r = nums.length - 1;\n while (l <= r) {\n let m = Math.floor((l + r) / 2);\n console.log({ l, m, r });\n if (nums[m] === target) {\n let n = m;\n while (nums[m - 1] === target) m--;\n while (nums[n + 1] === target) n++;\n return [m, n];\n }\n if (nums[m] < target) {\n l = m + 1;\n } else {\n r = m - 1;\n }\n }\n return [-1, -1];\n}", "title": "" }, { "docid": "b205fec5832596a482a8fa35903414e6", "score": "0.5580498", "text": "function getSmallestSubArr(arr, target) {\n let window = 0;\n let sum = 0;\n let sumArr = [];\n while (window < arr.length) {\n for (let i = 0; i < arr.length - window; i++) {\n const el1 = arr[i];\n sum += el1;\n sumArr.push(el1);\n if (sum > target) return sumArr;\n for (let j = i + 1; j < i + window + 1 && j < arr.length; j++) {\n const el2 = arr[j];\n sum += el2;\n sumArr.push(el2);\n }\n console.log(sumArr);\n if (sum > target) return sumArr;\n sum = 0;\n sumArr = [];\n }\n window += 1;\n }\n return null;\n}", "title": "" }, { "docid": "b4f42997fdbd3932db01e2f048b65266", "score": "0.5577228", "text": "function select(arr, left, right, k, compare) {\n var n, i, z, s, sd, newLeft, newRight, t, j;\n\n while (right > left) {\n if (right - left > 600) {\n n = right - left + 1;\n i = k - left + 1;\n z = Math.log(n);\n s = 0.5 * Math.exp(2 * z / 3);\n sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (i - n / 2 < 0 ? -1 : 1);\n newLeft = Math.max(left, Math.floor(k - i * s / n + sd));\n newRight = Math.min(right, Math.floor(k + (n - i) * s / n + sd));\n select(arr, newLeft, newRight, k, compare);\n }\n\n t = arr[k];\n i = left;\n j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}", "title": "" }, { "docid": "b4f42997fdbd3932db01e2f048b65266", "score": "0.5577228", "text": "function select(arr, left, right, k, compare) {\n var n, i, z, s, sd, newLeft, newRight, t, j;\n\n while (right > left) {\n if (right - left > 600) {\n n = right - left + 1;\n i = k - left + 1;\n z = Math.log(n);\n s = 0.5 * Math.exp(2 * z / 3);\n sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (i - n / 2 < 0 ? -1 : 1);\n newLeft = Math.max(left, Math.floor(k - i * s / n + sd));\n newRight = Math.min(right, Math.floor(k + (n - i) * s / n + sd));\n select(arr, newLeft, newRight, k, compare);\n }\n\n t = arr[k];\n i = left;\n j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}", "title": "" }, { "docid": "a64d838b7e594e3058a21056e5accdd1", "score": "0.5572759", "text": "function findDisjoint(n, nsf, ssf, rem, retind, ind) {\n \"use strict\";\n var i, sn = '', d2;\n for (i = ind; i < rem.length; i++) {\n d2 = $(rem[i]).html();\n if (d2.length <= n) {\n sn = normalise(ssf + d2);\n if (sn.length === n && nsf + 1 === n) {\n retind.push(i);\n return sn;\n }\n if (sn.length < nsf + 1) {\n showmsg(\"You've gone wrong!\", \"warning\");\n return '';\n }\n if (nsf + 1 < n && sn.length <= n && i + 1 < rem.length) {\n retind.push(i);\n sn = findDisjoint(n, nsf + 1, sn, rem, retind, i + 1);\n if (sn !== '') {\n return sn;\n } else {\n retind.pop();\n }\n }\n }\n }\n return '';\n}", "title": "" }, { "docid": "2192fe1a2f688733630bfa95013878c4", "score": "0.55727", "text": "function dynamicProgramming(str) {\n if (str.length < 1) return 0\n if (isPalindrome(str)) return 0\n\n const table = [...Array(str.length)].map(e => Array(str.length).fill(0))\n // when indexes i == j, there's only 1 char. 1 char needs 0 partitions \n for (let i = 0; i < str.length; i++) {\n table[i][i] = 0\n }\n // the gap is the difference between end of left side partition and start of right side partition\n for (let gap = 1; gap < str.length; gap++) {\n for (let i = 0; i + gap < str.length; i++) {\n let j = i + gap\n // FUTURE improvements:\n // Since we repeatedly check if a substring is a palindrome\n // we can improve runtime performance by using 2d array to store isPalindrome\n // result and use later on when needed\n if (isPalindrome(str.slice(i, j + 1))) {\n table[i][j] = 0\n } else {\n table[i][j] = Number.POSITIVE_INFINITY\n for (let k = i; k < j; k++) {\n table[i][j] = Math.min(\n table[i][j],\n 1 + table[i][k] + table[k+1][j]\n )\n }\n }\n }\n }\n console.log(table)\n return table[0][str.length-1]\n}", "title": "" }, { "docid": "961c09d2cfe26d47f8016dcf5103b573", "score": "0.55720586", "text": "function arrayManipulation(n, queries) {\n // bc is 1-based\n // 0 pos is ignored, so n + 1\n // the algo will use (pos + 1) on last pos incl, so n + 2 pos are needed total\n let arr = Array(n + 2).fill(0);\n\n queries.map(q => {\n let [a, b, k] = q;\n\n // apply prefix sum algo\n // where you calculate curr el = prev el + curr el\n arr[a] += k;\n arr[b + 1] -= k;\n });\n\n let max = 0;\n for (var i = 1; i <= n; i++) {\n arr[i] = arr[i] + arr[i - 1];\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n\n // Math.max returns runtime error...\n return max;\n}", "title": "" }, { "docid": "e2974789da05fb490b10daaed14d22da", "score": "0.55628127", "text": "function solution(arr) {\n // let count = 0;\n // let copy = [...arr];\n // const getMin = (list) => {\n // let filter = list.filter((el) => el !== 0);\n // let min = Math.min(...filter);\n // return min;\n // };\n // const go = (list, min) => {\n // list = list.map((el) => {\n // if (el !== 0) {\n // el = el - min;\n // }\n // return el;\n // });\n // return list;\n // };\n // const getZeroLen = (list) => list.filter((el) => el === 0).length;\n // while (getZeroLen(arr) !== arr.length) {\n // let min = Math.min(...arr);\n // min = min === 0 ? getMin(arr) : min;\n // arr = go(arr, min);\n // count++;\n // }\n // if (Array.from(new Set(copy)).length === 2) {\n // let min = Math.min(...copy);\n // if (min === 0) {\n // return copy.filter((el) => el !== min).length;\n // } else {\n // return copy.filter((el) => el !== min).length;\n // }\n // }\n\n let set = Array.from(new Set(arr));\n if (set.length === 2 && set.includes(0)) return set.length + 1;\n if (set.length === 2) return set.length + 2;\n\n return set.length;\n}", "title": "" }, { "docid": "adbbadfdb8fd3cc64bd09ce055b51ec6", "score": "0.55591697", "text": "function arrayManipulation(n, queries) {\n // console.log(\"n: \", n);\n // this is written poorly above where I expected n to contain n & m, but it doesn't\n // this frustrates me every time that I work on challenges on hackerrank due to inconsistency of the description of the input/output\n\n // console.log(\"queries: \", queries);\n let queryArray = queries;\n let arraySize = Number(n);\n\n\n // populate myArray to have correct amount of zeroes\n // for (let i = arraySize; i >0; i--) {\n // myArray.push(0);\n // }\n\n let myArray = Array(arraySize).fill(0);\n \n\n // need to make this more performance friendly...\n for (let j=0; j<queryArray.length;j++) {\n // for(let k = 1; k< myArray.length;k++) {\n // if (k >= queryArray[j][0] && k <= queryArray[j][1]) {\n // myArray[k-1] += queryArray[j][2];\n // }\n // }\n\n myArray[queryArray[j][0]-1] += queryArray[j][2];\n myArray[queryArray[j][1]] += (-1* queryArray[j][2]); \n }\n\n let highestValue = 0;\n let currentValue = 0;\n\n for (let l = 0; l < myArray.length;l++) {\n currentValue += myArray[l];\n\n if (currentValue > highestValue) {\n highestValue = currentValue;\n }\n }\n\n return highestValue;\n}", "title": "" }, { "docid": "54f7ea31e5781b96826650d3902afbf1", "score": "0.554828", "text": "function minimumBribes(q) {\n let maxPosition = q.length;\n let steps = 0;\n // Used to mimic possible bribes until we get to final position\n let initialState = Array.from({length: maxPosition}, (_, i) => i+1);\n // will store final position indexes difference with initial position for every element\n let afterTable = {};\n // same as above, but will not change, for info request only\n const afterTableStatic = {};\n // to avoid expensive cost of index searching in initial state\n let initialStateIndexes = {};\n\n // getting all the elements with - after position and + after posiition\n // - value: it is sure q[i] bribe a position\n // + value: moved forward its position lastly or as a result of - values movement\n // 0 value: ordered\n let i;\n for(i = 0; i < maxPosition; i++) {\n afterTable[q[i]] = ((i+1) - q[i]);\n afterTableStatic[q[i]] = i;\n initialStateIndexes[i+1] = i;\n }\n\n // hacker test purpose\n //let chaoticMsg = false;\n let tempValue;\n let currentElementLocation= 0;\n let element;\n let elementMinusOne;\n let elementMinusOneIndex\n let elementMinusTwo;\n let elementMinusTwoIndex;\n for(element in afterTable) {\n if(afterTable.hasOwnProperty(element)) {\n if(afterTable[element] < -2) {\n // hacker test purpose\n //chaoticMsg = true;\n //console.log('Too chaotic');\n //break;\n\n // for local testing\n return 'Too chaotic';\n\n }\n if(afterTable[element] < 0) {\n currentElementLocation = parseInt(element);\n // look backwards last two elements in initial state\n //second element\n elementMinusOne = initialState[currentElementLocation-2];\n // first element\n elementMinusTwo = initialState[currentElementLocation-3];\n // if element-2 is greater than element-1 then do nothin\n // if this was false, that means both were swapped before\n if(elementMinusOne > elementMinusTwo) {\n // search for its orders within q array, if they are in same order do nothing\n elementMinusOneIndex = afterTableStatic[elementMinusOne]\n elementMinusTwoIndex = afterTableStatic[elementMinusTwo]\n // if they are inverted, swap them before swap element\n if(elementMinusTwoIndex > elementMinusOneIndex) {\n // swap in initialState\n [initialState[initialStateIndexes[elementMinusOne]],\n initialState[initialStateIndexes[elementMinusTwo]]] =\n [initialState[initialStateIndexes[elementMinusTwo]],\n initialState[initialStateIndexes[elementMinusOne]]];\n // change indexes in initialStateIndexes\n [initialStateIndexes[elementMinusOne],\n initialStateIndexes[elementMinusTwo]] =\n [initialStateIndexes[elementMinusTwo],\n initialStateIndexes[elementMinusOne]];\n // update afterTable\n afterTable[elementMinusOne] =\n (afterTable[elementMinusOne] < 0) ? ++afterTable[elementMinusOne]\n : --afterTable[elementMinusOne];\n afterTable[elementMinusTwo] =\n (afterTable[elementMinusTwo] < 0) ? ++afterTable[elementMinusTwo]\n : --afterTable[elementMinusTwo];\n ++steps\n }\n }\n\n // relocate until afterTable is 0\n while(afterTable[element] < 0) {\n //console.log(initialState);\n tempValue = initialState[currentElementLocation-1];\n initialState[currentElementLocation-1] = initialState[currentElementLocation-2];\n initialState[currentElementLocation-2] = tempValue;\n\n // storing initial state indexes to avoid search for elements in second iteration over all afterTable elements\n initialStateIndexes[initialState[currentElementLocation-1]] = currentElementLocation-1\n initialStateIndexes[initialState[currentElementLocation-2]] = currentElementLocation-2\n\n // update current movement debt from table, movements done to get final state are removed\n // new steps to get final states are computed, until 0 movements in every element are debt\n afterTable[element] += 1;\n afterTable[initialState[currentElementLocation-1]] -=1;\n // because element change its location with left element in initialState\n currentElementLocation -= 1;\n ++steps;\n }\n }\n }\n }\n return steps;\n // hacker test purpose\n //if(!chaoticMsg) console.log(steps);\n}", "title": "" }, { "docid": "88a3e2fdb06160de681e11bf01dc1fb4", "score": "0.5539611", "text": "function task22(arr=[3,-1,-7,-4,-6,9,10]) {\n const answer = {};\n arr.forEach((n1,i1) => {\n if (!answer.found)\n arr.forEach((n2,i2) => {\n if (!answer.found)\n arr.forEach((n3,i3) => {\n if (\n i1!==i2 &&\n i2!==i3 &&\n i1!==i3 &&\n n1+n2+n3===0 &&\n !answer.found\n ) {\n answer.found = true;\n answer.group = [n1,n2,n3];\n }\n });\n });\n });\n if(answer.found) return answer.group;\n return false;\n}", "title": "" }, { "docid": "99aeae32a372cfbfefaa6d234881efdd", "score": "0.55346847", "text": "function solution(nums, numOfGroups) {\n // console.log(nums, numOfGroups);\n let lengthOfNums = nums.length;\n // console.log(lengthOfNums)\n let prefixSum = Array(nums.length + 1);\n prefixSum[0] = 0;\n for (let i = 0; i < lengthOfNums; i++) {\n\n prefixSum[i + 1] = prefixSum[i] + nums[i];\n }\n\n // console.log('prefix sum ', prefixSum)\n let resultMatrix = Array(nums.length + 1);\n // resultMatrix = resultMatrix.map(() =>\n // Array(nums.length + 1).fill(0)\n // )\n\n for (let i = 0; i <= lengthOfNums; i++) {\n // for (let j = i; j < lengthOfNums + 1; j++) {\n // console.log(i, j, prefixSum[j] - prefixSum[i], resultMatrix)\n resultMatrix[i] = prefixSum[lengthOfNums] - prefixSum[i];\n // }\n }\n // console.log(resultMatrix)\n // printMatrix(resultMatrix);\n // console.time('cal')\n // let count = 0;\n for (let n = 2; n <= numOfGroups; n++) {\n // console.log('\\n------------------------')\n // console.log('n = ', n);\n // count = 0;\n let boundary = lengthOfNums - n + 1;\n for (let i = 0; i < boundary; i++) {\n // console.log('i=', i);\n // console.log(resultMatrix[0][lengthOfNums]);\n // for (let j = i + 1; j <= lengthOfNums; j++) {\n // for (let j = lengthOfNums; j <= lengthOfNums; j++) {\n // console.log('j=', j);\n for (let k = i + 1; k < lengthOfNums; k++\n ) {\n // console.log('k=', k);\n // console.log('====================')\n // console.log('prefixsum:', prefixSum)\n // console.log('i j k:', i, j, k)\n // console.log('result:', resultMatrix[i][j])\n // console.log('mik:', prefixSum[k] - prefixSum[i])\n // console.log('mkj:', resultMatrix[k][j]);\n let sumOfi2k = prefixSum[k] - prefixSum[i];\n if (sumOfi2k >= resultMatrix[i]) break;\n resultMatrix[i] = Math.min(resultMatrix[i], Math.max(sumOfi2k, resultMatrix[k]))\n if (sumOfi2k > resultMatrix[k]) break;\n // printMatrix(resultMatrix);\n // console.log(resultMatrix)\n // count++\n }\n if (n === numOfGroups) break;\n\n\n // }\n\n }\n // console.log(resultMatrix)\n // console.log(count)\n // printMatrix('for n = ', n, resultMatrix);\n }\n // console.log(count);\n // console.timeEnd('cal')\n // console.log('count', count)\n return resultMatrix[0]\n}", "title": "" }, { "docid": "8f7a0f8a2d328b8fac87ef5bf5368144", "score": "0.55339766", "text": "function sieveTotient(limit) {\n if (limit < 0 || limit >= 9007199254740992 || Math.round(limit) != limit)\n throw new RangeError(\"Limit out of range\");\n let result = [];\n for (let i = 0; i <= limit; i++)\n result.push(i);\n for (let i = 2; i < result.length; i++) {\n if (result[i] == i) {\n for (let j = i; j < result.length; j += i)\n result[j] -= result[j] / i;\n }\n }\n return result;\n}", "title": "" }, { "docid": "f0e940c95bef1d1a8930b86170389aa4", "score": "0.55314964", "text": "siftDown(index) {\n const arr = this.storage;\n let max;\n if (!arr[2*index+2] && !arr[2*index+1]) return arr;\n if (arr[2*index+2]) {\n max = Math.max(arr[index],arr[2*index+1],arr[2*index+2]);\n } else {\n max = Math.max(arr[index],arr[2*index+1]);\n }\n if(arr[2*index+1] === max) {\n arr[2*index+1] = arr[index];\n arr[index] = max;\n } if (arr[2*index+2] === max) {\n arr[2*index+2] = arr[index];\n arr[index] = max;\n }\n return arr;\n }", "title": "" }, { "docid": "0cd2c525a044543fe70e86452da5e148", "score": "0.5525622", "text": "function doit(N,pos,arr,funk){\n\tif(pos>=funk.length){\n\t\tconsole.log(\"rez:\",arr);\n\t\treturn true;\n\t\t}\n\t\n\t\tif(arr[pos]===0){\n\t\t\tfor(let j=1;j<=N;j++){\n\t\t\t\tif(funk[j]===0 && (pos%j===0||j%pos===0)){\n\t\t\t\t\tfunk[j]=1;\n\t\t\t\t\tarr[pos]=j;\n\t\t\t\t\tdoit(N,pos+1,arr,funk)\n\t\t\t\t\tarr[pos]=0;\n\t\t\t\t\t//this is the key part. I forgot to re-init funk\n\t\t\t\t\tfor(let k=0;k<=N;k++){\n\t\t\t\t\t\tfunk[k]=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\treturn false;\n\n}", "title": "" }, { "docid": "23988b2476dd06a0f6a6bf497c0323d4", "score": "0.5520148", "text": "function largeGroupPositions(s) {\n // First attempt: accepted, but quite slow:\n // let currIdx = 0;\n // const r = [];\n\n // while (currIdx < s.length) {\n // let start = currIdx;\n // let end;\n\n // for (let i = currIdx; i <= s.length; i++) {\n // if (s[i] !== s[currIdx]) {\n // if (end - start >= 2) {\n // r.push([start, end]);\n // currIdx = end;\n // }\n // break;\n // }\n\n // if (s[i] === s[currIdx]) {\n // end = i;\n // }\n // }\n\n // currIdx++;\n // }\n\n // return r;\n const r = [];\n let start = 0,\n end = 0;\n for (let i = 1; i < s.length; i++) {\n if (s[i] !== s[i - 1]) {\n if (end - start >= 2) {\n r.push([start, end]);\n }\n start = i;\n end = i;\n } else {\n end++;\n }\n }\n if (end - start >= 2) {\n r.push([start, end]);\n }\n return r;\n}", "title": "" }, { "docid": "9b45ac94ec2d4c3cb6efd73e1ee39496", "score": "0.549655", "text": "function maxSubsetSumNoAdjacent(arr) {\n if (arr.length === 0) return 0;\n if (arr.length === 1) return arr[0];\n const maxSums = [...arr]; // create a new array of same length as input array\n maxSums[1] = Math.max(maxSums[0], maxSums[1])\n // console.log(maxSums)\n for (let i = 2; i < arr.length; i += 1) {\n maxSums[i] = Math.max(maxSums[i-1], maxSums[i-2] + arr[i])\n }\n return maxSums[maxSums.length - 1]\n }", "title": "" }, { "docid": "2583b9b99e179987583f5dcf9e13cce7", "score": "0.5486592", "text": "function minimumBribes(q) {\n let answer = 0;\n let arr = Array(100001);\n let arrCnt = Array(100001);\n for (let i = 0; i < arr.length; ++i) {\n arr[i] = i + 1;\n }\n for (let i = 0; i < q.length - 1; ++i) {\n let originValue = q[i];\n if (arr[i] !== originValue) {\n if (arr[i + 1] !== originValue) {\n if (arr[i + 2] !== originValue) {\n return 'Too chaotic';\n }\n let temp = arr[i + 2];\n arr[i + 2] = arr[i + 1];\n arr[i + 1] = temp;\n answer++;\n }\n let temp = arr[i + 1];\n arr[i + 1] = arr[i];\n arr[i] = temp;\n answer++;\n }\n }\n return answer;\n}", "title": "" }, { "docid": "0ada69f8746280c88c5a2094d314fbe3", "score": "0.54845256", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var pos = 0;\n var count = 0;\n\n for (var i = 0; i < A.length; i++) {\n if (A[pos] == A[i]) {\n count++;\n } else {\n count--;\n if (count == 0) {\n pos = i;\n count++;\n }\n }\n }\n\n var ret = 0;\n var cand = A[pos];\n\n var E = [];\n var N = [];\n\n var ec = 0;\n var nc = 0;\n for (var i = 0; i < A.length; i++) {\n if (A[i] == cand) {\n ec++;\n } else {\n nc++;\n }\n E[i] = ec;\n N[i] = nc;\n }\n\n for (var i = 0; i < A.length; i++) {\n if (E[i] > N[i] && ((nc - N[i]) < (ec - E[i]))) {\n ret++;\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "d172384588209ecb3cedc77f8a84e11c", "score": "0.5478436", "text": "e77() {\n // from problem 76, i = 30 was sufficient to generate > 5000 partitions\n // in order to minimize space and time, we will use 46 primes as an upper bound, and increase if necessary\n const PRIMES = Object.keys(utils.generatePrimesTable(200)).map(Number);\n let answer = 0;\n let I = 2;\n\n // each key is of the form a|b, and the value is the number of partitions of a using primes smaller or equal to b\n const MEM = { };\n while (!answer) {\n for (let i = 2; i <= I; i++) {\n for (let j = 0; j < PRIMES.length; j++) {\n const prime = PRIMES[j];\n if (prime > i) {\n MEM[`${i}|${prime}`] = MEM[`${i}|${PRIMES[j - 1]}`];\n continue;\n }\n if (j === 0) {\n MEM[`${i}|${prime}`] = utils.isEven(i) ? 1 : 0;\n continue;\n }\n const usingPrime = MEM[`${i - prime}|${prime}`] || (i === prime ? 1 : 0);\n const notUsing = MEM[`${i}|${PRIMES[j - 1]}`] || 0;\n if (notUsing + usingPrime > 5000) {\n MEM[`${i}|${prime}`] = notUsing + usingPrime;\n answer = i;\n break;\n }\n MEM[`${i}|${prime}`] = notUsing + usingPrime;\n }\n if (answer) {\n break;\n }\n }\n I++;\n }\n return answer;\n }", "title": "" }, { "docid": "5a7db10b1b5df5eecd691a434475d354", "score": "0.5478019", "text": "function maxmimumSubarraySum4_WithIndexes_KadaneAlgo(a){\n //Kadane's algo for maximum subarray sum\n let current_sum = 0;\n let max_sum = Number.MIN_SAFE_INTEGER;\n let start =0;\n let end = 0; \n let newStart=0; \n\n //Kadane's algo for maximum subarray sum\n for (let i = 0; i < a.length; i++) {\n current_sum = current_sum + a[i];\n\n if(current_sum > max_sum){\n max_sum = current_sum;\n\n start = newStart; \n end = i; \n }\n\n if (current_sum < 0) {\n current_sum = 0;\n\n newStart = i + 1; \n }\n }\n console.log(`Maximum Subarray Sum: ${max_sum}`);\n console.log(`Indices: ${start} - ${end}`);\n}", "title": "" }, { "docid": "ba1c678239c0a7459c01b28579199827", "score": "0.547202", "text": "function maxSubsetSumNoAdjacent(array) {\n // Write your code here.\n\tif(!array.length) return 0\n if(array.length === 1) return array[0]\n\tarray[1] = Math.max(array[0], array[1])\n for(let i = 2; i < array.length; i++) {\n array[i] = Math.max(array[i], array[i-1], (array[i-2] + array[i]))\n }\n console.log({array})\n return array[array.length - 1]\n}", "title": "" }, { "docid": "542b00f69ba0979f58959ab668eff870", "score": "0.54594654", "text": "function arrayManipulation(n, queries,m) {\n \n \n var result = 0;\n \n var temp = [n];\n \n for(var i=0;i<n;i++){\n temp[i]=0;\n \n }\n \n for(var i = 0; i < m; i++) {\n var lbound = queries[i][0];\n var ubound = queries[i][1];\n var value = queries[i][2];\n \n temp[lbound-1]+=value;\n if(ubound<n) temp[ubound]-=value; \n }\n \n /*for(int i = 0; i < n; i++) {\n if(temp[i] > result){\n result = temp[i];\n }\n }*/\n var t=0;\n\n for(var i=0;i<n;i++){\n t += temp[i];\n if(t> result) result=t;\n }\n\n return result;\n\n\n}", "title": "" }, { "docid": "4e9ffba1676adc2973f3d7eb68b7fe61", "score": "0.545739", "text": "function solve(nums,goal){\n fullSolutions = {}\n for(let z=0; z<=6; z++){\n fullSolutions[z]={}\n }\n // console.log(goal)\n var ordering=[-1,-1,-1,-1,-1,-1]\n for(let n0=0; n0<6; n0++){\n ordering[0]=n0\n for(let n1=0; n1<6; n1++){\n ordering[1]=n1\n for(let n2=0; n2<6; n2++){\n ordering[2]=n2\n for(let n3=0; n3<6; n3++){\n ordering[3]=n3\n for(let n4=0; n4<6; n4++){\n ordering[4]=n4\n for(let n5=0; n5<6; n5++){\n ordering[5]=n5\n let good=true\n for(let n_check_1 = 0; n_check_1<6; n_check_1++)\n for(let n_check_2 = n_check_1+1; n_check_2<6; n_check_2++)\n if(ordering[n_check_1]==ordering[n_check_2])\n good = false\n if (good)\n find(nums, ordering, goal)\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "095ce0c6f73542b7df81e0616872c27d", "score": "0.5451213", "text": "function solution(A) {\n const peak = [];\n\n for(let i = 1; i < A.length; i++) {\n if(A[i - 1] < A[i] && A[i] > A[i + 1]) peak.push(i);\n }\n // console.log(peak)\n\n if(peak.length < 2) return peak.length; // [1, 3, 2] // one flag\n let dist = peak[peak.length - 1] - peak[0];\n\n const placeFlags = num => {\n let target = num;\n let start = peak[0];\n let i = 1;\n\n while(i < peak.length) {\n if(peak[i] - start >= num) {\n target--;\n if(target === 0) return true;\n }\n i++;\n }\n return false;\n }\n\n let left = 1;\n // let right = peak.length;\n let right = Math.floor(Math.sqrt(dist));\n let mid;\n\n while(left <= right) {\n mid = Math.floor((left + right) / 2) \n if(placeFlags(mid) === true) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n // console.log(left, mid, right)\n return mid;\n}", "title": "" }, { "docid": "31eabd313fa0b9c173b27b6c5a7bcb08", "score": "0.54506946", "text": "function frankenSplice(arr1, arr2, n) {\n let arr2Start = arr2.slice(0, n);\n let arr2End = arr2.slice(n);\n \n for(let i = 0; i < arr1.length; i++) {\n arr2Start.push(arr1[i]);\n }\n for(let i = 0; i < arr2End.length; i++){\n arr2Start.push(arr2End[i])\n }\n return arr2Start;\n}", "title": "" }, { "docid": "04e767b1648dddba848e4c1a03788fdc", "score": "0.54495305", "text": "function mOptimized(arr, start, end) {\n if(end - start === 1) {\n return [arr[start]];\n };\n let mid = start + Math.floor((end - start) / 2);\n return merge(\n mOptimized(arr, start, mid),\n mOptimized(arr, mid, end)\n );\n}", "title": "" }, { "docid": "7e6d0c1a7daa506cff97108be2cd4557", "score": "0.5447484", "text": "function i$2(n,r,i,o){if(1===o.length){if(Z$2(o[0]))return l$2(n,o[0],-1);if(E$6(o[0]))return l$2(n,o[0].toArray(),-1)}return l$2(n,o,-1)}", "title": "" }, { "docid": "f090423f0ffe365daa5b07fc587f44fa", "score": "0.54472584", "text": "function returnReverso(array) { //[1, 2, 3]\n var temp = 0;\n for (var i = 0; i < array.length / 2; i++) {\n // temp = array[0] = 1\n temp = array[i];\n // 1 = array[3-1-0]>2>3\n array[i] = array[array.length - 1 - i];\n // 3 = 1\n array[array.length - 1 - i] = temp;\n }\n return array;\n}", "title": "" }, { "docid": "4f8e00f058a54d58d6ae9f8c7a4f770c", "score": "0.54422516", "text": "function maxSubsetSumNoAdjacent(array) {\n if (!array.length) return 0\n if (array.length === 1) return array[0]\n const max = array.slice()\n\n max[1] = Math.max(array[0], array[1])\n for (let i = 2; i < array.length; i++) {\n max[i] = Math.max(max[i - 1], max[i - 2] + array[i])\n console.log(max)\n }\n return max[max.length - 1]\n}", "title": "" }, { "docid": "aac6e7f5c8b52cebf7cc93a4ec050578", "score": "0.5441342", "text": "function longestBitonicSubarray(arr) {\n let longest = 0;\n for(let i = 0; i < arr.length; i++){\n for(let j = i; j < arr.length; j++){\n let sub = arr.slice(i, j+1);\n console.log(sub);\n if(isBitonic(sub) && sub.length > longest){\n longest = sub.length\n }\n }\n }\n return longest;\n}", "title": "" }, { "docid": "75791dc772cf0a5da0bc98e5246b100c", "score": "0.5437411", "text": "sortBUxxx(a, lo, hi, merge) {\n const N = a.length\n let mid = 0\n\n for(let sz = 2; sz < N; sz += sz) {\n for(let i = 0; i < N; i += sz) {\n const hi = i + sz - 1\n if(hi >= N - 1) {\n merge(a, i, N - 1, Math.floor((N - 1 + i) / 2))\n // console.log('lo: ' + i + ', hi: ' + N + ', mid: ' + Math.floor((N + i) / 2) + ', ret: ' + a)\n }\n else {\n merge(a, i, i + sz - 1, Math.floor((i * 2 + sz - 1) / 2))\n // console.log('lo: ' + i + ', hi: ' + (i + sz - 1) + ', mid: ' + Math.floor((i * 2 + sz - 1) / 2) + ', ret: ' + a)\n }\n }\n }\n merge(a, 0, N - 1, Math.floor((N - 1) / 2))\n // console.log('lo: ' + 0 + ', hi: ' + N + ', mid: ' + Math.floor(N / 2) + ', ret: ' + a)\n\n }", "title": "" }, { "docid": "7d52e2c5d89c102fafe3fce5368ad0df", "score": "0.54300994", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "e2e74238a757e8ac9ce303c6016cb392", "score": "0.5419913", "text": "function search_triplets(arr) {\n arr.sort((a,b) => a - b)\n const triplets = []\n\n for (let i = 0; i < arr.length; i++) {\n\n // skip same element to avoid duplicate triplets\n if (i > 0 && arr[i] === arr[i - 1]) {\n continue\n }\n\n // pass in -X\n search_pair(arr, -arr[i], i + 1, triplets)\n }\n\n return triplets\n}", "title": "" }, { "docid": "df8049cf987322b7fb146413d5c0de4e", "score": "0.5417969", "text": "function partialSums(list){\n return (list.map((item,index) => list.filter((temp,j) => j <= index))\n .map(item => item.reduce((a, b) => a + b,0)));\n}", "title": "" }, { "docid": "9c38362504980058960cedc0058afc30", "score": "0.54096705", "text": "function search_pair(arr, target_sum, left, triplets) {\n let right = arr.length - 1\n\n while (left < rigth) {\n // sum Y and Z\n const current_sum = arr[left] + arr[right]\n\n // found the triplet\n if (current_sum === target_sum) {\n triplets.push([-target_sum, arr[left], arr[right]])\n left++\n right--\n\n while (left < right && arr[left] === arr[left - 1]) {\n // skip same element to avoid duplicate triplets\n left++\n }\n\n while (left < right && arr[right] === arr[right - 1]) {\n // skip same element to avoid duplicate triplets\n right--\n }\n\n } else if (target_sum > current_sum) { // slide & shrink our window to find our sum\n // we need a pair with a bigger sum\n left++\n } else {\n // we need a pair with a smaller sum\n right--\n }\n }\n}", "title": "" }, { "docid": "9c1e29a2b30a3ba7a74342d3cf3cf905", "score": "0.54090834", "text": "function findTasks(i, j){\r\n // Base case\r\n if(j === 0){\r\n // There is nothing else to take\r\n return;\r\n }\r\n if(dp[i][j] === 0){\r\n // Nothing else to take as well\r\n return;\r\n }\r\n // Got to the 0 item, which means that item is taken\r\n if(i === 0){\r\n tasksAllocation[i] = 1;\r\n return;\r\n }\r\n // Pushing factor\r\n if(dp[i][j] === dp[i-1][j]){\r\n // If same as the above value\r\n return findTasks(i-1, j);\r\n }\r\n else{\r\n // If different, this item is taken and go on to find where is next place to start searching down\r\n tasksAllocation[i] = 1;\r\n return findTasks(i-1, j-tasks[i]);\r\n }\r\n }", "title": "" }, { "docid": "612f00bac340409866d5c34e357054b5", "score": "0.54074717", "text": "function solvePart2(board) {\n // Keep track of the boards I've seen and when I saw them\n // This may need to be an actual hashmap for efficiency reasons\n let seen = {};\n let cycleLength = 0;\n for (var i = 0; cycleLength === 0; i++) {\n let flatBoard = flatten(board);\n if (seen.hasOwnProperty(flatBoard)) {\n cycleLength = i - seen[flatBoard]\n }\n seen[flatBoard] = i;\n //console.log(seen);\n board = nextBoard(board);\n }\n\n const remainingIterations = (1000000000 - i) % cycleLength;\n console.log(`remaing iterations: ${remainingIterations}`);\n\n // Now that we've shortcutted, look return the final answer\n return iterate(board, remainingIterations);\n}", "title": "" }, { "docid": "117239e9c99b2a0d7c30a14ffb08730c", "score": "0.5402874", "text": "function solve(str) {\n const dp = [...new Array(str.length)];\n\n for (let i = 0; i < dp.length; i++) {\n const row = [...new Array(str.length)].fill(false);\n dp[i] = row;\n }\n\n // all substrings of length 1 are palindromes/ true\n for (let i = 0; i < dp.length; i++) {\n dp[i][i] = true;\n }\n\n let start = 0;\n let maxLen = 0;\n // check substrings of length 2\n for (let i = 0; i < dp.length - 1; i++) {\n if (str[i] === str[i + 1]) {\n dp[i][i + 1] = true;\n start = i;\n maxLen = 2;\n }\n }\n\n // check all lengths greather than 2\n for (let k = 2; k < dp.length; k++) {\n for (let i = 0; i < dp.length - k + 1; i++) {\n let j = i + k - 1;\n if (dp[i + 1][j - 1] && str[i] === str[j]) {\n dp[i][j] = true;\n if (k > maxLen) {\n start = i;\n maxLen = k;\n }\n }\n }\n }\n\n let res = str[start];\n start++;\n maxLen--;\n while (maxLen) {\n res += str[start];\n start++;\n maxLen--;\n }\n\n console.log(dp);\n return res;\n}", "title": "" }, { "docid": "d9297265d4979243bfcfdce09f2fb495", "score": "0.53991085", "text": "function sol(s) {\n const n = s.length;\n const dp = [];\n for (let i = 0; i <= n; i++) {\n const row = [];\n for (let j = 0; j <= n; j++) {\n row.push(0);\n }\n dp.push(row);\n }\n computeAllPals();\n const minPals = Array(n + 2).fill(Infinity);\n minPals[n + 1] = 0;\n\n for (let k = n; k >= 1; k--) {\n for (let l = k; l <= n; l++) {\n if (dp[k][l]) {\n minPals[k] = Math.min(minPals[k], 1 + minPals[l + 1]);\n }\n }\n }\n\n console.log({ dp, minPals });\n return minPals[1] - 1;\n\n function computeAllPals() {\n for (let i = n; i >= 1; i--) {\n // fill to the left of the char, used to get correct index on line 43\n dp[i][i - 1] = true;\n // char by itself is a pal\n dp[i][i] = true;\n for (let j = i + 1; j <= n; j++) {\n if (s[i - 1] === s[j - 1]) {\n dp[i][j] = dp[i + 1][j - 1];\n } else {\n dp[i][j] = false;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "407c1b5565f22fed17c8b1b7831a9c02", "score": "0.5398216", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n var indices=[];\n for(var i =0 ; i < A.length;i++){\n var sum1 = 0;\n var sum2 = 0\n for(var j = 0; j<i; j++){\n sum1 = sum1 + A[j];\n\n }\n for(var k = i+1; k<A.length; k++){\n sum2 = sum2 + A[k];\n\n }\n console.log(sum2);\n console.log(sum1);\n if(sum1 == sum2){\n indices.push(\"\"+i);\n }\n }\n if (typeof indices !== 'undefined' && indices.length > 0){\n return indices;\n }\n else{\n return -1;\n }\n}", "title": "" }, { "docid": "5ef82745f54b2b931c38b69d50ff3974", "score": "0.5397438", "text": "function findSubarray(arr, target) {\n let sum = 0, mapOfSums = {};\n for (let ii = 0; ii < arr.length; ii++) {\n sum += arr[ii];\n if (sum === target) {\n return [0, ii];\n }\n\n if (mapOfSums[sum - target] !== undefined) {\n return [mapOfSums[sum - target] + 1, ii];\n }\n\n mapOfSums[sum] = ii;\n }\n\n return null;\n}", "title": "" }, { "docid": "3ad5782ca0373ba4d768b7b652438273", "score": "0.53817326", "text": "function beautifulTriplets(d, arr) {\n let temp_arr = [];\n let tripplet_count = 0;\n\n\n for (let index=0; index<arr.length-2; index++) {\n temp_arr.push(arr[index]);\n for(let x=index+1; x<arr.length; x++) {\n if(arr[x] - temp_arr[temp_arr.length-1] == d) {\n temp_arr.push(arr[x]);\n }\n \n \n if (temp_arr.length == 3) {\n tripplet_count++;\n }\n\n }\n //console.log(tripplet_count);\n temp_arr.length = 0;\n \n\n }\n\n console.log(tripplet_count);\n return tripplet_count;\n\n}", "title": "" }, { "docid": "a92e3387e6848b990fbd099fe26472ec", "score": "0.53804725", "text": "function cut(n, a) {\n var r = [],\n i, len = a.length;\n if (len == 0) return r;\n var rws = Math.ceil(len / n)\n var s = a.slice(0);\n for (i = 0; i < n; i++) s.push(0)\n for (i = 0; i < len; i += n) r.push(s.slice(i, n + i))\n return r\n}", "title": "" }, { "docid": "a92e3387e6848b990fbd099fe26472ec", "score": "0.53804725", "text": "function cut(n, a) {\n var r = [],\n i, len = a.length;\n if (len == 0) return r;\n var rws = Math.ceil(len / n)\n var s = a.slice(0);\n for (i = 0; i < n; i++) s.push(0)\n for (i = 0; i < len; i += n) r.push(s.slice(i, n + i))\n return r\n}", "title": "" }, { "docid": "a0bd1e0511f6f361e377fbd47945cb92", "score": "0.53798944", "text": "function f3 (arr, k) {\n let windowStart = 0, windowEnd = 0, countDistinct = 0, holdDistinct = {};\n for(;windowEnd<arr.length;windowEnd++) {\n if(!holdDistinct[arr[windowEnd]]) {\n holdDistinct[arr[windowEnd]] = 0;\n }\n holdDistinct[arr[windowEnd]] += 1;\n if(windowEnd - windowStart + 1 == k) {\n console.log(Object.keys(holdDistinct).length+'\\n');\n let leftEl = arr[windowStart];\n holdDistinct[leftEl] -= 1;\n if(holdDistinct[leftEl] == 0) {\n delete holdDistinct[leftEl];\n }\n windowStart++;\n }\n }\n}", "title": "" }, { "docid": "b8f9b575f1e9901be2d38a200dfb1e07", "score": "0.5372389", "text": "function getPrimes(n){\n let k = (n-2)/2;\n let arr = [k+1];\n for(let i = 1;i<k+1;i++){\n let j = i;\n while((i+j+2*i*j)<= k){//can optimize ?\n arr[i+j+2*i*j] = 1;\n j++;\n }\n }\n let fixedArray = [];\n let count = 0;\n for(let i = 0; i < k+1;i++){\n if(arr[i] != 1){\n fixedArray[count++] = 2*i+1;\n }\n }\n return fixedArray;\n}", "title": "" }, { "docid": "e88db4c010de447708dfd5f01148d6a7", "score": "0.53689814", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "a16577e8daee94bd12910628e788b888", "score": "0.53640795", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "a16577e8daee94bd12910628e788b888", "score": "0.53640795", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "a16577e8daee94bd12910628e788b888", "score": "0.53640795", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "a16577e8daee94bd12910628e788b888", "score": "0.53640795", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "a16577e8daee94bd12910628e788b888", "score": "0.53640795", "text": "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "title": "" }, { "docid": "8837fa92cd5a5c6847c415872c8ec473", "score": "0.53634405", "text": "function solve(n, p){\n const book = generateBook(n),\n pageTurns = [-1, -1];\n\n // Front side\n for (let i = 0; i < book.length; i++) {\n if (~book[i].indexOf(p)) {\n pageTurns[0] = i;\n break\n }\n }\n\n // Back side\n for (let i = book.length - 1; i >= 0; i--) {\n if (~book[i].indexOf(p)) {\n pageTurns[1] = book.length - 1 - i;\n break;\n }\n }\n\n return Math.min(...pageTurns);\n}", "title": "" }, { "docid": "7c3cc72e67681bc2f0c492c5a81e4ced", "score": "0.53629977", "text": "function arrayChangePP2(a){\n var length=a.length;\n var move=0;\n var rs=0;\n for(var i=0; i<length; i++)\n {\n while(a[i+1]<=a[i])\n {\n move=a[i]-a[i+1]+1;\n rs+=move;\n a[i+1]+=move;\n }\n }\n return rs;\n}", "title": "" }, { "docid": "b2b4986995d7a52aeaabfec84f73f2b7", "score": "0.53628534", "text": "function findNumbersOfSum(data, sum) {\n let result = [];\n function findNumbers(i, j, sum) {\n console.log(data[i] + '+' + data[j]);\n let res = data[i] + data[j];\n\n if (res === sum) {\n let items = [];\n items.push(data[i]);\n items.push(data[j]);\n result.push(items);\n i++;\n if (i !== j) {\n findNumbers(i, j, sum);\n }\n }\n else if (res < sum) {\n i++;\n findNumbers(i, j, sum);\n }\n else if (res > sum) {\n j--;\n findNumbers(i, j, sum);\n }\n }\n findNumbers(0, data.length - 1, sum);\n return result;\n}", "title": "" }, { "docid": "3d84dea262684d5d8d77fc00dae3109b", "score": "0.5360923", "text": "function quickselect(array, k, left = 0, right = array.length - 1, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}", "title": "" }, { "docid": "3d84dea262684d5d8d77fc00dae3109b", "score": "0.5360923", "text": "function quickselect(array, k, left = 0, right = array.length - 1, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}", "title": "" }, { "docid": "3d84dea262684d5d8d77fc00dae3109b", "score": "0.5360923", "text": "function quickselect(array, k, left = 0, right = array.length - 1, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}", "title": "" }, { "docid": "cdf7914ddaed0eebccbec38b48e6c7c1", "score": "0.5359556", "text": "function Part2(input) {\n let diffs = getDiffs(input);\n let results = [];\n let lastbit = null;\n\n // build an array of consecutive 1-diff lengths\n for (let i = 0; i < diffs.length; i++) {\n let jolt = diffs[i];\n if (jolt === 1) {\n if (lastbit === 1) {\n results[results.length - 1]++;\n } else {\n results.push(1);\n }\n }\n lastbit = jolt;\n }\n\n // I worked out the permutations by hand for a run of consecutive 1-diffs from 1 to 5\n // which 4 seems like the longest consecutive run present in my data. Not happy with this\n const permutationTable = [1, 2, 4, 7, 13];\n results = results.map(val => permutationTable[val - 1]);\n console.log(results);\n\n // multiply the permutations together\n return results.reduce((acc, val) => acc * val);\n}", "title": "" }, { "docid": "79a4b2f59a4c79a7c5cbcc36974f29f8", "score": "0.53592837", "text": "function quickselect(array, k, left = 0, right = array.length - 1, compare = ascending) {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}", "title": "" }, { "docid": "32497044ed143f9b3bf8edfc33ce987a", "score": "0.53590846", "text": "function reverseChunks(arr,k) {\n let result = arr.slice();\n let left = 0;\n let right = left + k - 1;\n if(right >= arr.length){right = arr.length-1}\n let tracker = 0;\n while(tracker <= result.length+right) {\n while(left < right) {\n [result[left],result[right]] = [result[right],result[left]]\n ++left;\n --right;\n }\n tracker += k; \n left = tracker;\n right = left + k - 1;\n if(right > result.length-1) {right = result.length-1}\n }\n return result; \n}", "title": "" }, { "docid": "552c354ce1919fd1f8dd4b3814a6abc1", "score": "0.53583187", "text": "function SubsetsWithGivenDifference(arr, diff) {\n let sum = 0;\n \n for(let i=0; i < arr.length; i++) {\n sum += arr[i];\n }\n \n \n let S1 = (diff+sum)/2;\n let row = arr.length+1;\n let col = S1+1;\n let m = Array(row);\n \n for(let i=0; i < row; i++){\n m[i] = Array(col);\n m[i][0] = 1;\n }\n \n for(let i=1; i < col; i++) {\n m[0][i] = 0;\n }\n \n for(let i=1; i < row; i++){\n for(let j=1; j < col; j++){\n m[i][j] = m[i-1][j] + (arr[i-1] <= j) ? m[i-1][j - arr[i-1]] : 0;\n }\n }\n \n return m[row-1][col-1];\n}", "title": "" }, { "docid": "e38679e401be535402387acf71668c4f", "score": "0.5357452", "text": "function getTotalX(a, b) {\n let arr =[];\n let res = [];\n let out = 0; \n for(let i=a[a.length-1]; i<=b[0]; i++){\n arr.push(i);\n }\n console.log(arr);\n for(let i=0; i<arr.length; i++){\n for(let j=0; j<b.length; j++){\n if(b[j] % arr[i] === 0){\n if(j === b.length-1){\n res.push(arr[i]); \n }\n }else {\n break;\n }\n }\n }\n console.log(res);\n for(let i=0; i<res.length; i++){\n for(let j=0; j<a.length; j++){\n if(res[i] % a[j] === 0){\n if(j === a.length-1){\n out += 1; \n }\n }else {\n break;\n }\n }\n }\n return out;\n}", "title": "" }, { "docid": "5bb15b6b7aa7ad70752faebc4240dd77", "score": "0.5356512", "text": "function main() {\n var ntests = parseInt(std_input_arr[0], 10)\n\n for(var t = 1; t <= ntests; t++) {\n var line1 = std_input_arr[t*2-1].split(' ');\n var n_str = parseInt(line1[0]);\n \n var str = std_input_arr[t*2];\n var indexes = [];\n\n // removing overlapping houses that got counted\n for(let i=0; i<n_str; i++) {\n if(str[i] === '1') {\n indexes.push(i);\n }\n }\n\n var total_ones = indexes.length\n var total_substrings = total_ones + (total_ones*(total_ones - 1)/2)\n\n console.log(total_substrings);\n }\n}", "title": "" }, { "docid": "84781ce0b2dee1380f3c8c893cbe74f2", "score": "0.53555423", "text": "function quickselect(array, k) {\n var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var right = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Infinity;\n var compare = arguments.length > 4 ? arguments[4] : undefined;\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n if (!(left <= k && k <= right)) return array;\n compare = compare === undefined ? _sort.ascendingDefined : (0, _sort.compareDefined)(compare);\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n var t = array[k];\n var i = left;\n var j = right;\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n if (compare(array[left], t) === 0) swap(array, left, j);else ++j, swap(array, j, right);\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}", "title": "" }, { "docid": "9491dce7e10bd099a35119cb8c804544", "score": "0.53552914", "text": "function cariModus(arr) {\n\n\n //check kalo nomor cuman ada satu(tidak di hitung sebagai modus)\n //slice dipake soalnya kalo nga pake array ke sort\n //console.log(arr.sort(function(a,b){return a-b}));\n //console.log(arr.sort(function(a,b){return b-a}));\n if (arr.slice(0).sort(function (a, b) {\n return a - b\n })[0] === (arr.slice(0).sort(function (a, b) {\n return b - a\n }))[0]) {\n return -1;\n } else {\n var newArr = [];\n for (var x = 0; x <= arr.length - 1; x++) {\n for (var i = 0; i <= arr.length - 1; i++) {\n if (x !== i && arr[x] === arr[i]) {\n console.log(arr[i]);\n newArr.push(arr[i]);\n }\n }\n }\n if (newArr[0] === undefined) {\n return -1;\n } else {\n return newArr[0];\n }\n }\n\n\n}", "title": "" } ]
5c39e24c3e0babdc2500ca2d71d46647
Crossplatform codegen helper for generating vmodel value assignment code.
[ { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6200408", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" } ]
[ { "docid": "a03f5c289902a3b579fdccb1de5c6979", "score": "0.6501747", "text": "function genAssignmentCode(value, assignment) {\n const res = parseModel(value);\n if (res.key === null) {\n return `${value}=${assignment}`;\n }\n else {\n return `$set(${res.exp}, ${res.key}, ${assignment})`;\n }\n}", "title": "" }, { "docid": "07ae654d6caacc99dc6693851fe0ee18", "score": "0.6488642", "text": "function genAssignmentCode(value, assignment) {\n const res = parseModel(value);\n\n if (res.key === null) {\n return `${value}=${assignment}`;\n } else {\n return `$set(${res.exp}, ${res.key}, ${assignment})`;\n }\n }", "title": "" }, { "docid": "06e0051a1e4d15cb4544a288147ee475", "score": "0.645518", "text": "function genAssignmentCode(value, assignment) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "8ce44d8fac1c8960abc7709092d52479", "score": "0.643828", "text": "function genAssignmentCode(value, assignment) {\n var res = (0, _modal.parseModel)(value);\n if (res.key === null) {\n return value + '=' + assignment; // (value + \"=\" + assignment)\n }\n // (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n return '$set(' + res.exp + ', ' + res.key + ', ' + assignment + ')';\n}", "title": "" }, { "docid": "7f7bfe0665998aaf51fe1eb557d100a4", "score": "0.63918537", "text": "function genAssignmentCode(value, assignment) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return value + \"=\" + assignment;\n } else {\n return \"var $$exp = \" + modelRs.exp + \", $$idx = \" + modelRs.idx + \";\" + \"if (!Array.isArray($$exp)){\" + value + \"=\" + assignment + \"}\" + \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\";\n }\n}", "title": "" }, { "docid": "7f7bfe0665998aaf51fe1eb557d100a4", "score": "0.63918537", "text": "function genAssignmentCode(value, assignment) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return value + \"=\" + assignment;\n } else {\n return \"var $$exp = \" + modelRs.exp + \", $$idx = \" + modelRs.idx + \";\" + \"if (!Array.isArray($$exp)){\" + value + \"=\" + assignment + \"}\" + \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\";\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6322025", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "c052684b3cf730ea8e5f791757886482", "score": "0.63133407", "text": "function genAssignmentCode(value,assignment){var res=parseModel(value);if(res.key===null){return value+\"=\"+assignment;}else{return\"$set(\"+res.exp+\", \"+res.key+\", \"+assignment+\")\";}}", "title": "" }, { "docid": "563d6c069e5a594ce6233eebabd6132c", "score": "0.62955093", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n }", "title": "" }, { "docid": "563d6c069e5a594ce6233eebabd6132c", "score": "0.62955093", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n }", "title": "" }, { "docid": "85ad2eac70bbc14c2f42e4af527588d1", "score": "0.62829715", "text": "function genAssignmentCode(value, assignment) {\n\t var modelRs = parseModel(value);\n\t if (modelRs.idx === null) {\n\t return value + \"=\" + assignment;\n\t } else {\n\t return \"var $$exp = \" + modelRs.exp + \", $$idx = \" + modelRs.idx + \";\" + \"if (!Array.isArray($$exp)){\" + value + \"=\" + assignment + \"}\" + \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\";\n\t }\n\t}", "title": "" }, { "docid": "b646d41faafeb88a6590d350d7edf829", "score": "0.62463945", "text": "function genAssignmentCode (\n\t value,\n\t assignment\n\t) {\n\t var modelRs = parseModel(value);\n\t if (modelRs.idx === null) {\n\t return (value + \"=\" + assignment)\n\t } else {\n\t return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n\t }\n\t}", "title": "" }, { "docid": "94e582288afc51b2a2c7f98b765995a3", "score": "0.622457", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n}", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.6167703", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "a1dcbb8bea78267944bb4a32388144af", "score": "0.6165415", "text": "function genComponentModel (\n el,\n value,\n modifiers\n ) {\n var ref = modifiers || {};\n var number = ref.number;\n var trim = ref.trim;\n \n var baseValueExpression = '$$v';\n var valueExpression = baseValueExpression;\n if (trim) {\n valueExpression =\n \"(typeof \" + baseValueExpression + \" === 'string'\" +\n \"? \" + baseValueExpression + \".trim()\" +\n \": \" + baseValueExpression + \")\";\n }\n if (number) {\n valueExpression = \"_n(\" + valueExpression + \")\";\n }\n var assignment = genAssignmentCode(value, valueExpression);\n \n el.model = {\n value: (\"(\" + value + \")\"),\n expression: JSON.stringify(value),\n callback: (\"function (\" + baseValueExpression + \") {\" + assignment + \"}\")\n };\n }", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.615768", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "6e75ee611baed6ba5387a3f56dcc1551", "score": "0.0", "text": "function t(e,t,n,r){var a={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],ss:[e+\"sekundi\",e+\"sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[e+\" minuti\",e+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[e+\" tunni\",e+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[e+\" kuu\",e+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[e+\" aasta\",e+\" aastat\"]};return t?a[n][2]?a[n][2]:a[n][1]:r?a[n][0]:a[n][1]}", "title": "" } ]
[ { "docid": "178433e4b11f9ddcb88c4b6e193a2995", "score": "0.82470614", "text": "function Wr(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "title": "" }, { "docid": "a390e3889aaf18f7f94b575486cc78ae", "score": "0.8205188", "text": "function ya(e,a,t){var n={ss:a?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:a?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:a?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===t?a?\"хвилина\":\"хвилину\":\"h\"===t?a?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,a){var t=e.split(\"_\");return a%10==1&&a%100!=11?t[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?t[1]:t[2]}(n[t],+e)}", "title": "" }, { "docid": "d8460bf77dfc9523fd479119f87673fb", "score": "0.8185529", "text": "function b(e,t,n){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}//! moment.js locale configuration", "title": "" }, { "docid": "495a928bc0fe94f1ee8dfcd920e9e883", "score": "0.7475443", "text": "function n0(e,t,n,s){var i={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?i[n][0]:i[n][1]}//! moment.js locale configuration", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.72040725", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d11d49c1c0d4ff5684649e17cdef56d0", "score": "0.7132608", "text": "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "title": "" }, { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.71282613", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "bb8b71ffd36b2533e0a66198bff05a13", "score": "0.69288945", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(typeof values === 'undefined'){data = locale_locales__getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "ee81d7536b923f48eaaac79336a54c14", "score": "0.67254865", "text": "async function useLocale(name: string) {\n // import locale as you do normally\n // smth like `require('moment/locale/en-gb')` will happen down the lines\n await import(`moment/locale/${name}`);\n moment.locale(name); // apply it to moment\n // eslint-disable-next-line no-underscore-dangle (in case eslint is also used ;) )\n momentTZ.defineLocale(name, moment.localeData()._config); // copy locale to moment-timezone\n momentTZ.locale(name); // apply it to moment-timezone\n}", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "bd45c18382f47b3e3883f2f8774dbdef", "score": "0.6498538", "text": "function toMomentLocale(lang) {\n if (lang === undefined) {\n return undefined;\n }\n\n // moment.locale('') equals moment.locale('en')\n // moment.locale(null) equals moment.locale('en')\n if (!lang || lang === 'en' || lang === 'default') {\n return 'en';\n }\n return lang.toLowerCase().replace('_', '-');\n}", "title": "" }, { "docid": "905b2a63b0758abf2b864fb122567678", "score": "0.6456085", "text": "convertFormat() {\n\n let format = this.options.format;\n this.options._format = this.options.format; // store orginal Moment format\n\n if (format) {\n\n // lower case everything\n format = format.toLowerCase();\n\n // Since we lowercased everything convert the map is slightly different than above\n const map = {'mmm': 'M', 'mmmm': 'MM', 'ddd': 'D', 'dddd': 'DD'};\n const re = new RegExp(Object.keys(map).join('|'), 'gi');\n format = format.replace(re, matched => {\n return map[matched];\n });\n\n }\n\n // this is moment format converted to bootstrap-datepicker.js format.\n this.options.format = format;\n\n }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6335232", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6335232", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "15c20f00d96a62ebece47e3cb1a1aa8d", "score": "0.6120914", "text": "defaultLocale() {\n return validLocale[0];\n }", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6096749", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "40b3c68c07532eaf59b06d98280ea5ac", "score": "0.6078787", "text": "static localize () {\n\t\tthis.trigger ('willLocalize');\n\n\t\t// Setup the correct locale for the momentjs dates\n\t\tmoment.locale (this._languageMetadata[this.preference ('Language').code]);\n\n\t\tthis.element ().find ('[data-string]').each ((element) => {\n\t\t\tconst string_translation = this.string ($_(element).data ('string'));\n\n\t\t\t// Check if the translation actually exists and is not empty before\n\t\t\t// replacing the text.\n\t\t\tif (typeof string_translation !== 'undefined' && string_translation !== '') {\n\t\t\t\t$_(element).text (string_translation);\n\t\t\t}\n\t\t});\n\t\tthis.trigger ('didLocalize');\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
3469afd188e050d02f801b8105f9000e
(Op I32, Op I32) > Op I32 Conversion
[ { "docid": "0f65dd17e34d79b1c3217328fbd7232c", "score": "0.0", "text": "wrap_i64 (a) { return new instr_pre1(0xa7, this, a) }", "title": "" } ]
[ { "docid": "0a6462e92b42970b0240fb79bd26262b", "score": "0.58276683", "text": "_op(a, o, b) {\n const rtl = this.settings.rtl;\n switch (o) {\n case '<':\n return rtl ? a > b : a < b;\n case '>':\n return rtl ? a < b : a > b;\n case '>=':\n return rtl ? a <= b : a >= b;\n case '<=':\n return rtl ? a >= b : a <= b;\n default:\n break;\n }\n }", "title": "" }, { "docid": "5464321ebf5a5d758a8c351560db0181", "score": "0.53789264", "text": "function lt(v1, v2)\n{\n \"tachyon:static\";\n\n // If both values are immediate integers\n if (boxIsInt(v1) && boxIsInt(v2))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_lt(v1, v2))\n return true;\n else\n return false;\n }\n\n // Convert both values to primitives\n var px = boxToPrim(v1);\n var py = boxToPrim(v2);\n\n // If both values are immediate integers\n if (boxIsInt(px) && boxIsInt(py))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_lt(px, py))\n return true;\n else\n return false;\n }\n\n // If both values are strings\n if (boxIsString(px) && boxIsString(py))\n {\n // Perform string comparison\n return strcmp(px, py) < pint(0);\n }\n\n // Attempt to convert both values to numbers\n var nx = boxToNumber(px);\n var ny = boxToNumber(py);\n \n // If both values are immediate integers\n if (boxIsInt(nx) && boxIsInt(ny))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_lt(nx, ny))\n return true;\n else\n return false;\n }\n\n // The values are not comparable\n return false;\n}", "title": "" }, { "docid": "1e712e21178e751af0b7f408de740e9d", "score": "0.5335814", "text": "function gt(v1, v2)\n{\n \"tachyon:static\";\n\n // If both values are immediate integers\n if (boxIsInt(v1) && boxIsInt(v2))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_gt(v1, v2))\n return true;\n else\n return false;\n }\n\n // Convert both values to primitives\n var px = boxToPrim(v1);\n var py = boxToPrim(v2);\n\n // If both values are immediate integers\n if (boxIsInt(px) && boxIsInt(py))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_gt(px, py))\n return true;\n else\n return false;\n }\n\n // If both values are strings\n if (boxIsString(px) && boxIsString(py))\n {\n // Perform string comparison\n return strcmp(px, py) > pint(0);\n }\n\n // Attempt to convert both values to numbers\n var nx = boxToNumber(px);\n var ny = boxToNumber(py);\n \n // If both values are immediate integers\n if (boxIsInt(nx) && boxIsInt(ny))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_gt(nx, ny))\n return true;\n else\n return false;\n }\n\n // The values are not comparable\n return false;\n}", "title": "" }, { "docid": "3f5e2a99a83762a4a6f075a55c86d6d7", "score": "0.5294912", "text": "function applyOp(/* char */ op, /*int*/ b, /*int*/ a){\n switch (op){\n case '+':\n return a + b;\n case '-':\n return a - b;\n case '*':\n return a * b;\n case '/':\n if (b === 0){\n throw new Error(\"Cannot divide by zero\");\n }else{\n return a / b;\n }\n case '^':\n return Math.pow(a, b);\n case '&':\n return boolToInt(a!==0 && b!==0);\n case '|': \n return boolToInt(a!==0 || b!==0);\n case '>':\n return boolToInt(a===0 || (a!==0 && b!==0));\n case '=':\n //return boolToInt((a===0 && b===0) || (a!==0 && b!==0));\n return boolToInt(a===b);\n case '~':\n case '!':\n return boolToInt(b===0);\n }\n return 0;\n }", "title": "" }, { "docid": "675de33e932fa84b2d86488c1ebb6cb0", "score": "0.52879554", "text": "function op_order_compare_1_to_2(op_1, op_2)\n{\n\tif (!(is_operator(op_1)))\n\t\treturn OP_ORDER.ERROR;\n\tif (!(is_operator(op_2)))\n\t\treturn OP_ORDER.ERROR;\n\t\t\n\t// higher precedence is lower\n\treturn OP_ORDER.OPERATORS.indexOf(op_1) < OP_ORDER.OPERATORS.indexOf(op_2) ? OP_ORDER.HIGHER :\n\t\t(OP_ORDER.OPERATORS.indexOf(op_1) > OP_ORDER.OPERATORS.indexOf(op_2) ? OP_ORDER.LOWER : OP_ORDER.EQUAL);\n}", "title": "" }, { "docid": "6ebf97c6d9575e4a2ecfebce97fe2b41", "score": "0.52431685", "text": "function ge(v1, v2)\n{\n \"tachyon:static\";\n\n // If both values are immediate integers\n if (boxIsInt(v1) && boxIsInt(v2))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_ge(v1, v2))\n return true;\n else\n return false;\n }\n\n // Convert both values to primitives\n var px = boxToPrim(v1);\n var py = boxToPrim(v2);\n\n // If both values are immediate integers\n if (boxIsInt(px) && boxIsInt(py))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_ge(px, py))\n return true;\n else\n return false;\n }\n\n // If both values are strings\n if (boxIsString(px) && boxIsString(py))\n {\n // Perform string comparison\n return strcmp(px, py) >= pint(0);\n }\n\n // Attempt to convert both values to numbers\n var nx = boxToNumber(px);\n var ny = boxToNumber(py);\n \n // If both values are immediate integers\n if (boxIsInt(nx) && boxIsInt(ny))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_ge(nx, ny))\n return true;\n else\n return false;\n }\n\n // The values are not comparable\n return false;\n}", "title": "" }, { "docid": "90217eb64d55e048dc3b4ce052d467e5", "score": "0.51821876", "text": "function int32(x) {\n return (x | 0);\n}", "title": "" }, { "docid": "d14a68df71e6c5ca72f9ae516ffbda70", "score": "0.5116727", "text": "function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }", "title": "" }, { "docid": "715f72c322e966b2a877f497cd3c943b", "score": "0.5103541", "text": "function le(v1, v2)\n{\n \"tachyon:static\";\n\n // If both values are immediate integers\n if (boxIsInt(v1) && boxIsInt(v2))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_le(v1, v2))\n return true;\n else\n return false;\n }\n\n // Convert both values to primitives\n var px = boxToPrim(v1);\n var py = boxToPrim(v2);\n\n // If both values are boxed integers\n if (boxIsInt(px) && boxIsInt(py))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_le(px, py))\n return true;\n else\n return false;\n }\n\n // If both values are strings\n if (boxIsString(px) && boxIsString(py))\n {\n // Perform string comparison\n return strcmp(px, py) <= pint(0);\n }\n\n // Attempt to convert both values to numbers\n var nx = boxToNumber(px);\n var ny = boxToNumber(py);\n \n // If both values are immediate integers\n if (boxIsInt(nx) && boxIsInt(ny))\n {\n // Compare the immediate integers directly without unboxing them\n if (iir.if_le(nx, ny))\n return true;\n else\n return false;\n }\n\n // The values are not comparable\n return false;\n}", "title": "" }, { "docid": "adfc817d477fc2e17bfea57481b10992", "score": "0.5096093", "text": "function less(lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }", "title": "" }, { "docid": "054792ed676cab04dc60c44c677b0d4d", "score": "0.5087585", "text": "function $rb_gt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs);\n }", "title": "" }, { "docid": "054792ed676cab04dc60c44c677b0d4d", "score": "0.5087585", "text": "function $rb_gt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs);\n }", "title": "" }, { "docid": "054792ed676cab04dc60c44c677b0d4d", "score": "0.5087585", "text": "function $rb_gt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs);\n }", "title": "" }, { "docid": "054792ed676cab04dc60c44c677b0d4d", "score": "0.5087585", "text": "function $rb_gt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs);\n }", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.5059486", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.5059486", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.5059486", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.5059486", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.5059486", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "ca9c8e485946fd1735009bdc41893336", "score": "0.505911", "text": "function LowToHigh(a, b){return a - b;}", "title": "" }, { "docid": "2c11e9463a1b9e58a456b3c4fee92d0e", "score": "0.50510925", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Integer_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if(((($_0_arg.equals($_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if(((((($_0_arg).compareTo(($_1_arg)) < 0)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "2c11e9463a1b9e58a456b3c4fee92d0e", "score": "0.50510925", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Integer_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if(((($_0_arg.equals($_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if(((((($_0_arg).compareTo(($_1_arg)) < 0)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "2c11e9463a1b9e58a456b3c4fee92d0e", "score": "0.50510925", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Integer_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if(((($_0_arg.equals($_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if(((((($_0_arg).compareTo(($_1_arg)) < 0)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "af7f31b6410ec3cf83def2282b4f8341", "score": "0.5048378", "text": "getOp() {\n // wrap if necessary\n // underflow check\n if (this.y < 0) { this.y += this.code.length; }\n if (this.x < 0) { this.x += this.code[0].length; }\n \n // overflow check\n this.y %= this.code.length;\n this.x %= this.code[0].length;\n \n return this.code[this.y][this.x];\n }", "title": "" }, { "docid": "b0fc9520fd47190c1e6b6fdb5f38f203", "score": "0.50380576", "text": "function operatorPriority(operator){\n switch(operator){\n case '^': return 2;\n case '+': \n case '-': return 0;\n default : return 1; // *, /, %\n \n // minimizes comparisons by doing in 2 0 1 order\n }\n }", "title": "" }, { "docid": "1c72ae8fc2aba223b2193f328fc5a29e", "score": "0.50354856", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Int_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if((((($_0_arg === $_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if((((($_0_arg < $_1_arg)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "1c72ae8fc2aba223b2193f328fc5a29e", "score": "0.50354856", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Int_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if((((($_0_arg === $_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if((((($_0_arg < $_1_arg)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "1c72ae8fc2aba223b2193f328fc5a29e", "score": "0.50354856", "text": "function Prelude__Interfaces__Prelude__Interfaces___64_Prelude__Interfaces__Ord_36_Int_58__33_compare_58_0($_0_arg, $_1_arg){\n \n if((((($_0_arg === $_1_arg)) ? 1|0 : 0|0) === 0)) {\n \n if((((($_0_arg < $_1_arg)) ? 1|0 : 0|0) === 0)) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "fbf60f6d396740e61b921eaebe615c27", "score": "0.503533", "text": "function TypedArrayCompareInt(x, y) {\n // Step 1.\n assert(typeof x === \"number\" && typeof y === \"number\",\n \"x and y are not numbers.\");\n assert((x === (x | 0) || x === (x >>> 0)) && (y === (y | 0) || y === (y >>> 0)),\n \"x and y are not int32/uint32 numbers.\");\n\n // Step 2 (Implemented in TypedArraySort).\n\n // Steps 6-7.\n var diff = x - y;\n if (diff)\n return diff;\n\n // Steps 3-5, 8-9 (Not applicable when sorting integer values).\n\n // Step 10.\n return 0;\n}", "title": "" }, { "docid": "6edd58a7d263f26bdd8ba67584e80e41", "score": "0.50138044", "text": "function isMachineOp(value) {\n return value >= 0 && value <= 15;\n }", "title": "" }, { "docid": "6edd58a7d263f26bdd8ba67584e80e41", "score": "0.50138044", "text": "function isMachineOp(value) {\n return value >= 0 && value <= 15;\n }", "title": "" }, { "docid": "6edd58a7d263f26bdd8ba67584e80e41", "score": "0.50138044", "text": "function isMachineOp(value) {\n return value >= 0 && value <= 15;\n }", "title": "" }, { "docid": "4184e5b6282466db14a3c86488ded8d7", "score": "0.49959975", "text": "function ROTR32 (x, y) {\n return (x >>> y) ^ (x << (32 - y))\n}", "title": "" }, { "docid": "4184e5b6282466db14a3c86488ded8d7", "score": "0.49959975", "text": "function ROTR32 (x, y) {\n return (x >>> y) ^ (x << (32 - y))\n}", "title": "" }, { "docid": "4184e5b6282466db14a3c86488ded8d7", "score": "0.49959975", "text": "function ROTR32 (x, y) {\n return (x >>> y) ^ (x << (32 - y))\n}", "title": "" }, { "docid": "4184e5b6282466db14a3c86488ded8d7", "score": "0.49959975", "text": "function ROTR32 (x, y) {\n return (x >>> y) ^ (x << (32 - y))\n}", "title": "" }, { "docid": "5df1fbc7019f9f3018bdc8c5901886c4", "score": "0.49906462", "text": "gt (a, b) { return new instr_pre(0x64, this, [a, b]) }", "title": "" }, { "docid": "775feef6e01e7a4c0819726e40a4661f", "score": "0.4973885", "text": "function exComparator( int1, int2){\r\n\t\r\n if (int1 > int2){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f9b785cbedf5745438dda057d3f929b3", "score": "0.49680585", "text": "function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }", "title": "" }, { "docid": "e020fb22518eb25463672a7ee510fbd5", "score": "0.49564558", "text": "function $rb_lt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs);\n }", "title": "" }, { "docid": "e020fb22518eb25463672a7ee510fbd5", "score": "0.49564558", "text": "function $rb_lt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs);\n }", "title": "" }, { "docid": "e020fb22518eb25463672a7ee510fbd5", "score": "0.49564558", "text": "function $rb_lt(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs);\n }", "title": "" }, { "docid": "91d19d3e8b0b5c5f4ea5db8d31fd6189", "score": "0.4952771", "text": "function greater(lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }", "title": "" }, { "docid": "f38e39574626bf520b14a4fabfe1fdfc", "score": "0.49324754", "text": "function float2int (value) {\r\n return value | 0;\r\n}", "title": "" }, { "docid": "3b98001057fd716043c88977584ed2b9", "score": "0.49195325", "text": "function exComparator( int1, int2){\n if (int1 > int2){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "17c262ecfb6acbc200287eb437de8c77", "score": "0.49098697", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t\t{\n\t\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t\t}", "title": "" }, { "docid": "17c262ecfb6acbc200287eb437de8c77", "score": "0.49098697", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t\t{\n\t\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t\t}", "title": "" }, { "docid": "17c262ecfb6acbc200287eb437de8c77", "score": "0.49098697", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t\t{\n\t\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t\t}", "title": "" }, { "docid": "9830f3a07c82046030ce4ab3147578f6", "score": "0.49011868", "text": "concat_to_upto32(upto32) {\n if (upto32.num_bits + this.num_bits <= 32) {\n upto32.shift_left(this.num_bits).or(this);\n } else {\n console.trace();\n throw 'Out of bounds';\n }\n }", "title": "" }, { "docid": "66a4a4c0ef851ad055e12269ef71ffb4", "score": "0.48779523", "text": "function B2S_GET32(v, i) {\n return v[i] ^ v[i + 1] << 8 ^ v[i + 2] << 16 ^ v[i + 3] << 24;\n} // Mixing function G.", "title": "" }, { "docid": "f943b4ab8dc721a7defc9c375c1fd196", "score": "0.48737556", "text": "function compare1(a, b){\n let comparison = 0;\n \n if (a > b) {\n comparison = 1;\n } else if (b > a) {\n comparison = -1;\n }\n \n return comparison;\n }", "title": "" }, { "docid": "41c2fc991b7800bf2d183e1733d0779b", "score": "0.4867384", "text": "function imul_reg32(operand1, operand2)\n{\n dbg_assert(operand1 < 0x80000000 && operand1 >= -0x80000000);\n dbg_assert(operand2 < 0x80000000 && operand2 >= -0x80000000);\n var result = multiply_low(operand1, operand2),\n high_result = operand1 * operand2 / 0x100000000 | 0;\n if(high_result === 0)\n {\n flags &= ~1 & ~flag_overflow;\n }\n else\n {\n flags |= 1 | flag_overflow;\n }\n flags_changed = 0;\n return result;\n //console.log(operand + \" * \" + source_operand);\n //console.log(\"= \" + reg32[reg]);\n}", "title": "" }, { "docid": "af6a55fe0fb8da6fa944a55eae59ff99", "score": "0.48612908", "text": "function compare(number11, number12) {\n if (checkValid(number11) && checkValid(number12)) {\n if (number11 == number12)\n return 0;\n else {\n if (number11 > number12)\n return 1;\n else\n return -1;\n }\n }\n }", "title": "" }, { "docid": "f547e1fe7a6963fdf8cc8de88de0a3dc", "score": "0.4859778", "text": "function exComparator(int1, int2) {\r\n if (int1 > int2) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f30c52a5a4c0435be2055da3f7d86041", "score": "0.48410073", "text": "compareToScalar(operator, scalar){\n\t\tlet sum = 0;\n\t\tfor (let v=this.min; v<=this.max; v++) {\n\t\t\tif (operator(v, scalar)) sum += this.combinations(v);\n\t\t}\n\t\treturn sum / this.totalCombinations;\n\t}", "title": "" }, { "docid": "d553909ae9d728128743fa70dd94d624", "score": "0.48142922", "text": "function compareTopologyVersion(lhs, rhs) {\n if (lhs == null || rhs == null) {\n return -1;\n }\n if (lhs.processId.equals(rhs.processId)) {\n // tests mock counter as just number, but in a real situation counter should always be a Long\n const lhsCounter = bson_1.Long.isLong(lhs.counter) ? lhs.counter : bson_1.Long.fromNumber(lhs.counter);\n const rhsCounter = bson_1.Long.isLong(rhs.counter) ? lhs.counter : bson_1.Long.fromNumber(rhs.counter);\n return lhsCounter.compare(rhsCounter);\n }\n return -1;\n}", "title": "" }, { "docid": "ffef273260f649c6af054750a14fe611", "score": "0.48060188", "text": "function compareX(a,b) {\n if (a[_this.xDim.code] < b[_this.xDim.code])\n return -1;\n if (a[_this.xDim.code] > b[_this.xDim.code])\n return 1;\n return 0;\n }", "title": "" }, { "docid": "35c8c9b41995ef72cf2e369952905cce", "score": "0.48016822", "text": "unary(loc, op, input, result) {\n \t\t\t\t\tif(op.includes(\"const\"))\n \t\t\t\t\t\tincInstr(\"register\");\n \t\t\t\t\telse if(op.includes(\"i32\") || op.includes(\"i64\"))\n \t\t\t\t\t\tincInstr(\"integer\");\n \t\t\t\t\telse if(op.includes(\"f32\") || op.includes(\"f64\"))\n \t\t\t\t\t\tincInstr(\"float\");\n count_func_instr_counts(find_top());\n \t\t\t }", "title": "" }, { "docid": "5e3f1213f47c5f27972cbc8ee6525d6c", "score": "0.47866458", "text": "function basicOp(operation, value1, value2){\n switch (operation){\n case '+':\n return value1 + value2;\n break;\n case '-':\n return value1 - value2;\n break;\n case '*':\n return value1 * value2;\n break;\n case '/':\n return value1 / value2;\n break; \n default:\n return 0; \n }\n}", "title": "" }, { "docid": "7e2a63a6a82b8814ef19fbf3af7488ee", "score": "0.47864136", "text": "function CompareNegate(a, b) {\n a = a | 0;\n b = b | 0;\n var sub = 0 - b;\n return a < (sub | 0);\n}", "title": "" }, { "docid": "1a965434fd5460f083aa73c9ba8371e4", "score": "0.47805488", "text": "function binaryPrecedence(op_val) {\n return binary_ops[op_val] || 0;\n }", "title": "" }, { "docid": "7e7c1e01f3b5e616be8f401ad148d8c4", "score": "0.47805247", "text": "gt (a, b) { return new instr_pre(0x5e, this, [a, b]) }", "title": "" }, { "docid": "118d57fc0e1648847ba19d6f573683c9", "score": "0.47768316", "text": "function xapiCompare(a, b) {\n const gaA = a.result.score.scaled;\n const gaB = b.result.score.scaled;\n\n let comparison = 0;\n if (gaA > gaB) {\n comparison = 1;\n } else if (gaA < gaB) {\n comparison = -1;\n }\n return comparison * -1;\n}", "title": "" }, { "docid": "1e2340df5f8a7a15422397e3dd44652a", "score": "0.47764114", "text": "alu(op, regA, regB) {\n switch (op) {\n case \"MUL\":\n // !!! IMPLEMENT ME\n regA = (regA * regB) & 0xff;\n return regA;\n break;\n case \"CMP\":\n // values are the same\n if (regA === regB) {\n this.E = 1;\n }\n // registerA less than registerB\n if (regA < regB) {\n this.L = 1;\n }\n // register A greater than register B\n if (regA > regB) {\n this.G = 1;\n }\n break;\n }\n }", "title": "" }, { "docid": "0928e20e16d5b4cde6f46672abe0c4fb", "score": "0.4766225", "text": "function opaqueCheckedBetweenIntMinAndZeroExclusive(arg) {\n if (arg < 0) {\n if (arg > (0x80000000|0)) {\n return Math.abs(arg);\n }\n }\n throw \"We should not be here\";\n}", "title": "" }, { "docid": "74f738c35d058712b81f4c8460b72a79", "score": "0.47639024", "text": "function compareNum(a, b) {\n if (a > b) return 1;\n if (a == b) return 0;\n if (a < b) return -1;\n}", "title": "" }, { "docid": "e5862cf05ee5fd0081f71dd75d4cb144", "score": "0.4754179", "text": "function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }", "title": "" }, { "docid": "3fa48bd79291bf6ab49949dd13e38426", "score": "0.47485346", "text": "function compareNumber(a, b) {\n a = \"\" + a;\n b = \"\" + b;\n //return a - b;\n if (a > b) return 1;\n if (a < b) return -1;\n if (a = b) return 0;\n}", "title": "" }, { "docid": "765f1491b3cce3313c1a983b35a386f8", "score": "0.47478303", "text": "rewrite(a_addr) {\n var a_ptrn = Pointer(a_addr, 0);\n var b_ptrn = this.get_port(a_addr, 0);\n if (type_of(b_ptrn) === NUM) {\n var a_type = this.type_of(a_addr);\n var a_kind = this.kind_of(a_addr);\n\n // UnaryOperation\n if (a_type === OP1) {\n var dst = this.enter_port(Pointer(a_addr, 2));\n var fst = numb_of(b_ptrn);\n var snd = numb_of(this.enter_port(Pointer(a_addr, 1)));\n switch (a_kind) {\n case 0: var res = Numeric((fst + snd) >>> 0); break;\n case 1: var res = Numeric((fst - snd) >>> 0); break;\n case 2: var res = Numeric((fst * snd) >>> 0); break;\n case 3: var res = Numeric((fst / snd) >>> 0); break;\n case 4: var res = Numeric((fst % snd) >>> 0); break;\n case 5: var res = Numeric((fst ** snd) >>> 0); break;\n case 6: var res = Numeric((fst & snd) >>> 0); break;\n case 7: var res = Numeric((fst | snd) >>> 0); break;\n case 8: var res = Numeric((fst ^ snd) >>> 0); break;\n case 9: var res = Numeric((~snd) >>> 0); break;\n case 10: var res = Numeric((fst >>> snd) >>> 0); break;\n case 11: var res = Numeric((fst << snd) >>> 0); break;\n case 12: var res = Numeric((fst > snd ? 1 : 0) >>> 0); break;\n case 13: var res = Numeric((fst < snd ? 1 : 0) >>> 0); break;\n case 14: var res = Numeric((fst == snd ? 1 : 0) >>> 0); break;\n default: throw \"[ERROR]\\nInvalid interaction.\";\n }\n this.link_ports(dst, res);\n this.unlink_port(Pointer(a_addr, 0));\n this.unlink_port(Pointer(a_addr, 2));\n this.free_node(a_addr);\n \n // BinaryOperation\n } else if (a_type === OP2) {\n this.set_type(a_addr, OP1);\n var num0_ptr = this.enter_port(Pointer(a_addr, 1));\n var num1_ptr = this.enter_port(Pointer(a_addr, 0));\n this.link_ports(num0_ptr, Pointer(a_addr, 0));\n this.link_ports(num1_ptr, Pointer(a_addr, 1));\n \n // NumberDuplication\n } else if (a_type === NOD) {\n this.link_ports(b_ptrn, this.enter_port(Pointer(a_addr, 1)));\n this.link_ports(b_ptrn, this.enter_port(Pointer(a_addr, 2)));\n\n // IfThenElse\n } else if (a_type === ITE) {\n var pair_ptr = this.enter_port(Pointer(a_addr, 1));\n var dest_ptr = this.enter_port(Pointer(a_addr, 2));\n var cond_val = numb_of(b_ptrn) === 0;\n this.set_type(a_addr, NOD);\n this.link_ports(Pointer(a_addr, 0), pair_ptr);\n this.link_ports(Pointer(a_addr, cond_val ? 1 : 2), Pointer(a_addr, cond_val ? 1 : 2));\n this.link_ports(Pointer(a_addr, cond_val ? 2 : 1), dest_ptr);\n\n } else {\n throw \"[ERROR]\\nInvalid interaction.\";\n }\n\n } else {\n var b_addr = addr_of(b_ptrn);\n var a_type = this.type_of(a_addr);\n var b_type = this.type_of(b_addr);\n var a_kind = this.kind_of(a_addr);\n var b_kind = this.kind_of(b_addr);\n\n // NodeAnnihilation, UnaryAnnihilation, BinaryAnnihilation\n if ( a_type === NOD && b_type === NOD && a_kind === b_kind\n || a_type === OP1 && b_type === OP1\n || a_type === OP2 && b_type === OP2\n || a_type === ITE && b_type === ITE) {\n var a_aux1_dest = this.enter_port(Pointer(a_addr, 1));\n var b_aux1_dest = this.enter_port(Pointer(b_addr, 1));\n this.link_ports(a_aux1_dest, b_aux1_dest);\n var a_aux2_dest = this.enter_port(Pointer(a_addr, 2));\n var b_aux2_dest = this.enter_port(Pointer(b_addr, 2));\n this.link_ports(a_aux2_dest, b_aux2_dest);\n for (var i = 0; i < 3; i++) {\n this.unlink_port(Pointer(a_addr, i));\n this.unlink_port(Pointer(b_addr, i));\n }\n this.free_node(a_addr);\n if (a_addr !== b_addr) {\n this.free_node(b_addr);\n }\n\n // NodeDuplication, BinaryDuplication\n } else if\n ( a_type === NOD && b_type === NOD && a_kind !== b_kind\n || a_type === NOD && b_type === OP2\n || a_type === NOD && b_type === ITE) {\n var p_addr = this.alloc_node(b_type, b_kind);\n var q_addr = this.alloc_node(b_type, b_kind);\n var r_addr = this.alloc_node(a_type, a_kind);\n var s_addr = this.alloc_node(a_type, a_kind);\n this.link_ports(Pointer(r_addr, 1), Pointer(p_addr, 1));\n this.link_ports(Pointer(s_addr, 1), Pointer(p_addr, 2));\n this.link_ports(Pointer(r_addr, 2), Pointer(q_addr, 1));\n this.link_ports(Pointer(s_addr, 2), Pointer(q_addr, 2));\n this.link_ports(Pointer(p_addr, 0), this.enter_port(Pointer(a_addr, 1)));\n this.link_ports(Pointer(q_addr, 0), this.enter_port(Pointer(a_addr, 2)));\n this.link_ports(Pointer(r_addr, 0), this.enter_port(Pointer(b_addr, 1)));\n this.link_ports(Pointer(s_addr, 0), this.enter_port(Pointer(b_addr, 2)));\n for (var i = 0; i < 3; i++) {\n this.unlink_port(Pointer(a_addr, i));\n this.unlink_port(Pointer(b_addr, i));\n }\n this.free_node(a_addr);\n if (a_addr !== b_addr) {\n this.free_node(b_addr);\n }\n\n // UnaryDuplication\n } else if\n ( a_type === NOD && b_type === OP1\n || a_type === ITE && b_type === OP1) {\n var c_addr = this.alloc_node(OP1, b_kind);\n this.link_ports(Pointer(c_addr, 1), this.enter_port(Pointer(b_addr, 1)));\n this.link_ports(Pointer(a_addr, 0), this.enter_port(Pointer(b_addr, 2)));\n this.link_ports(this.enter_port(Pointer(a_addr, 1)), Pointer(b_addr, 0));\n this.link_ports(this.enter_port(Pointer(a_addr, 2)), Pointer(c_addr, 0));\n this.link_ports(Pointer(a_addr, 1), Pointer(b_addr, 2));\n this.link_ports(Pointer(a_addr, 2), Pointer(c_addr, 2));\n \n // Permutations\n } else if (a_type === OP1 && b_type === NOD) {\n return this.rewrite(b_addr);\n } else if (a_type === OP2 && b_type === NOD) {\n return this.rewrite(b_addr);\n } else if (a_type === ITE && b_type === NOD) {\n return this.rewrite(b_addr);\n\n // InvalidInteraction\n } else {\n throw \"[ERROR]\\nInvalid interaction.\";\n }\n }\n }", "title": "" }, { "docid": "f97104ca181e606638e93dc59bad0f74", "score": "0.4747251", "text": "function $rb_le(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs);\n }", "title": "" }, { "docid": "faeecd5b39b77175d45d21de3824f7f5", "score": "0.4735807", "text": "function lessOrEqual(lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }", "title": "" }, { "docid": "728a2a6d21ef55176f4145b0dea4b65b", "score": "0.4734984", "text": "function bitop() {\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.47190318", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "6ad166ab6d88b1c959a4a167137fd0dc", "score": "0.47184706", "text": "function isOperator2(op) {\n\treturn op === '+' || op === '-' || op === '/' || op === '*' || op === '(';\n}", "title": "" }, { "docid": "fc02c90eb1a72e6aefb30bcfde74fe61", "score": "0.47137773", "text": "function compareIntegers(a, b) {\n return a.length > b.length ? 'greater' : a.length < b.length ? 'less': a < b ? 'less': a > b ? \"greater\":'equal'\n}", "title": "" }, { "docid": "641313f1bbbb97bec4c95c088a92d076", "score": "0.47084397", "text": "function compare(a, b) {\n if (a.value > b.value)\n return -1;\n if (a.value < b.value)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "c48902f35b2241d02843eb370db89f16", "score": "0.4708237", "text": "function compare (a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0\n\t}", "title": "" }, { "docid": "c48902f35b2241d02843eb370db89f16", "score": "0.4708237", "text": "function compare (a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0\n\t}", "title": "" }, { "docid": "c48902f35b2241d02843eb370db89f16", "score": "0.4708237", "text": "function compare (a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0\n\t}", "title": "" }, { "docid": "0887963c3ed1702dc878e08b4f8b75ca", "score": "0.47050387", "text": "function opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(arg) {\n if (arg < 0) {\n if (arg >= (0x80000000|0)) {\n return Math.abs(arg);\n }\n }\n throw \"We should not be here\";\n}", "title": "" }, { "docid": "c46ea5ea867c4331b14e8c86622d8c4a", "score": "0.47048035", "text": "static getbinopr(op) {\n switch (String.fromCharCode(op)) {\n case '+':\n return Syntax.OPR_ADD;\n case '-':\n return Syntax.OPR_SUB;\n case '*':\n return Syntax.OPR_MUL;\n case '/':\n return Syntax.OPR_DIV;\n case '%':\n return Syntax.OPR_MOD;\n case '^':\n return Syntax.OPR_POW;\n case String.fromCharCode(Syntax.TK_CONCAT):\n return Syntax.OPR_CONCAT;\n case String.fromCharCode(Syntax.TK_NE):\n return Syntax.OPR_NE;\n case String.fromCharCode(Syntax.TK_EQ):\n return Syntax.OPR_EQ;\n case '<':\n return Syntax.OPR_LT;\n case String.fromCharCode(Syntax.TK_LE):\n return Syntax.OPR_LE;\n case '>':\n return Syntax.OPR_GT;\n case String.fromCharCode(Syntax.TK_GE):\n return Syntax.OPR_GE;\n case String.fromCharCode(Syntax.TK_AND):\n return Syntax.OPR_AND;\n case String.fromCharCode(Syntax.TK_OR):\n return Syntax.OPR_OR;\n default:\n return Syntax.OPR_NOBINOPR;\n }\n }", "title": "" }, { "docid": "b1b443a0a5ad994921aae31ce8779b69", "score": "0.47044954", "text": "function checkPrevOpTwo() {\n switch (prevOpTwo) {\n case \"\":\n switch (prevOp) {\n case \"\":\n result = current;\n break;\n case \"+\":\n result += current;\n break;\n case \"-\":\n result -= current;\n break;\n }\n break;\n case \"*\":\n switch (prevOp) {\n case \"\":\n result = tempResult * current;\n break;\n case \"+\":\n result += tempResult * current;\n break;\n case \"-\":\n result -= tempResult * current;\n break;\n }\n break;\n case \"/\":\n switch (prevOp) {\n case \"\":\n result = tempResult / current;\n break;\n case \"+\":\n result += tempResult / current;\n break;\n case \"-\":\n result -= tempResult / current;\n break;\n }\n break;\n }\n }", "title": "" } ]
2fe613651b92276f299f1e7032f71ba1
this method is called when your extension is deactivated
[ { "docid": "378fa3812b7b2ac968d88b3a86b5bf49", "score": "0.0", "text": "function deactivate() {\n}", "title": "" } ]
[ { "docid": "d41e1849162de582fe4153544eb6db92", "score": "0.84461457", "text": "function deactivate() {\n // TODO: add extension cleanup code, if needed\n}", "title": "" }, { "docid": "99f2233a100e2a8f1c295039a0b4372f", "score": "0.786724", "text": "function deactivate() {\n console.log(\"Preview Extension Shutdown\");\n}", "title": "" }, { "docid": "a76c3576af8adbd4e45df73769d648b1", "score": "0.7622034", "text": "function deactivate() {\n\tconsole.log('插件已释放');\n}", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.73553675", "text": "function deactivate() { }", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342692", "text": "function deactivate() {}", "title": "" } ]
453fa1cbcf9933d5ea5cbec2b81fb8ed
document.getElementById("home").addEventListener("click", ChangeContent('home')); document.getElementById("cameras").addEventListener("click", ChangeContent('cameras')); document.getElementById("detected").addEventListener("click", ChangeContent('detected')); document.getElementById("login").addEventListener("click", ChangeContent('login')); document.getElementById("mobile_home").addEventListener("click", ChangeContent('home')); document.getElementById("mobile_cameras").addEventListener("click", ChangeContent('cameras')); document.getElementById("mobile_detected").addEventListener("click", ChangeContent('detected')); document.getElementById("mobile_login").addEventListener("click", ChangeContent('login'));
[ { "docid": "552f914eb0c068daae36a2ed87081f95", "score": "0.6098641", "text": "function ChangeContent(pageName) {\n switch (pageName) {\n case \"home\":\n document.getElementById(\"content\").src = \"resources/home.html\";\n break;\n case \"cameras\":\n document.getElementById(\"content\").src = \"resources/cameras.html\";\n break;\n case \"detected\":\n document.getElementById(\"content\").src = \"resources/detected_objects.html\";\n break;\n case \"login\":\n document.getElementById(\"content\").src = \"resources/login.html\";\n break;\n }\n}", "title": "" } ]
[ { "docid": "b734369e2a8eb3e5106c29c0d127028e", "score": "0.7223605", "text": "function loadEvents() {\n document.getElementById('home').addEventListener('click', loadHomeContent);\n document.getElementById('menu').addEventListener('click', loadMenuContent);\n document.getElementById('contact').addEventListener('click', loadContactContent);\n}", "title": "" }, { "docid": "143e1b152aa59434ffa91826060579b2", "score": "0.7183644", "text": "function addSwitchDisplaysListeners(){\n document.getElementById(\"homePage\").style.display = \"flex\";\n\n document.getElementById(\"homePageBtn\").addEventListener(\"click\", ()=>{\n hideAllDisplays();\n document.getElementById(\"homePage\").style.display = \"flex\";\n });\n\n document.getElementById(\"aboutCompanyBtn\").addEventListener(\"click\", ()=>{\n hideAllDisplays();\n document.getElementById(\"aboutCompany\").style.display = \"block\";\n });\n\n document.getElementById(\"faqBtn\").addEventListener(\"click\", ()=>{\n hideAllDisplays();\n document.getElementById(\"faq\").style.display = \"block\";\n });\n\n document.getElementById(\"blogPageBtn\").addEventListener(\"click\", ()=>{\n hideAllDisplays();\n document.getElementById(\"blogPage\").style.display = \"block\";\n });\n}", "title": "" }, { "docid": "1fadad10982902bddab52c4f2912bad5", "score": "0.71135753", "text": "function addEventListeners() { \n switchMode.addEventListener('click', switchModes)\n navHome.addEventListener('click', goToHome)\n navBuilding.addEventListener('click', goToBuildingGallery)\n navLandscape.addEventListener('click', goToLandscapeGallery)\n navAbout.addEventListener('click', goToAboutMe)\n btnBuilding.addEventListener('click', goToBuildingGallery)\n btnLandscape.addEventListener('click', goToLandscapeGallery)\n openMenu()\n closMenu()\n}", "title": "" }, { "docid": "da1742cd090e077933b9568e589418f4", "score": "0.68416107", "text": "function changeContent(){\n changeSliderBtn();\n addlInfo();\n lowerBtn.removeEventListener(\"click\",loginCourse);\n // show first lecture video, slideIndex = 1\n showSlides(slideIndex);\n}", "title": "" }, { "docid": "da503b45cd0973cbcbe0a153689da0f9", "score": "0.67001975", "text": "function addLoginListeners(){\n document.getElementById(\"open-reg-menu\").addEventListener(\"click\",()=>{\n document.getElementById(\"registration-menu\").style.display= \"block\"; \n });\n \n document.getElementById(\"open-login-menu\").addEventListener(\"click\", ()=>{\n document.getElementById(\"registration-menu\").style.display= \"block\"; \n document.getElementById(\"registration-btn\").innerHTML = \"Войти\";\n });\n \n document.querySelector(\".black-background\").addEventListener(\"click\", function(){\n document.getElementById(\"registration-menu\").style.display= \"none\"; \n });\n \n document.getElementById(\"logout\").addEventListener(\"click\", logout);\n \n document.getElementById(\"registration-btn\").addEventListener(\"click\", login);\n}", "title": "" }, { "docid": "11e7dc7f94a0480c3c54e732b285a367", "score": "0.66833633", "text": "function configure_event_handlers(){\n\n document.getElementById('btn-start').addEventListener(\"click\", btn_start_click_function);\n document.getElementById('btn-save').addEventListener(\"click\", btn_save_click_function);\n document.getElementById('btn-continue').addEventListener(\"click\", btn_continue_click_function);\n\n document.getElementById('game-mode-select').addEventListener(\"click\", game_mode_option_change_function);\n\n}", "title": "" }, { "docid": "6995efc04cbd4405db935e293a34830b", "score": "0.654284", "text": "function setEventListeners() {\n // triggers carousel color change with hash change event\n window.addEventListener(\"hashchange\", changeCarouselColor, false);\n // event listener for main down arrow\n mainDownArrow.addEventListener('click', shiftDown, false);\n // section 4 replay button - listen for hash change\n replayButton.addEventListener('click', removeAddSection4, false);\n window.addEventListener(\"hashchange\", checkSection, false);\n // Navbar for sections 5 and 6\n sec5Nav.addEventListener('click', function(e) {\n changeSec5Background(e);}, false);\n section6Nav.addEventListener('click', function(event) {\n changeBackground(event);});\n}", "title": "" }, { "docid": "08668e0bca3ddccb745b4e964c4255d1", "score": "0.65259844", "text": "function eventAssign() {\r\n window.addEventListener('resize', mobile_menu_close);\r\n document.getElementsByClassName('menu_btn')[0].addEventListener('click', scrollControl);\r\n navLinksEvents();\r\n mobile_nav_close_listener();\r\n document.querySelectorAll('.projects_tab').forEach((tab) => {\r\n tab.addEventListener('click', project_tab_switch);\r\n });\r\n}", "title": "" }, { "docid": "3352b08f0687b7a4ff2e6394942d9ae5", "score": "0.6501369", "text": "function homepageLoad() {\n popularButton = document.getElementById('popularCarButton');\n businessButton = document.getElementById('businessCarButton');\n familyButton = document.getElementById('familyCarButton');\n sportButton = document.getElementById('sportCarButton');\n limitedButton = document.getElementById('limitedCarButton');\n popularShow = document.getElementById('popular-show');\n businessShow = document.getElementById('business-show');\n familyShow = document.getElementById('family-show');\n sportShow = document.getElementById('sport-show');\n limitedShow = document.getElementById('limited-show');\n accountButton = document.getElementById('accountQuestion');\n techButton = document.getElementById('techQuestion');\n featureButton = document.getElementById('featureQuestion');\n accountQues = document.getElementById('faq-account');\n techQues = document.getElementById('faq-tech');\n featureQues = document.getElementById('faq-feature');\n popularClick();\n accountClick();\n}", "title": "" }, { "docid": "9bf9d5723cb07e7824358c25dbc95519", "score": "0.6492755", "text": "function init() { //first function called on loading script. (initialization)\n document.querySelector('#cameraBtn').addEventListener('click', openUserMedia);\n document.querySelector('#hangupBtn').addEventListener('click', hangUp);\n}", "title": "" }, { "docid": "e3f8b427b38967b7395d903e5fa1cc0e", "score": "0.647751", "text": "function main(){\r\n rock_div.addEventListener('click', function() {\r\n game(\"r\");\r\n });\r\n paper_div.addEventListener('click', function() {\r\n game(\"p\");\r\n });\r\n scissors_div.addEventListener('click', function() {\r\n game(\"s\");\r\n });\r\n}", "title": "" }, { "docid": "15b62b5ebd688d10c45baefbce822edf", "score": "0.645361", "text": "function main() {\n\n rock_dom.addEventListener(\"click\", function () {\n game(\"r\");\n })\n\n paper_dom.addEventListener(\"click\", function () {\n game(\"p\");\n })\n\n scissors_dom.addEventListener(\"click\", function () {\n game(\"s\");\n })\n\n}", "title": "" }, { "docid": "33a8299e0b072c32d75ca6290a4f7739", "score": "0.64498955", "text": "function initializePage() {\n\t// add any functionality and listeners you want here\n\n $(\".home_a\").click(function(){\n \twoopra.track(\"home_a\");\n })\n\n $(\".home_b\").click(function(){\n \twoopra.track(\"home_b\");\n })\n\n $(\".menu_a\").click(function() {\n console.log(\"clicked through a\");\n woopra.track(\"menu_a\");\n })\n\n $(\".menu_b\").click(function() {\n console.log(\"clicked through b\");\n woopra.track(\"menu_b\");\n })\n}", "title": "" }, { "docid": "191060042690c2ca3ed6bb32a8e9c22d", "score": "0.6448513", "text": "function linkHomeButton(){\n \n let homeLink = document.getElementById('home-nav')\n \n homeLink.addEventListener(\"click\",function(){\n mainBody.innerHTML = \"\"\n loadCarousel()\n loadHomePage()\n \n })\n}", "title": "" }, { "docid": "f49c27832ab6c22813ae4d4684afdfa8", "score": "0.6440613", "text": "function documentClickListener() { \n document.addEventListener('click', function(e){\n const welcome = document.getElementById('just-signed-in')\n if (e.target.id === \"category-return-from-cooking\") {\n const cookingRules = document.getElementById(\"cooking-game-description\")\n const cookingSelectDiv = document.getElementById(\"select-cooking-game\")\n cookingRules.style.display = \"none\"\n cookingSelectDiv.style.display = \"none\"\n welcome.style.display = \"block\"\n } else if (e.target.id === \"category-return-from-baseball\") {\n const baseballRules = document.getElementById(\"baseball-game-rules\")\n const baseballSelectDiv = document.getElementById(\"select-baseball-game\")\n baseballRules.style.display = \"none\"\n baseballSelectDiv.style.display = \"none\"\n welcome.style.display = \"block\"\n } else if (e.target.id === \"category-return-from-real-estate\") {\n const realEstateRules = document.getElementById(\"real-estate-game-description\")\n const realEstateSelectDiv = document.getElementById(\"select-real-estate-game\")\n realEstateRules.style.display = \"none\"\n realEstateSelectDiv.style.display = \"none\"\n welcome.style.display = \"block\"\n } else if (e.target.id === \"category-return-from-music\") {\n const musicRules = document.getElementById(\"music-game-description\")\n const musicSelectDiv = document.getElementById(\"select-music-game\")\n musicRules.style.display = \"none\"\n musicSelectDiv.style.display = \"none\"\n welcome.style.display = \"block\"\n }\n else if (e.target.id === 'baseball-quit-button') {\n startTimer(1, '', 'quitGame')\n endBaseballGame()\n } else if (e.target.className === 'pick-another-game-button' || e.target.id === 'pick-game-button') {\n const divWelcome = document.getElementById('just-signed-in')\n hideDivsExceptNavandUsername()\n divWelcome.style.display = 'block'\n } else if (e.target.id === \"baseball-category-set-up\") {\n welcome.style.display = \"none\"\n const baseballRules = document.getElementById(\"baseball-game-rules\")\n const baseballSelectDiv = document.getElementById(\"select-baseball-game\")\n const editUserLink = document.getElementById(\"edit-user-info\")\n const teamSelect = baseballSelectDiv.querySelector('select')\n if (editUserLink.dataset.userteam != 'No-Team-Selected') { \n for (let i=0; i<teamSelect.options.length; i++) {\n if (teamSelect.options[i].value === baseballValueHash[`${editUserLink.dataset.userteam}`]) {\n teamSelect.options[i].selected = true\n break;\n }\n }\n } \n else {\n teamSelect.options[0].selected = true\n }\n baseballRules.style.display = \"block\"\n baseballSelectDiv.style.display = \"block\"\n } else if (e.target.id === 'cooking-category-set-up') {\n welcome.style.display = \"none\"\n const cookingRules = document.getElementById(\"cooking-game-description\")\n const cookingSelectDiv = document.getElementById(\"select-cooking-game\")\n const editUserLink = document.getElementById(\"edit-user-info\")\n const userDietaryArray = editUserLink.dataset.userdietary.split('-')\n const lowerCaseArray = userDietaryArray.map(string => string.toLowerCase())\n const dietaryValue = lowerCaseArray.join('+')\n if (editUserLink.dataset.userdietary != 'No-Dietary-Restrictions') {\n const dietarySelect = cookingSelectDiv.querySelectorAll('select')[1]\n for (let i=0; i<dietarySelect.options.length; i++) {\n if (dietarySelect.options[i].value === dietaryValue) {\n dietarySelect.options[i].selected = true\n break;\n }\n }\n }\n cookingRules.style.display = \"block\"\n cookingSelectDiv.style.display = \"block\"\n } else if (e.target.id === 'real-estate-category-set-up') {\n welcome.style.display = \"none\"\n const realEstateRules = document.getElementById(\"real-estate-game-description\")\n const realEstateSelectDiv = document.getElementById(\"select-real-estate-game\")\n const editUserLink = document.getElementById(\"edit-user-info\")\n if (editUserLink.dataset.userstate != 'No-State-Selected') {\n const stateSelect = realEstateSelectDiv.querySelectorAll('select')[1]\n for (let i=0; i<stateSelect.options.length; i++) {\n if (stateSelect.options[i].value === editUserLink.dataset.userstate) {\n stateSelect.options[i].selected = true\n break;\n }\n }\n }\n realEstateRules.style.display = \"block\"\n realEstateSelectDiv.style.display = \"block\"\n } else if (e.target.className === 'properties-searched-for-re') {\n renderProperty(e.target)\n } else if (e.target.id === 'real-estate-quit-button') {\n startTimer(1, '', 'quitGame')\n realEstateEndGame()\n } else if (e.target.id === 'recipe-quit-button') {\n startTimer(1, '', 'quitGame')\n recipeEndGame()\n } else if (e.target.id === \"logout-button\") {\n hideDivsExceptNavandUsername()\n const navBar = document.getElementById('navigation-bar')\n navBar.style.display = \"none\"\n const enterUsername = document.getElementById('username-form')\n enterUsername.style.display = 'block'\n } else if (e.target.id === \"user-archive-button\") {\n hideDivsExceptNavandUsername()\n fetchUserScores()\n } else if (e.target.id === \"leaderboard-button\") {\n hideDivsExceptNavandUsername()\n fetchLeaderBoards()\n } else if (e.target.id === \"edit-user-info\") {\n hideDivsExceptNavandUsername()\n renderUserPage(e.target.dataset.username, e.target.dataset.userid, e.target.dataset.useractualname, e.target.dataset.userstate, e.target.dataset.userteam, e.target.dataset.userdietary)\n } else if (e.target.id === 'music-quit-button') {\n startTimer(1, '', 'quitGame')\n musicEndGame()\n } else if (e.target.className === 'listed-songs-for-game') {\n renderSong(e.target)\n } else if (e.target.id === 'logout-button') {\n hideDivsExceptNavandUsername()\n document.getElementById('navigation-bar').style.display = 'none'\n document.getElementsById('username-form').style.display = 'block'\n //log out user right here!!!\n } else if (e.target.id === \"change-attribute-button\") {\n addAttributesForm()\n } else if (e.target.id === \"music-category-set-up\") {\n welcome.style.display = \"none\"\n document.getElementById('music-game-description').style.display = 'block'\n document.getElementById(\"select-music-game\").style.display = 'block'\n } else if (e.target.id === \"delete-button-for-scoresheet\") {\n const scoresheetId = e.target.dataset.scoresheetid \n const scoreDiv = e.target.parentNode\n scoreDiv.remove()\n fetchDeleteScoresheet(scoresheetId)\n }\n })\n}", "title": "" }, { "docid": "8b022abb8ec7289b9f558bdad6aef0cd", "score": "0.6407103", "text": "function main() {\n rock_div.addEventListener('click', function() {\n game(\"r\")\n })\n paper_div.addEventListener('click', function() {\n game(\"p\")\n })\n scissors_div.addEventListener('click', function() {\n game(\"s\")\n }) \n}", "title": "" }, { "docid": "61efbe9b7f3dbddc1942b93b4d8364ee", "score": "0.63939685", "text": "async function listenForClicks() {\r\n document.addEventListener(\"click\", (e) => {\r\n /**\r\n * Given the name of a beast, get the URL to the corresponding image.\r\n */\r\n\r\n async function actionToScript(id) {\r\n switch (id) {\r\n case \"remove-courses\":\r\n browser.tabs.executeScript({file: '/content_scripts/courseRemover.js'}).catch(reportError)\r\n sendMessageToTabs(\"CourseRemoverStatus\", {val: !window.courseRemoverStatus}).catch(reportError)\r\n return\r\n case \"dark-mode\":\r\n sendMessageToTabs(\"DarkMode\", {val: !window.darkMode}).catch(reportError)\r\n return\r\n case \"enhance-page\":\r\n location.href = \"./enahnceMenu.html\"\r\n return\r\n case \"reset\":\r\n await handleReset().catch(reportError)\r\n return\r\n case \"monochrome\":\r\n sendMessageToTabs(\"MonoChrome\", {val: !window.monochrome}).catch(reportError)\r\n return\r\n case \"cursor\":\r\n const val = window.cursor === \"big\" ? \"normal\" : \"big\"\r\n sendMessageToTabs(\"EnhancePage\", {cursor: val}).catch(reportError)\r\n return\r\n case \"back\":\r\n location.href = './index.html'\r\n return\r\n }\r\n }\r\n\r\n if (e.target.classList.contains(\"btn\")) {\r\n actionToScript(e.target.id)\r\n }\r\n })\r\n}", "title": "" }, { "docid": "fa8e2cd587f8a9c5b480ff709f14927d", "score": "0.6392147", "text": "function register_event_handlers()\n {\n \n \n /* button Button */\n $(document).on(\"click\", \"#btn_logar\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#home\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_diabetes\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#diabetes\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_cancer\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#cancer\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_informacoes\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#page_100_61\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_recomendacoes\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#recomendacoes\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_noticias\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#noticias\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_voltar\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#home\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_voltar2\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#home\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_informacoes2\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#page_101_93\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_recomendacoes2\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#recomendacoes2\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_noticias2\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#noticias2\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_receitas\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#receitas\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_alimentacao\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#alimentacao\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_sintomas\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#sintomas\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_prevencao\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#prevencao\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_prevencao\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#prevencao\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_causas\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#causas\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_causas\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#causas\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_tratamentos\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#tratamentos\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_consequencias\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#consequencias\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_maps\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#page_94_59\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_info\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#informacoes\"); \n return false;\n });\n \n $(document).on(\"click\", \"#btn_1\", function(evt)\n {\n /*global activate_page */\n activate_subpage(\"#detalhes\");\n $('#preparo').html(\"1 - Bata os ovos na batedeira por 10 minutos ou até obter um creme branco e espesso <br>\" +\n \"2 - Enquanto o creme está sendo batido, comece a derreter o chocolate <br>\" +\n \"3 - Pegue dois recipientes (um maior e outro menor) para o banho-maria <br>\" +\n \"4 - De preferência, escolha dois recipientes que se encaixem perfeitamente um sobre o outro <br>\" +\n \"5 - Coloque o chocolate picado dentro da tigela sem água e coloque água dentro da segunda tigela, leve ao fogo baixo e cozinhe em banho-maria – o segredo é não deixar que a água encoste no fundo da primeira tigela, que está com o chocolate, e também que o encaixe dos recipientes seja perfeito, evitando o vazamento de vapor <br>\" +\n \"6 - Mexa o chocolate com uma espátula até derreter e desligue o fogo antes que a água do banho-maria ferva <br>\" +\n \"7 - Misture o chocolate no creme branco <br>\" +\n \"8 - Acrescente a essência de baunilha e mexa delicadamente <br>\" +\n \"9 - Peneire a farinha e o leite em pó desnatado e acrescente no creme, juntamente com o adoçante e misture <br>\" +\n \"10 - Unte as forminhas individuais com o óleo e polvilhe com o achocolatado diet <br>\" +\n \"11 - Acrescente a massa em cada forminha e cubra com filme plástico <br>\" +\n \"12 - Leve à geladeira por no mínimo 6 horas <br>\" +\n \"13 - Ligue o forno em temperatura média (180ºC) <br>\" +\n \"14 - Como este bolinho precisa do tempo exato para ficar na consistência correta, assado por fora e derretido por dentro, aconselhamos a assar, pelo menos os primeiros, individualmente, para verificar o tempo exato de seu forno <br>\" +\n \"15 - Leve o bolinho ao forno preaquecido e deixe assar por cerca de 6 minutos <br>\" +\n \"16 - Retire o bolinho do forno e coloque a forminha num recipiente com água fria <br>\" +\n \"17 - Não deixe que a água caia dentro da forminha <br>\" +\n \"18 - Passe uma faca para que o bolinho se desprenda da borda <br>\" +\n \"19 - Vire sobre um prato e sirva a seguir <br>\");\n return false;\n });\n \n /* button capturar */\n $(document).on(\"click\", \".uib_w_17\", function(evt)\n {\n // Resultado para quando conseguir capturar a posição GPS...\n var fnCapturar = function(position){\n \n // Gravar dados da posição capturada em uma variável...\n var coords = position.coords;\n \n // Exibir dados das coordenadas capturadas...\n //navigator.notification.alert(JSON.stringify(coords),\"COORDENADAS\");\n \n // GOOGLE MAPS: Mostrar marcador no mapa...\n var image = 'images/marker.png';\n var map = new google.maps.Map(\n document.getElementById(\"map\"), \n { \n center : new google.maps.LatLng( coords.latitude, coords.longitude ), \n zoom : 5, \n mapTypeId : google.maps.MapTypeId.ROADMAP\n }\n );\n ListaEmpresas(map)\n var marker = new google.maps.Marker({\n title : \"VOCÊ ESTÁ AQUI: \"+coords.latitude+\", \"+coords.longitude,\n position : new google.maps.LatLng(coords.latitude, coords.longitude),\n icon : image\n });\n marker.setMap(map);\n \n }\n \n // Caso falhe na captura, faça isso...\n var fnFalhar = function(error){\n \n navigator.notification.alert(\"Erro ao capturar posição: \"+error.message, \"INFORMAÇÃO\");\n \n }\n \n // Opções para acessar o GPS...\n var opcoes = { maximumAge: 3000, timeout: 100000, enableHighAccuracy: true };\n \n // CAPTURAR POSIÇÃO: Chamada a API de Geolocalização (GPS) via Apache Cordova\n navigator.geolocation.getCurrentPosition(fnCapturar, fnFalhar, opcoes);\n \n });\n \n var beaches = [\n ['Bondi Beach', 40.6725096, -73.9167359, 4],\n ['Coogee Beach', -33.923036, 151.259052, 5],\n ['Cronulla Beach', -34.028249, 151.157507, 3],\n ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],\n ['Maroubra Beach', -33.950198, 151.259302, 1]\n ];\n\n function setMarkers(map) {\n for (var i = 0; i < beaches.length; i++) {\n var beach = beaches[i];\n var marker = new google.maps.Marker({\n position: {lat: beach[1], lng: beach[2]},\n map: map,\n title: beach[0],\n zIndex: beach[3]\n });\n }\n }\n \n function ListaEmpresas(map){\n setMarkers(map);\n var url = 'http://jehackathon2016.esy.es/webservice/';\n $.ajax({\n method: 'GET', \n url: url+'webservice.php',\n dataType: 'json',\n data: 'acao=select',\n beforeSend: function(){\n //$('#titulo-tarefa').html('Carregando...');\n },\n success: function(data){\n $.each(data, function(i, ret){\n //setMarkers(map);\n });\n }\n });\n }\n \n \n}", "title": "" }, { "docid": "7bfdd165375442aa7d65b91c32a9760e", "score": "0.63739896", "text": "function main() {\n\n rock_div.addEventListener('click', function() {\n game('Rock');\n })\n\n paper_div.addEventListener('click', function() {\n game('Paper');\n })\n\n scissors_div.addEventListener('click', function() {\n game('Scissors');\n })\n\n}", "title": "" }, { "docid": "045643b203aeb147d15676037717d45e", "score": "0.6373614", "text": "function set_event_listeners() {\n\n // Gets the Flipping/Spinning Coin's (Bitcoin's) Motions' Radio options\n flipping_spinning_bitcoin_motions_radios = document.getElementsByName(\"flipping_spinning_bitcoin_motions_radios\");\n\n // Gets the Camera View's Radio options\n camera_view_radios = document.getElementsByName(\"camera_view_radios\");\n \n // Gets the Coin's (Bitcoin's) State's Radio options\n bitcoin_state_radios = document.getElementsByName(\"bitcoin_state_radios\");\n \n \n // When the Flipping/Spinning Coin's (Bitcoin's) Motions' Radio change, calls the given function\n document.addEventListener('onchange', on_change_flipping_spinning_bitcoin_motions);\n \n // When the Camera View's Radio change, calls the given function\n document.addEventListener('onchange', on_change_camera_view);\n \n // When the Coin's (Bitcoin's) State's Radio change, calls the given function\n document.addEventListener('onchange', on_change_bitcoin_state);\n \n \n // When any change occurs in the Scene (Bloch Sphere (Qubit) and Single Quantum Logic Gates/Operators Scene),\n // calls the given function\n controls.addEventListener('change', render);\n\n // When the window is resized, calls the given function\n window.addEventListener('resize', on_window_resize, false);\n\n // When the mouse moves, calls the given function\n document.addEventListener('mousemove', on_document_mouse_move, false);\n\n}", "title": "" }, { "docid": "9b1d02878560e460b12d1cda12b0ce7c", "score": "0.6373294", "text": "function addZodiacListeners() {\ndocument.getElementById('zodiacContainer1').addEventListener('click',featureZodiac1);\ndocument.getElementById('zodiacContainer2').addEventListener('click',featureZodiac2);\ndocument.getElementById('zodiacContainer3').addEventListener('click',featureZodiac3);\ndocument.getElementById('zodiacContainer4').addEventListener('click',featureZodiac4);\n\n }", "title": "" }, { "docid": "0dbfc48e5ef2e157cecc82c2603fc764", "score": "0.63668644", "text": "function main(){\n fox_div.addEventListener('click', () => game(\"fox\"));\n falco_div.addEventListener('click', () => game(\"falco\"));\n puff_div.addEventListener('click', () => game(\"puff\"));\n}", "title": "" }, { "docid": "96af541216b038d47bd82595f141fcec", "score": "0.6351084", "text": "function init_listeners() {\n let view_menu = document.getElementById(\"ViewMode\");\n view_menu.addEventListener(\"click\", view_mode_listener);\n let camera = document.getElementById(\"CameraMode\");\n\n camera.addEventListener(\"click\", camera_mode_listener);\n let pendant = document.getElementById(\"PendantIndex\");\n pendant.oninput = camera_mode_listener;\n\n let dist = document.getElementById(\"Dist\");\n dist.onchange = camera_mode_listener;\n\n document.addEventListener('keydown', key_press_listener);\n document.addEventListener('keyup', key_up_listener);\n}", "title": "" }, { "docid": "91087d1bc281a98108ab3c90001884c2", "score": "0.6332666", "text": "function addListener() {\n const links = document.querySelectorAll(\".header__link\");\n links.forEach((link) => link.addEventListener(\"click\", changeView));\n}", "title": "" }, { "docid": "a80637655a0d2e61c8717dd832601c0f", "score": "0.63303995", "text": "function setEventListener() {\n var acc = document.getElementsByClassName(\"accordion\");\n for (var i = 0; i < acc.length; i++) {\n acc[i].onclick = accordion;\n }\n for (var i = 0; i < slides.length; i++) {\n slides[i].onclick = slideshow;\n }\n var arrows = document.getElementsByClassName(\"arrow\");\n for (var i = 0; i < arrows.length; i++) {\n arrows[i].onclick = toggleArrow;\n }\n var dates = document.getElementsByClassName(\"date\");\n for (var i = 0; i < dates.length; i++) {\n dates[i].onclick = toggleArrow;\n }\n var prev = document.getElementById(\"prev\");\n prev.onclick = getPreviousSlides;\n var next = document.getElementById(\"next\");\n next.onclick = getNextSlides;\n}", "title": "" }, { "docid": "1ab8f0563344ca5923701952e5e00d0d", "score": "0.6328509", "text": "function setEventListeners() {\n if (location.pathname === \"/login\") {\n // We don't do anyting on the login page\n return;\n }\n\n\n // Loads a table for a given domain\n // This happens on listings and details\n var loadTableHandler = function (evt) {\n var domain = getLastUrlElement(this.href);\n LoadTable(domain);\n evt.preventDefault();\n };\n\n\n // General events that happen on every page\n\n // All links to the home/main page\n var homeButtons = document.querySelectorAll('a[href=\"/\"]')\n for (var i = 0; i < homeButtons.length; i++) {\n homeButtons[i].onclick = loadTableHandler;\n }\n\n // Add title click scrolling (in header)\n document.getElementById('title').onclick = scrollBottomTop;\n\n // New: Loads the new page\n // This should be used by the 'Add' button & the link that is there when you don't have any pages\n var loadNewHandler = function (evt) {\n LoadNew();\n evt.preventDefault();\n };\n\n var newButtons = document.querySelectorAll('a[href=\"/new\"]');\n for (var i = 0; i < newButtons.length; i++) {\n newButtons[i].onclick = loadNewHandler;\n }\n\n // Register `details` event listeners\n if (state.isTable) {\n // Loads the details of a page\n // This is used in all table listings, aka when `state.isTable` === true\n var loadDetailsHandler = function (evt) {\n var id = getLastUrlElement(this.href);\n LoadDetails(id);\n evt.preventDefault();\n };\n\n var detailButtons = document.querySelectorAll('a[href^=\"/details/\"]');\n for (var i = 0; i < detailButtons.length; i++) {\n detailButtons[i].onclick = loadDetailsHandler;\n }\n }\n\n\n // Form on Details Page\n if (state.isDetails) {\n var del_button = document.getElementById(\"delete\");\n if (del_button) { del_button.onclick = SubmitDeleteEntry; }\n\n var sub_button = document.getElementById(\"submit\");\n if (sub_button) { sub_button.onclick = SubmitChangeTitle; }\n }\n\n // Register `table` event listeners\n if (state.isTable || state.isDetails) {\n\n // All links that point to a site listing (also all sites)\n // We need to convert these NodeLists to arrays to join them\n var siteButtons = document.querySelectorAll('a[href^=\"/site/\"]');\n for (var i = 0; i < siteButtons.length; i++) {\n siteButtons[i].onclick = loadTableHandler;\n }\n }\n \n // Register listeners for the form on the new page\n if (state.isNew) {\n prepareNewPage();\n }\n}", "title": "" }, { "docid": "9c352ada31f9ba1b97725ee4a13b4f9c", "score": "0.6314161", "text": "function main(){\n \nrock_div.addEventListener(\"click\",() => game('Rock'))\npaper_div.addEventListener(\"click\",() => game('Paper'))\nscissors_div.addEventListener(\"click\",() => game('Scissors'))\n}", "title": "" }, { "docid": "ab1b47ccb79f0748452d4c474b918c58", "score": "0.6313433", "text": "function addclickEvents(){\r\n document.getElementById(\"reset_btn\").addEventListener(\"click\", function() {\r\n reload();\r\n }, false);\r\n document.getElementById(\"data_button\").addEventListener(\"click\", function() {\r\n popitup(\"slideshow.html\");\r\n }, false);\r\n document.getElementById(\"round-bottom-flask\").addEventListener(\"click\", function() {\r\n moveFlask();\r\n }, false);\r\n document.getElementById(\"pipette\").addEventListener(\"click\", function() {\r\n movePipette();\r\n }, false);\r\n document.getElementById(\"cuvette\").addEventListener(\"click\", function() {\r\n moveCuvette();\r\n }, false);\r\n document.getElementById(\"comp_trans_button\").addEventListener(\"click\", function() {\r\n scan();\r\n }, false);\r\n document.getElementById(\"spectrolid_trans_button\").addEventListener(\"click\", function() {\r\n spectrofluorimeter();\r\n }, false);\r\n document.getElementById(\"spectrolid_trans_button1\").addEventListener(\"click\", function() {\r\n spectrofluorimeter();\r\n }, false);\r\n document.getElementById(\"power_trans_button\").addEventListener(\"click\", function() {\r\n turnOn(); showClock();\r\n }, false);\r\n document.getElementById(\"ok_btn\").addEventListener(\"click\", function() {\r\n okBtn();\r\n }, false);\r\n document.getElementById(\"select\").addEventListener(\"click\", function() {\r\n selectGraph();\r\n }, false);\r\n document.getElementById(\"disposegraph\").addEventListener(\"click\", function() {\r\n disposeGraph();\r\n }, false);\r\n}", "title": "" }, { "docid": "6702c24ecde808bab0b1d8fe00c7648f", "score": "0.62882423", "text": "function phoneScreensActivate() {\n const phones = document.querySelectorAll(\".slider .iphone\");\n phones.forEach( phone => phone.querySelectorAll(\".iphone__clickable\").forEach( \n element => element.addEventListener( \"click\", event => {\n let screen = phone.querySelector(\".iphone__screen\");\n (screen.classList.contains(\"hidden\")) ?\n screen.classList.remove(\"hidden\") :\n screen.classList.add(\"hidden\");\n })\n ));\n}", "title": "" }, { "docid": "5599bb74a2039f5525b433900b642b1d", "score": "0.6285142", "text": "function listenForClicks() {\n document.addEventListener(\"click\", (e) => {\n\n /**\n * Given the name of a beast, get the URL to the corresponding image.\n */\n function beastNameToURL(beastName) {\n switch (beastName) {\n case \"Frog\":\n return browser.extension.getURL(\"beasts/frog.jpg\");\n case \"Snake\":\n return browser.extension.getURL(\"beasts/snake.jpg\");\n case \"Turtle\":\n return browser.extension.getURL(\"beasts/turtle.jpg\");\n }\n }\n\n /**\n * Insert the page-hiding CSS into the active tab,\n * then get the beast URL and\n * send a \"beastify\" message to the content script in the active tab.\n */\n function beastify(tabs) {\n browser.tabs.insertCSS({code: hidePage}).then(() => {\n let url = beastNameToURL(e.target.textContent);\n browser.tabs.sendMessage(tabs[0].id, {\n command: \"beastify\",\n beastURL: url\n });\n });\n }\n\n /**\n * Remove the page-hiding CSS from the active tab,\n * send a \"reset\" message to the content script in the active tab.\n */\n function reset(tabs) {\n browser.tabs.removeCSS({code: hidePage}).then(() => {\n browser.tabs.sendMessage(tabs[0].id, {\n command: \"reset\",\n });\n });\n }\n\n /**\n * Just log the error to the console.\n */\n function reportError(error) {\n console.error(`Could not beastify: ${error}`);\n }\n\n /**\n * Get the active tab,\n * then call \"beastify()\" or \"reset()\" as appropriate.\n */\n if (e.target.classList.contains(\"beast\")) {\n browser.tabs.query({active: true, currentWindow: true})\n .then(beastify)\n .catch(reportError);\n }\n else if (e.target.classList.contains(\"reset\")) {\n browser.tabs.query({active: true, currentWindow: true})\n .then(reset)\n .catch(reportError);\n }\n });\n}", "title": "" }, { "docid": "4fcdac68219712d498e59c8bc46a098a", "score": "0.62755716", "text": "function mainInit(){\n ///// Declare variables /////\n window.home = document.getElementById(\"home\");\n window.mainContent = document.getElementById(\"mainContent\");\n window.thematicSection = document.getElementById(\"thematicSection\");\n window.iconicSection = document.getElementById(\"iconicSection\");\n window.whimsicalSection = document.getElementById(\"whimsicalSection\");\n window.contactSection = document.getElementById(\"contactSection\");\n window.contactLinks=document.getElementsByClassName(\"contactLink\");\n\n ///// Hide content sections ///////\n thematicSection.style.display=\"none\";\n iconicSection.style.display=\"none\";\n whimsicalSection.style.display=\"none\";\n contactSection.style.display=\"none\";\n\n ////// Add Event Listeners ////////\n home.addEventListener(\"click\", drawMainContent);\n document.getElementById(\"thematicBlurb\").addEventListener(\"click\", drawThematicSection);\n document.getElementById(\"iconicBlurb\").addEventListener(\"click\", drawIconicSection);\n document.getElementById(\"whimsicalBlurb\").addEventListener(\"click\", drawWhimsicalSection);\n for(var i= 0; i<contactLinks.length; i++){\n contactLinks[i].addEventListener(\"click\", drawContactSection);\n\n }\n}", "title": "" }, { "docid": "d1f3ca0579bad7638a034c081296ae28", "score": "0.6274902", "text": "function addEventListeners() {\n let navigationTemplate = document.getElementById('navigation-template').innerHTML;\n let notificationsTemplate = document.getElementById('notifications-template').innerHTML;\n // let navigationTemplate = Handlebars.compile(document.getElementById('navigation-template').innerHTML); => na Иво му е така и все пак работи\n let movieCardTemplate = document.getElementById('movie-card-template').innerHTML;\n\n Handlebars.registerPartial('navigation-template', navigationTemplate);\n Handlebars.registerPartial('notifications-template', notificationsTemplate);\n Handlebars.registerPartial('movie-card-template', movieCardTemplate);\n\n // navigate('/'); // the first time that the app loads send the user to the home page\n console.log(location.pathname);\n navigate(location.search.trim() === '' ? location.pathname : `${location.pathname}${location.search}`); // otherwise the queryString would get load on the initial load\n // document.querySelector('.navigation').addEventListener('click', navigateHandler);\n}", "title": "" }, { "docid": "2e6fa146b0919b0415afd7f5d3715f90", "score": "0.6263861", "text": "function clickedSomething(event){\n// console.log(event.target.id);\n if ((event.target.id)===\"gameS\") {\n// console.log(\"about\");\n document.getElementById(\"show_back\").style.display=\"block\";\n document.getElementById(\"aboutS\").innerHTML =\"Apple1\";\n document.getElementById(\"aboutS\").href = \"apple1\";\n document.getElementById(\"contS\").innerHTML =\"Amstrad CPC\";\n document.getElementById(\"contS\").href = \"amstrad-cpc\";\n //hidden section\n document.getElementById(\"ae\").style.display=\"block\"; \n document.getElementById(\"ae\").style.color=\"white\"; \n\n document.getElementById(\"atarS\").style.display=\"block\";\n document.getElementById(\"atarS\").style.color=\"white\";\n document.getElementById(\"virt\").style.display=\"block\";\n document.getElementById(\"virt\").style.color=\"white\"; \n document.getElementById(\"superS\").style.display=\"block\";\n document.getElementById(\"superS\").style.color=\"white\"; \n \n //show game section debug\n document.getElementById(\"gameS\").classList.add(\"hidden\");\n console.log(\"hmm...\");\n document.getElementById(\"right_arrow\").style.opacity=\"0\";\n }else if ((event.target.id)===\"go_back\") {\n document.getElementById(\"show_back\").style.display=\"none\";\n document.getElementById(\"aboutS\").innerHTML =\"ABOUT\";\n document.getElementById(\"aboutS\").href = \"about.html\";\n document.getElementById(\"right_arrow\").style.opacity=\"1\";\n document.getElementById(\"contS\").innerHTML =\"CONTACT\";\n document.getElementById(\"contS\").href = \"contact.html\";\n document.getElementById(\"gameS\").classList.remove(\"hidden\");\n document.getElementById(\"atarS\").style.display=\"none\";\n document.getElementById(\"virt\").style.display=\"none\";\n document.getElementById(\"superS\").style.display=\"none\";\n document.getElementById(\"ae\").style.display=\"none\";\n }else if ((event.target.id)===\"close\") {\n document.getElementById(\"sub_nav\").style.display=\"none\";\n document.getElementById(\"back\").style.display=\"none\";\n// document.getElementById(\"nothing\").classList.remove(\"hideall\");\n }\n}", "title": "" }, { "docid": "36c2ea993f4204f8f3c0f1541d209395", "score": "0.6261417", "text": "function attachEvents() {\n searchBtn.addEventListener(\"click\", onSearch);\n previousPageBtn.addEventListener(\"click\", goPreviousPage);\n nextPageBtn.addEventListener(\"click\", goNextPage);\n homeLink.addEventListener(\"click\", goMainPage);\n}", "title": "" }, { "docid": "90ae8c47beb326eb0b125c36fbc4565b", "score": "0.62600935", "text": "events() {\n this.nextbutton.addEventListener(\"click\", () => this.nextImage())\n this.prevbutton.addEventListener(\"click\", () => this.prevImage())\n this.moreinfobutton.addEventListener(\"click\", () => this.textToggle())\n this.slideshow.addEventListener(\"scroll\", () => this.buttonHide())\n\t}", "title": "" }, { "docid": "e6b4e1a9227ab4c9c9a5e448c8f1177c", "score": "0.62572306", "text": "function main() {\r\n hunter_div.addEventListener('click', function() {\r\n game(\"h\");\r\n })\r\n\r\n ninja_div.addEventListener('click', function() {\r\n game(\"n\");\r\n })\r\n\r\n bear_div.addEventListener('click', function() {\r\n game(\"b\");\r\n })\r\n}", "title": "" }, { "docid": "9ef4809783f4d26592fc53481da840e0", "score": "0.62552", "text": "function addModeSwitchListeners() {\n document.getElementById('index-hide-btn').addEventListener('click' ,function(event) {\n focusModeWrapper();\n });\n\n document.getElementById('index-show-btn').addEventListener('click' ,function(event) {\n browseModeWrapper();\n });\n}", "title": "" }, { "docid": "b3ee9c71b81d6cff273ba2a6cabc1afc", "score": "0.62546563", "text": "function main() {\n\t\trock_div.addEventListener('click', () => game(\"rock\"));\n\t\tpaper_div.addEventListener('click', () => game(\"paper\"));\n\t\tscissors_div.addEventListener('click', () => game(\"scissors\"));\n\t}", "title": "" }, { "docid": "a73a2c975bfeb2e4afcc849ce6a396d4", "score": "0.62398183", "text": "function addListenersToDivsAndTabs() {\n addContentListener(\"home-tab\", homeContentGenerator());\n addContentListener(\"about-tab\", aboutContentGenerator());\n addContentListener(\"contact-tab\", contactContentGenerator());\n }", "title": "" }, { "docid": "501b90a9a539756b9bc5a1f52dffa671", "score": "0.62395704", "text": "function main() {\n\n rock_div.addEventListener(\"click\", function () {\n game(\"rock\");\n });\n paper_div.addEventListener(\"click\", function () {\n game(\"paper\");\n });\n scissors_div.addEventListener(\"click\", function () {\n game(\"scissors\");\n });\n lizard_div.addEventListener(\"click\", function () {\n game(\"lizard\");\n });\n spock_div.addEventListener(\"click\", function () {\n game(\"spock\");\n });\n\n}", "title": "" }, { "docid": "19c4184de4d7970ee7b29f1745562a7d", "score": "0.62281084", "text": "function my(){\n if (document.getElementById(\"highlight\").innerHTML === \"about\"){ \n document.getElementById(\"about\").style.color=\"red\";\n }\n else if (document.getElementById(\"highlight\").innerHTML === \"game\"){\n document.getElementById(\"games\").style.color=\"red\";\n document.getElementById(\"colorize\").style.fill=\"red\";\n }else if (document.getElementById(\"highlight\").innerHTML === \"cont\"){\n document.getElementById(\"cont\").style.color=\"red\";\n }\n document.getElementById(\"nav-lists\").addEventListener(\"click\", clickedSomething);\n document.getElementById(\"nav-lists\").addEventListener(\"mouseover\", hover);\n document.getElementById(\"nav-lists\").addEventListener(\"mouseout\", gone);\n document.getElementById(\"ham\").addEventListener(\"click\", click);\n document.getElementById(\"sub_nav_top\").style.display=\"none\";\n //this fixed error for some reason...\n document.getElementById(\"main\").addEventListener(\"click\", clicked);\n document.getElementById(\"main\").addEventListener(\"mouseover\", hov);\n// document.getElementById(\"main\").addEventListener(\"mouseout\", off);\n}", "title": "" }, { "docid": "199387bbd1fb31c3bd7b7bfbf252136f", "score": "0.6218961", "text": "function listeners(){\n \n //Glyph generation\n document.querySelector('#regenerate_glyph').addEventListener('click', regenerateGlyph);\n \n // Options save button\n document.querySelector('#save').addEventListener('click', saveWhitelist);\n \n // content server menu listeners\n document.querySelector('#alpha').addEventListener('click', saveServer);\n document.querySelector('#dev').addEventListener('click', saveServer);\n document.querySelector('#local').addEventListener('click', saveServer);\n document.querySelector('#other').addEventListener('click', saveServer);\n document.querySelector('#save_server').addEventListener('click', saveServer);\n}", "title": "" }, { "docid": "6a73a81324f3237cc23f64d9cbd97c24", "score": "0.62106526", "text": "function main() {\n\n\teverFlicker();\n\n\trock_div.addEventListener('click', () => game(\"rock\"));\n\n\tpaper_div.addEventListener('click', () => game(\"paper\"));\n\n\tscissors_div.addEventListener('click', () => game(\"scissors\"));\n}", "title": "" }, { "docid": "cad0340da83943368489aedaf29ddaea", "score": "0.618619", "text": "function setHandlers(){\r\n //search\r\n document.getElementById(\"searchBtn\").addEventListener(\"click\", handleSearch);\r\n\r\n //nav\r\n document.getElementById(\"addNewContact\").addEventListener(\"click\", handleNavNewContact);\r\n document.getElementById(\"addNewGroup\").addEventListener(\"click\", handleNavNewGroup);\r\n document.getElementById(\"delete\").addEventListener(\"click\", handleNavDelete);\r\n document.getElementById(\"showAll\").addEventListener(\"click\", handleNavShowAll);\r\n document.getElementById(\"resetData\").addEventListener(\"click\", handleResetData);\r\n }", "title": "" }, { "docid": "c7142a3d876886a50e10f168e6188941", "score": "0.61790246", "text": "function init() {\n document\n .getElementById(\"game-photo-1\")\n .addEventListener(\"click\", playSound1);\n document\n .getElementById(\"game-photo-2\")\n .addEventListener(\"click\", playSound2);\n document\n .getElementById(\"game-photo-3\")\n .addEventListener(\"click\", playSound3);\n document\n .getElementById(\"game-photo-4\")\n .addEventListener(\"click\", playSound4);\n}", "title": "" }, { "docid": "535b3e007de17e27e02890c7bd4cd6e8", "score": "0.61575466", "text": "function registerEventListeners() {\n\tlet peopleElement = document.getElementById('people');\n\tpeopleElement.addEventListener('click', function (event) {\n\t\tlet chosenOne = event.target.closest('.frame').getAttribute('id');\n\t\tdisplayOverlay(chosenOne);\n\t}, false)\n}", "title": "" }, { "docid": "652226ba1f0bf5b1bace194130f97cf4", "score": "0.61497843", "text": "function main() {\n rock_div.addEventListener('click', () => game(\"rock\"));\n paper_div.addEventListener('click', () => game(\"paper\"));\n scissor_div.addEventListener('click', () => game(\"scissor\"));\n lizard_div.addEventListener('click', () => game(\"lizard\"));\n spock_div.addEventListener('click', () => game(\"spock\"));\n }", "title": "" }, { "docid": "cb23819b034a8943f1add8af5334a9cd", "score": "0.61385024", "text": "function main() {\n rock_div.addEventListener(\"click\", function () {\n console.log(\"you be clicking DW Johnson\");\n game(\"rock\");\n });\n\n paper_div.addEventListener(\"click\", function () {\n console.log(\"you be clicking papel\");\n game(\"paper\");\n });\n\n scissor_div.addEventListener(\"click\", function () {\n console.log(\"you be clicking edward S.\");\n game(\"scissor\");\n });\n}", "title": "" }, { "docid": "b3a1dc65aa56ecfbc8f4639aba83806b", "score": "0.61348575", "text": "function addPageButtonListeners() {\n\tconsole.log(\"addPageButtonListeners\")\n\tdocument.querySelector('#back').addEventListener('click', changePage)\n\tdocument.querySelector('#forward').addEventListener('click', changePage)\n}", "title": "" }, { "docid": "37423c78a91a23c27b1e32fa30e039ba", "score": "0.6124256", "text": "function activateMainContent()\n{\n hideLogin();\n\n // Allow tabs to be clicked\n El.aside.addEventListener(\"click\", clickTab);\n\n // Have the first page and tab be active\n activateTabPage(0);\n}", "title": "" }, { "docid": "e2af96d97bc157c903c3d75ce1aba105", "score": "0.61230373", "text": "function main(){\n rock_div.addEventListener('click',function(){\n game('r');\n })\n paper_div.addEventListener('click',function(){\n game('p') ;\n })\n scissor_div.addEventListener('click',function(){\n game('s');\n })\n}", "title": "" }, { "docid": "617ccb1ba30b3d73538499b53563c8e8", "score": "0.6120793", "text": "function allEventListners() {\r\n // toggler icon click event\r\n navToggler.addEventListener('click', togglerClick);\r\n // nav links click event\r\n navLinks.forEach( elem => elem.addEventListener('click', navLinkClick));\r\n}", "title": "" }, { "docid": "617ccb1ba30b3d73538499b53563c8e8", "score": "0.6120793", "text": "function allEventListners() {\r\n // toggler icon click event\r\n navToggler.addEventListener('click', togglerClick);\r\n // nav links click event\r\n navLinks.forEach( elem => elem.addEventListener('click', navLinkClick));\r\n}", "title": "" }, { "docid": "d918579f76956af4754d9ca292234296", "score": "0.6120608", "text": "function headButtons() {\n document.getElementById('nextButton').addEventListener('click', () => {\n navigation++;\n load();\n });\n\n document.getElementById('backButton').addEventListener('click', () => {\n navigation--;\n load();\n });\n\n document.getElementById('saveButton').addEventListener('click', saveEvent);\n document.getElementById('cancelButton').addEventListener('click', closeModal);\n}", "title": "" }, { "docid": "daf85bafbf1dc883f9671d2a45817549", "score": "0.6108111", "text": "function allEventListners() {\n // toggler icon click event\n navToggler.addEventListener('click', togglerClick);\n // nav links click event\n navLinks.forEach( elem => elem.addEventListener('click', navLinkClick));\n}", "title": "" }, { "docid": "e9c5ec0a5f115e33834a4bb56708f9e5", "score": "0.6103052", "text": "function onClickListeners() {\n var onboarding = document.getElementById('js-onboarding-button');\n onboarding.addEventListener('click', hideAllViewsExcept.bind(null, 'onboarding'));\n\n var completion_close = document.getElementById('js-completion-close');\n completion_close.addEventListener('click', resetAfterCompletion);\n\n FCH.loopAndExecute('.js-overlay-close', function(close_button) {\n close_button.addEventListener('click', hideAllViewsExcept.bind(null, false));\n });\n\n var transcript = document.getElementById('js-transcript-button');\n transcript.addEventListener('click', openTranscriptWindow);\n\n // Once onboarding window is closed, ensure onboarding is marked as true\n var onboarding_close = document.getElementById('js-onboarding-close');\n onboarding_close.addEventListener('click', function() {\n DD.constants.has_onboarded = true;\n });\n\n switcher.addEventListener('click', this.updateSwitcher.bind(this, true));\n }", "title": "" }, { "docid": "bbd0455f560917f9bf7a6c9c9d429f62", "score": "0.6101846", "text": "function eventsFirstTime(){\n\t/******** Events ************/\n\t$(\".language\").on(\"click\", changeLanguage);\n\t//Pages\n\t$(\"#PGterms\").on(\"pagebeforeshow\", showTerms);\t\t\t\t\t\t//Terms page\n\t$(\"#PGformation\").on(\"pagebeforeshow\", formationButtons);\t\t\t//Formation page\n\t$(\"#PGplayers\").on(\"pagebeforeshow\", showPositions);\t\t\t\t//Players page\n\t$(\"#PGperformanceP\").on(\"pagebeforeshow\", showPerformanceP);\t\t//Player performance page\n\t//Restore\n\t$(\"#HRrestore\").on(\"click\", restoreValues);\t\t\t\t\t\t\t//Restore default values\n\t//Referee\n\t$(\".IMlike\").on(\"click\", showPerformanceR);\t\t\t\t\t\t\t//Referee performance page\n\t$(\"#SPclosePopupR\").on(\"click\", closeRefereePopup);\t\t\t\t\t//Closes referee popup\n\t$(window).on( \"orientationchange\", orientationChange);\t\t\t//Catch orient change event\n\t//-----------------------\n\n\t/******** Components ********/\n\tsettings=getItem(\"settings\");\n\t\n\tsetDefaults();\t//Determine wether default items must be set or not\n\ttranslate();\t//Translate menus and pages\n\t//-----------------------------------\n}", "title": "" }, { "docid": "43864af2a13ee1e5e20061c1694c14e2", "score": "0.6098021", "text": "function main(){\r\n rock_div.addEventListener('click', function(){\r\n Game (\"r\");\r\n })\r\n paper_div.addEventListener('click', function(){\r\n Game (\"p\");\r\n })\r\n scissor_div.addEventListener('click', function(){\r\n Game(\"s\");\r\n })\r\n }", "title": "" }, { "docid": "8e38214a83d9ebb1e9e7be14130e42c6", "score": "0.6097641", "text": "function addListeners() {\n document.addEventListener(CLICK, onClick);\n document.addEventListener(KEY_PRESS, onKeyPress);\n document.addEventListener(KEY_UP, onKeyUp);\n}", "title": "" }, { "docid": "59523c7cd51ee8587ec1efe8248d4f70", "score": "0.6093365", "text": "function registerEventHandlers(){\t\n\tvar login_button;\n\tvar signUp_button;\n\t\n\tlogin_button = document.getElementById(\"login_button\");\n login_button.addEventListener(\"click\", function() { \n compareLoginInfo();}, true);\n \n signUp_button = document.getElementById(\"signUp_button\");\n signUp_button.addEventListener(\"click\", function() { \n createNewInfo();}, true);\t\n}", "title": "" }, { "docid": "19ed0ceee71895981420d5a2a5563a6a", "score": "0.60864484", "text": "function addOnClickListenerToElements() {\n document.getElementById('session-info-span').addEventListener('click', \n openSessionInfo);\n document.querySelectorAll('.close').forEach(element => {\n element.addEventListener('click', event => {\n closeParentDisplay(event.target);\n });\n });\n document.querySelectorAll('.session-id-input').forEach(element => {\n element.addEventListener('click', event => {\n copyTextToClipboard(event.target);\n });\n });\n}", "title": "" }, { "docid": "560962b0aa4da77193c983a28439444f", "score": "0.6081736", "text": "function initGame() {\n let teme = document.getElementById(\"theme\");\n teme.addEventListener(\"click\", function() {\n switch (teme) {\n\n\n }\n\n })\n\n}", "title": "" }, { "docid": "8fd2c67720d449ac7f30d078b0207234", "score": "0.608123", "text": "function hello(){\n\t\n\t// when clicking the tapes\t\n\tdocument.querySelector(\"#Cry_Me_A_River_\").onclick = tape1;\n\tdocument.querySelector(\"#Free_As_A_Bird_\").onclick = tape2;\n\tdocument.querySelector(\"#Funky_Peppers_\").onclick = tape3;\n\tdocument.querySelector(\"#Honky_Shuffle_\").onclick = tape4;\n\tdocument.querySelector(\"#Shake_It_\").onclick = tape5;\n\t\n\tdocument.querySelector(\"#pause\").onclick = pauseMusic;\n\tdocument.querySelector(\"#eject\").onclick = eject;\n\n}", "title": "" }, { "docid": "fda7cdaab17b18fabfed5abba995c92e", "score": "0.6074507", "text": "function HomeContent() {\n\n console.log(\"Home Content Accessed ...\");\n console.log(\"%c Home Content Accessed ...\", \"font-weight:bold; font-size: 20px;\");\n var AboutButton = document.getElementById(\"AboutButton\");\n\n //Some browser do not like innerText but others do. textContent is standard. User textContent\n //AboutButton.innerText = \"About\";\n AboutButton.textContent = \"About\";\n\n //About Button event listener (Call back function)\n // addEventListener = built in js function 2 part = event type (click) + event handler(AboutButtonClick) enent handler called call back function\n AboutButton.addEventListener(\"click\", AboutButtonClick); //\n AboutButton.addEventListener(\"mouseover\", AboutButtonOver);\n AboutButton.addEventListener(\"mouseout\", AbooutButtonOut);\n }", "title": "" }, { "docid": "e5c23c34408a38fdf67d481d2ff67117", "score": "0.60692894", "text": "function initapp(){\n console.log(\"dispositivo listo!!\");\n $$('#camara').on(\"click\",click_camara);\n $$('#video').on(\"click\",click_video);\n $$('#audio').on(\"click\",click_audio);\n}", "title": "" }, { "docid": "0a262f0186a12875da858285a997a5b7", "score": "0.60682106", "text": "attachEvents() {\n document.querySelector(\".arrow-left\").addEventListener(\"click\", () => this.navigateSlides(true));\n document.querySelector(\".arrow-right\").addEventListener(\"click\", () => this.navigateSlides());\n document.querySelector(\".slider-navigation-wrapper\").addEventListener(\"click\", (e) => {\n this.navigateSlides(false, parseInt(e.target.getAttribute(\"data-id\")));\n });\n }", "title": "" }, { "docid": "5ab8eff795390df972a427e6de009aaf", "score": "0.6063551", "text": "function btnClickEventListener(){\n var btn=tabsgroups[s].querySelectorAll(\"button.link\");\n for(let i=0;i<btn.length;i++){\n let text=btn[i].innerHTML.split(\" \")[0].toLowerCase();\n let tab=document.getElementById(text);\n btn[i].addEventListener('click',()=>activateTab(tab))\n }\n }", "title": "" }, { "docid": "24ad20fdd2fd04b3ba54e317e40ed263", "score": "0.60524905", "text": "function allEventListners() {\n // toggler icon click event\n navToggler.addEventListener('click', togglerClick);\n // nav links click event\n navLinks.forEach( elem => elem.addEventListener('click', navLinkClick));\n }", "title": "" }, { "docid": "d59f0f765191193b32b4dd5b32d603f5", "score": "0.6051376", "text": "function navbarClickListener() {\n\t\t$('.user-navbar').on('click', () => {\n $('.js-menu').toggleClass('active');\n $('#fullscreen').addClass('hidden');\n });\n\n $('.user-navbar').on('click', '.nav-links', () => {\n $('.js-menu').toggleClass('active');\n $('#fullscreen').addClass('hidden'); \n }); \n\n $('.aux-nav').on('click', '.nav-links', () => {\n $('.js-menu').toggleClass('active');\n $('#fullscreen').addClass('hidden');\n })\n\t}", "title": "" }, { "docid": "2c401a77af7b89b6da45504bf7c13134", "score": "0.60264045", "text": "function bindDeviceEvents(){\n document.addEventListener(\"pause\", function(ev){\n broadcast.trig(deviceEvs.pause, ev);\n logger.log('on pause');\n }, false);\n document.addEventListener(\"resume\", function(ev){\n broadcast.trig(deviceEvs.resume, ev);\n logger.log('on resume');\n }, false);\n document.addEventListener(\"menubutton\", function(ev){\n broadcast.trig(deviceEvs.menubutton, ev);\n logger.log('on menubutton');\n }, false);\n // please, don't bind backbutton click. this is processed by router\n //document.addEventListener(\"backbutton\", function(ev){\n // broadcast.trig(deviceEvs.backbutton, ev);\n //}, false);\n document.addEventListener(\"searchbutton\", function(ev){\n broadcast.trig(deviceEvs.searchbutton, ev);\n logger.log('on searchbutton');\n }, false);\n }", "title": "" }, { "docid": "160fd569baeae07fd19af3a0f7334364", "score": "0.60235465", "text": "function chooseMenuListeners() {\n // if any of menu clicked launch close module functionlity\n var chooseMenu = document.querySelectorAll('.js-choose-menu');\n chooseMenu.forEach(function (item) {\n item.addEventListener('click', function () {\n deactivateMenu(this);\n });\n });\n\n // listener for contact module\n document.getElementById('showContact').addEventListener('click', activateContact);\n\n // close menu module and get back home by clicking logo\n document.getElementById('menuLogo').addEventListener('click', function () {\n location.href = '#';\n deactivateMenu(this);\n });\n}", "title": "" }, { "docid": "7653bfc1456553b4f4c379a93b6b7a61", "score": "0.60225326", "text": "function goHome()\n{\n switchScreens(activeWindow, document.getElementById(\"mood-main-screen\"));\n}", "title": "" }, { "docid": "04cf9e4309d981dad72e1727fbd94ab8", "score": "0.601626", "text": "function listenForClicks() {\n document.addEventListener(\"click\", (e) => {\n console.log(`[menu_actions.js] Clicked! Id: ${e.target.id}`);\n hideError();\n var activeTab = browser.tabs.query({\n currentWindow: true,\n active: true\n });\n\n // figure out which button was clicked and take appropriate action\n switch (e.target.id) {\n\n case \"analyze-webpage-button\":\n console.log(\"[menu_actions.js] Analyze Webpage button was clicked.\");\n activeTab\n .then(sendAnalyzeCommandToContentScript)\n .catch(logError);\n break;\n\n case \"fetch-webpage-button\":\n console.log(\"[menu_actions.js] Fetch Webpage data button was clicked.\");\n activeTab\n .then(sendFetchCommandToContentScript)\n .catch(logError);\n break;\n\n case \"analyze-text-button\":\n console.log(\"[menu_actions.js] Analyze Custom Text button was clicked.\");\n activeTab\n .then(analyzeCustomText)\n .catch(logError);\n break;\n\n case \"analyze-selected-button\":\n console.log(\"[menu_actions.js] Analyze Selected Text button was clicked.\");\n activeTab\n .then(sendAnalyzeSelectedCommandToContentScript)\n .catch(logError);\n break;\n\n case \"explain-selected-button\":\n console.log(\"[menu_actions.js] Explain Selected Text button was clicked.\");\n activeTab\n .then(sendExplainSelectedCommandToContentScript)\n .catch(logError);\n break;\n\n case \"back-button\":\n console.log(\"[menu_actions.js] Back button was clicked.\");\n showDefaultMenu();\n break;\n\n case \"login\":\n console.log(\"[menu_actions.js] Login was clicked.\");\n activeTab\n .then(sendLoginCommandToContentScript)\n .catch(logError);\n // TODO: How to handle if the login fails?\n break;\n\n case \"logout\":\n console.log(\"[menu_actions.js] Logout was clicked.\");\n activeTab\n .then(sendLogoutCommandToContentScript)\n .catch(logError);\n // TODO: How to handle if the logout fails?\n break;\n\n default:\n console.log(`[menu_actions.js] Unhandled button was clicked with id ${e.target.id}`);\n break;\n }\n });\n return;\n}", "title": "" }, { "docid": "88206920b2d2e96a74a3326f77e4533c", "score": "0.6015342", "text": "addEventListeners () {\n const login = this.root.querySelector('.js-input-login');\n const password = this.root.querySelector('.js-input-password');\n const button = this.root.querySelector('.js-submit-login');\n const regButton = this.root.querySelector('.js-reg-button');\n const loginErrors = this.root.querySelector('.js-login-errors');\n const passwordErrors = this.root.querySelector('.js-password-errors');\n const logo = this.root.querySelector('.welcome-logo');\n\n logo.addEventListener('click', () => this.eventBus.call('REDIRECT_TO_ALL_STORES'));\n\n button.addEventListener('click', () => {\n loginErrors.innerText = '';\n passwordErrors.innerText = '';\n const data = { login, password };\n this.eventBus.call('SUBMIT_LOGIN', data);\n });\n\n regButton.addEventListener('click', () => this.eventBus.call('REDIRECT_TO_REG'));\n }", "title": "" }, { "docid": "895699a9e4e94afab161868415a73ab6", "score": "0.6014067", "text": "function register_event_handlers()\n {\n \n \n /* button #botao_informacao */\n \n \n /* button #botao_informacao */\n $(document).on(\"click\", \"#botao_informacao\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#pagina_informacao\"); \n });\n \n /* button #botao_principal */\n $(document).on(\"click\", \"#botao_principal\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#page_12_17\"); \n });\n \n /* button #botao_modalidade */\n $(document).on(\"click\", \"#botao_modalidade\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#pagina_modalidade\"); \n });\n \n /* listitem Musculação */\n $(document).on(\"click\", \".uib_w_11\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#pagina_mod_musculacao\"); \n });\n \n /* listitem Dança Aerobica */\n $(document).on(\"click\", \".uib_w_12\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#pagina_mod_dancaaerobica\"); \n });\n \n /* listitem Box */\n $(document).on(\"click\", \".uib_w_13\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#pagina_mod_box\"); \n });\n \n }", "title": "" }, { "docid": "a568f0b68b6579786be546f110a58f0e", "score": "0.6008337", "text": "function main(){\n rock_div.addEventListener('click', function() {\n // console.log(\"hey clicked on rock\")\n // () => game(\"r\")\n game(\"r\")\n })\n paper_div.addEventListener('click', function() {\n // console.log(\"hey clicked on paper\")\n game(\"p\")\n })\n scissors_div.addEventListener('click', function() {\n // console.log(\"hey clicked on scissors\")\n game(\"s\")\n })\n\n}", "title": "" }, { "docid": "c38ec53d0d12035a6d565a0033e1139b", "score": "0.60029364", "text": "function events() {\n // event for clicking on ortholog count\n $('.show-reaction' + pref).unbind('click');\n $('.show-reaction' + pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n $('.show-gene' + pref).unbind('click');\n $('.show-gene' + pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n }", "title": "" }, { "docid": "89497456f30f5539ed067c861bf51fcc", "score": "0.59995985", "text": "function ChangeLoginRegister(){\n var loginForm=document.querySelector(\".login-form\");\n var regisForm=document.querySelector(\".regis-form\");\n var forgotForm=document.querySelector(\".forgot-form\");\n var btnLogin=document.querySelector(\".login\");\n var btnRegister=document.querySelector(\".register\");\n \n btnLogin.addEventListener(\"click\",function(){\n loginForm.style.display=\"block\";\n regisForm.style.display=\"none\";\n forgotForm.style.display='none';\n });\n btnRegister.addEventListener(\"click\",function(){\n regisForm.style.display=\"block\";\n loginForm.style.display=\"none\";\n forgotForm.style.display='none';\n })\n}", "title": "" }, { "docid": "08a8ce3d051f6941f4a08a03b70b64b0", "score": "0.5978383", "text": "function Add_Listeners () {\n document.getElementById(\"info_box\").addEventListener(\"click\", Bottom_Bar, false)\n\n btmbuttons.forEach(function (btmbutton) {\n var btm_btn = \"llama_\" + btmbutton\n document.getElementById(btm_btn).addEventListener(\"click\", function () {\n Bottom_Bar(btmbutton)\n }, false)\n }\n )\n top_buttons.forEach(function (top_button) {\n var top_btn = \"llama_\" + top_button\n document.getElementById(top_btn).addEventListener(\"click\", function () {\n Top_Bar_Action(top_button)\n }, false)\n }\n )\n checkbox_actions.forEach(function (checkbox_action) {\n var checkbox_action_element = \"llama_\" + checkbox_action\n document.getElementById(checkbox_action_element).addEventListener(\"click\", function () {\n Checkbox_Action(checkbox_action)\n }, false)\n })\n button_actions.forEach(function (button_action) {\n var button_action_element = \"llama_\" + button_action\n document.getElementById(button_action_element).addEventListener(\"click\", function () {\n Button_Action(button_action)\n }, false)\n }\n )\n document.getElementById(\"Exit_Box\").addEventListener(\"click\", function () {\n Exit_Box_Action()\n }, false)\n}", "title": "" }, { "docid": "28ec1c7596b6bc60c18364270c86cb01", "score": "0.5966936", "text": "function botones() {\n let botones = document.getElementsByClassName(\"boton\");\n\n for (let i = 0; i < botones.length; i++) {\n\n botones[i].addEventListener(\"click\", botonAcciones, false);\n }\n\n\n}", "title": "" }, { "docid": "bfabbc73a815ec23b922e84288acba8d", "score": "0.5956912", "text": "function bindEvents() {\n\n document.body.addEventListener('click', canvasClicked);\n\n nodes.controls.saveButton.addEventListener('click', saveButtonClicked);\n\n nodes.controls.resizeSqure.addEventListener('click', resizeButtonClicked);\n nodes.controls.resizeVertical.addEventListener('click', resizeButtonClicked);\n nodes.controls.resizeHorisontal.addEventListener('click', resizeButtonClicked);\n\n nodes.controls.pictureButton.addEventListener('click', controlButtonsClicked);\n nodes.controls.mainTextButton.addEventListener('click', controlButtonsClicked);\n nodes.controls.headlineButton.addEventListener('click', controlButtonsClicked);\n\n }", "title": "" }, { "docid": "462acaaff130063dfddf105db97e0841", "score": "0.59557784", "text": "function add_listeners(){\n jQuery(document).click(function(e){\n switch(e.target.id){\n case 'crowdlogger-logging-button':\n CROWDLOGGER.logging.toggle_logging();\n refresh_icon();\n break;\n\n case 'crowdlogger-registration-launch-button':\n CROWDLOGGER.study.launch_registration_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-refer-a-friend-button':\n CROWDLOGGER.study.launch_refer_a_friend_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-settings-button':\n CROWDLOGGER.gui.preferences.launch_preference_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-show-status-page-button':\n CROWDLOGGER.gui.study.pages.launch_status_page(); \n exit(); \n break;\n\n case 'crowdlogger-clrm-library-button':\n CROWDLOGGER.clrm.launchCLRMLibraryPage(); \n exit(); \n break;\n\n case 'crowdlogger-help-button':\n CROWDLOGGER.gui.study.pages.launch_help_page(); \n exit(); \n break;\n\n case 'crowdlogger-welcome-wizard-button':\n CROWDLOGGER.version.util.launch_welcome_page(); \n exit(); \n break;\n }\n });\n}", "title": "" }, { "docid": "14021c9ac27cab40a1a6cdd359f55978", "score": "0.59468585", "text": "function register_event_handlers()\n {\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Orar */\n $(document).on(\"click\", \".uib_w_13\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Orar\"); \n return false;\n });\n \n /* button Acasa */\n $(document).on(\"click\", \".uib_w_11\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Catalog */\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Catalog\"); \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_15\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Despre Noi */\n $(document).on(\"click\", \".uib_w_12\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#despre_noi\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "22b8fd370206c00291085fc9dc708b57", "score": "0.5945002", "text": "function addEventListeners() {\n left.addEventListener('click', selectedData);\n center.addEventListener('click', selectedData);\n right.addEventListener('click', selectedData);\n}", "title": "" }, { "docid": "9d3a8fcd62d88908d7c516eb02d4690e", "score": "0.5944005", "text": "function register_event_handlers()\n {\n \n \n /*Activa listado */\n $(document).on(\"click\", \".bsoftware\", function(evt)\n {\n /*Destino listado */\n activate_subpage(\"#software\"); \n\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_15\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n });\n \n }", "title": "" }, { "docid": "cdacd24f10572a69fd63787905132abd", "score": "0.5919555", "text": "function addEventListenersToNavButtons() {\n\tlet navButtons = [...document.getElementsByClassName(\"navButton\")];\n\tnavButtons.forEach(navButton => {\n\t\tnavButton.addEventListener(\"click\", function(event) {\n\t\t\t//call openTab with event and tabName to switch active tab and contents\n\t\t\topenTab(event, navButton.innerHTML.trim());\n\t\t});\n\t});\n}", "title": "" }, { "docid": "23952034b6ac77e127c992221c36f6c6", "score": "0.5909991", "text": "function register_event_handlers()\n {\n \n \n /* button #op-staffBack */\n $(document).on(\"click\", \"#op-staffBack\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* graphic button #op-staff-01 */\n $(document).on(\"click\", \"#op-staff-01\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#staffMenu\"); \n return false;\n });\n \n /* button #op-studentBack */\n $(document).on(\"click\", \"#op-studentBack\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* graphic button #op-student-01 */\n $(document).on(\"click\", \"#op-student-01\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#studentMenu\"); \n return false;\n });\n \n /* button #op-staffOSidebar */\n $(document).on(\"click\", \"#op-staffOSidebar\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\"#op-sidebarStaff\")); \n return false;\n });\n \n /* button #op-sideMenuHomeStaff */\n $(document).on(\"click\", \"#op-sideMenuHomeStaff\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Student */\n $(document).on(\"click\", \".uib_w_42\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#studentMenu\"); \n return false;\n });\n \n /* button .uib_w_22 */\n $(document).on(\"click\", \".uib_w_22\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\".uib_w_43\")); \n return false;\n });\n \n /* button Home */\n $(document).on(\"click\", \".uib_w_44\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Staff */\n $(document).on(\"click\", \".uib_w_45\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#staffMenu\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "76c8f0da7466d8626cdf7be2b6789911", "score": "0.5906031", "text": "function listenForClicks() {\n // const engineStatus = sessionStorage.getItem('engine') || 'on';\n // document\n // .querySelector(`input[value=${engineStatus}]`)\n // .setAttribute('checked', 'checked');\n\n document.addEventListener('click', e => {\n if (e.target.classList.contains('variant')) {\n browser.tabs\n .query({ active: true, currentWindow: true })\n .then(tabs => {\n browser.tabs.sendMessage(tabs[0].id, {\n variant: e.target.textContent,\n });\n })\n .catch(console.error);\n } else if (e.target.classList.contains('engine')) {\n browser.tabs\n .query({ active: true, currentWindow: true })\n .then(tabs => {\n browser.tabs.sendMessage(tabs[0].id, {\n cheatOff: e.target.value === 'off',\n });\n })\n .catch(console.error);\n }\n });\n}", "title": "" }, { "docid": "809cf4ac3da58ca711a64f3aa0e5683a", "score": "0.59046113", "text": "function articleClicked() {\n const image = document.querySelectorAll(\"figure img\");\n const figcaption = document.querySelectorAll(\"figcaption\");\n const titleDirect = document.querySelectorAll(\"#Direct h3\");\n\n image.forEach( function (image) {\n image.addEventListener(\"click\", function (){\n sessionStorage.removeItem(\"id\");\n sessionStorage.setItem(\"id\", image.classList.value);\n redirectionArticle();\n })\n })\n\n figcaption.forEach( function (figcaption) {\n figcaption.addEventListener(\"click\", function (){\n sessionStorage.removeItem(\"id\");\n sessionStorage.setItem(\"id\", figcaption.classList.value);\n redirectionArticle();\n })\n })\n \n titleDirect.forEach( function (titleDirect) {\n titleDirect.addEventListener(\"click\", function (){\n sessionStorage.removeItem(\"id\");\n sessionStorage.setItem(\"id\", titleDirect.classList.value);\n redirectionArticle();\n })\n })\n}", "title": "" }, { "docid": "feab5a6c0faab5293c3b04925b04ebdb", "score": "0.590202", "text": "function registerListeners() {\n let $body = $('body');\n\n $body.on('click', 'button.nav', event => navigateTo(event.target.name));\n $body.on('click', 'button.back', event => back());\n}", "title": "" }, { "docid": "b425463e7234b00f63cafa80cd30d904", "score": "0.5899095", "text": "addListeners() {\n this.startGameButton.addEventListener(\"click\", this.startGameHandler);\n this.gameOptionsButton.addEventListener(\"click\", this.gameOptionsHandler);\n this.gameCreditsButton.addEventListener(\"click\", this.gameCreditsHandler);\n this.exitGameButton.addEventListener(\"click\", this.exitGameHandler);\n this.saveGameButton.addEventListener(\"click\", this.saveGameOptionsHandler);\n this.restartGameButton.addEventListener(\"click\", this.startGameHandler);\n }", "title": "" }, { "docid": "656db22745241475a1d4b1b2d6cc800f", "score": "0.58872783", "text": "function setDefaultEvents() {\n document.addEventListener(\"tizenhwkey\", keyEventHandler);\n document.querySelector(\"#area-news\").addEventListener(\"click\", showNextNews);\n }", "title": "" }, { "docid": "cbf5008f4caf6488ec204023bd11c741", "score": "0.58861613", "text": "function registerEventListeners() {\n document.querySelector(\"#shapes\").addEventListener(\"click\", clickShape);\n document.querySelector(\"#colors\").addEventListener(\"click\", clickColor);\n}", "title": "" }, { "docid": "f91432655a4d27dd4b01042a6bfb0d97", "score": "0.5877288", "text": "function ampliar() {\n if (!pantallaDesktop.matches) {\n const arrayImagenes = document.querySelectorAll(\".imgBuscada\");\n arrayImagenes.forEach(imagenesGaleria => {\n imagenesGaleria.addEventListener('click', (eventoAmpliar) => {\n console.log(eventoAmpliar.target);\n console.log(eventoAmpliar.target.getAttribute(\"key\"));\n sectionImagenAmplificada.style.display = \"block\";\n imgAmplificada.src = `${eventoAmpliar.target.src}`;\n imgAmplificada.setAttribute(\"corazon\", `${eventoAmpliar.target.getAttribute(\"corazon\")}`);\n imgAmplificada.key = `${eventoAmpliar.target.getAttribute(\"key\")}`;\n imgAmplificada.setAttribute(\"key\", `${eventoAmpliar.target.getAttribute(\"key\")}`);\n nombreUsuario.innerHTML = `${eventoAmpliar.target.getAttribute(\"nombre\")}`;\n tituloGif.innerHTML = `${eventoAmpliar.target.getAttribute(\"titulo\")}`;\n busquedaSection.style.display = \"none\";\n buscadorGifos.style.display = \"none\";\n trendingSection.style.display = \"none\";\n footer.style.display = \"none\";\n galeriaFav.style.display = \"none\";\n let cruzImgAmplificadaBtn = document.getElementById('cruzImgAmplificadaBtn');\n cruzImgAmplificadaBtn.addEventListener('click', (eventoReducir) => {\n location.reload()\n });\n if (arrayFavoritos.includes(eventoAmpliar.target.getAttribute(\"key\"))) {\n btnFavImgAmpliada.src = \"assets/assets/icon-fav-active.svg\";\n btnFavImgAmpliada.style.padding = \"2.4vw 2.13333333vw\";\n btnFavImgAmpliada.style.borderRadius = \"5px\";\n btnFavImgAmpliada.style.backgroundColor = \"#ffffff\";\n } else {\n btnFavImgAmpliada.src = \"assets/assets/icon-fav.svg\";\n btnFavImgAmpliada.style.width = \"9.6vw\";\n btnFavImgAmpliada.style.height = \"9.6vw\";\n btnFavImgAmpliada.style.backgroundColor = \"#ffffff\";\n btnFavImgAmpliada.style.borderRadius = \"5px\";\n }\n btnFavImgAmpliada.setAttribute(\"key\", `${eventoAmpliar.target.getAttribute(\"key\")}`);\n\n let btnDescargarImgAmpliada = document.getElementById(\"btnDescargarImgAmpliada\");\n btnDescargarImgAmpliada.addEventListener('click', (eventoDescargar) => {\n console.log(\"click\");\n console.log(eventoDescargar);\n download();\n });\n });\n });\n }\n}", "title": "" }, { "docid": "85cc81a185d7212f0f5504d148337ff4", "score": "0.58767277", "text": "function setEventListeners() {\n let next = document.getElementsByClassName(\"slider-button-next\")[0],\n prev = document.getElementsByClassName(\"slider-button-prev\")[0];\n\n next.addEventListener(\"click\", moveNext);\n prev.addEventListener(\"click\", movePrev);\n}", "title": "" }, { "docid": "8cf1212d2e8a0d3075c48d4304bdea83", "score": "0.5872355", "text": "loadAllEventListener(){\n const{sBtnELm,insertElm,cNBtnElm,searchElm} = this.selectors()\n sBtnELm.addEventListener('click',(e)=>this.addNote(e))\n window.addEventListener('DOMContentLoaded',(e)=>this.getData(data.note))\n insertElm.addEventListener('click',(e)=>this.deleteOrModifyNoteData(e))\n cNBtnElm.addEventListener('click',()=>this.otherItemRemove())\n searchElm.addEventListener('keyup',(e)=>this.searchNoteItem(e))\n }", "title": "" }, { "docid": "4853ef41fd2ed6719a260a057a63c65e", "score": "0.58702403", "text": "function onDeviceReady() {\n $('#Connection').on(\"click\", showConnection);\n $('#Inscription').on(\"click\", showInscription);\n}", "title": "" }, { "docid": "85dd1785829343a428bb67b6d3d3768a", "score": "0.5860938", "text": "function setGamePanelContent(screenName){\n screenController.currentScreen = screenName;\n document.getElementById(\"gamepanel\").innerHTML= screenController.getScreenContent();\n if(screenName === 'intro'){\n document.getElementById('status-panel').style.visibility = \"hidden\";\n document.getElementById('clock-label').style.visibility = `hidden`;\n document.getElementById('clock-div').style.visibility = `hidden`;\n document.getElementById('intro-panel').classList.add('animation');\n document.getElementById('intro-panel').innerHTML = `<p>${introText1}</p>`;\n document.getElementById('intro-panel').onclick = function(){\n document.getElementById('intro-panel').classList.remove('animation');\n void document.getElementById('intro-panel').offsetWidth; // Zeitliche Lückenfüller-Funktion, die das erneute Hinzufügen einer Klasse \"sichtbar\" wirksam macht\n document.getElementById('intro-panel').classList.add('animation');\n document.getElementById('intro-panel').innerHTML = `<p>${introText2}</p>`;\n document.getElementById('intro-panel').onclick = function(){\n document.getElementById('intro-panel').classList.remove('animation');\n void document.getElementById('intro-panel').offsetWidth;\n document.getElementById('intro-panel').classList.add('animation');\n document.getElementById('intro-panel').innerHTML = `<p>${introText3}</p>`;\n document.getElementById('intro-panel').onclick = function(){\n document.getElementById('intro-panel').classList.remove('animation');\n void document.getElementById('intro-panel').offsetWidth;\n document.getElementById('intro-panel').classList.add('animation');\n document.getElementById('intro-panel').innerHTML = `<p>${introText4}</p>`;\n document.getElementById('intro-panel').onclick = function(){\n gotoMainScreen();\n }\n }\n }\n };\n }\n if(screenName === 'main'){\n console.log('entered main section in set gamepanel content method');\n document.getElementById('clock-label').style.visibility = `visible`;\n document.getElementById('clock-div').style.visibility = `visible`;\n document.getElementById('clock-div').style.backgroundImage = `url(\"assets/img/clock/clock_${remainingHours}.png\")`;\n\n document.getElementById('status-panel').style.visibility = \"visible\";\n document.getElementById('status-panel').innerHTML = \"Wähle einen Ort aus\";\n document.getElementById('candidates-overlay').style.visibility = \"hidden\";\n document.getElementById('solve-overlay').style.visibility = \"hidden\";\n\n for(let location in alreadyVisitedMapping){\n if(alreadyVisitedMapping[location] === true){\n document.getElementById(`main-map-${location}`).innerHTML = `<img src=\"/assets/img/haken.png\" id=\"overlay-mark\">`;\n }\n }\n\n document.getElementById('main-map-house1').onclick = function(){handleClickOnLocation('house1', false);};\n document.getElementById('main-map-house2').onclick = function(){handleClickOnLocation('house2', false);};\n document.getElementById('main-map-house3').onclick = function(){handleClickOnLocation('house3', false);};\n document.getElementById('main-map-house4').onclick = function(){handleClickOnLocation('house4', false);};\n document.getElementById('main-map-house5').onclick = function(){handleClickOnLocation('house5', false);};\n document.getElementById('main-map-house6').onclick = function(){handleClickOnLocation('house6', false);};\n document.getElementById('main-map-house7').onclick = function(){handleClickOnLocation('house7', false);};\n document.getElementById('main-map-house8').onclick = function(){handleClickOnLocation('house8', false);};\n document.getElementById('main-map-house9').onclick = function(){handleClickOnLocation('house9', false);};\n document.getElementById('main-map-house10').onclick = function(){handleClickOnLocation('house10', false);};\n document.getElementById('main-map-house11').onclick = function(){handleClickOnLocation('house11', false);};\n document.getElementById('main-map-house12').onclick = function(){handleClickOnLocation('house12', false);};\n document.getElementById('main-map-cabanon').onclick = function(){handleClickOnLocation('cabanon', false);};\n document.getElementById('main-map-forest').onclick = function(){handleClickOnLocation('forest', false);};\n document.getElementById('main-map-show-candidates-button').onclick = handleClickOnShowCandidates;\n document.getElementById('main-map-solve-button').onclick = handleClickOnSolve;\n }\n if(screenName === 'easteregg'){\n console.log('entered easteregg section in set gamepanel content method');\n document.getElementById('confirm-button').onclick = function(){\n console.log(`HINTS: ${hints}`);\n setGamePanelContent('main');\n handleClickOnLocation(currentlySelectedLocation, true);\n let textToDisplay = getSuccessText(houseEventMapping[currentlySelectedLocation]);\n textToDisplay = textToDisplay.concat('Die Person hatte die folgende Eigenschaft <b><u>NICHT</u></b>: ');\n textToDisplay = textToDisplay.concat(hints[0]);\n tryShift();\n document.getElementById('speechbubble-div').innerHTML = `<p>${textToDisplay}</p></br><button id=\"back-to-map-button\">OK</button>`;\n document.getElementById('back-to-map-button').onclick = function(){\n alreadyVisitedMapping[currentlySelectedLocation] = true;\n remainingHours -= 1;\n shiftLock = \"open\";\n setGamePanelContent('main');\n return;\n };\n };\n }\n if(screenName === 'joker'){\n console.log('entered joker section in set gamepanel content method');\n console.log(`HINTS: ${hints}`);\n handleClickOnLocation(currentlySelectedLocation, true);\n let textToDisplay = getSuccessText(houseEventMapping[currentlySelectedLocation]);\n textToDisplay = textToDisplay.concat('Die Person hatte die folgende Eigenschaft <b><u>NICHT</u></b>: ');\n textToDisplay = textToDisplay.concat(hints[0]);\n tryShift();\n document.getElementById('speechbubble-div').innerHTML = `<p>${textToDisplay}</p></br><button id=\"back-to-map-button\">OK</button>`;\n document.getElementById('back-to-map-button').onclick = function(){\n alreadyVisitedMapping[currentlySelectedLocation] = true;\n remainingHours -= 1;\n shiftLock = \"open\";\n setGamePanelContent('main');\n return;\n };\n }\n if(screenName === 'quiz'){\n console.log('entered quiz section in set gamepanel content method');\n\n let quizObject = getQuizObject(houseEventMapping[currentlySelectedLocation]);\n\n // set question params\n document.getElementById('question-text').innerHTML = quizObject.introText;\n\n document.getElementById('answer-1-button').innerHTML = quizObject.answers[0];\n document.getElementById('answer-2-button').innerHTML = quizObject.answers[1];\n document.getElementById('answer-3-button').innerHTML = quizObject.answers[2];\n document.getElementById('answer-4-button').innerHTML = quizObject.answers[3];\n if(quizObject.answers.length < 5){\n document.getElementById('answer-5-button').style.visibility = \"hidden\";\n } else{\n document.getElementById('answer-5-button').innerHTML = quizObject.answers[4];\n }\n\n // set handlers\n for(let answerNumber in quizObject.answers){\n if(answerNumber == quizObject.correctAnswer){\n document.getElementById(`answer-${Number(answerNumber) + 1}-button`).onclick = function(){\n setGamePanelContent('main');\n handleClickOnLocation(currentlySelectedLocation, true);\n let textToDisplay = getSuccessText(houseEventMapping[currentlySelectedLocation]);\n textToDisplay = textToDisplay.concat('Die Person hatte die folgende Eigenschaft <b><u>NICHT</u></b>: ');\n textToDisplay = textToDisplay.concat(hints[0]);\n tryShift();\n document.getElementById('speechbubble-div').innerHTML = `<p>${textToDisplay}</p></br><button id=\"back-to-map-button\">OK</button>`;\n document.getElementById('back-to-map-button').onclick = function(){\n alreadyVisitedMapping[currentlySelectedLocation] = true;\n remainingHours -= 1;\n shiftLock = \"open\";\n setGamePanelContent('main');\n return;\n };\n };\n }else{\n document.getElementById(`answer-${Number(answerNumber) + 1}-button`).onclick = function(){\n setGamePanelContent('main');\n handleClickOnLocation(currentlySelectedLocation, true);\n let textToDisplay = getFailText(houseEventMapping[currentlySelectedLocation]);\n document.getElementById('speechbubble-div').innerHTML = `<p>${textToDisplay}</p></br><button id=\"back-to-map-button\">OK</button>`;\n document.getElementById('back-to-map-button').onclick = function(){\n alreadyVisitedMapping[currentlySelectedLocation] = true;\n remainingHours -= 1;\n setGamePanelContent('main');\n return;\n };\n };\n }\n }\n }\n}", "title": "" }, { "docid": "7d96a811fc8e8b3166106d24049ba07b", "score": "0.586072", "text": "setEventListeners() {\n this.getJokeFromClickOnCategoryLink();\n this.getJokeFromClickOnSurpriseButton();\n this.getJokeFromClickOnSearchButton();\n }", "title": "" }, { "docid": "77546a67207ce49b8fd19849ad5701b4", "score": "0.5855485", "text": "function clickHome(f) {\nconst targetLink =\tf.target.className\n\n divLinkImg.forEach((e) => {\n\t \n\t e.style.visibility = \"hidden\";\n\t \n\t});\n//show h1 and text and links\n topicSourceLink.forEach((e) => {\n e.style.display = \"block\";\n\te.addEventListener('click' ,el=>{\n\t\tlet targetel = el.target.textContent\n\t\nif(el.target.src === `https://walery0001.github.io/ownWebOne/grafik/hubert/h00.jpeg`){\n\t el.target.src = `https://walery0001.github.io/ownWebOne/grafik/hubert/h1.jpeg`\n\tfor(i=1;i<18;i++){\t\n\ttekstLink.innerHTML += `<img class=\"firstFotoGalery\" src=\"grafik/hubert/h${i}.jpeg\"/>`}\n\t\n}\nconsole.log(el.target.src)\n//show small pic BIG\nif(el.target.classList[0] === 'firstFotoGalery'){\n\timgBlackBg.style.display = \"block\"\n\t\n\tlet imgForDiv = el.target.src.split('https://walery0001.github.io/ownWebOne/')\n\n\timgBlackBg.innerHTML =`<img class=\"fullImg\" src=\"${imgForDiv[1]}\"/>`\n\n}\n//close big pic\nimgBlackBg.addEventListener('click',()=>\n\timgBlackBg.style.display = \"none\")\n\n\n\t//link Home back to HOME\n\t\n\t\tif(targetel === 'Home'){\n\t\t\tdivLinkImg.forEach((e) => {\n\t\t\t\te.classList.add(\"keyFrames\");\n\t\t\t\te.style.visibility = \"visible\";\n\t\t\t\ttopicSourceLink.forEach((e) => {\n\t\t\t\t\te.style.display = \"none\"})\n\n\t\t\t });\n\n\t\t}\n\t//\ttext links / links click\n\t\tif(targetel === 'Omnie'){\n\t\t\ttopicText.innerText = linkSources[1].topic;\n\t\t\ttekstLink.innerText = linkSources[1].source;\n\t\t}\n\t\tif(targetel === 'Portfolio'){\n\t\t\ttopicText.innerText = linkSources[2].topic;\n\t\t\ttekstLink.innerHTML = linkSources[2].source;\n\n\t\t}\n\n\t\tif(targetel === 'Kontakt'){\n\t\t\ttopicText.innerText = linkSources[3].topic;\n\t\t\ttekstLink.innerHTML = linkSources[3].source;\n\t\t}\n\t})\n });\n//pictures links / links click\nif(f.target.classList[1] === 'home'){\n\ttopicText.innerText = linkSources[0].topic;\n\ttekstLink.innerText = linkSources[0].source;\n\tconsole.log()\n}\nif(f.target.classList[1] === 'omnie'){\n\ttopicText.innerText = linkSources[1].topic;\n\ttekstLink.innerText = linkSources[1].source;\n}\nif(f.target.classList[1] === 'portfol'){\n\ttopicText.innerText = linkSources[2].topic;\n\ttekstLink.innerHTML = linkSources[2].source;\n\n}\nif(f.target.classList[1] === 'kontakt1'){\n\ttopicText.innerText = linkSources[3].topic;\n\ttekstLink.innerHTML = linkSources[3].source;\n}\n\n}", "title": "" } ]
f9e3fcaf908aea0d5de620400020d161
Handles the reply of the relationships transaction and is called once the transaction is complete.
[ { "docid": "c0f8ff85ba19f95cbbf4d1caf28b51a8", "score": "0.70194405", "text": "function processRelationships(reply) {\n\tTimers.stop(\"ENG:CareCompass.loadRelationships.ExecuteTransaction\");\n\tTimers.start(\"ENG:CareCompass.loadRelationships.ProcessTransaction\");\n\tvar jsonReply = parseReply(reply);\n\tif(jsonReply != null && jsonReply.status != \"F\") {\n\t\tRelationshipDialog.relationships = jsonReply.data;\n\t\tRelationshipDialog.load();\n\t}else if(jsonReply == null || jsonReply.status == \"F\") {\n\t\tErrorScreen.display(i18n.SYSTEM_FAILURE);\n\t}\n}", "title": "" } ]
[ { "docid": "f203dec5947fe8953513d7156b9f3fc4", "score": "0.686589", "text": "function processEstablishRelationship(reply) {\n\tTimers.stop(\"ENG:CareCompass.establishRelationships.ExecuteTransaction\");\n\tTimers.start(\"ENG:CareCompass.establishRelationships.ProcessTransaction\");\n\tvar jsonReply = parseReply(reply);\n\tif(jsonReply != null && jsonReply.status == \"S\") {\n\t\tService.loadPatients(PatientLists.getActiveId()); \n\t\tTimers.stop(\"USR:CareCompass.EstablishRelationships\");\n\t}else if(jsonReply == null || jsonReply.status == \"F\") {\n\t\tErrorScreen.display(i18n.SYSTEM_FAILURE); \n\t}\n\tTimers.stop(\"ENG:CareCompass.establishRelationships.ProcessTransaction\");\n\tTimers.stop(\"ENG:CareCompass.establishRelationships.TotalTransaction\");\n}", "title": "" }, { "docid": "a53f73006b3bc5e7f3dedf83c6338555", "score": "0.554374", "text": "async function relationshipOperation(rec, \n/**\n * **operation**\n *\n * The relationship operation that is being executed\n */\noperation, \n/**\n * **property**\n *\n * The property on this model which changing its relationship status in some way\n */\nproperty, \n/**\n * The array of _foreign keys_ (of the \"from\" model) which will be operated on\n */\nfkRefs, \n/**\n * **paths**\n *\n * a set of name value pairs where the `name` is the DB path that needs updating\n * and the value is the value to set.\n */\npaths, options = {}) {\n // make sure all FK's are strings\n const fks = fkRefs.map(fk => {\n return typeof fk === \"object\" ? createCompositeKeyString_1.createCompositeRef(fk) : fk;\n });\n const dispatchEvents = {\n set: [\n __1.FmEvents.RELATIONSHIP_SET_LOCALLY,\n __1.FmEvents.RELATIONSHIP_SET_CONFIRMATION,\n __1.FmEvents.RELATIONSHIP_SET_ROLLBACK\n ],\n clear: [\n __1.FmEvents.RELATIONSHIP_REMOVED_LOCALLY,\n __1.FmEvents.RELATIONSHIP_REMOVED_CONFIRMATION,\n __1.FmEvents.RELATIONSHIP_REMOVED_ROLLBACK\n ],\n // update: [\n // FMEvents.RELATIONSHIP_UPDATED_LOCALLY,\n // FMEvents.RELATIONSHIP_UPDATED_CONFIRMATION,\n // FMEvents.RELATIONSHIP_UPDATED_ROLLBACK\n // ],\n add: [\n __1.FmEvents.RELATIONSHIP_ADDED_LOCALLY,\n __1.FmEvents.RELATIONSHIP_ADDED_CONFIRMATION,\n __1.FmEvents.RELATIONSHIP_ADDED_ROLLBACK\n ],\n remove: [\n __1.FmEvents.RELATIONSHIP_REMOVED_LOCALLY,\n __1.FmEvents.RELATIONSHIP_REMOVED_CONFIRMATION,\n __1.FmEvents.RELATIONSHIP_REMOVED_ROLLBACK\n ]\n };\n try {\n const [localEvent, confirmEvent, rollbackEvent] = dispatchEvents[operation];\n const fkConstructor = rec.META.relationship(property).fkConstructor;\n // TODO: fix the typing here to make sure fkConstructor knows it's type\n const fkRecord = new Record_1.Record(fkConstructor());\n const fkMeta = ModelMeta_1.getModelMeta(fkRecord.data);\n const transactionId = \"t-reln-\" +\n Math.random()\n .toString(36)\n .substr(2, 5) +\n \"-\" +\n Math.random()\n .toString(36)\n .substr(2, 5);\n const event = {\n key: rec.compositeKeyRef,\n operation,\n property,\n kind: \"relationship\",\n eventType: \"local\",\n transactionId,\n fks,\n paths,\n from: util_1.capitalize(rec.modelName),\n to: util_1.capitalize(fkRecord.modelName),\n fromLocal: rec.localPath,\n toLocal: fkRecord.localPath,\n fromConstructor: rec.modelConstructor,\n toConstructor: fkRecord.modelConstructor\n };\n const inverseProperty = rec.META.relationship(property).inverseProperty;\n if (inverseProperty) {\n event.inverseProperty = inverseProperty;\n }\n try {\n await localRelnOp(rec, event, localEvent);\n await relnConfirmation(rec, event, confirmEvent);\n }\n catch (e) {\n await relnRollback(rec, event, rollbackEvent);\n throw new errors_1.FireModelProxyError(e, `Encountered an error executing a relationship operation between the \"${event.from}\" model and \"${event.to}\". The paths that were being modified were: ${event.paths\n .map(i => i.path)\n .join(\"- \\n\")}\\n A dispatch for a rollback event has been issued.`);\n }\n }\n catch (e) {\n if (e.firemodel) {\n throw e;\n }\n else {\n throw new UnknownRelationshipProblem_1.UnknownRelationshipProblem(e, rec, property, operation);\n }\n }\n}", "title": "" }, { "docid": "d38a5bde1e569cff43e000f59f1f10af", "score": "0.5355865", "text": "function finishTransaction() {\n transaction.run()\n .then(result => {\n //console.log(result);\n res.send({ code: 200, message: \"All the dictionary were saved or updated\" });\n transaction.clean();\n })\n .catch(err => {\n transaction.rollback().catch(console.error);\n transaction.clean();\n })\n }", "title": "" }, { "docid": "bf6fd874924f4ca0740005109e622dfb", "score": "0.5352941", "text": "function transitionRelatedToDirty(relationship, record) {\n if (!record || isPromise(record)) return;\n var kind = relationship.kind;\n if (kind === 'belongsTo') {\n transitionToDirty(record);\n } else if (kind === 'hasMany') {\n record.content.forEach(transitionToDirty);\n }\n}", "title": "" }, { "docid": "f6f6c4e29e31abc0b5c7f7682d788be8", "score": "0.5238242", "text": "get relationships() {\n return (this.ref ? this.ref.relationships : [])\n }", "title": "" }, { "docid": "fc35307d7c4f6b8838ea764c26c52ad2", "score": "0.5190891", "text": "rollbackRelationships() {\n this.rollbackBelongsTo();\n this.rollbackHasMany();\n }", "title": "" }, { "docid": "672807cb8487eab1d99622236f9b1898", "score": "0.5181108", "text": "createRelations() {\n\t\tfor (const name in relationships) {\n\t\t\tif ({}.hasOwnProperty.call(relationships, name)) {\n\t\t\t\tconst relation = relationships[name];\n\t\t\t\tfor (const relName in relation) {\n\t\t\t\t\tif ({}.hasOwnProperty.call(relation, relName)) {\n\t\t\t\t\t\tconst related = relation[relName];\n\t\t\t\t\t\tmodels[name][relName](models[related]);\n\t\t\t\t\t\tlogger.log('verbose', 'Relation: ' + name + ' ' + relName + ' ' + related);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e524163c859513f9b9d086f8b63deb8e", "score": "0.5154136", "text": "sendResponseMessage() {\n if (this.isDestroyed || !this._currentResponseModel || !this._currentResponseModel.operations.length) return;\n this._sendResponseTimeout = 0;\n if (this.parentModel.message && this.parentModel.part && !this.parentModel.message.isNew()) {\n this._currentResponseModel.responseTo = this.parentModel.message.id;\n this._currentResponseModel.responseToNodeId =\n this.parentModel.part ? this.parentModel.nodeId : this.parentModel.parentId;\n const evt = this.parentModel.trigger('message-type-model:sending-response-message', {\n respondingToModel: this.parentModel,\n responseModel: this._currentResponseModel,\n cancelable: true,\n });\n if (evt.canceled) {\n this._currentResponseModel = null;\n } else {\n this._currentResponseModel.send({ conversation: this.parentModel.message.getConversation() });\n this._currentResponseModel = null;\n }\n } else if (this.parentModel.message) {\n this.parentModel.message.once('messages:sent', this.sendResponseMessage.bind(this), this);\n } else {\n this.parentModel.once('message-type-model:has-new-message', this.sendResponseMessage.bind(this), this);\n }\n }", "title": "" }, { "docid": "953a9cbe01ff76375a52f5c0f73cab95", "score": "0.5143823", "text": "function handleRelationsAndRelatedEntitiesByTarget(parentRowModel, rowModel, paramModel, token) {\n\t\t\n\t\t//console.log('handleRelationsAndRelatedEntitiesByTarget(): ');\n\t\t//console.log(angular.toJson(paramModel));\n\t\t\n\t\t// Modal here is very desturbing\n\t\tvar modalOptions = {\n\t\t\theaderText: 'Loading Please Wait...',\n\t\t\tbodyText: 'Updating available options...'\n\t\t};\n\t\t\n\t\tvar modalInstance = modalService.showModal(modalDefaults, modalOptions);\n\t\t\n\t\t// Make the model String (more convenient for the back-end)\n\t\tparamModel.model = angular.toJson(paramModel.model);\n\t\t\n\t\tqueryService.getRelationsAndRelatedEntitiesByTarget(paramModel, token)\n\t\t.then(function (response) {\n \t\t\n\t\t\tif(response.status == -1) {\n\t\t\t\t$scope.message = 'There was a network error. Try again later.';\n\t\t\t\t$scope.showErrorAlert('Error', $scope.message);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(response.status == '200') {\n\n\t\t\t\t\tif(response.data.length > 0) {\n\t\t\t\t\t\t\n\t\t\t\t\t\trowModel.selectedRelatedEntity = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\trowModel.rowModelList = [];\n\t\t\t\t\t\t//$scope.searchForm['relatedEntityInput_' + rowModel.id].$setValidity('required', false);\n\t\t\t\t\t\trowModel.relations = [];\n\t\t\t\t\t\trowModel.selectedRelation = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Storing response in the rowModel\n\t\t\t\t\t\trowModel.relatedEntityRelationTuples = angular.toJson(response.data);\n\t\t\t\t\t\n\t\t\t\t\t\tfor(var i=0; i<response.data.length; i++) {\n\t\t\t\t\t\t\t// Check for duplicates (URI based) in the list of related entities\n\t\t\t\t\t\t\t// Pure compare\n\t\t\t\t\t\t\tif (!containedInList(response.data[i].related_entity, rowModel.relatedEntities, false).contained)\n\t\t\t\t\t\t\t\trowModel.relatedEntities.push(response.data[i].related_entity);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\trowModel.relations.push(response.data[i].relation);\n\t\t\t\t\t\t\trowModel.relations[i].relatedEntity = response.data[i].related_entity;\n\t\t\t\t\t\t\t// Check if the relation's label is duplicated and mark it as duplicated\n\t\t\t\t\t\t\t//if(containedInListManyTimesBasedOnFieldPathOfDepth2(response.data[i].relation, response.data, 'name', 'relation', 'name').index.length >1)\n\t\t\t\t\t\t\t//\trowModel.relations[i].duplicate = true;\n\t\t\t\t\t\t\t//$log.info('value: ' + value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Sort them by label\n\t\t\t\t\t\trowModel.relations = $filter('orderBy')(rowModel.relations, 'name');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Display msg\n\t\t\t\t\t\t$mdToast.show(\n\t\t\t\t\t\t\t$mdToast.simple()\n\t\t\t\t\t .textContent('Selection Options for related entities have been updated.')\n\t\t\t\t\t .position('top right')\n\t\t\t\t\t .parent(angular.element('#mainContent'))\n\t\t\t\t\t .hideDelay(3000)\n\t\t\t\t\t );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse { //if(response.data.length <= 0)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(parentRowModel != null) {// Parent is some entityModel\n\t\t\t\t\t\t\tparentRowModel.rowModelList.splice(parentRowModel.rowModelList.length-1, 1);\n\t\t\t\t\t\t\tif(parentRowModel.rowModelList.length < 2) // Restore logical options if only one left\n\t\t\t\t\t\t\t\tparentRowModel.availableFilterExpressions = [{expression: 'OR'}, {expression: 'AND'}];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { // Parent is target\n\t\t\t\t\t\t\tif($scope.rowModelList.length == 1) // This is the only rowmodel\n\t\t\t\t\t\t\t\tresetWholeQueryModel(false);\n\t\t\t\t\t\t\telse // /There are more than one row models (target has many children)\n\t\t\t\t\t\t\t\t$scope.rowModelList.splice($scope.rowModelList.length-1, 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($scope.rowModelList.length < 2) // Restore logical options if only one left\n\t\t\t\t\t\t\t\t$scope.targetModel.availableFilterExpressions = [{expression: 'OR'}, {expression: 'AND'}];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// I cannot get the parentRowModel, thus prompting a general message\n\t\t\t\t\t\t$scope.message = 'The selected options lead to no results.';\n\t\t\t\t\t\t$scope.showErrorAlert('Information', $scope.message);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(response.status == '408') {\n \t\t\t\t$log.info(response.status);\n \t\t\t\t$scope.message = 'It seems that it takes a lot of time to complete this task! Please redifine your query and try again.';\n \t\t\t\t$scope.showErrorAlert('Important', $scope.message);\n \t\t\t}\n\t\t\t\t\n\t\t\t\telse if(response.status == '400') {\n \t\t\t\t$log.info(response.status);\n \t\t\t\t$scope.message = 'There was a network error. Try again later and if the same error occures again please contact the administrator.';\n \t\t\t\t$scope.showErrorAlert('Error', $scope.message);\n \t\t\t}\n \t\t\telse if(response.status == '401') {\n \t\t\t\t$log.info(response.status);\n \t\t\t\t$scope.showLogoutAlert();\n \t\t\t\tauthenticationService.clearCredentials();\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$log.info(response.status);\n \t\t\t\t$scope.message = 'There was a network error. Try again later and if the same error occures again please contact the administrator.';\n \t\t\t\t$scope.showErrorAlert('Error', $scope.message);\n \t\t\t}\n\t\t\t\n\t\t\t} // else close\n\t\t\n\t\t}, function (error) {\n\t\t\t$scope.message = 'There was a network error. Try again later.';\n\t\t\talert(\"failure message: \" + $scope.message + \"\\n\" + JSON.stringify({\n\t\t\t\tdata : error\n\t\t\t}));\n\t\t}).finally(function() {\n\t\t\tmodalInstance.close();\n\t\t});\n\t}", "title": "" }, { "docid": "1781630ea3aa594c73a520c9a0564719", "score": "0.51252854", "text": "async reply (envelope, ...strings) {\n await this.adapter.reply(envelope, ...strings)\n }", "title": "" }, { "docid": "d742155edc62c990d8734a9e312d854e", "score": "0.5088619", "text": "get manageRelationships() {\n return this.mode === TreeManagerMode.RELATIONAL;\n }", "title": "" }, { "docid": "255b275ceaf5a602fe1d2f266e14792e", "score": "0.5049258", "text": "function handleSaveRelativesInfo(agent) {\n const parentela = agent.parameters.parentela;\n const nome = agent.parameters.nome;\n const eta = agent.parameters.eta;\n const dataNascita = agent.parameters.dataNascita;\n\n // Test ok\n const senderID = getSenderID();\n\n // Ottengo la posizione dei contatori dei parenti\n let relativesCounterPath = admin.database().ref('pazienti/' + senderID + '/counters/parenti');\n\n return relativesCounterPath.once('value').then((snapshot) => {\n // Controllo quanti parenti ha inserito il paziente\n let relativesCounterForUser = snapshot.val();\n console.log('parenti gia\\' espressi: ' + relativesCounterForUser);\n\n // Test sender id\n console.log('SenderID: ' + senderID);\n\n // Creo path con id pari a quantita' di parenti espressi\n let relativesPath = admin.database().ref('pazienti/' + senderID + '/parenti/' + relativesCounterForUser);\n\n const parente = {\n parentela:parentela,\n nome:nome,\n eta:eta,\n dataNascita:dataNascita,\n };\n\n relativesPath.set(parente);\n\n // Incremento il numero di parenti di una unita'\n let relativesCounterPath = admin.database().ref('pazienti/' + senderID + '/counters/parenti');\n relativesCounterPath.set(relativesCounterForUser + 1);\n });\n }", "title": "" }, { "docid": "7e861ea7de72cf2a50f3da910f3f82d4", "score": "0.5047588", "text": "async function _getRelationsHandler() {\n logger.debug('* Connection Open: retrieveRelations');\n text = 'SELECT * FROM relations ORDER BY person_id';\n values = [];\n res = await psqlQuery(text, values);\n logger.debug('* Connection Closed: retrieveRelations');\n return res.rows;\n}", "title": "" }, { "docid": "c86efc0b9bb45d4bbc925d20710a1c20", "score": "0.5030725", "text": "function removeAllRelationships(obj, connection, callback) {\n\tvar deferred = Q.defer();\n\n\tif (obj.id != null && obj.object_type != null) {\n\t\tvar col = obj.object_type;\n\t\tvar qry = \"SELECT row_id FROM \\\"\" + col + \"\\\" WHERE \\\"data\\\" @> '{\\\"id\\\": \\\"\" + obj.id + \"\\\"}'\";\n\t\tvar params = [];\n\t\tDataAccess.prototype.ExecutePostgresQuery(qry, params, connection)\n\t\t.then(function (connection) {\n\t\t\tif (connection.results.length === 0) {\n\t\t\t\treleaseConnection(connection)\n\t\t\t\t.then(function() {\n\t\t\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t\t\t'da0100',\n\t\t\t\t\t\t__filename,\n\t\t\t\t\t\t'removeAllRelationships',\n\t\t\t\t\t\t'no entities found with that id'\n\t\t\t\t\t);\n\t\t\t\t\tdeferred.reject(errorObj);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (connection.results.length > 1) {\n\t\t\t\treleaseConnection(connection)\n\t\t\t\t.then(function() {\n\t\t\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t\t\t'da0101',\n\t\t\t\t\t\t__filename,\n\t\t\t\t\t\t'removeAllRelationships',\n\t\t\t\t\t\t'multiple entities found with that id'\n\t\t\t\t\t);\n\t\t\t\t\tdeferred.reject(errorObj);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// WE HAVE THE OBJECT, FIND THE RELATIONSHIPS AND DELETE THEM\n var rowId = connection.results[0].row_id;\n\t\t\t\tasync.forEach(relationshipMap, function (relDescriptor, callback) {\n if (relDescriptor.type1 === obj.object_type) {\n\t\t\t\t\t\tvar del_qry = \"DELETE FROM \\\"\" + relDescriptor.linkingTable + \"\\\" WHERE left_id = $1\";\n\t\t\t\t\t\tvar del_params = [rowId];\n\t\t\t\t\t\tDataAccess.prototype.ExecutePostgresQuery(del_qry, del_params, connection)\n\t\t\t\t\t\t.then(function (connection) {\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function (err) {\n\t\t\t\t\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t\t\t\t\t'da0102',\n\t\t\t\t\t\t\t\t__filename,\n\t\t\t\t\t\t\t\t'removeAllRelationships',\n\t\t\t\t\t\t\t\t'error deleting in postgres',\n\t\t\t\t\t\t\t\t'Database error',\n\t\t\t\t\t\t\t\terr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(errorObj);\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse if (relDescriptor.type2 === obj.object_type) {\n\t\t\t\t\t\tvar del_qry2 = \"DELETE FROM \\\"\" + relDescriptor.linkingTable + \"\\\" WHERE right_id = $1\";\n\t\t\t\t\t\tvar del2_params = [rowId];\n\t\t\t\t\t\tDataAccess.prototype.ExecutePostgresQuery(del_qry2, del2_params, connection)\n\t\t\t\t\t\t.then(function (connection) {\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function (err) {\n\t\t\t\t\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t\t\t\t\t'da0103',\n\t\t\t\t\t\t\t\t__filename,\n\t\t\t\t\t\t\t\t'removeAllRelationships',\n\t\t\t\t\t\t\t\t'error deleting in postgres',\n\t\t\t\t\t\t\t\t'Database error',\n\t\t\t\t\t\t\t\tdel_err\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(errorObj);\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t}, function (err) {\n\t\t\t\t\tif (!err) {\n\t\t\t\t\t\tdeferred.resolve(true);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treleaseConnection(connection)\n\t\t\t\t\t\t.then(function() {\n\t\t\t\t\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t\t\t\t\t'da0104',\n\t\t\t\t\t\t\t\t__filename,\n\t\t\t\t\t\t\t\t'removeAllRelationships',\n\t\t\t\t\t\t\t\t'error removing all relationships',\n\t\t\t\t\t\t\t\t'Database error',\n\t\t\t\t\t\t\t\terr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tdeferred.reject(errorObj);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t\t.fail(function (err) {\n\t\t\tdeferred.reject(err.AddToError(__filename, 'removeAllRelationships'));\n\t\t});\n\t}\n\telse {\n\t\treleaseConnection(connection)\n\t\t.then(function() {\n\t\t\tvar errorObj = new ErrorObj(500,\n\t\t\t\t'da0106',\n\t\t\t\t__filename,\n\t\t\t\t'removeAllRelationships',\n\t\t\t\t'object inputs must include an id and object_type property'\n\t\t\t);\n\t\t\tdeferred.reject(errorObj);\n\t\t});\n\t}\n\n\tdeferred.promise.nodeify(callback);\n\treturn deferred.promise;\n}", "title": "" }, { "docid": "73e23893a59293b073b08d0dee421a12", "score": "0.4993943", "text": "get relatesTo() {\n\t\treturn this.__relatesTo;\n\t}", "title": "" }, { "docid": "9ff8c0e2d602fb1fea4066b00f307e70", "score": "0.4988977", "text": "function addEachRelationship(contact, linkId)\r\n{\r\n try {\r\n\r\n var apidata = {\r\n \"method\": \"get\",\r\n \"knackobj\": dbContacts.key,\r\n \"appid\": app_id,\r\n \"id\" : contact\r\n };\r\n\r\n OYPKnackAPICall (headers, apidata)\r\n .then (result => {\r\n\r\n console.dir (result) ;\r\n if ( result == undefined)\r\n return ;\r\n\r\n apidata.record = {};\r\n\r\n var linkedContacts = [];\r\n if (result.field_258_raw == undefined)\r\n linkedContacts = [ linkId ] ;\r\n else {\r\n for (var n = 0; n < result.field_258_raw.length ; n++ )\r\n linkedContacts.push ( result.field_258_raw[n].id ) ;\r\n\r\n linkedContacts.push ( linkId ) ;\r\n }\r\n\r\n console.dir (linkedContacts) ;\r\n apidata.record.field_258 = linkedContacts;\r\n\r\n apidata.method = \"put\" ;\r\n console.dir (apidata) ;\r\n OYPKnackAPICall (headers, apidata) ;\r\n });\r\n }\r\n catch (e) {\r\n logerror (e);\r\n }\r\n}", "title": "" }, { "docid": "58f7ea17f14d37e1dcd56320e20b843e", "score": "0.49720764", "text": "function sendFollowRequestNotifications(guid, friendGuid, overrideRequest) {\n\n printTimeForEvent(\"sendFollowRequestNotifications\" );\n\n connection.query({\n sql: \"INSERT INTO `notifications`(`guid`, `id`, `fguid`, `type`) SELECT ?, coalesce(MAX(`id`) + 1, 0), ?, ? FROM `notifications` WHERE guid = ?\",\n values: [ guid, friendGuid, NotificationType.SentFollowRequest, guid]\n },\n function (err, results) {\n \n console.log(\"sendFollowRequestNotifications results results[0].id\");\n\n if (err) {\n printError(err);\n rollbackErrorResponse();\n } else if (results && results.affectedRows === 1) {\n \n connection.query({\n sql: \"INSERT INTO `notifications`(`guid`, `id`, `fguid`, `type`) SELECT ?, coalesce(MAX(`id`) + 1, 0), ?, ? FROM `notifications` WHERE guid = ?\",\n values: [ friendGuid, guid, NotificationType.ReceivedFollowRequest, friendGuid]\n },\n function (err, results) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n } else if (results && results.affectedRows === 1) {\n \n // We don't update follower/folling count numbers\n // We don't insert into timeline anything\n connection.commit(function(err) {\n \n printTimeForEvent(\"sendFollowRequestNotifications Commit\" );\n \n if (err) {\n printError(err);\n rollbackErrorResponse();\n } else {\n console.log('successful commit!');\n finalAppResponse( friendActionResponse( \n true, Relationship.FollowRequested));\n }\n });\n } else {\n rollbackErrorResponse(); \n }\n });\n } else {\n rollbackErrorResponse();\n }\n });\n \n\n // connection.query({\n // sql: 'INSERT INTO `notifications` (guid, fguid, type) VALUES ?',\n // values: [\n // [\n // [guid, friendGuid, NotificationType.SentFollowRequest],\n // [friendGuid, guid, NotificationType.ReceivedFollowRequest]\n // ]\n // ]\n // },\n // function (err, results) {\n \n // printTimeForEvent(\"Tried inserting 2 rows\");\n\n // if (err) {\n // printError(err);\n // rollbackErrorResponse();\n\n // } else if (results && results.affectedRows === 2) {\n // // Commit queries\n\n // // We don't update follower/folling count numbers\n // connection.commit(function(err) {\n\n // printTimeForEvent(\"sendFollowRequestNotifications Commit\" );\n\n // if (err) {\n // printError(err);\n // rollbackErrorResponse();\n // } else {\n // console.log('successful commit!');\n // finalAppResponse( friendActionResponse( \n // true, Relationship.FollowRequested));\n // }\n // });\n // } else {\n // rollbackErrorResponse();\n // }\n // });\n }", "title": "" }, { "docid": "4a4722a9565daa32ffefa520e30a8e09", "score": "0.49662456", "text": "function deleteRelationship(sourceNodeQueryCriteria,targetNodeQueryCriteria,targetNodeCriteriaValue,neo4JID){\t\n\tvar tableDataJson={};\n\t//Get Node properties in string format for input of update operation.\n\tvar newPropertiesSet=getNewPropertiesForUpdate(tableDataJson);\n\t\n\t// Setup AJAX Header for authorization\t\n\t$.ajaxSetup({\n headers: {\n \"Authorization\": \"Basic bmVvNGo6T2NlYW4=\" \n }\n\t});\n\t//Ajax request for deleting a relationship.\n\t//Relationship will be selected on sourceNeo4j and targetNeo4j property values.\n\t $.ajax({\n\t\t type: \"POST\",\n\t\turl: \"http://localhost:7474/db/data/transaction/commit \",\n\t\tdataType: \"json\",\n\t\tcontentType: \"application/json;charset=UTF-8\",\n\t\tdata: JSON.stringify({\"statements\":[{\"statement\":\"MATCH (n) WHERE ID(n)=\"+tableDataJson[sourceNodeQueryCriteria]+\" MATCH (m) WHERE ID(m)=\"+tableDataJson[targetNodeQueryCriteria]+\" OPTIONAL MATCH (n)-[r:\"+tableDataJson[\"Relationship Type\"]+\"]->(m) DELETE r\"}]}),\n\t\tsuccess: function (data, textStatus, jqXHR) {\n\t\t},\n\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\talert(\"Error\");\n\t\t}});\n}", "title": "" }, { "docid": "2209877cc7522d2603e818b8af4386dd", "score": "0.49601004", "text": "deleteRelations(currentRow) {\n let currentRecord = [];\n currentRecord.push(currentRow.Id);\n this.showLoadingSpinner = true;\n\n // calling apex class method to delete the selected contact\n deletecontact({ deleteContactIds: currentRecord })\n .then(result => {\n this.showLoadingSpinner = false;\n\n // showing success message\n this.dispatchEvent(new ShowToastEvent({\n message: 'Contatact Deleted sucessfully',\n variant: 'success'\n }));\n\n // refreshing table data using refresh apex\n return refreshApex(this.refreshTable);\n\n })\n .catch(error => {\n this.dispatchEvent(new ShowToastEvent({\n message: error.message,\n variant: 'error'\n }));\n });\n }", "title": "" }, { "docid": "61d47897cc8ceac567d6f79f918d51bb", "score": "0.49036554", "text": "function tickRelationshipsOutlines() {\n\n relationship.each(function (relationship) {\n\n let rel = d3.select(this),\n outline = rel.select('.outline');\n\n // Determines if curved edges should always be used\n let opposingRelationship = options.showRelationshipCurvedEdges && options.alwaysShowCurvedEdges;\n\n // If only showRelationshipCurvedEdges is set, we will check to see if there are multiple\n // edges in order to draw a curved or straight edge.\n if (!opposingRelationship && options.showRelationshipCurvedEdges) {\n opposingRelationship = relationships.find(r =>\n r.source.id === relationship.target.id &&\n r.target.id === relationship.source.id);\n }\n\n if (opposingRelationship) {\n outline.attr('d', function (d) {\n\n let offset = 30;\n\n let dx = (d.target.x - d.source.x);\n let dy = (d.target.y - d.source.y);\n\n let normalise = Math.sqrt((dx * dx) + (dy * dy));\n\n return \"M \" + options.nodeRadius + \",0S\" + ((normalise / 2) * .96) + \",\" + offset + \" \" + (normalise - options.nodeRadius) + \",0\";\n });\n } else {\n\n outline.attr('d', function (d) {\n\n let dx = (d.target.x - d.source.x);\n let dy = (d.target.y - d.source.y);\n\n let normalise = Math.sqrt((dx * dx) + (dy * dy));\n\n // Alters the length of the edge depending upon the relationship icon\n let nodeRadius = options.nodeRadius;\n if (options.relationshipIcon && endCaps.find(e => e.name === options.relationshipIcon)) {\n if (options.relationshipIcon !== 'stub') {\n nodeRadius += (options.relationshipIconSize / 2);\n } else {\n nodeRadius += 1;\n }\n }\n\n return \"M \" + (options.nodeRadius + 1) + \" 0 L \" + (normalise - nodeRadius) + \" 0\";\n });\n }\n });\n }", "title": "" }, { "docid": "8cbfa7216c9ce3a4c617f662bde8797d", "score": "0.49011457", "text": "getRelationshipTypes() {\n return this.tex.relationships;\n }", "title": "" }, { "docid": "68e537917dbadbe674c27f18f09e0227", "score": "0.48989677", "text": "function PersonReplyHandler(request, reply){\n Person.find({}, function (err, docs) {\n reply(docs);\n });\n}", "title": "" }, { "docid": "425cce1e7beb615ed0b42a556aea403a", "score": "0.48944074", "text": "async function replyData(data){\n // console.log(data.post.reply);\n // console.log('the data is', data)\n const postData = {\n userId: data.userId,\n name: data.name,\n user: { name: data.name},\n message: data.post.reply,\n postId: data.postId,\n } \n const replyData = new db.reply( postData )\n const saveData = await replyData.save();\n let replyId = saveData._id\n const updateUserReplyinWalkSchema = await db.walk.findByIdAndUpdate({_id:data.postId}, {$push: {userReply: saveData._id}}) \n // console.log(saveData);\n const updateUserDatainReplySchema = await db.reply.findOneAndUpdate({_id:replyId}, {$push: {userInfo: data.UserId}})\n const replyPoints = await db.user.findByIdAndUpdate({_id:data.userId}, {$inc: {points: 1 }})\n\n return{\n message: \"post submited successfully!\"\n }\n }", "title": "" }, { "docid": "83d10f3323d5af84a8b6e15a058aaace", "score": "0.48789734", "text": "function modifiedRelationshipLogger(obj) {\n if (\"relationships\" in obj) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "4d69cedbf4372f96a5112ff14ecf6502", "score": "0.48169297", "text": "function loading_done() {\n //console.log(\"Bot has finished loading!\");\n // Now the replies must be sorted!\n bot.sortReplies();\n\n // And now we're free to get a reply from the brain!\n\n // RiveScript remembers user data by their username and can tell\n // multiple users apart.\n let username = \"local-user\";\n\n\n // NOTE: the API has changed in v2.0.0 and returns a Promise now.\n bot.reply(username, \"sorry!\").then(function(reply) {\n console.log(\"The bot says: \" + reply);\n });\n}", "title": "" }, { "docid": "9e44a590ff765d912c31380e1e26a35b", "score": "0.48130098", "text": "function getRelationshipData (req, res) {\n characterDataModel.getRelationshipCollection()\n .then(collectionToArray)\n .then(function(data){\n res.send(data);\n })\n .catch(console.error.bind(this));\n}", "title": "" }, { "docid": "449d9652b253d8812f99e23ce4f5903d", "score": "0.48102447", "text": "function handleReadAllRelativesInfo() {\n\n // Payload base\n var localBasePayload = fbBasePayload;\n var senderID = getSenderID();\n return admin.database().ref('pazienti/' + senderID + '/parenti/').once('value').then((snapshot) => {\n\n let relatives = snapshot.val();\n console.log('snapshot.val() : ' + JSON.stringify(relatives));\n\n if(relatives !== null) {\n let i;\n let elements = [];\n\n for (i=0; i < relatives.length; i++) {\n let relName = snapshot.child(i.toString() + '/nome').val();\n let relAffinity = snapshot.child(i.toString() + '/parentela').val();\n let relAge = snapshot.child(i.toString() + '/eta').val();\n let relPhotoURL = snapshot.child(i.toString() + '/foto').val();\n let tempBirtdate = snapshot.child(i.toString() + '/dataNascita').val();\n let relBirthDate = getDate(tempBirtdate);\n\n console.log(\n 'relName: ' + relName + '\\n' +\n 'relAffinity: ' + relAffinity + '\\n' +\n 'relAge: ' + relAge + '\\n' +\n 'relPhotoURL: ' + relPhotoURL + '\\n' +\n 'relBirthDate: ' + relBirthDate + '\\n');\n\n let title = relName + ', ' + relAge + ' anni e ti è ' + relAffinity;\n let subtitle = 'E\\' nato il ' + relBirthDate;\n elements[i] = element(title, relPhotoURL, subtitle);\n\n localBasePayload.facebook.attachment.payload.elements[i] = elements[i];\n }\n //agent.add('Ecco a lei la sua terapia giornaliera:');\n agent.add(new Payload('FACEBOOK', localBasePayload, {rawPayload: true, sendAsMessage: true}));\n } else {\n let question = 'Non mi hai parlato dei tuoi parenti. Vuoi aggiungerli?';\n let suggestions = [\n \"Parenti\",\n 'Più tardi',\n \"No grazie\",\n \"Cancella\"\n ];\n setSuggestions(question, suggestions, senderID);\n }\n });\n }", "title": "" }, { "docid": "ccaf14efa9adc2feebc9848258a5a444", "score": "0.4805972", "text": "function saveChanges(){\n\n\t//Disable button on click.\n\t$('#saveChanges').prop('disabled', true);\n\t//Get relationship type value.\n\tvar relationshipType=$('#relationshipType').val();\n\n\t//Get table data in Json format.\n\tvar tr = $('tr').length;\n\tvar tableDataJson={};\n\tfor(var i=0; i < tr;i++){\n\t$.each($('tr:eq('+i+') td'),function(){\n\t\tvar tds = $('tr:eq('+i+') td');\n\n\t\t\t var productId = $(tds).eq(0).text();\n\t\t\t var name = $(tds).eq(1).text();\n\t\t\t \n\t\t\t if(!tableDataJson.hasOwnProperty(productId)){\n\t\t\t\t if(productId==\"Relationship Type\"){\n\t\t\t\t\t tableDataJson[productId]=$('#relationshipType').val();\n\t\t\t\t }else{\n\t\t\t\t\t tableDataJson[productId]=name;\n\t\t\t\t }\n\n\t}\n\t});\n\t}\n\n\t//Ajax authentication request for saving relationship to Neo4j.\n\tif(!tableDataJson.hasOwnProperty(\"nodeType\")){\n\t\t\t\t$.ajaxSetup({\n\t\theaders: {\n\t\t\t// Add authorization header in all ajax requests\n\t\t\t\"Authorization\": \"Basic bmVvNGo6T2NlYW4=\" \n\t\t}\n\t});\n\n\t//Ajax request for saving relationship to Neo4j.\n\t//Passing source Neo4j Id in url and target Neo4j Id in data for creating relationship.\n\tvar restServerURL = \"http://localhost:7474/db/data\";\n\t$.ajax({\n\t\tasync: false,\n\t\ttype: \"POST\",\n\t\turl: restServerURL + \"/node/\"+tableDataJson['sourceNeo4jNodeId']+\"/relationships\",\n\t\tdataType: \"json\",\n\t\tdata:JSON.stringify({to: \"http://localhost:7474/db/data/node/\"+tableDataJson['targetNeo4jNodeId'], type: relationshipType,data:tableDataJson}),\n\t\tcontentType: \"application/json\",\n\t\tsuccess: function( data, xhr, textStatus ) {\n\t\t\t console.log(\"success\"+data);\n\t\t},\n\t\terror: function( data, xhr, textStatus ) {\n\t\t\twindow.console && console.log( xhr );\n\t\t\tconsole.log(\"data is \"+JSON.stringify(data)+\"textStatus is \"+textStatus+\" and xhr is \"+xhr);\n\t\t\tconsole.log(\"error\");\n\t\t},\n\t\tcomplete: function() {\n\t\t\tconsole.log(\"complete function\"); \n\t\t}\n\t});\n\t\n\t//Ajax code for creating a node in Neo4j.\n\t//Authentication header of ajax request.\n\t}else{\n\t\t$.ajaxSetup({\n\t\theaders: {\n\t\t\t\"Authorization\": \"Basic bmVvNGo6T2NlYW4=\" \n\t\t\t}\n\t\t});\n\t\tvar restServerURL = \"http://localhost:7474/db/data\";\n\t\ttableDataJson[\"uri\"]=data.self;\n\n\t\t//Ajax request for saving a Node with Node json properties as input.\t\n\t\t$.ajax({\n\t\t\tasync: false,\n\t\t\ttype: \"POST\",\n\t\t\turl: restServerURL + \"/node\",\n\t\t\tdata: JSON.stringify(tableDataJson),\n\t\t\tdataType: \"json\",\n\t\t\tcontentType: \"application/json\",\n\t\t\tsuccess: function( data, xhr, textStatus ) {\n\t\t\t\t neo4jNodeId = data.metadata.id;\n\t\t\t},\n\t\t\terror: function( xhr ) {\n\t\t\t\twindow.console && console.log( xhr );\n\t\t\t},\n\t\t\tcomplete: function() {\n\t\t\t}\n\t\t});\n\n\t\t//Delete the last created node on canvas.\n\t\t//This code needs enhancement.\n\t\tnodes.pop();\n\n\t\t//Create a new node on canvas with Neo4j id from Neo4j database.\n\t\tcreateNode(tableDataJson[\"nodeName\"], neo4jNodeId, true,'Driver');\n\n\t\t// Set the property neo4jNodeId in the database to the id returned from neo4j\n\t\t//This code needs enhancement.\n\t\t$.ajaxSetup({\n\t\t\theaders: {\n\t\t\t\"Authorization\": \"Basic bmVvNGo6T2NlYW4=\" \n\t\t\t}\n\t\t});\n\t\t// Set the property neo4jNodeId in the database to the id returned from neo4j\n\t\t//This code needs enhancement.\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"http://localhost:7474/db/data/transaction/commit \",\n\t\t\tdataType: \"json\",\n\t\t\tcontentType: \"application/json;charset=UTF-8\",\n\t\t\tdata: JSON.stringify({\"statements\": [{\"statement\": \"START n=node(\" + neo4jNodeId + \") SET n.neo4jNodeId = \" + neo4jNodeId + \" RETURN n\"}]}),\n\t\t\tsuccess: function (data, textStatus, jqXHR) {\n\t\t\t\t//alert(\"neo4jNodeId property successfully updated in database\");\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t\t// handle errors\n\t\t\t\talert(\"Error\");\n\t\t\t}\n\t\t});\n\n\t\t\n\t}\n\n}", "title": "" }, { "docid": "7332da0fd451f41e36276b48fe8bd353", "score": "0.48024556", "text": "navigateRelatedListView() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordRelationshipPage',\n attributes: {\n recordId: this.recordId,\n objectApiName: 'Account',\n relationshipApiName: 'Contacts',\n actionName: 'view'\n },\n });\n }", "title": "" }, { "docid": "b5c6417bd260813b601ebf585e9a8b0a", "score": "0.4799545", "text": "process (conversation, actions, recastResponse) {\n return new Promise((resolve, reject) => {\n // Check if the action has all it needs\n if (this.isComplete(actions, conversation)) {\n // We expect to have a 'reply' method defined\n if (this.reply) {\n return Promise.resolve(this.reply(conversation, recastResponse))\n .then(resolve)\n .catch(reject)\n }\n return reject(new Error('No reply found'))\n }\n // The action asks for a missing notion\n return resolve(utils.getRandom(this.getMissingEntities(conversation.memory)).isMissing)\n })\n }", "title": "" }, { "docid": "c9fec3dc6eaa2f6e936b9f6cbf29f93d", "score": "0.478685", "text": "replies() {\n return this.hasMany('App/Models/Comment', 'id', 'parent_id')\n }", "title": "" }, { "docid": "cb1eb5c86caee243862dc48a53415c64", "score": "0.47751835", "text": "addRelationship (username, originItemId, destinationItemId, relationshipType, portalOpts) {\n let urlPath = `/content/users/${username}/addRelationship?f=json`;\n return this.request(urlPath, {\n method: 'POST',\n data: {\n relationshipType: relationshipType,\n originItemId: originItemId,\n destinationItemId: destinationItemId\n }\n }, portalOpts);\n }", "title": "" }, { "docid": "522cebc247315a71036612862478c01c", "score": "0.47730443", "text": "get relations() {\n return this._relations;\n }", "title": "" }, { "docid": "49ca3925f290aeb2cefab604826148e3", "score": "0.4758656", "text": "delete (context) {\n const request = context.request\n const ids = request.ids\n let transaction\n let recordsFound\n\n return this.adapter.connect()\n .then(() => this.adapter.find(request.type, ids ? {ids} : undefined))\n .then((records) => {\n if (ids && !records.length) {\n throw new NotFoundError('DeleteRecordsInvalid')\n }\n recordsFound = records\n })\n .catch((error) => this.adapter.disconnect().then(() => { throw error }))\n .then(() => this.adapter.disconnect())\n\n .then(() => this.adapter.beginTransaction())\n .then((newTransaction) => { context.transaction = transaction = newTransaction })\n\n .then(() => { // run some business logic before delete them\n const transformers = this.transforms[request.type]\n const transformer = transformers && transformers.input && transformers.input.delete\n\n if (!transformer) return // nothing to do\n\n // `delete` transformer has access to context.transaction to make additional db-requests\n return Promise.all(recordsFound.map((record) => transformer(context, record)))\n })\n\n .then(() => transaction.delete(request.type, request.ids))\n\n // referential integrity\n .then(() => {\n const primaryIds = recordsFound.map((record) => record.id)\n\n const nullify = (relationType, linkName) => {\n const options = {fieldsOnly: ['id'], match: {}}\n options.match[linkName] = primaryIds\n\n return transaction.find(relationType, options)\n .then((records) => records.map((record) => {\n record[linkName] = null\n return record // {id: 1, postTag: null}\n }))\n .then((updates) => transaction.update(relationType, updates))\n }\n\n const typesLinks = this._getRelationTypesLinks(request.type)\n\n return Promise.all(Object.keys(typesLinks).map((relationType) => { // for all type\n return Promise.all(typesLinks[relationType].map((linkName) => { // for all links in type\n return nullify(relationType, linkName)\n }))\n }))\n .then(() => 'ok')\n })\n\n .then(() => transaction.endTransaction())\n\n // This makes sure to call `endTransaction` before re-throwing the error.\n .catch((error) => {\n if (!transaction) throw error\n return transaction.endTransaction(error).then(() => { throw error })\n })\n\n .then(() => this.end(context))\n }", "title": "" }, { "docid": "6aa314e0c83099b4060fe2239de4fb69", "score": "0.4752661", "text": "function unfollowRequest(guid, friendGuid, relationship) {\n\n console.log(\"unfollowRequest\");\n\n connection.beginTransaction(function(err) {\n if (err) { \n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else {\n connection.query({\n sql: 'UPDATE `friends` SET `status` = ?, `cancel_count` = `cancel_count` + 1 WHERE `guid1` = ? AND `guid2` = ?',\n values: [ Relationship.CanceledFollowRequest, guid, friendGuid ]\n }, \n function (err, results) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n } \n \n if (results !== null && results.affectedRows === 1) {\n unfollowNotifications(guid, friendGuid, relationship);\n } else {\n rollbackErrorResponse();\n }\n });\n }\n });\n }", "title": "" }, { "docid": "5de05cb910ab521defa42dd6cb4cabab", "score": "0.47404525", "text": "function askForRelationshipsId() {\n // Don't ask relationship id if there aren't any relationship\n // Or option --force\n if (this.relationships === undefined || this.relationships.length === 0 || this.force) {\n return;\n }\n\n // work only on owner relationship\n this.relationshipsPile = this.relationships.filter(relationshipItem =>\n // We don't need to do anything about relationships which don't add any constraint.\n !(relationshipItem.relationshipType === 'one-to-many' ||\n (relationshipItem.relationshipType === 'one-to-one' && !relationshipItem.ownerSide) ||\n (relationshipItem.relationshipType === 'many-to-many' && !relationshipItem.ownerSide)));\n\n if (this.relationshipsPile.length === 0) {\n return;\n }\n\n this.log(chalk.green(`Asking column names for ${this.relationshipsPile.length} relationship(s)`));\n const done = this.async();\n\n this.relationship = this.relationshipsPile.shift();\n askForRelationshipId.call(this, done);\n}", "title": "" }, { "docid": "a55cfdcc06d8e0201e410e8ff0c93bab", "score": "0.4728915", "text": "respond(order) {\n db.createUserOrderResponse(this.id, order);\n }", "title": "" }, { "docid": "2255f558502bdb09e718cb9cee9ee25d", "score": "0.47134826", "text": "setUpTransaction(req, res) {\n let id = parseInt(req.params.id);\n if(req.body.id) {\n id = parseInt(req.body.id);\n }\n let txids = req.body.txids || [];\n let buyerId = req.body.validatedUser.id;\n let addy = req.body.contractAddress;\n\n if(!buyerId || !id || !addy) {\n return res.status(400).send({\n message: \"Missing parameters, please check your request and try again.\"\n })\n }\n\n let contractAddress = addy.toLowerCase();\n\n return Posting\n .findById(id)\n .then(async posting => {\n if(!posting) {\n return res.status(404).send({\n message: `posting with id: ${id} not found.`\n })\n } else {\n\n if(posting.userId == buyerId) {\n return res.status(400).send({\n message: \"Seller can not buy their own item.\"\n })\n }\n\n let transaction = {\n contractAddress: contractAddress,\n txids: txids,\n startedAt: Date.now(),\n completedAt: 1000\n }\n\n await User.findById(buyerId)\n .then(user => {\n buyer = user;\n console.log(\"Founder user\", user);\n })\n\n return User.findById(buyerId)\n .then(user => {\n if(!user) {\n return res.status(404).send({\n message: `user with id: ${buyerId} not found.`\n })\n } else {\n return posting\n .update({\n status: \"pendingConfirmation\",\n buyerId: buyerId,\n transaction: transaction\n })\n .then(() => {\n console.log(\"Successfully updated posting\");\n res.send(posting);\n })\n .catch((error) => {\n console.log(\"Opps we ran into an error\");\n console.log(error);\n res.status(400).send(error);\n })\n }\n });\n }\n })\n .catch((error) => {\n console.log(\"Opps we ran into an error\");\n console.log(error);\n res.status(400).send(error);\n })\n }", "title": "" }, { "docid": "7dc67da1a412a32f32de215c4c5f1d0b", "score": "0.47111532", "text": "confirmRequest(uid, first_name, last_name) {\n // create a message room for both people\n firebase.database().ref('/messages').push({ \n texts: [\n {\n _id: 1,\n text: 'Say hi to your new friend!',\n timestamp: firebase.database.ServerValue.TIMESTAMP,\n user: {\n _id: 1,\n name: \"System\"\n },\n system: true\n }\n ],\n group_name: \"\"\n }).then(snap => {\n firebase.database().ref(`/messages/${snap.key}/members/`).update({\n [uid]: {\n first_name: first_name,\n last_name: last_name,\n last_seen: null\n },\n [this.uid]: {\n first_name: `${this.first_name}`,\n last_name: `${this.last_name}`,\n last_seen: null\n },\n });\n // add to friends list\n firebase.database().ref(`users/${this.uid}/friends/`).update({\n [uid]: {\n first_name: first_name,\n last_name: last_name,\n room: snap.key,\n }\n })\n .then(() => {\n // console.log('add user', uid, name, 'to', this.name+'\\'s friends list')\n }).catch((error) => {\n console.log(error)\n })\n // add to friends list\n firebase.database().ref(`users/${uid}/friends/`).update({\n [this.uid]: {\n first_name: `${this.first_name}`,\n last_name: `${this.last_name}`,\n room: snap.key,\n }\n })\n .then(() => {\n // console.log('add current user', this.uid, this.name, 'to', name+'\\'s friends list')\n }).catch((error) => {\n console.log(error)\n })\n })\n\n // remove from requested/requesting lists\n firebase.database().ref(`users/${this.uid}/requestingFriends/${uid}`).remove()\n .then(() => { \n // console.log('remove user ', uid, name, 'from the requesting list')\n }).catch((error) => {\n console.log(error)\n })\n firebase.database().ref(`users/${uid}/requestedFriends/${this.uid}`).remove()\n .then(() => {\n // console.log('remove current user', this.uid, this.name, 'from the requested list')\n }).catch((error) => {\n console.log(error)\n })\n }", "title": "" }, { "docid": "0dc2481b9a9ceef85020e5fb9835c849", "score": "0.47054538", "text": "function addRelationships(relationships) {\n for(var i = 0; i < relationships.length; i++) {\n var rel = relationships[i];\n if(idCache[rel.source_ref] === null || idCache[rel.source_ref] === undefined) {\n console.error(\"Couldn't find source!\", rel);\n } else if (idCache[rel.target_ref] === null || idCache[rel.target_ref] === undefined) {\n console.error(\"Couldn't find target!\", rel);\n } else {\n currentGraph.edges.push({source: idCache[rel.source_ref], target: idCache[rel.target_ref], label: rel.value});\n }\n }\n}", "title": "" }, { "docid": "b9dc4b1e7a540437c9a20bd8693e31e5", "score": "0.47052816", "text": "function transactionEnd() {\n inquirer.prompt([\n {\n name: 'action',\n type: 'list',\n choices: ['View products', 'Get me out of here'],\n message: 'What would you like to do?'\n }\n ]).then(function(response) {\n switch (response.action) {\n case 'View products':\n customerPrompt();\n break;\n case 'Get me out of here':\n connection.end();\n break;\n default:\n };\n });\n}", "title": "" }, { "docid": "52d8cccabc01b1774162f1f97638a6c6", "score": "0.4684602", "text": "function notifySuccess() {\n successes++;\n if (successes >= orderItems.length) {\n console.log(\"order added for table \" + order.tableNum + \", party \" + party + \" with orderID \" + orderID);\n //all queries success. emit response.\n socket.emit(\"order_result\", {\n success: true,\n order_details: {\n orderID: orderID\n }\n });\n }\n }", "title": "" }, { "docid": "9b32c053374d29009d1111b3d4a74f4e", "score": "0.46825212", "text": "async function handleReplySubmit(e) {\n e.preventDefault();\n setLoading(true);\n await addReply(stock, \"IzlviiBHzydpeCezXbQ8\", uid, text);\n setReplied(true);\n setLoading(false);\n }", "title": "" }, { "docid": "9ee3f1116a0c94d4b99e151757c8598c", "score": "0.46745804", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n senderID, recipientID, timeOfMessage);\n\n console.log(\"THIS IS THE MESSAGE WE WANT:\", JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n if (isEcho) {\n // Just logging message echoes to console\n console.log(\"Received echo for message %s and app %d with metadata %s\",\n messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",\n messageId, quickReplyPayload);\n return;\n }\n\n var foundUser;\n if (messageText) {\n User.findOne({senderId: senderID})\n .then(function(temp){\n\n foundUser = temp;\n // if user wants to RESTART the conversation\n // if(messageText === \"Restart\" || messageText === \"restart\" || messageText === \"Redo\" || messageText === \"redo\"){\n // foundUser.data= {};\n // foundUser.completed = false;\n // foundUser.save();\n // var next = getNextState(foundUser);\n // foundUser.currentContext = next;\n // foundUser.save();\n // sendTextMessage(senderID, \"It's ok 👌. Let's start over.\", function(){\n // sendTextMessage(senderID, getPrompt(foundUser.currentContext));\n // })\n // return;\n // }\n\n\n var userContext = foundUser.currentContext;\n return sendQuery(messageText, senderID, userContext);\n })\n .then(({ data }) => {\n console.log('APIAI', JSON.stringify(data, null, 2));\n if(data === undefined){\n return;\n }\n if (data.result.action === 'input.unknown' || data.result.actionIncomplete) {\n sendTextMessage(senderID, data.result.fulfillment.speech);\n throw new Error();\n } else if (data.result.metadata.intentName === 'restart'){\n foundUser.data= {};\n foundUser.completed = false;\n var next = getNextState(foundUser);\n foundUser.currentContext = next;\n foundUser.save();\n return data;\n } else {\n\n console.log(\"This is the CURRENT CONTEXT:\", foundUser.currentContext);\n console.log(\"Params of CURRENT CONTEXT:\", data.result.parameters);\n if (foundUser.currentContext === 'add-major') {\n\n // allows user to skip MAJOR section\n if(messageText === 'N/A'){\n foundUser.data.major = 'empty';\n console.log(\"this should be empty\", foundUser.data.major);\n\n }else{\n _.mapObject(dbMajors, function(majorArr, key) {\n\n majorArr.map(function(majorString){\n if(majorString === data.result.parameters['major']){\n foundUser.data.major = key;\n console.log(\"look here for the major string\", foundUser.data.major);\n return;\n }\n })\n\n })\n\n console.log(\"inside major\",foundUser.data.major);\n }\n } else if (foundUser.currentContext === 'add-location') {\n\n // allows user to skip LOCATION section\n if(messageText === 'N/A'){\n foundUser.data.location = 'empty';\n console.log(\"skip location:this should be 'empty':\", foundUser.data.location);\n\n }else{\n _.mapObject(dbLocations, function(locationArr, key) {\n\n locationArr.map(function(locationString){\n if(locationString === data.result.parameters['region1']){\n foundUser.data.location = key;\n console.log(\"look here for the location string\", foundUser.data.location);\n return;\n }\n })\n\n })\n }\n } else if (foundUser.currentContext === 'add-price') {\n\n // allows user to skip PRICE section\n if(data.result.metadata.intentName === 'add-price --not-applicable'){\n foundUser.data.minPrice = -100;\n foundUser.data.maxPrice = -100;\n console.log(\"PRICE skipped: this should be empty:\", foundUser.data.minPrice);\n }\n // if(messageText === 'N/A'){\n // foundUser.data.minPrice = 'empty';\n // console.log(\"PRICE skipped: this should be empty:\", foundUser.data.minPrice);\n //\n // }\n else{\n if(typeof data.result.parameters['price'] === 'object'){\n console.log('obj min');\n foundUser.data.minPrice = 100;\n foundUser.data.maxPrice = Number(data.result.parameters['price'].amount);\n\n } else {\n foundUser.data.minPrice = 100;\n foundUser.data.maxPrice = Number(data.result.parameters['price'].replace(',', ''));\n }\n }\n // CORRECT PARAM\n } else if (foundUser.currentContext === 'add-college') {\n foundUser.data.colleges = data.result.parameters['college'];\n\n console.log(foundUser.data.colleges);\n console.log(\"look here for college string\", foundUser.data.colleges[0], foundUser.data.colleges[1], foundUser.data.colleges[2]);\n } else if (foundUser.currentContext === 'add-SAT-or-ACT') {\n\n // allows user to skip SCORES section\n if(data.result.metadata.intentName === 'add-SAT-or-ACT --not-applicable'){\n foundUser.data.minScore = -100;\n foundUser.data.maxScore = -100;\n console.log(\"SCORE skipped: this should be empty:\", foundUser.data.minScore);\n }\n else{\n if (data.result.parameters['act-score']){\n foundUser.data.minScore = data.result.parameters['act-score'] - 2;\n foundUser.data.maxScore = Number(data.result.parameters['act-score']) + 2;\n foundUser.data.scoreType = \"act\";\n\n }else if (data.result.parameters['sat-score']){\n foundUser.data.minScore = data.result.parameters['sat-score'] - 150;\n foundUser.data.maxScore = Number(data.result.parameters['sat-score']) + 150;\n foundUser.data.scoreType = \"sat\";\n }\n }\n } else if (foundUser.currentContext === 'add-salary') {\n\n // allows user to skip SALARY section\n if(data.result.metadata.intentName === 'add-salary --not-applicable'){\n foundUser.data.minSalary = -100;\n foundUser.data.maxSalary = -100;\n console.log(\"SCORE skipped: this should be empty:\", foundUser.data.salary);\n }\n else{\n if(typeof data.result.parameters['salary'] === 'object'){\n console.log('obj min');\n foundUser.data.minSalary = data.result.parameters['salary'].amount - 25000;\n foundUser.data.maxSalary = Number(data.result.parameters['salary'].amount) + 25000;\n\n } else {\n foundUser.data.minSalary = data.result.parameters['salary'].replace(',', '') - 25000;\n foundUser.data.maxSalary = Number(data.result.parameters['salary'].replace(',', '')) + 25000;\n }\n }\n }\n var next = getNextState(foundUser);\n if (next === null) {\n foundUser.completed = true;\n sendTextMessage(senderID, \"Awesome! Let me do my magic and pull up a list that matches your criteria!✨🎩\", function(){\n sendTextMessage(senderID, \"Keep in mind that the results may vary depending on your specifications.\");\n dbQuery(senderID, foundUser);\n });\n return;\n }\n foundUser.currentContext = next;\n console.log(\"this should be the next CURRENT CONTEXT: \", foundUser.currentContext);\n foundUser.save();\n return data;\n }\n })\n .then((data1) => {\n console.log('this is data1', data1);\n if(data1 === undefined){\n return;\n }\n\n sendTextMessage(senderID, data1.result.fulfillment.speech);\n })\n .catch(function(err) {\n // do nothing\n console.log(err);\n })\n } else if (messageAttachments) {\n sendTextMessage(senderID, \"Message with attachment received\");\n }\n}", "title": "" }, { "docid": "c446c0210838a77804b08d761fb0331c", "score": "0.46718127", "text": "function transverse(result, nodes, rels) {\n var queue = [],\n prev = result,\n next = result;\n while (next) {\n if (next.parent !== undefined) {\n prev = next.parent;\n next = queue.shift();\n }\n\n appendToResponse(prev, next, nodes, rels);\n\n if (next.children !== undefined) {\n queue.push({ parent: next });\n next.children.forEach(child => {\n queue.push(child);\n });\n }\n next = queue.shift();\n }\n}", "title": "" }, { "docid": "e6f5cb61580967c7b536f469a9b1881c", "score": "0.46683976", "text": "function acceptFollowRequest(guid, followerGuid) {\n \n // Confirm we received a request \n \n connection.beginTransaction(function(err) {\n if (err) { \n console.log('Error:', JSON.stringify(err, null, 2));\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else { \n connection.query({\n sql: 'UPDATE `friends` set `status` = ? WHERE `guid1` = ? AND `guid2` = ?',\n values: [ Relationship.IsFollowing, followerGuid, guid]\n }, \n function (err, results) {\n if (err) { \n printError(err);\n rollbackErrorResponse(); \n } else {\n console.log(\"will update notification\");\n updateAcceptFollowNotification(guid, followerGuid);\n }\n }); \n }\n }); \n }", "title": "" }, { "docid": "f2bb43a4433b1b6bcd1cb22c0c777a61", "score": "0.4660899", "text": "function genNewMessageReply(context, events, done) {\n\tloadData();\n\tif( typeof context.vars.msgJSON !== undefined) {\n\t\tcontext.vars.entityId = context.vars.msgJSON.entityId\n\t\tcontext.vars.fromWho = `${Faker.name.firstName()} ${Faker.name.lastName()}`\n\t\tcontext.vars.msg = `${Faker.lorem.paragraph()}`\n\t\tcontext.vars.replyToId = context.vars.msgJSON.id\n\t} else {\n\t\tdelete context.vars.entityId\n\t}\n\treturn done()\n}", "title": "" }, { "docid": "e2760baf8ca6a79c8b81ee9c870497f2", "score": "0.46532917", "text": "_onReply(line) {\n this.emit('reply', line);\n }", "title": "" }, { "docid": "ad09dba90896dc34d794334aff629402", "score": "0.46509945", "text": "function onReply(reply) {\n\t\tappendHistory(\"bot\", reply);\n\t}", "title": "" }, { "docid": "32a42a3b8f9dd82e5fd61bca06badb1f", "score": "0.4633902", "text": "async function _decodeRelationsIds(personObject) {\n logger.debug(`* Connection Open: decodeRelationsIds`);\n person = [];\n tempArr = [];\n tempArr.push(personObject.person_id);\n tempArr.push(personObject.father_id);\n tempArr.push(personObject.mother_id);\n tempArr.push(personObject.spouse_id);\n if (personObject.children_id == null) tempArr.push(personObject.children_id);\n else {\n personObject.children_id.forEach((child) => {\n tempArr.push(child);\n });\n }\n\n result = await _getDataHandler(tempArr);\n logger.debug(`* Connection Closed: decodeRelationsIds`);\n /* Handle Result Before sending it back the chain */\n finalResult = [];\n dummyObj = {\n id: 0,\n };\n\n /* Array used to re order the result */\n\n for (i = 0; i < tempArr.length; i++) {\n if (tempArr[i] == null) {\n finalResult[i] = dummyObj;\n } else {\n finalResult[i] = result.find((element) => element.id == tempArr[i]);\n }\n }\n\n /* Restructuring Array back into an Object */\n finalResult2 = {};\n finalResult2.person = finalResult[0];\n finalResult2.father = finalResult[1];\n finalResult2.mother = finalResult[2];\n finalResult2.spouse = finalResult[3];\n finalResult2.children = [dummyObj];\n for (i = 4; i < tempArr.length; i++) finalResult2.children[i - 4] = finalResult[i];\n return finalResult2;\n}", "title": "" }, { "docid": "355ccdf77598aedc9a1c484b28019779", "score": "0.4632831", "text": "function insertComplete(){\n\t\t// after the insertion, delete any existing author associations\n\t\tdeleteBookAuthors(context.book_id, res, mysql, context, deleteComplete);\n\t}", "title": "" }, { "docid": "a7f6bdf724da5c71c085e5fc5df0b7e7", "score": "0.46289223", "text": "function promotePosts() {\n return new Promise(function (resolve, reject) {\n // process.stdout.write('here' + '\\n');\n dbneo4j.cypher({ query: cypher }, (e, d) => {\n if (e) {\n responseObj = { code: 500, message: 'internal server error while promotePosts', error: e };\n reject(responseObj);\n } else {\n responseObj = { code: 200, message: 'success', data: d };\n resolve(responseObj);\n }\n });\n });\n }", "title": "" }, { "docid": "710054887efd43f1e2822ee253c5733e", "score": "0.46213943", "text": "addResourceRelationshipStatement(parent, reference, referenceName, isCollection) {\n const statementText =\n \"MATCH\" +\n \"(p:Content {checksum: $p.checksum}),\" +\n \"(r:Resource {url: $r.destination})\\n\" +\n \"MERGE (p)-[:References {\" +\n \"name: $ref.name,\" +\n \"class: $ref.class,\" +\n \"isCollection: $ref.isCollection,\" +\n \"selectorType: $ref.selector.type,\" +\n \"startSelectorType: $ref.selector.startSelector.type,\" +\n \"startSelectorValue: $ref.selector.startSelector.value,\" +\n \"startSelectorOffset: $ref.selector.startSelector.offset,\" +\n \"endSelectorType: $ref.selector.endSelector.type,\" +\n \"endSelectorValue: $ref.selector.endSelector.value,\" +\n \"endSelectorOffset: $ref.selector.endSelector.offset\" +\n \"}]->(r)\";\n\n const refParam = Object.assign({}, reference);\n delete refParam.destination;\n refParam.name = referenceName;\n refParam.isCollection = isCollection;\n\n const parameters = {\n \"p\": {\n \"checksum\": this.getChecksum(parent)\n },\n \"r\": {\n \"destination\": reference.destination\n },\n \"ref\": refParam\n };\n this.addStatement(statementText, parameters);\n }", "title": "" }, { "docid": "913ab3470a57d6912ad7f5c15d9188b3", "score": "0.46122026", "text": "@wire(getContatcs, { sourceAccount: '$recordId' })\n relations(result) {\n this.refreshTable = result;\n if (result.data) {\n this.data = result.data;\n this.emptyList = true;\n }\n }", "title": "" }, { "docid": "08ddbf94fffe4128b6d18f864065b4a6", "score": "0.46103007", "text": "function followStatus(myGuid, beingFollowedGuid) {\n\n connection.query({ // follower // being followed\n sql: 'SELECT status, cancel_count, timestamp FROM `friends` WHERE `guid1` = ? AND `guid2` = ?',\n values: [myGuid, beingFollowedGuid]\n }, \n function (error, results, fields) {\n\n if (error) {\n printError(error);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n }\n\n // If has Relationship\n if (results && results.length > 0) {\n console.log('Results:', JSON.stringify(results, null, 2));\n\n var status = results[0].status;\n // var blocked = results[0].blocked;\n var cancelInfo = [];\n \n cancelInfo[0] = results[0].cancel_count;\n cancelInfo[1] = results[0].timestamp;\n\n\n finalAppResponse(followingStatusResponse(status));\n \n\n } else {\n finalAppResponse(followingStatusResponse(Relationship.NoneExist));\n }\n });\n }", "title": "" }, { "docid": "ab64007b8897801041cb67df94942082", "score": "0.46055093", "text": "async postConfirmation(target, tx) { }", "title": "" }, { "docid": "772c02a55eaf1beed0e7a19feb52a3b6", "score": "0.46036896", "text": "setTransaction(req, res) {\n let id = parseInt(req.body.id);\n let confirmed = Boolean(req.body.confirmed);\n let txid = req.body.txid;\n\n return Posting\n .findById(id)\n .then(posting => {\n if(!posting) {\n return res.status(404).send({\n message: `posting with id: ${id} not found.`\n })\n } else {\n let newTransaction = posting.transaction;\n let newStatus = posting.status;\n let ok = confirmed;\n\n if(txid) {\n newTransaction.txids.push(txid);\n }\n\n if(req.body.validatedUser.id == posting.userId) {\n newTransaction.sellerOk = ok;\n } else if(req.body.validatedUser.id == posting.buyerId) {\n newTransaction.buyerOk = ok;\n } else {\n return res.status(404).send({\n message: `Only buyer or seller of an item is able to confirm the transaction`\n })\n }\n\n if(newTransaction.sellerOk && newTransaction.buyerOk) {\n newStatus = \"fulfilled\";\n newTransaction.completedAt = Date.now();\n } else if(newTransaction.sellerOk == false && newTransaction.buyerOk == false) {\n newStatus = \"cancelled\";\n newTransaction.completedAt = Date.now();\n } else if(newTransaction.sellerOk == false && newTransaction.buyerOk == true ||\n newTransaction.sellerOk == true && newTransaction.buyerOk == false\n ) {\n newStatus = \"disputing\";\n }\n\n return posting\n .update({\n status: newStatus || posting.status,\n transaction: newTransaction\n })\n .then(() => {\n console.log(\"Successfully updated posting\");\n res.send(posting);\n })\n .catch((error) => {\n console.log(\"Opps we ran into an error\");\n console.log(error);\n res.status(400).send(error);\n })\n }\n })\n .catch((error) => {\n console.log(\"Opps we ran into an error\");\n console.log(error);\n res.status(400).send(error);\n })\n\n }", "title": "" }, { "docid": "b5f06c1d309b4116e2588008ffcadddc", "score": "0.45965537", "text": "function updateRelProperty(sourceNodeQueryCriteria,targetNodeQueryCriteria,neo4JID){\n\n\tvar tableDataJson={};\n\t//Get Node properties in string format for input of update operation.\n\tvar newPropertiesSet=getNewPropertiesForUpdate(tableDataJson);\n\t// Setup AJAX Header for authorization\t\n\t$.ajaxSetup({\n\t\theaders: {\n\t\t\t\"Authorization\": \"Basic bmVvNGo6T2NlYW4=\" \n\t\t}\n\t});\n\t//Ajax request for selecting a relationship for update and passing new properties value string for update.\n\t//Relationship will be queried on sourceNeo4j and targetNeo4j property values.\n\t $.ajax({\n\t\t type: \"POST\",\n\t\turl: \"http://localhost:7474/db/data/transaction/commit \",\n\t\tdataType: \"json\",\n\t\tcontentType: \"application/json;charset=UTF-8\",\n\t\tdata: JSON.stringify({\"statements\":[{\"statement\":\"MATCH (n) WHERE ID(n)=\"+tableDataJson[sourceNodeQueryCriteria]+\" MATCH (m) WHERE ID(m)=\"+tableDataJson[targetNodeQueryCriteria]+\" OPTIONAL MATCH (n)-[r:\"+tableDataJson[\"Relationship Type\"]+\"]->(m) SET r=\"+newPropertiesSet+\" RETURN r\"}]}),\n\t\tsuccess: function (data, textStatus, jqXHR) {\n\t\t},\n\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\talert(\"Error\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2861d5d28e7e8efb0b69246ad26a0f7c", "score": "0.45869675", "text": "function addRelationHandler(data) {\n fd.graph.addAdjacence(\n fd.graph.getNode(data.causeTo),\n fd.graph.getNode(data.causeFrom),\n {\n \"$type\": \"relationArrow\",\n //\"$direction\": [data.causeTo, data.causeFrom],\n \"$dim\": 15,\n \"$color\": \"#23A4FF\",\n \"weight\": 1\n }\n );\n\n fd.plot();\n}", "title": "" }, { "docid": "462c139c85b166b7c7ca25f1a21f68c0", "score": "0.45841914", "text": "post() {\n return __awaiter(this, void 0, void 0, function* () {\n let operation = yield TransactionService.postTransaction(this.book.getId(), this.wrapped);\n this.wrapped = operation.transaction;\n return this;\n });\n }", "title": "" }, { "docid": "3d721d87baf77365c4d3ac78b6d3a1ff", "score": "0.45840907", "text": "function doneSendBackResult(){\n\t\t\tif(typeof record!=\"undefined\" && typeof record[\"$status\"] ==\"undefined\"){\n\t\t\t\trecord[\"$status\"]=\"draft\";\n\t\t\t\tif(schema[\"@initialState\"]){\n\t\t\t\t\trecord[\"$status\"]=schema[\"@initialState\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(record && \n\t\t\t\trecord[\"$status\"] && \n\t\t\t\ttypeof schema[\"@state\"] ==\"object\" &&\n\t\t\t\tschema[\"@state\"]!=null && \n\t\t\t\tObject.keys(schema[\"@state\"]).length>0){\n\t\t\t\t\n\t\t\t\tvar possibleMethods=[];\n\t\t\t\tif(schema[\"@state\"][record[\"$status\"]]){\n\t\t\t\t\tpossibleMethods=Object.keys(schema[\"@state\"][record[\"$status\"]]);\n\t\t\t\t}\n\t\t\t\tif(methods==\"all\"){\n\t\t\t\t\tmethodsCanPerform=possibleMethods;\n\t\t\t\t}else{\n\t\t\t\t\tfor(var i=0;i<possibleMethods.length;i++){\n\t\t\t\t\t\tif(methods.indexOf(possibleMethods[i])!=-1){\n\t\t\t\t\t\t\tmethodsCanPerform.push(possibleMethods[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tmethodsCanPerform=methods;\n\t\t\t}\n\t\t\tcallback(methodsCanPerform);\n\t\t}", "title": "" }, { "docid": "822022262bb9eb3f003df66ff906c719", "score": "0.45827886", "text": "_commitForDescendants () {\n }", "title": "" }, { "docid": "c81de89572df3803b866c67a00fff669", "score": "0.4578475", "text": "async markAsRead() {\n await this.async(() => this.env.services.rpc({\n model: 'mail.message',\n method: 'set_message_done',\n args: [[this.id]]\n }));\n }", "title": "" }, { "docid": "30b3108a76f9b79e7837b9525b78bb28", "score": "0.4573922", "text": "function resolveRelated(np) {\n\n var fkNames = np.foreignKeyNames;\n if (fkNames.length === 0) return;\n\n var parentEntityType = np.parentType;\n var fkProps = fkNames.map(function (fkName) {\n return parentEntityType.getDataProperty(fkName);\n });\n var fkPropCollection = parentEntityType.foreignKeyProperties;\n\n fkProps.forEach(function (dp) {\n __arrayAddItemUnique(fkPropCollection, dp);\n dp.relatedNavigationProperty = np;\n // now update the inverse\n __arrayAddItemUnique(np.entityType.inverseForeignKeyProperties, dp);\n if (np.relatedDataProperties) {\n __arrayAddItemUnique(np.relatedDataProperties, dp);\n } else {\n np.relatedDataProperties = [dp];\n }\n });\n }", "title": "" }, { "docid": "83936ffb9725f0246888b4b67dc37710", "score": "0.45722124", "text": "function replyPostEntity(requestParams, response, context, ee, next) {\n\tif( response.statusCode == 200) {\n\t\tlet entity = response.toJSON().body\n\t\tentityIds.push(entity.id)\n\t\tfs.writeFileSync('entities.data', JSON.stringify(entityIds))\n\t}\n return next()\n}", "title": "" }, { "docid": "2c74bdac10c51d5a0dc68e4b5c3336fe", "score": "0.4571771", "text": "function user_related_question_view(ref_id){\n var reply_type = \"json\";\n var vars = {};\n if (ref_id == '' || ref_id == undefined){\n vars.url = myhost+'/view/user_question_all/';\n vars.content = \"question\";\n } else {\n vars.url = myhost+'/view/user_question_replys/';\n vars.content = \"replys\";\n }\n vars.ref_id = ref_id;\n global.user_agent\n .get(vars.url)\n .set('Content-Type', 'application/json')\n .query({m_id:ref_id, reply_type:reply_type})\n .end(function(err, res){\n if (err) {\n myutil.error(\"== user_related_question_view ==\", err);\n return\n }\n if (res.ok){\n myutil.debug(\"== user_related_question_view ==\");\n var body = res.text;\n //myutil.debug(res.body, res.text);\n //user_related_question_view_not_leave(body, vars);\n var r = JSON.parse(body);\n var data = r.data;\n var i = Math.floor(Math.random()*data.length);\n myutil.info(data.length, i);\n var msg = data[i];// ref_id = msg._id somtime\n vars.msg = msg;\n if (vars.msg == undefined) {vars.msg = {}; vars.msg._id= '';}\n vars.current_status = \"user_related_question_view\";\n decision(vars);\n } else {\n myutil.error(\"== user_related_question_view ==\", err, res.status);\n }\n });\n}", "title": "" }, { "docid": "7874f1d807a29ba601638aa1c1efba75", "score": "0.4563235", "text": "function handleEvent(event) {\n var respond;\n if (event.type === 'follow') {\n isUserRegistered(event.source.userId).then((res) => {\n if (res.rowCount > 0)\n return;\n respond = [];\n respond.push(getMessageJson('Terimakasih telah menambahkan aku menjadi teman!'));\n respond.push(getMessageJson(`Sebelum bermain, kamu harus mendaftar dan memilih Class yang dipakai dalam bermain\\nClass dan nama dapat diganti kapanpun dengan command '!edit class' untuk mengganti class dan '!edit name <namamu>' untuk mengganti nama`));\n respond = respond.concat(getClassList());\n return client.replyMessage(event.replyToken, respond);\n });\n respond = null;\n } else if (event.type === 'join') {\n return client.replyMessage(event.replyToken, getMessageJson(`Terimakasih telah menambahkanku di ${event.source.type} ini!\\nUntuk memulai permainan, ketik !playpvp\\nUntuk melihat perintah yang lain, ketik !commands`));\n } else if (event.type === 'leave') {\n if (isRoomExist(getRoomId(event.source)))\n deleteRoomNoReply(event.source);\n } else if (event.type === 'postback') {\n var args = event.postback.data.split('&');\n switch (args[0]) {\n case 'castskill':\n castSkill(event.replyToken, event.source, event.postback.data);\n break;\n case 'ra':\n removeUsedSkill(event.replyToken, event.source, event.postback.data);\n break;\n case 'rs':\n removeSkill(event.replyToken, event.source, event.postback.data);\n break;\n }\n respond = null;\n }\n if (event.type !== 'message' || event.message.type !== 'text') {\n // ignore non-text-message event\n return Promise.resolve(null);\n }\n if (event.message.text.substring(0, 1) == \"!\") {\n var args = event.message.text.substring(1).split(' ');\n var cmd = args[0];\n switch (cmd) {\n case 'kick':\n switch (event.source.type) {\n case 'room':\n client.leaveRoom(event.source.roomId);\n break;\n case 'group':\n client.leaveGroup(event.source.groupId);\n break;\n }\n break;\n case 'ACTION':\n if (event.source.type !== 'user') {\n checkAction(event.replyToken, event.source);\n respond = null;\n }\n break;\n case 'saran':\n if (event.source.type === 'user') {\n if (args[1] == undefined || args[1] == '') {\n return client.replyMessage(event.replyToken, getMessageJson('Pesan kamu tidak valid (argumen pesan tidak ada atau kosong)'));\n }\n isUserRegistered(event.source.userId).then((res) => {\n if (res.rowCount > 0) {\n var msg = args[1];\n for (var i = 2; i < args.length; i++) {\n msg += ' ' + args[i];\n }\n dbClient.query(`INSERT INTO PlayerFAQ (playerName, messages) VALUES ('${res.rows[0].displayname.replace(/'/g, \"''\")}', '${msg.replace(/'/g, \"''\")}')`).then(() => {\n return client.replyMessage(event.replyToken, getMessageJson('Terimakasih atas sarannya!'));\n }).catch((err) => {\n console.log(err);\n return client.replyMessage(event.replyToken, errDBMessage);\n });\n }\n });\n respond = null;\n }\n break;\n case 'playpvp':\n if (event.source.type !== 'user') {\n createRoom(0, event.source, event.replyToken);\n respond = null;\n }\n break;\n case 'joinpvp':\n if (event.source.type !== 'user') {\n joinRoom(0, event.source, event.replyToken);\n respond = null;\n }\n break;\n case 'exit':\n if (event.source.type !== 'user') {\n deleteRoom(event.source, event.replyToken);\n respond = null;\n }\n break;\n case 'player':\n if (event.source.type !== 'user') {\n roomPlayerList(event.source, event.replyToken);\n respond = null;\n }\n break;\n case 'edit':\n if (event.source.type === 'user') {\n if (isUserLocked(event.source.userId)) {\n return client.replyMessage(event.replyToken, getMessageJson('Kamu sedang dalam permainan. Selesaikan atau berhentikan permainan terlebih dahulu untuk mengubah profil'));\n }\n switch (args[1]) {\n case 'class':\n if (args[2] !== undefined && parseInt(args[2]) < _class.length) {\n //Set class\n isUserRegistered(event.source.userId)\n .then((res) => {\n if (res.rowCount > 0) {\n dbClient.query(`UPDATE PlayerStats SET class = ${args[2]} WHERE playerId = '${event.source.userId}';`)\n .then(() => {\n return client.replyMessage(event.replyToken, getMessageJson('Class kamu sudah diperbarui. Silahkan lihat daftar skill yang tersedia dengan !info skill'));\n })\n .catch((err) => {\n console.log(err);\n return client.replyMessage(event.replyToken, errDBMessage);\n });\n } else {\n client.getProfile(event.source.userId).then((res) => {\n dbClient.query(`INSERT INTO PlayerStats (playerId, displayName, class) VALUES ('${event.source.userId}', '${res.displayName.replace(/'/g, \"''\")}', ${args[2]});`)\n .then(() => {\n return client.replyMessage(event.replyToken, getMessageJson('Kamu berhasil mendaftar dan menetapkan class.\\nUbah namamu dengan \\'!edit name <namamu>\\'\\nLihat daftar skill yang tersedia dengan !info skill'));\n })\n .catch((err) => {\n console.log(err);\n return client.replyMessage(event.replyToken, errDBMessage);\n });\n });\n }\n })\n .catch((err) => {\n console.log(err);\n return client.replyMessage(event.replyToken, errDBMessage);\n });\n respond = null;\n } else {\n //Carousel class list\n respond = getClassList();\n }\n break;\n case 'name':\n if (args[2] == undefined) {\n return client.replyMessage(event.replyToken, getMessageJson('Masukan nama tidak valid. Ubah nama dengan command \\'!edit name <namamu>\\' tanpa tanda kutip dan panah'));\n }\n var curName = args[2];\n for (var i = 3; i < args.length; i++) {\n curName += ' ' + args[i];\n }\n isUserRegistered(event.source.userId)\n .then((res) => {\n if (res.rowCount > 0) {\n dbClient.query(`UPDATE PlayerStats SET displayName = '${curName.replace(/'/g, \"''\")}' WHERE playerId = '${event.source.userId}';`)\n .then(() => {\n return client.replyMessage(event.replyToken, getMessageJson('Nama kamu sudah diperbarui menjadi: ' + curName));\n })\n .catch((err) => {\n return client.replyMessage(event.replyToken, errDBMessage);\n });\n } else {\n return client.replyMessage(event.replyToken, getMessageJson('Kamu belum terdaftar dalam database bot. Silahkan ketik \\'!edit class\\' untuk memilih serta mendaftar.'));\n }\n });\n respond = null;\n break;\n default:\n respond = getMessageJson(`Perintah tidak valid. Perintah harusnya berisi:\\n!edit <class/name>`);\n break;\n }\n }\n break;\n case 'info':\n if (event.source.type === 'user') {\n switch (args[1]) {\n case 'char':\n isUserRegistered(event.source.userId).then((res) => {\n if (res.rowCount > 0) {\n return client.replyMessage(event.replyToken, getMessageJson(`Nama: ${res.rows[0].displayname}\\nClass: ${_class[res.rows[0].class].name}`));\n } else {\n return client.replyMessage(event.replyToken, getMessageJson('Kamu belum terdaftar dalam database bot. Silahkan ketik \\'!edit class\\' untuk memilih class serta mendaftar.'));\n }\n });\n respond = null;\n break;\n case 'skill':\n isUserRegistered(event.source.userId).then((res) => {\n if (res.rowCount > 0) {\n var resp;\n resp = 'Daftar Skill untuk ' + _class[res.rows[0].class].name + '\\n======';\n var sk = _class[res.rows[0].class].skill;\n for (var i = 0; i < sk.length; i++) {\n resp += `\\n${i + 1}. ${sk[i].sName}`;\n resp += `\\nDeskripsi: ${sk[i].shortDesc}`;\n resp += `\\nMasa Pakai: ` + (sk[i].usage == 0 ? 'Tak Terbatas' : sk[i].usage);\n var sp, ds, arg, val;\n sp = sk[i].effect.split(';');\n if (sp[0] != '')\n resp += '\\n-- Effect --';\n for (j = 0; j < sp.length; j++) {\n ds = sp[j].substring(0, 2);\n switch (ds) {\n case 'AT':\n arg = sp[j].substring(2, sp[j].length);\n resp += '\\n> ATTACK - Mengurangi darah musuh sebesar ' + -parseInt(arg);\n break;\n case 'AP':\n arg = sp[j].substring(2, sp[j].length);\n resp += '\\n> ATTACK % - Mengurangi darah musuh sebesar ' + -parseInt(arg) + '%';\n break;\n case 'CL':\n resp += '\\n> CLEAR POISON - Membersihkan POISON';\n break;\n }\n }\n sp = sk[i].buff.split(';');\n if (sp[0] != '')\n resp += '\\n-- Buff --';\n for (k = 0; k < sp.length; k++) {\n ds = sp[k].substring(0, 2);\n switch (ds) {\n case 'ED':\n arg = sp[k].substring(2, sp[k].length).split(',');\n resp += '\\n> SHIELD - Hanya menerima ' + arg[0] + '% dari damage musuh selama ' + arg[1] + ' turn';\n break;\n case 'HL':\n arg = sp[k].substring(2, sp[k].length).split(',');\n resp += '\\n> HEAL UP - Menambah darah ' + arg[0] + '% dari damage musuh selama ' + arg[1] + ' turn';\n break;\n case 'AU':\n arg = sp[k].substring(2, sp[k].length).split(',');\n resp += '\\n> ATTACK UP - Menambah serangan sebesar ' + arg[0] + '% selama ' + arg[1] + ' turn';\n break;\n case 'DP':\n arg = sp[k].substring(2, sp[k].length);\n resp += '\\n> OVER DAMAGE - Mengurangi darah sebesar ' + -parseInt(arg) + '%';\n break;\n case 'HP':\n arg = sp[k].substring(2, sp[k].length).split(',');\n if (parseInt(arg[1]) == 1) {\n resp += '\\n> HP CHANGE - Menambah darah sebesar ' + arg[0];\n } else {\n resp += '\\n> POISON - Mengurangi darah sebesar ' + -parseInt(arg[0]) + ' selama ' + arg[1] + ' turn';\n }\n break;\n }\n }\n sp = sk[i].debuff.split(';');\n if (sp[0] != '')\n resp += '\\n-- Debuff --';\n for (k = 0; k < sp.length; k++) {\n ds = sp[k].substring(0, 2);\n switch (ds) {\n case 'ST':\n arg = sp[k].substring(2, sp[k].length);\n resp += '\\n> STUN - Menambah giliran bermain sebanyak ' + arg + ' turn';\n break;\n case 'BA':\n arg = sp[k].substring(2, sp[k].length).split(',');\n resp += '\\n> POISON - Mengurangi darah musuh sebesar ' + -parseInt(arg[0]) + ' selama ' + arg[1] + ' turn';\n break;\n case 'BL':\n arg = sp[k].substring(2, sp[k].length);\n resp += '\\n> BLIND - Membutakan musuh sehingga tak bisa memberi damage (buff dan debuff masih bisa) selama ' + arg + ' turn';\n break;\n case 'PD':\n resp += '\\n> PURE DAMAGE - Membatalkan semua SHIELD yang aktif dari musuh';\n break;\n case 'RH':\n resp += '\\n> REVERSE HP - Menukar darah dengan musuh';\n break;\n case 'RS':\n resp += '\\n> REMOVE SKILL - Menghapus skill musuh yang dipilih. (sisa pakai skill musuh yang dipilih = 0)';\n break;\n case 'RA':\n arg = sp[k].substring(2, sp[k].length);\n resp += '\\n> REMOVE USAGE SKILL - Menghapus masa pakai skill musuh yang dipilih sebanyak ' + arg + ' kali';\n break;\n }\n }\n resp += '\\n======';\n }\n return client.replyMessage(event.replyToken, getMessageJson(resp));\n } else {\n return client.replyMessage(event.replyToken, getMessageJson('Kamu belum terdaftar dalam database bot. Silahkan ketik \\'!edit class\\' untuk memilih class serta mendaftar.'));\n }\n });\n respond = null;\n break;\n }\n }\n break;\n case 'commands':\n if (event.source.type === 'user') {\n respond = getMessageJson('Daftar perintah untuk user:\\n\\n!edit class [<idx>]\\nMengganti class karaktermu\\n\\n!edit name <nama>\\nMengganti nama karaktermu\\n\\n!info <char/skill>\\nMelihat info karakter/skillmu\\n\\n!saran <pesan, kesan, dan saran>\\nMemberi pesan pada developer\\n\\nNB: [] = opsional, <> = nilai, <a/b> = pilih salah satu');\n }\n else {\n respond = getMessageJson('Daftar perintah untuk grup:\\n\\n!joinpvp\\nMemasuki room permainan\\n\\n!playpvp\\nMembuat permainan baru\\n\\n!player\\nMenampilkan daftar pemain beserta class dan darahnya di room\\n\\n!ACTION\\nMendapatkan giliran\\n\\n!exit\\nMemberhentikan permainan\\n\\n!kick\\nMengeluarkan bot dari grup/room');\n }\n break;\n case 'debug':\n if (event.source.type === 'user' && event.source.userId == 'U6e1b0bcf6299166f09484785507f85e0') {\n switch (args[1]) {\n case 'player':\n respond = null;\n dbClient.query('SELECT * FROM PlayerStats').then((r) => {\n return client.replyMessage(event.replyToken, getMessageJson(`DATA\\n${JSON.stringify(r.rows)}`));\n });\n break;\n case 'rooms':\n return client.replyMessage(event.replyToken, getMessageJson(`DATA\\n${_rooms}`));\n break;\n case 'locked':\n return client.replyMessage(event.replyToken, getMessageJson(`DATA\\n${_lockedUsers}`));\n break;\n case 'saran':\n respond = null;\n dbClient.query('SELECT * FROM PlayerFAQ').then((r) => {\n return client.replyMessage(event.replyToken, getMessageJson(`DATA\\n${JSON.stringify(r.rows)}`));\n });\n break;\n }\n }\n break;\n }\n if (respond != undefined)\n return client.replyMessage(event.replyToken, respond);\n else if (respond === undefined)\n return client.replyMessage(event.replyToken, getMessageJson('Perintah tidak diketahui. !commands untuk melihat daftar perintah yang tersedia.'));\n }\n}", "title": "" }, { "docid": "7380fe2e9ab879bd30a6994356be2cfc", "score": "0.45591325", "text": "createRelationshipLinks(cardinality) {\n config.relationshipBehavior = \"link\";\n return API;\n }", "title": "" }, { "docid": "9f9e66324df189e8edb3db1945c50a84", "score": "0.45556325", "text": "async function handleFollowing() {\n try {\n if (user._id && currUser._id) {\n if (isFollowing) {\n const res = await axios.put(url + `/user/${user._id}/unfollow`, {\n userId: currUser._id,\n });\n\n loadMe();\n } else {\n const res = await axios.put(url + `/user/${user._id}/follow`, {\n userId: currUser._id,\n });\n loadMe();\n }\n }\n\n setFollowing(!isFollowing);\n } catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "206c69b378b46d3a8644691d1df85614", "score": "0.45527074", "text": "function processRelationsID(relationsNoSorted, entities) {\n\t\tvar relations = [];\n\t\t// Création du tableau des liens à partir de celui des nodes, en utilisant les objets comme source/target des liens et non les index comme c'est le cas par defaut pour la librairie\n\t\trelationsNoSorted.forEach(function (e) {\n\t\t\tvar sourceNode = entities.filter(function (n) {\n\t\t\t\t\treturn n.id === e.source;\n\t\t\t\t})[0],\n\t\t\t\ttargetNode = entities.filter(function (n) {\n\t\t\t\t\treturn n.id === e.target;\n\t\t\t\t})[0];\n\n\t\t\t// !!!!!!!!! On ne met pas une relation si une des entités de la relation est indéfinie, donc potentiellement on enlève de l'info\n\t\t\tif (typeof sourceNode !== 'undefined' && typeof targetNode !== 'undefined') {\n\t\t\t\tif (e.referenceData) {\n\t\t\t\t\tvar refData = [];\n\t\t\t\t\te.referenceData.forEach(function (ref) {\n\t\t\t\t\t\tvar newReference = {};\n\t\t\t\t\t\tnewReference.referenceType = ref.referenceType;\n\t\t\t\t\t\tnewReference.method = ref.method;\n\t\t\t\t\t\trefData.push(newReference);\n\t\t\t\t\t});\n\t\t\t\t\trelations.push({\n\t\t\t\t\t\tsource: sourceNode,\n\t\t\t\t\t\ttarget: targetNode,\n\t\t\t\t\t\ttype: e.type,\n\t\t\t\t\t\treferenceData: refData\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\trelations.push({\n\t\t\t\t\t\tsource: sourceNode,\n\t\t\t\t\t\ttarget: targetNode,\n\t\t\t\t\t\ttype: e.type\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t\t// Traitement pour pouvoir avoir plusieurs liens orienté pareil entre deux entités\n\t\t//sort links by source, then target\n\t\trelations.sort(function (a, b) {\n\t\t\tif (a.source.id > b.source.id) {\n\t\t\t\treturn 1;\n\t\t\t} else if (a.source.id < b.source.id) {\n\t\t\t\treturn -1;\n\t\t\t} else {\n\t\t\t\tif (a.target.id > b.target.id) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif (a.target.id < b.target.id) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t//any links with duplicate source and target get an incremented 'linknum'\n\t\tfor (var i = 0; i < relations.length; i++) {\n\t\t\tif (i != 0 &&\n\t\t\t\trelations[i].source == relations[i - 1].source &&\n\t\t\t\trelations[i].target == relations[i - 1].target) {\n\t\t\t\trelations[i].linknum = relations[i - 1].linknum + 1;\n\t\t\t} else {\n\t\t\t\trelations[i].linknum = 1;\n\t\t\t};\n\t\t};\n\n\t\treturn relations;\n\t}", "title": "" }, { "docid": "4ef5aa8fa03413f565c8783af9120ea1", "score": "0.4546176", "text": "get _getRelationForName () { return this.content._getRelationForName }", "title": "" }, { "docid": "851a0793f6101706ef3358decd6f4f5e", "score": "0.45449376", "text": "serializeHasMany(snapshot, json, relationship) {\n if (!json.hasOwnProperty('relationships')) {\n json.relationships = {};\n }\n\n let serializedKey = this._getMappedKey(relationship.key, snapshot.type);\n if (serializedKey === relationship.key && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.key, relationship.kind, \"serialize\");\n }\n\n json.relationships[serializedKey] = { links: { related: '--indexeddb--' } };\n }", "title": "" }, { "docid": "07e76f9cd4d6146dd7718ff1ff7b0901", "score": "0.4544583", "text": "async addReply (userAuthenticated, parent, parentReply, sTitle, sDescription, arrAttachments, arrKeywords, sCountry, sCity, sLanguage, dbLatitude, dbLongitude, dtCreation, arrAdditionalInfo){\n\n if ((typeof dtCreation === 'undefined') || (dtCreation === null)) dtCreation = '';\n if ((typeof arrAdditionalInfo === 'undefined')) arrAdditionalInfo = {};\n\n try{\n sCountry = sCountry || ''; sCity = sCity || ''; dbLatitude = dbLatitude || -666; dbLongitude = dbLongitude || -666; sTitle = sTitle || '';\n\n sLanguage = sLanguage || sCountry;\n parent = parent || '';\n\n let reply = redis.nohm.factory('ReplyModel');\n let errorValidation = {};\n\n\n //get object from parent\n //console.log(\"addReplies ===============\", userAuthenticated);\n\n let parentObject = await MaterializedParentsHelper.findObject(parent);\n\n if (parentObject === null){\n return {\n result:false,\n message: 'Parent not found. Probably the topic you had been replying in, has been deleted in the mean while',\n }\n }\n\n // sDescription = striptags(sDescription, ['a','b','i','u','strong', 'h1','h2','h3','h4','h5','div','font','ul','li','img', 'br', 'span','p','div','em','iframe']);\n // let shortDescription = striptags(sDescription, ['a','b','i','u','strong','div','font','ul','li', 'br', 'span','p','div','em','iframe']);\n // if (shortDescription.length > 512) shortDescription = shortDescription.substr(0, 512);\n\n sDescription = SanitizeAdvanced.sanitizeAdvanced(sDescription);\n let shortDescription = SanitizeAdvanced.sanitizeAdvancedShortDescription(sDescription, 512);\n\n parentReply = await MaterializedParentsHelper.findObject(parentReply);\n\n console.log('parentReply',typeof parentReply);\n\n if (((arrAdditionalInfo.scraped||false) === true)&&((arrAdditionalInfo.dtOriginal||'') !== '')) {//it has been scrapped...\n dtCreation = arrAdditionalInfo.dtOriginal;\n arrAdditionalInfo.dtRealCreation = new Date().getTime();\n delete arrAdditionalInfo.dtOriginal;\n }\n\n reply.p(\n {\n title: sTitle,\n // URL template: skyhub.com/forum/topic#reply-name\n URL: await URLHash.getFinalNewURL( parentObject.p('URL') , (sTitle.length > 0 ? sTitle : hat()) , null , '#' ), //Getting a NEW URL\n description: sDescription,\n shortDescription: shortDescription,\n authorId: (userAuthenticated !== null ? userAuthenticated.id : ''),\n keywords: CommonFunctions.convertKeywordsArrayToString(arrKeywords),\n attachments: arrAttachments,\n country: sCountry.toLowerCase(),\n city: sCity.toLowerCase(),\n language: sLanguage.toLowerCase(),\n dtCreation: dtCreation !== '' ? Date.parse(dtCreation) : new Date().getTime(),\n dtLastActivity: null,\n nestedLevel: (parentReply !== null ? parentReply.p('nestedLevel') + 1 : 1),\n addInfo: arrAdditionalInfo, //Additional information\n parentReplyId: await MaterializedParentsHelper.getObjectId(parentReply),\n parentId: await MaterializedParentsHelper.getObjectId(parent),\n parents: (await MaterializedParentsHelper.findAllMaterializedParents(parent)).toString(),\n }\n );\n\n console.log('parentReplyDone',typeof reply);\n\n if (dbLatitude != -666) reply.p('latitude', dbLatitude);\n if (dbLongitude != -666) reply.p('longitude', dbLongitude);\n\n return new Promise( (resolve)=> {\n\n if (Object.keys(errorValidation).length !== 0 ){\n\n resolve({result: false, errors: errorValidation});\n return false;\n }\n\n reply.save(async (err) => {\n if (err) {\n console.log(\"==> Error Saving Reply\");\n console.log(reply.errors); // the errors in validation\n\n resolve({result:false, errors: reply.errors });\n } else {\n console.log(\"Saving Reply Successfully\");\n\n await reply.keepURLSlug();\n await VotingsHashList.initializeVoteInDB(reply.id, reply.p('parents'));\n await RepliesSorter.initializeSorterInDB(reply.id, reply.p('dtCreation'));\n\n NotificationsCreator.newReply(reply.p('parentId'), reply.p('title'), reply.p('description'), reply.p('URL'), '', userAuthenticated );\n NotificationsSubscribersHashList.subscribeUserToNotifications(reply.p('authorId'), reply.p('parentId'), true);\n\n await reply.keepParentsStatistics();\n\n if ((arrAdditionalInfo.scraped||false) === true){ //it has been scrapped...\n\n } else {\n\n\n SearchesHelper.addReplyToSearch(null, reply); //async, but not awaited\n }\n\n //console.log(reply.getPublicInformation(userAuthenticated));\n\n resolve( {result:true, reply: reply.getPublicInformation(userAuthenticated) });\n\n }\n });\n\n });\n } catch (Exception){\n console.log('############# ERRROR AddReply',Exception.toString());\n return {result:false, message: ' error '};\n }\n\n\n }", "title": "" }, { "docid": "f1457520722dc7b05b1d75bceedb1674", "score": "0.45379633", "text": "async populate_messages_with_replies() {\r\n\t\tfor (const [thread_id, message] of Object.entries(this.messages)) {\r\n\t\t\tthis.messages_with_replies.push(message);\r\n\t\t\tfor (const child of message.children) {\r\n\t\t\t\tthis.messages_with_replies.push(child);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "36fb240496b850b2702fb7fa90c37837", "score": "0.45282912", "text": "async execute(interaction) {\n\n//all of the emebds are premade responces to questions. \n\t\t\tconst embedhtjt = new MessageEmbed()\n\t\t\t.setTitle('How to join a Tournament.')\n\t\t\t.setColor('#FF0000')\n\t\t\t.setDescription('This is how you join a Tournament.')\n\t\t\t.setTimestamp()\n\t\t\t.setFooter('Clan Warz Info Bot', 'https://i.imgur.com/WPiL1Ye.png');\n\n//This is where the bot checks what question needs to be answered then sends the correct responce.\n\t\tconst string = interaction.options.getString('question');\n\t\tif(string == 'How to join a Tournament.'){\n\t\t\treturn interaction.reply({ embeds: [embedhtjt] });\n\t\t}\n\t}", "title": "" }, { "docid": "ba2c37574f589613e96d67841ff31989", "score": "0.45277563", "text": "function sendQuickReply(recipientId, text, replies, metadata) {\n\n\tconsole.log(\"inside sendQuickReply\");\n\n\tvar messageData = {\n\t\trecipient: {\n\t\t\tid: recipientId\n\t\t},\n\t\tmessage: {\n\t\t\ttext: text,\n\t\t\tmetadata: isDefined(metadata) ? metadata : '',\n\t\t\tquick_replies: replies\n\t\t}\n\t};\n\tconsole.log(\"sendQuickReplysendQuickReply\");\n\tcallSendAPI(messageData);\n}", "title": "" }, { "docid": "f6b67b1cfd8fa87c0ae9ac5609e23de3", "score": "0.45276916", "text": "_saveAssociations() {\n Object.keys(this.belongsToAssociations).forEach((key) => {\n let association = this.belongsToAssociations[key];\n let parent = this[key];\n if (parent && parent.isNew()) {\n let fk = association.getForeignKey();\n parent.save();\n this.update(fk, parent.id);\n }\n });\n\n Object.keys(this.hasManyAssociations).forEach((key) => {\n let association = this.hasManyAssociations[key];\n let children = this[key];\n children.update(association.getForeignKey(), this.id);\n });\n }", "title": "" }, { "docid": "0637333273a0440ef87995b97c2c2e17", "score": "0.45193627", "text": "function handleResults(ordersResponse) {\n if (ordersResponse.body.count) {\n self.emit('data', messages.newMessageWithBody(ordersResponse.body));\n helper.updateSnapshotWithLastModified(ordersResponse.body.results, snapshot);\n }\n self.emit('snapshot', snapshot);\n }", "title": "" }, { "docid": "9ea8898eb1cf461a69052fa2ccb218ee", "score": "0.45182154", "text": "RedrawRelationships(name, name2 = null){\n // eachtime it finds a marriageNode\n // it looks for the links which contains any of the names in the marriage nodes\n // and draws a line between them if all of them has locations\n for (var i = 0; i < this.state.nodes.length; i++) {\n var node = this.state.nodes[i];\n if (node.type == 'husband-wife') {\n\n\n // linking wife this line causes the crash, may be because of svg\n // guess ill just directly link the husband to wife then\n this.DrawBetween(this.state.nodesDic[node.person1].location,this.state.nodesDic[node.person2].location);\n for (var j = 0; j < this.state.links.length; j++) {\n var link = this.state.links[j];\n if (node.person1 == link.person1 && !(node.person2 == link.person2)) {\n // draws aline with the marriage node if it is a child of the husband\n var p1Loc = this.state.nodesDic[node.name].location;\n var p2Loc = this.state.nodesDic[link.person2].location;\n if (p1Loc &&p2Loc ) console.log('linking', node.name, '->', link.person2);\n this.DrawBetween(p1Loc,p2Loc);\n }\n\n }\n }\n\n }\n return null;\n }", "title": "" }, { "docid": "14fb2295dcc97218757d1446bca53d42", "score": "0.4517195", "text": "async getAllRelationships(cls) {\n\t\t/* formulating and sending the query */\n\t\tlet result = await this.query(`\n\t\t\tMATCH (A) -[rel:${matchLabelsQueryFragment(cls).join('|')}]-> (B) \n\t\t\tRETURN A, rel, B\n\t\t`);\n\n\t\treturn result.map(({A, rel, B}) => ({\n\t\t\t...neo4jToData(cls, rel),\n\t\t\t1: neo4jToData(manifestClasses[A.class], A),\n\t\t\t2: neo4jToData(manifestClasses[B.class], B)\n\t\t}));\n }", "title": "" }, { "docid": "a3c66e4a994ef2e20cfb2b9ed763d0a5", "score": "0.45149466", "text": "function gotReply(xmlDoc)\n{\n console.log(\"UserInfo: gotReply: \" + new XMLSerializer().serializeToString(xmlDoc));\n location.reload();\n}", "title": "" }, { "docid": "e3896f3c869997c78cfd951a38b7f9ee", "score": "0.45130238", "text": "function followerStatus(followerGuid, myGuid) {\n\n connection.query({ // follower // being followed\n sql: 'SELECT * FROM `friends` WHERE `guid1` = ? AND `guid2` = ?',\n values: [followerGuid, myGuid]\n }, \n function (error, results, fields) {\n\n if (error) {\n printError(error);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n }\n\n // If has Relationship\n if (results && results.length > 0) {\n console.log('Results:', JSON.stringify(results, null, 2));\n\n var status = results[0].status;\n var blocked = results[0].blocked;\n var cancelInfo = [];\n \n cancelInfo[0] = results[0].cancel_count;\n cancelInfo[1] = results[0].timestamp;\n\n\n finalAppResponse(followerStatusResponse(status, blocked));\n \n\n } else {\n finalAppResponse(followerStatusResponse(Relationship.NoneExist));\n }\n });\n }", "title": "" }, { "docid": "cbb67d5341d5722c0ebc034a4f199c34", "score": "0.4511601", "text": "deleteFriendship(req, res, next) {\n let session = driver.session();\n const userName1 = req.body.userName1;\n const userName2 = req.body.userName2;\n const user1 = User.findOne({user: userName1});\n const user2 = User.findOne({user: userName2});\n\n Promise.all([user1, user2])\n session.run(\n 'MATCH (:User {userName: $userName1})-[r:IS_FRIENDS_WITH]-(:User {userName: $userName2}) DETACH DELETE r',\n {\n userName1: req.body.userName1,\n userName2: req.body.userName2\n }\n )\n .then(() => res.status(200).send({Message : req.body.userName1 + ' ended friendship with '+ req.body.userName2}))\n .catch(() => {\n res.status(422).send();\n next();\n });\n }", "title": "" }, { "docid": "53b70f286bc287db9f6746131d95f77c", "score": "0.45071486", "text": "function finalTransactionCompleted()\n{\n debug('The final transaction completed.');\n done();\n}", "title": "" }, { "docid": "47e252f78432c4f8f048c139ee196fa8", "score": "0.44968364", "text": "function send_prescription_details(){\n console.log(\"send_prescription_details called\");\n return new Promise(function (resolve,reject){\n\n\n console.log(\"contract_address: \",contract_address);\n\n var pres = contract_obj.at(contract_address);\n\n console.log(\"drug_json: \", drug_json);\n\n var num_sent = 0;\n pres.set_drug.sendTransaction(drug_json.drug ,{from: web3.eth.coinbase, to: contract_address}, callback);\n pres.set_dose.sendTransaction(drug_json.dose ,{from: web3.eth.coinbase, to: contract_address}, callback);\n\n\n function callback(e,r){\n console.log(\"callback fired\");\n if(e){\n reject(\"send failed\")\n } else{\n\n num_sent++;\n if (num_sent == 2){resolve(r)}\n }\n\n\n\n }\n // resolve(\"finished\");\n\n });\n }", "title": "" }, { "docid": "300856ff08c4e24dcd6e3e84457ac4f3", "score": "0.44966248", "text": "function sendToRecipient(recipientId, senderId, message, images, name, convoId) {\n console.log(\"Got to sending to recipeint\");\n const ws = idToConnection.get(recipientId);\n User.findOne({\n _id: recipientId\n }, (err, user) => {\n if (err) {\n console.log(err);\n return;\n }\n console.log(`Found recipient: ${user}`);\n console.log(`SenderId: ${senderId}`);\n const userConvos = user.onGoingConversations;\n //adds notification status to recipient's sender conversation\n for (let i = 0; i < userConvos.length; i++) {\n let thisConvo = userConvos[i];\n console.log(thisConvo.recipientId.toString() === senderId.toString());\n if (thisConvo.recipientId.toString() === senderId.toString()) {\n thisConvo.newMessage = true;\n console.log(userConvos);\n console.log(user.onGoingConversations);\n break;\n }\n }\n User.updateOne({\n _id: recipientId\n }, {\n $set: {\n onGoingConversations: user.onGoingConversations\n }\n }, (err) => {\n if (err) {\n console.log(err);\n }\n })\n console.log(\"Notified recipient\");\n \n User.findById(recipientId, (err, user) => {\n console.log(user);\n });\n \n //sends message right to recipient if server has active connnection\n //and tells them there's a new message\n if (ws) {\n console.log(\"Active connection to recipient\");\n ws.send(JSON.stringify({\n senderId: senderId,\n message: message,\n images: images,\n senderName: name,\n convoId: convoId\n }));\n }\n \n \n })\n \n }", "title": "" }, { "docid": "c72dc192d1468bc9d102fbc103bb9c44", "score": "0.44904888", "text": "function drawRelationships() {\n\n showRelationships();\n\n const getPathId = ({ source, target }) => `${source._id}-${target._id}`;\n\n // ====== RELATIONSHIP ARCS ===========\n\n // Data of unique relationships for arcs, even if they are at the same path.\n let arcsData = Object.values(_d3DataHolder.visible.relationships.reduce((accumulator, d) => {\n accumulator[getPathId(d)] = d;\n return accumulator;\n }, {}));\n\n let relationArcs = _relationArcs.selectAll('.relation').data(arcsData, (d) => getPathId(d));\n\n // Returns node coordinates with adjustment for member spec rotation if present.\n const getNodeCoordinates = (entity) => {\n let _node = nodeForEntity(entity);\n let _x = _node.x;\n let _y = _node.y;\n\n if (entity.isMemberSpec()) {\n _y += _configHolder.nodes.memberspec.circle.cy;\n if (entity.parent.hasChildren()) {\n // follow the rotation as for 'specNodeData'\n let _radius = _configHolder.nodes.memberspec.circle.cy;\n let _theta = Math.PI * 2 * _configHolder.nodes.memberspec.rotationAngle / 360;\n _x += _radius * Math.cos(_theta);\n _y -= _radius - Math.abs(_radius * Math.sin(_theta));\n }\n }\n\n return [_x, _y];\n };\n\n const getArcTransitionParameters = (d) => {\n let [targetX, targetY] = getNodeCoordinates(d.target);\n let [sourceX, sourceY] = getNodeCoordinates(d.source);\n let dx = targetX - sourceX;\n let dy = targetY - sourceY;\n let dr = Math.sqrt(dx * dx + dy * dy);\n let sweep = dx * dy > 0 ? 0 : 1;\n _mirror.attr('d', `M ${sourceX},${sourceY} A ${dr},${dr} 0 0,${sweep} ${targetX},${targetY}`);\n\n let m = _mirror._groups[0][0].getPointAtLength(_mirror._groups[0][0].getTotalLength() - _configHolder.nodes.child.circle.r - 20);\n\n dx = m.x - sourceX;\n dy = m.y - sourceY;\n\n dr = Math.sqrt(dx * dx + dy * dy);\n\n let isLeftToRight = dx > 0 || sourceX === targetX;\n\n return [sourceX, sourceY, dr, sweep, m.x, m.y, isLeftToRight];\n }\n\n const isLeftToRight = (d) => {\n if (typeof d.isLeftToRight === 'boolean') {\n return d.isLeftToRight;\n }\n const [x1,y1, dr, sweep, x2, y2, isLeftToRight] = getArcTransitionParameters(d);\n return isLeftToRight;\n }\n\n relationArcs.enter().insert('path')\n .attr('class', 'relation ' + _configHolder.nodes.relationship.pathClass)\n .attr('id', (d) => getPathId(d))\n .attr('opacity', 0)\n .attr('from', (d) => (d.source._id))\n .attr('to', (d) => (d.target._id));\n\n relationArcs.transition()\n .duration(_configHolder.transition)\n .attr('opacity', 1)\n .attr('stroke', 'red')\n .attr('d', d => safe(() => {\n const [x1,y1, dr, sweep, x2, y2, isLeftToRight] = getArcTransitionParameters(d);\n\n d.isLeftToRight = isLeftToRight;\n\n return `M ${x1},${y1} A ${dr},${dr} 0 0,${sweep} ${x2},${y2}`;\n }, ()=>'', d));\n\n relationArcs.exit()\n .transition()\n .duration(_configHolder.transition)\n .attr('opacity', 0)\n .remove();\n\n // ====== RELATIONSHIP LABELS =========\n // Draw relationship labels that follow paths, somewhere in the middle of paths.\n // NOTE <textPath/> DECREASES THE UI PERFORMANCE, USE LABELS WITH CAUTION.\n\n _relationLabels.selectAll('.' + _configHolder.nodes.relationship.labelClass).remove(); // Re-draw labels every time, required to refresh changes.\n\n // Group unique labels per path.\n let labelsPerPath = {};\n _d3DataHolder.visible.relationships.forEach(d => {\n const key = getPathId(d);\n if (!labelsPerPath[key]) {\n labelsPerPath[key] = new Set();\n }\n labelsPerPath[key].add(d.label);\n });\n\n const getLabelId = (d) => (getPathId(d) + '-' + d.label);\n\n // Data of unique labels with info about other labels at the same path.\n let labelsData = _d3DataHolder.visible.relationships.reduce((accumulator, d) => {\n const pathKey = getPathId(d);\n const labelKey = getLabelId(d);\n const labelsCollectedForPath = Object.keys(accumulator).filter(k => k.startsWith(pathKey)).length;\n if (labelsCollectedForPath <= _configHolder.nodes.relationship.labelsToDisplay && !accumulator[labelKey]) {\n accumulator[labelKey] = d;\n accumulator[labelKey].labels = Array.from(labelsPerPath[pathKey]); // path labels.\n accumulator[labelKey].labelIndex = labelsCollectedForPath; // label index at path.\n }\n return accumulator;\n }, {});\n\n const getLabelOffset = (d) => {\n let labelIndex = labelsData[getLabelId(d)].labels.indexOf(d.label);\n return labelIndex > 0 ? labelIndex * _configHolder.nodes.relationship.labelOffsetPx : 0;\n };\n\n let relationLabelsEntered = _relationLabels.selectAll('.' + _configHolder.nodes.relationship.labelClass)\n .data(Object.values(labelsData)).enter();\n\n // Returns label text for up to 3 labels at the same path.\n const getLabelText = (d) => {\n let labelText = '';\n if (d.labelIndex === 0 && d.labels.length > _configHolder.nodes.relationship.labelsToDisplay) {\n labelText = ' +' + (d.labels.length - _configHolder.nodes.relationship.labelsToDisplay) + ' other';\n } else if (d.labelIndex <= _configHolder.nodes.relationship.labelsToDisplay) {\n labelText = d.label;\n }\n return isLeftToRight(d) ? labelText : labelText.split(\"\").reverse().join(\"\");\n };\n\n relationLabelsEntered.insert('text') // Add text layer of '&#9608;'s to erase the area on the path for label text.\n .attr('class', _configHolder.nodes.relationship.labelClass)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'middle')\n .attr('font-family', 'monospace')\n .attr('fill', _configHolder.nodes.relationship.labelBackgroundColor)\n .insert('textPath')\n .attr('xlink:href', (d) => ('#' + getPathId(d)))\n .attr('startOffset', '59%') // 59% roughly reflects `middle of the arch` minus `node radius`.\n .insert('tspan')\n .attr('dy', getLabelOffset)\n .html((d) => safe( () => ('&#9608;'.repeat(getLabelText(d).length + 2)), () => '', d)) // +2 spaces for padding\n\n relationLabelsEntered.insert('text') // Add label text on top of '&#9608;'s which is on top of the path.\n .attr('class', _configHolder.nodes.relationship.labelClass)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'middle')\n .attr('font-family', 'monospace')\n .insert('textPath')\n .attr('from', (d) => (d.source._id))\n .attr('to', (d) => (d.target._id))\n .attr('class', 'relation-text') // `relation-text` class is required for styling effects\n .attr('xlink:href', (d) => ('#' + getPathId(d)))\n .attr('startOffset', '59%') // 59% roughly reflects `middle of the arch` minus `node radius`.\n .insert('tspan')\n .attr('dy', getLabelOffset)\n .attr('rotate', (d) => safe(()=>isLeftToRight(d) ? '0' : '180', () => '0', d)) // rotate text if arc goes as right-to-left\n .style('z-index', 9)\n .on('mouseover', d => {\n if (d.labels.length > _configHolder.nodes.relationship.labelsToDisplay) {\n _canvasTooltip.style('visibility', 'visible');\n _canvasTooltip.select('.panel-heading').html('Relationships')\n _canvasTooltip.select('.panel-body').html(() => d.labels.join('<br>'));\n }\n })\n .on('mousemove', () => {\n _canvasTooltip.style('top', `${event.pageY - 100}px`).style('left',`${event.pageX - 40}px`);\n })\n .on('mouseout', () => {\n _canvasTooltip.style('visibility', 'hidden');\n })\n .html(d => safe(()=>getLabelText(d), ()=>'?', d));\n }", "title": "" }, { "docid": "ee5a8c8f3b9c702f47c55bd98eaa7d66", "score": "0.44864115", "text": "createReply (thread, replyObj) {\n return new Promise((resolve, reject) => {\n thread.replies.push(replyObj)\n thread.save((err, thread) => {\n if (!err) {\n console.log('Thread saved')\n resolve(thread)\n } else {\n console.log('Thread save error')\n reject(err)\n }\n })\n })\n }", "title": "" }, { "docid": "e6ec997035eabcc7214327e26a06606a", "score": "0.44852924", "text": "didUpdate() {\n this._super(...arguments);\n this._saveCanonicalBelongsTo();\n }", "title": "" }, { "docid": "a0d15d4030e1fa8c4085c61deb758e6f", "score": "0.44811627", "text": "function replySucceeded() {\n self.status = C.STATUS_WAITING_FOR_ACK;\n\n setInvite2xxTimer.call(self, request, desc);\n setACKTimer.call(self);\n accepted.call(self, 'local');\n }", "title": "" }, { "docid": "593735eb9e765cd3ccf7c97d773e95db", "score": "0.44754624", "text": "async postProcess () {\n\t\tawait this.userInviter.postProcess();\n\t}", "title": "" }, { "docid": "869d1f3fdf00e1c157facf13deb5bed5", "score": "0.44711006", "text": "function forwardRequest(req, res, urn){\n let identifier = req.body.actor.split(\"/\").pop()+'_'+Date.now();\n req.body.id = noteQueryUrl +''+identifier;\n return inboxApi.sendActivity(req,urn)\n .then((data) => {\n res.status(201).json({\n status: 'success',\n data\n })\n })\n .catch((err) => {\n console.log(err);\n res.status(500).json({\n status: 'error',\n message: String(err)\n })\n })\n}", "title": "" }, { "docid": "8be9f5d0a880715fe7cf5b3d0b61e8c5", "score": "0.44706148", "text": "get preparingEachEntityRelationship() {\n return this.asPreparingEachEntityRelationshipTaskGroup({});\n }", "title": "" }, { "docid": "24bc6a5763c9305576dee0d53c5294fe", "score": "0.44660318", "text": "function formatRelationship(callback) {\n var topologyRes = []\n var itemsList = []\n\n function getDictionary(topologyRes, callback) {\n var dictionary = {};\n for (var i = 0; i < topologyRes.length; i++) {\n var doc = topologyRes[i];\n dictionary[doc._id] = doc;\n if (i == topologyRes.length - 1) {\n callback(dictionary)\n }\n }\n }\n\n function buildTree(dictionary, topologyRes, callback) {\n var topologySearchProduct =[]\n for (var i = 0; i < topologyRes.length; i++) {\n var doc = topologyRes[i];\n var children = doc.children;\n var ref_children = [];\n for (var j = 0; j < children.length; j++) {\n var child = dictionary[children[j]]; // <-- here's where you need the dictionary\n ref_children.push(child);\n }\n doc.children = ref_children;\n topologySearchProduct.push(doc)\n }\n callback(_.find(topologySearchProduct, {_id: rootId}).children)\n }\n\n var itemsCursor = itemsDataBase.find({}, {_id: true, item: true}).stream()\n itemsCursor.on('data', function (a) {\n itemsList.push(a)\n })\n itemsCursor.on('end', function () {\n var topologyCursor = topologyDataBase.find({}, {_id: true, children: true, parent: true}).stream()\n topologyCursor.on('data', function (topologyElement) {\n var thisElement = _.find(itemsList, {_id: topologyElement._id})\n if (thisElement) {\n thisElement.children = topologyElement.children\n topologyRes.push(thisElement)\n }\n })\n topologyCursor.on('end', function () {\n getDictionary(topologyRes, function (dct) {\n buildTree( dct, topologyRes, function(topologySearchProduct){\n //db.close()\n callback(topologySearchProduct)\n })\n })\n })\n })\n}", "title": "" }, { "docid": "be1794b594df720163eb5f18b7c5668b", "score": "0.44608724", "text": "static associate(models) {\n // define association here\n Mapping.belongsTo(models.Respondent, {\n as: `respondent`,\n foreignKey: `respondent_id`,\n })\n }", "title": "" }, { "docid": "4dff059b51a5efacdadff37020be792a", "score": "0.4459003", "text": "followRelationshipLinks(cardinality) {\n // TODO: would like to move back to ICardinalityConfig<T> when I can figure out why Partial doesn't work\n config.relationshipBehavior = \"follow\";\n if (cardinality) {\n config.cardinality = cardinality;\n }\n return API;\n }", "title": "" }, { "docid": "69025fce8b5597f357ca6badff17135d", "score": "0.44527087", "text": "onEmitThanks(context) {\n var request = {\n roomId: context.roomId,\n reaction: \"THANK\",\n targetUser: context.otherUserId,\n targetUserBubbleId: context.otherUserId,\n };\n this.props.addReaction(this.props.socket, request);\n }", "title": "" }, { "docid": "2468db328a2453e158371904419113fd", "score": "0.44513264", "text": "function completeTransaction(newStockQuantity, userBoughtId) {\n inquirer.prompt([\n // Using inquirer to ask for confirmation. \n {\n type: 'confirm',\n name: 'confirmPurchase',\n message: 'If you want to complete your purchase, please select \"Yes\".',\n default: true\n }\n // If the user confirms, then update the stock quantity.\n ]).then(function(userResponse) {\n if (userResponse.confirmPurchase === true) {\n // \n connection.query('UPDATE products SET ? WHERE ?', [\n // Mapping stock_quantity and item_id so they can be updated in mysql. \n {\n stock_quantity: newStockQuantity\n },\n {\n item_id: userBoughtId\n }\n ],\n function(error, response) {\n if (error) throw error;\n });\n // After a completed transaction, the user is taken back to the beginning. She then can see an updated products table. \n console.log('============================================================');\n console.log('Your transaction is complete!')\n console.log('============================================================');\n welcomeToBamazon();\n // If the user changed her mind and does not what to complete the purchase, the connection ends.\n } else {\n console.log('Okey-Doke. Come back when you want to buy something.');\n connection.end();\n }\n })\n}", "title": "" }, { "docid": "61d2e8a80d99f1e49654cb59b49a1736", "score": "0.44503537", "text": "async sendOutGoing(): Promise < void > {\n\n var forward_url = getFromStorage('forward_url');\n var select_sql = \"SELECT * FROM smsout WHERE complete=1\";\n\n db.transaction(function (txn) {\n\n txn.executeSql(\n select_sql,\n [],\n function (tx, res) {\n\n for (let i = 0; i < res.rows.length; ++i) {\n\n var tmp_item = res.rows.item(i);\n\n SmsAndroid.autoSend(\n tmp_item.phone,\n tmp_item.sms,\n (fail) => {\n console.log('Failed with this error: ' + fail);\n },\n (success) => {\n console.log('SMS sent successfully');\n },\n );\n\n if (json.successful) {\n\n var sql = \"UPDATE smsin SET successful = 1, completed = 1, WHERE id = \" + tmp_item.id\n\n txn.executeSql(\n sql,\n [],\n function (tx, res) {\n\n if (res.rowsAffected > 0) {\n alert('Record added Successfully');\n } else {\n alert('Record addition Failed');\n }\n\n }\n );\n }\n\n }\n\n }\n );\n\n });\n\n }", "title": "" }, { "docid": "ccbd168ece25cb9e3521dcf7f2a1f73e", "score": "0.4449231", "text": "function makeRelationshipProcessInstance(node,result){\n var root_node_id = node[0]._id;\n var other_node_id = result._id;\n db.insertRelationship(other_node_id, root_node_id, 'INSTANCE_OF', {}, function(err, result){\n });\n\n}", "title": "" } ]
3094f51d6cb1515f6e10adb9d3228a1d
print out the total cost of the items in the cart
[ { "docid": "beb957f1d7942aa5ded9504b844fa087", "score": "0.0", "text": "function totalPrice() {\n let totalSum = 0;\n\n if (NewItem.quantity > 1) {\n\n }\n}", "title": "" } ]
[ { "docid": "624969e7ed9903bc6e1c9b165c4b22f7", "score": "0.8124159", "text": "function totalCost() {\n let totalPrice = 0;\n for (let i in itemsInCart) {\n let price = itemsInCart[i].Price;\n let removeSymbols = parseFloat(price);\n let quantityPrice = removeSymbols * itemsInCart[i].quantity;\n totalPrice = totalPrice + quantityPrice;\n $(\"#totalPrice\").text(`Total Cost: ${totalPrice}`);\n }\n}", "title": "" }, { "docid": "96c97ad48a9eb423af0a5e8335ad2705", "score": "0.81137335", "text": "function totalCostCart(){\r\n var totalCost = 0\r\n for (var i in cart){\r\n totalCost += cart[i].price * cart[i].count;\r\n }\r\n return totalCost.toFixed(2);\r\n }", "title": "" }, { "docid": "01baea028acb37721b16c9cd681f070b", "score": "0.7951175", "text": "function getTotalCost(cartItems){\n let totalCost = 0;\n cartItems.forEach((cartItem)=>{\n totalCost += cartItem.price * cartItem.quantity\n })\n document.querySelector(\".total-cost-number\").innerText = \"₹ \"+totalCost;\n\n}", "title": "" }, { "docid": "f796ce2d1305f2ec2adbd2adc36033f5", "score": "0.7889532", "text": "function getTotal(cartItems) {\n let total = 0;\n for (item in cartItems) {\n total += cartItems[item].qt * cartItems[item].price;\n };\n totalDin.innerHTML = `R$ ${total.toFixed(2)}`;\n }", "title": "" }, { "docid": "c21eecc80bf9c7d131b4a1b4cf2a6021", "score": "0.78161067", "text": "printShoppingCart(){\n var total= 0;\n let cost=''; \n for (let i = 0; i <= this.items.length - 1; i ++){\n cost = cost +`${this.items[i]} $${this.price[i]} \\n` ; \n \n }\n for (let i = 0; i <this.price.length; i++){\n total = this.price[i] + total;\n }\nreturn `Name: ${this.fName} ${this.lName}\nItems Purchases: \n${cost}Total Purchase: $${total}`;\n }", "title": "" }, { "docid": "03785199d9c262bed705590af7e5ac71", "score": "0.7724986", "text": "function getCosts() {\n\tlet subtotal = 0;\n\tfor (let i = 0; i < cart.length; i++) {\n\t\tsubtotal += cart[i].quantity * 2.99;\n\t}\n\tconst tax = 0.15 * subtotal;\n\tconst total = tax + subtotal;\n\tdocument.getElementById('subtotal').innerHTML = \"$\" + subtotal.toFixed(2);\n\tdocument.getElementById('tax').innerHTML = \"$\" + tax.toFixed(2);\n\tdocument.getElementById('total').innerHTML = \"$\" + total.toFixed(2);\n}", "title": "" }, { "docid": "359483c4193749b9430ece7e5d5ddea3", "score": "0.75552946", "text": "function totalCart(cart) {\n\tvar total = 0;\n\tfor (var x = 0; x < cart.charities.length; x++) {\n\t\ttotal += cart.charities[x].amount;\n\t}\n\tif (total > 0) {\n\t\tjQuery('#basket-total').html('€' + total + ',00');\n\t} else {\n\t\tjQuery('#basket-total').html('');\n\t}\n\tconsole.log('Total: ' + total);\n}", "title": "" }, { "docid": "2ac4ac2143ee740478da5b2b5a93567d", "score": "0.7498509", "text": "function updateCartTotal(){\n total = 0;\n for(var key in cart){\n let quantity = cart[key];\n total = total + products[key].product.computeNetPrice(quantity);\n }\n updateCart();\n\n document.getElementById(\"cartTotal\").innerText = \"Cart ($\" + total + \")\";\n}", "title": "" }, { "docid": "04b72665c16290318d7e16b2fdb3ca51", "score": "0.7455159", "text": "static sumCartItems() {\n let totalItems = 0;\n for (let item in cart) {\n totalItems += cart[item].quantity;\n }\n let numInCart = document.getElementById('cart-size');\n numInCart.innerHTML = totalItems;\n }", "title": "" }, { "docid": "6425b5bcaaa36843a78f1a0ba38f4da1", "score": "0.741205", "text": "function total() {\n var totalItems = 0;\n \n for (var i = 0; i < cart.length; i++) {\n totalItems += cart[i].itemPrice;\n }\n return totalItems \n}", "title": "" }, { "docid": "6600b2a12d77eeed8fe0b149d9d81dae", "score": "0.7410817", "text": "function CalculateTotal (prodName) {\n ///define local variable to store the total price\n var total = 0;\n ///loop through all items in the shopping cart\n for (prodName in shoppingCart){\n ///add total cost of each product by adding (product price * quantity)\n total = total + parseFloat (productList[prodName])* parseFloat (shoppingCart[prodName]);\n }\n ///print all key-value pairs in the object in the console\n console.log(shoppingCart);\n ///print the total price in the cart to 2 decimal numbers\n console.log(\"The total amount is \"+ total.toFixed(2) + \".\\n\");\n ///return the total price of products in the cart upto 2 decimal points\n return (total.toFixed(2));\n}", "title": "" }, { "docid": "d4418ae7adbdffb483fd32a170599c17", "score": "0.7407145", "text": "function calculateTotals(){\n \n itemsPrice = 0.00;\n tax = 0;\n total = 0;\n \n //iterate through customer cart and add price of each element in cart\n customerCart.forEach(function(element){ \n itemsPrice = itemsPrice += element.price;\n });\n \n tax = Math.round((itemsPrice * 0.06), 2);\n total = Math.round((itemsPrice + tax), 2);\n \n $(\"#itemsTotal\").html(`Items: $${itemsPrice}`);\n $(\"#taxTotal\").html(`Tax: $${tax}`);\n $(\"#orderTotal\").html(`Total Price: $${total}`);\n }//calculate totals", "title": "" }, { "docid": "478fd449c908f8e796d79e1700896ae1", "score": "0.7316465", "text": "totalPrice () {\n let totalPriceItem = document.getElementsByClassName('item_price--total--all')[0];\n let totalPrice = 0;\n if (this.cartItems) {\n for (let i = 0; i < this.cartItems.length; i++) {\n totalPrice = totalPrice + this.cartItems[i].totalPrice;\n totalPriceItem.innerHTML = totalPrice + ' &euro;';\n }\n }\n }", "title": "" }, { "docid": "2bf67ee7f8d6c770eea2dadd4b211bd3", "score": "0.73142856", "text": "function total() { \n let tp = 0;\n let i = 0;\n while (i < cart.length) {\n tp = tp + parseInt(getCart()[i].itemPrice);\n // tp += getCart()[i].itemPrice; - shorthand works too\n i++;\n }\n return tp;\n}", "title": "" }, { "docid": "13daf7bb585387b6ab44166b997a32ad", "score": "0.7296784", "text": "function total() {\n let t = 0\n for (var i = 0, l = cart.length; i < l; i++) {\n for (var item in cart[i]) {\n t += cart[i][item]\n }\n }\n return t\n}", "title": "" }, { "docid": "95fd139d46c504059ebd8ce9c8e13a89", "score": "0.7239622", "text": "getTotalItems() {\n const cartStor = Storage.getCart();\n let total = 0;\n cartStor.forEach((item) => {\n let amount = item.amount;\n total += amount;\n });\n cartItems.innerText = total;\n }", "title": "" }, { "docid": "cb603d16450d5e5a131583f64946865e", "score": "0.72207123", "text": "function totalAmount() {\n let total = 0;\n nbItemInCart = 0;\n if(idsInCart.length !== 0) {\n for(let i=0 ; i<idsInCart.length ; i++) {\n total += parseInt(idsInCart[i].quantity)*parseInt(idsInCart[i].price);\n nbItemInCart += parseInt(idsInCart[i].quantity);\n }\n }\n $totalPriceInCart.text(total+',00 €');\n}", "title": "" }, { "docid": "988c58d12232ebdea72d87a0648507bb", "score": "0.72094744", "text": "function showCart() {\n let cartList = document.querySelector('#cart ul');\n cartList.innerHTML = ''; // clear away all items\n\n // Loop through each item in the cart \n for (let i = 0; i < cart.length; i++) {\n showCartItem(cart[i]);\n } \n\n // update the total \n let subtotal = 0;\n for (let i = 0; i < cart.length; i++) {\n subtotal = subtotal + cart[i].price;\n }\n\n // add this number to the dom\n document.querySelector('#cart-subtotal').textContent = displayPrice(subtotal);\n document.querySelector('#cart-tax').textContent = displayPrice(subtotal * 0.1);\n document.querySelector('#cart-total').textContent = displayPrice(subtotal + (subtotal * 0.1));\n}", "title": "" }, { "docid": "d1642ebf11433add27d8ea69d2448368", "score": "0.7197145", "text": "totalCart(){\n\n\n\n\t\tlet total = 0;\n\t\tfor(var i=0; i<this.props.cart.length; i++){\n\t\t total += this.props.cart[i].book.price * this.props.cart[i].quantity;\n\t\t}\n\t\n\t\treturn total.toFixed(2);\n\t}", "title": "" }, { "docid": "ee410285b2be90c32af298555a8ebb63", "score": "0.716413", "text": "function calculateTotal() {\n let sum = 0;\n state.cart.forEach(item => {\n sum += item.price * item.purchaseQuantity;\n });\n return sum.toFixed(2);\n }", "title": "" }, { "docid": "d9bb4939175f299446d329287e1f6142", "score": "0.71594775", "text": "function calculateTotal() {\n let sum = 0;\n state.cart.forEach((item) => {\n sum += item.price * item.purchaseQuantity;\n });\n return sum.toFixed(2);\n }", "title": "" }, { "docid": "a085e70bf7292fc487a91e02c29a608b", "score": "0.7133053", "text": "function cartTotal(){\r\nlet cartItemEl=document.querySelectorAll('.item-container');\r\nlet total = 0;\r\nfor(let i=0;i<cartItemEl.length;i++){\r\n let price = parseInt(cartItemEl[i].querySelector('.product-price').innerText.replace('₹',''));\r\n let quantity = parseInt(cartItemEl[i].querySelector('.counter').value);\r\n total = total+(price*quantity);\r\n}\r\nlet totalAmtEl=document.querySelector('.total-price');\r\ntotalAmtEl.innerText=` ₹ ${total}`;\r\n}", "title": "" }, { "docid": "ffd2b9e89c33f2763e11ca47709c1c77", "score": "0.7103697", "text": "function totalCost() {\n var total =\n parseFloat(cost) +\n parseFloat(window.tax + parseFloat(window.totalShippingCost)).toFixed(2);\n document.getElementById(\"total\").innerHTML = `$ ${total}`;\n }", "title": "" }, { "docid": "ca293f6ee7336ae9805a479ec96f5f86", "score": "0.70999455", "text": "function cartAdd(){\n\tsubtotal = 0;\n\tvar html = \"\";\n\tcartItems.forEach(function(item){\n\t\tsubtotal += item.price * item.numToAdd;\n\n\t\thtml += `\n\t\t\t<div><p>${item.name} is <span>${item.price}</span></p></div>\n\t\t\t`;\n\t})\n\tsubtotalBox.innerHTML = subtotal.toFixed(2);\n\tvar total = subtotal*1.065;\n\ttotalBox.innerHTML = total.toFixed(2);\n\tcartStuff.innerHTML = html;\n}", "title": "" }, { "docid": "5bda19b4cb8fe8c81611bdc09e0f0d74", "score": "0.709574", "text": "getCartTotal() {\n var total = 0;\n for(let product in this._products){\n if(this._products.hasOwnProperty(product)){\n total += this._products[product].price * this._products[product].quantity;\n }\n }\n return total.toFixed(2);\n }", "title": "" }, { "docid": "7a011dad5f41be845117a3eacd0521e3", "score": "0.7089723", "text": "function getTotalItem() {\n var totalitems = 0;\n cart.forEach((item) => {\n totalitems += item.quantity;\n });\n setTotalItems(totalitems);\n props.cart(totalitems);\n }", "title": "" }, { "docid": "887eaaedc93fc2c4ad568a6b56b5cec2", "score": "0.70784926", "text": "function getTotal(cart){\n\tvar total = 0;\n\tfor(var i=0; i<cart.length; i++){\n\t\ttotal+=parseFloat(cart[i].price * cart[i].quantity);\n\t}\n\treturn total.toFixed(2);\n}", "title": "" }, { "docid": "e852c707bd08696d7d8ae4225420f28a", "score": "0.706169", "text": "static total() {\n let totalPrice = 0;\n for (let item in cart) {\n totalPrice += (cart[item].quantity * cart[item].unitPrice);\n }\n // Avoiding floating point addition error\n return Math.round(totalPrice * 100) / 100;\n }", "title": "" }, { "docid": "c61a9b02910aaab843bff392849e1171", "score": "0.7057607", "text": "function updateCartTotal() {\n var cartItemContainer = document.getElementsByClassName(\"cart-section\")[0];\n var cartRows = cartItemContainer.getElementsByClassName(\"container-cart\");\n var total = 0;\n for (var i = 0; i < cartRows.length; i++) {\n var cartRow = cartRows[i];\n var priceElement = cartRow.getElementsByClassName(\"item-price\")[0];\n var quantityElement = cartRow.getElementsByClassName(\"item-quantity\")[0];\n var price = parseFloat(priceElement.innerText.replace(\"$\", \"\"));\n var quantity = quantityElement.value;\n total = total + price * quantity;\n // cart-item-total\n var itemTotal = document.getElementsByClassName(\"cart-item-total\")[i];\n itemTotal.innerText = \"$\" + price * quantity;\n }\n total = Math.round(total * 100) / 100;\n document.getElementById(\"cart-total\").innerText = \"$\" + total;\n document.getElementById(\"cart-total-with-shipping\").innerText = \"$\" + total;\n document.getElementById(\"cartitems\").innerText = JSON.stringify(\n cartRows.length\n );\n}", "title": "" }, { "docid": "1e7d23a90adc67875d0b8395cdded355", "score": "0.7029934", "text": "function calculateCost(qty, price) {\n let cost = qty * price;\n console.log(\"The cost of this purchase is :\" + cost);\n}", "title": "" }, { "docid": "f8ffa75294acbe0389bc108d2eb318dc", "score": "0.70206976", "text": "getCartTotal(){\n let _total = 0;\n\n if(this.isCartEmpty()){\n return _total;\n }\n\n const _items = this.state.items;\n for(let i=0; i < _items.length; i++){\n _total += _items[i].cart_item.price * _items[i].cart_item.qty\n }\n\n return _total;\n }", "title": "" }, { "docid": "857311112f7d6cd4f0694c98cc93daac", "score": "0.70127106", "text": "cartValues(cart){\n \tlet cartItemTotal= 0;\n \tlet itemTotal = 0;\n \t\n\n \tcart.map(item => {\n \t\tcartItemTotal += item.field.price * item.quantity;\n \t\titemTotal += item.quantity;\n \t})\n\n \tcartTotal.innerText = parseFloat(cartItemTotal.toFixed(2));\n \tcartItems.innerText = itemTotal;\n\n }", "title": "" }, { "docid": "893caa24619bf55e7b6798187fd87266", "score": "0.7009994", "text": "function updateCartTotal() {\n\tlet cartItemContainer = document.getElementsByClassName('cart-items')[0];\n\tlet cartRows = cartItemContainer.getElementsByClassName('cart-row');\n\tlet total = 0;\n\tfor (let i = 0; i < cartRows.length; i++) {\n\t\tlet cartRow = cartRows[i];\n\t\tlet priceElement = cartRow.getElementsByClassName('cart-price')[0];\n\t\tlet quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0];\n\t\tlet itemTitle = cartRow.getElementsByClassName('cart-item-title')[0].innerText;\n\t\tlet price = parseFloat(priceElement.innerText.replace('€', ''));\n\t\tlet quantity = quantityElement.value;\n\t\ttotal = total + (price * quantity);\n\t\tcartContents[itemTitle] = {\n\t\t\t\"price\": price,\n\t\t\t\"quantity\": quantity,\n\t\t\t\"total\": price * quantity\n\t\t};\n\t}\n\ttotal = Math.round(total * 100) / 100;\n\tdocument.getElementsByClassName('cart-total-price')[0].innerText = '€' + total;\n}", "title": "" }, { "docid": "a4ff6c08fa51f74d843d7d33c2250cc0", "score": "0.70093226", "text": "function updateCartTotal() {\n var cartItemContainer = document.getElementsByClassName('cart-items')[0]\n var cartRows = cartItemContainer.getElementsByClassName('cart-row')\n var total = 0 //initiates the total value. \n for (var i = 0; i < cartRows.length; i++){\n var cartRow = cartRows[i]\n var priceElement = cartRow.getElementsByClassName('cart-price')[0]\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0]\n var price = parseFloat(priceElement.innerText.replace('€', ''))\n var quantity = quantityElement.value\n total = total + (price * quantity) // Gets the total varible and add upp to the price and quantity varibles.(the price is being mutiplied to the quantity before it adds to the total).\n }\n total = Math.round(total * 100) / 100\n document.getElementsByClassName('cart-total-price')[0].innerText = '€' + total // Print alt the total bill.\n}", "title": "" }, { "docid": "ff863fd4fc6fe812e6989ea5834c670c", "score": "0.70053834", "text": "function totalCost(productPrice, purchaseAmount) {\n console.log(\"Total Cost of Purchase: $\" + productPrice*purchaseAmount);\n}", "title": "" }, { "docid": "524a513008f112ea78130921d6021bfd", "score": "0.6997986", "text": "totalCostItems() {\n return this.getTotal('price');\n }", "title": "" }, { "docid": "0dc16877eeaeba32c185a8e1c5a2b7a0", "score": "0.69969827", "text": "function Total() {\n let total = 0;\n for (let val of cart) {\n total = total + (val.price * val.qtty);\n }\n document.getElementById(\"price\").innerHTML = total.toFixed(2) + \" €\";\n\n if (total > 100) { //discount\n document.getElementById(\"discountprice\").innerHTML= (10 * total / 100).toFixed(2) + \" €\";\n document.getElementById(\"finalamount\").innerHTML= (total - (10 * total / 100)).toFixed(2) + \" €\";\n } else {\n document.getElementById(\"discountprice\").innerHTML= 0 + \" €\";\n document.getElementById(\"finalamount\").innerHTML= total.toFixed(2) + \" €\";\n }\n\n}", "title": "" }, { "docid": "2997d06739a4ed09fcf71a4cc75ee1c4", "score": "0.69788307", "text": "function printTotalCost(cost) {\n globalTotalCost += cost;\n document.getElementById(TOTAL_COST_TD_NAME).innerHTML = globalTotalCost.toLocaleString();\n}", "title": "" }, { "docid": "ddba649d03cd5bf6df3eb6bdf14c378f", "score": "0.69759", "text": "function renderCart() {\n // Lets make sure the cart is empty\n $('#cart').html(\"\");\n $('#totalPrice').text('Total Cost: 0');\n let totalCost = 0;\n\n // Render all the objects + count the price\n for (let item of itemsInCart) {\n $('#cart').append($(\"<div></div>\").html(`<span>${item.Name} </span><span>- Quantity: ${item.quantity}</span>`))\n }\n}", "title": "" }, { "docid": "d30fa12c5e84922c358173820a742b82", "score": "0.697343", "text": "function totalCost() {\n var query = \"SELECT price FROM products WHERE item_id=\" + chosenProd;\n connection.query(query, function(err,res) {\n var total = res[0].price*chosenQuan;\n var formatTotal= number_format(total, 2);\n if (err)throw err;\n console.log(\"\\nYour total is \" + formatTotal + \".\" + \"\\n\" + \"-------------\");\n startOver();\n })\n}", "title": "" }, { "docid": "c22481123b682202f5548fb503667cb3", "score": "0.6955653", "text": "function getTotal() {\n\n let itemCount = this.getItemCount(), total = 0;\n\n while (itemCount--) {\n total += basket[itemCount].price;\n }\n\n return total;\n }", "title": "" }, { "docid": "0408db31dc78e4a6a63a00906a8b612d", "score": "0.69477266", "text": "function calculateTotal(){\n var total = 0;\n for (const [item, quantity] of Object.entries(order)){\n total += (itemPrices[item] * quantity);\n }\n return total;\n}", "title": "" }, { "docid": "aca5962ea8f6b8b2e764cb3f1aa2c166", "score": "0.6934992", "text": "function totalPrice(cart) {\n let totalAmount = 0;\n\n for (let i = 0; i < cart.length; i++) {\n const item = cart[i].product;\n const quantity = cart[i].quantity;\n const price = item.price * quantity;\n\n totalAmount = totalAmount + price;\n }\n return totalAmount;\n}", "title": "" }, { "docid": "6d47e3df892b9fb3302df2975632b816", "score": "0.6934466", "text": "function cartTotal(){\n const total = [];\n const itemsprice = document.querySelectorAll(\".cart-item-price\");\n\n itemsprice.forEach(function(itemprice){\n total.push(parseFloat(itemprice.textContent));\n });\n\n const totalMoney = total.reduce(function(total, item){\n total += item\n return total;\n }, 0);\n\n const finalTotal = totalMoney.toFixed(2); //pour limiter à 2 chiffres après la virgule\n\n document.getElementById(\"cart-total\").textContent = finalTotal;\n document.getElementById(\"item-count\").textContent = total.length;\n document.getElementById(\"item-total\").textContent = finalTotal;\n\n }", "title": "" }, { "docid": "a19f232017f72f9a45b330d60dc20d5d", "score": "0.6934383", "text": "function totalCost() {\n var total = 1299 + costAmount('extra-memory-cost') + costAmount('extra-storage-cost') + costAmount('delivery-cost');\n customConfigureCost('total-price', total)\n customConfigureCost('coupon-amount', total)\n}", "title": "" }, { "docid": "95cfe3cb7be34ba091eafc72f4053f22", "score": "0.69247174", "text": "function updateTotal() {\n\tlet costs = window.document.getElementsByClassName(\"cost\");\n\tlet quantities = window.document.getElementsByClassName(\"quantity\");\n\n\t// Ensure balanced costs and quantity\n\tif (costs.length !== quantities.length) {\n\t\twindow.console.log(\"Unbalanced cost and quantity values\");\n\t\treturn;\n\t}\n\n\tlet total = 0;\n\n\tfor (let index = 0; index < costs.length; index++) {\n\t\tlet cost = costs[index].value;\n\t\tlet quantity = quantities[index].value;\n\t\tlet add = (cost * quantity);\n\n\t\tif (isNaN(add)) {\n\t\t\treturn;\n\t\t}\n\n\t\ttotal += add;\n\t}\n\n\t$(\"#labelCost\").text(total.toFixed(2));\n}", "title": "" }, { "docid": "b76a49331ec266592087c0d4a75ca2d5", "score": "0.69231623", "text": "function printProductPrice(product) {\n const subtotal = getTotal(product);\n const vat = getTotalVat(product);\n const total = subtotal + vat;\n\n console.log(\"Subtotal:\", subtotal + \"€\");\n console.log(\"IVA:\", vat + \"€\");\n console.log(\"Total:\", total + \"€\");\n}", "title": "" }, { "docid": "06410baafdc9b20ef30592ed8455fc10", "score": "0.6907285", "text": "function totalCost() {\n var total = (\n parseFloat(cost) +\n parseFloat(window.totalShippingCost) +\n parseFloat(window.tax)\n ).toFixed(2);\n\n document.getElementById(\"total\").innerHTML = `$ ${total}`;\n\n return true;\n }", "title": "" }, { "docid": "4c3425e7c1a0c0ab04e383fa1dad5cf5", "score": "0.6880619", "text": "countTotalCost() {\n const costs = [];\n\n this.ingredients.forEach((elem) => {\n costs.push(elem.summedCost);\n });\n\n const newCost = costs.reduce((prev, curr) => prev + curr, 0);\n this.totalCost = Number(newCost.toFixed(2));\n // console.log('TOTAL COST', this.totalCost);\n }", "title": "" }, { "docid": "0f471f1613992f17b410c9b03e2c9a23", "score": "0.68595684", "text": "function printCart() {\n cartList.innerHTML = ''; //resetting the inner HTML & total price\n this.totalPrice = 0;\n\n //loop and display user selection\n for (var i = 1; i < cartItems.length; i++) {\n var p = ' <h5 class=\"text-center\">';\n totalPrice += Number(cartItems[i].PRICE);\n p += cartItems[i].NAME + '- Price: €' + cartItems[i].PRICE + '</h5><hr>';\n cartList.innerHTML += p + '</div>';\n }\n var p2 = '<h5 class=\"text-center\" style=\"color: red\">'\n p2 += 'Total Price: €' + totalPrice + '</h5>';\n cartList.innerHTML += p2; //add this html to the cartList div\n}", "title": "" }, { "docid": "a79da8cf6ec05a66282f980aabf95ca2", "score": "0.68515915", "text": "function updateCartTotal() {\n const cartItemContainer = document.querySelector(\".cart-items\");\n const cartRows = cartItemContainer.querySelectorAll(\".cart-row\");\n let total = 0;\n\n for (let i = 0; i < cartRows.length; i++) {\n const cartRow = cartRows[i];\n const priceElement = cartRow.querySelector(\".cart-price\");\n const quantityElement = cartRow.querySelector(\".cart-quantity-input\");\n const price = parseFloat(priceElement.innerText.replace(\"$\", \"\"));\n const quantity = quantityElement.value;\n total = total + (price * quantity);\n }\n //Make the price show only two decimal places.\n total = Math.round(total * 100) / 100\n document.querySelector(\".cart-total-price\").innerText = \"$\" + total;\n}", "title": "" }, { "docid": "dfc1f778ec9615cbcf58f1aca1933d1c", "score": "0.68424994", "text": "function calcCart(){\n\n\t\tvar subTotal = 0;\n\t\tvar taxTotal = 0;\n\t\tvar cartTotal = 0;\n\t\tvar taxrate = 0.13;\n\n\t\tvar cartStuff = $(\"span.cart-list__item-price\");\n\t\t// As the length (or amount of) cart items keeps changing, we have a for loop to consider all of those items in the frequently updating cart when calculating our totals\n\t\tfor (i = 0; i < cartStuff.length; i++) { \n\n \t\tvar cartEntry = parseFloat(cartStuff.eq(i).text().replace(\"$\", \"\"));\n\n \t\tsubTotal += cartEntry;\n \t\t$(\".subtotal\").text(\"$\" + subTotal);\n \t\ttaxTotal = subTotal * 0.13;\n\t\t\t$(\".taxes\").text(\"$\" + taxTotal);\n\t\t\tcartTotal = subTotal + taxTotal;\n\t\t\t$(\".carttotal\").text(\"$\" + cartTotal);\n\n\t\t};\n\n\t\t// If the array of cart items has come to an end the default text should be set back to $0.00\n\t\tif(cartStuff.length < 1){\n\t\t\t$(\".subtotal\").text(\"$0.00\");\n\t\t\t$(\".taxes\").text(\"$0.00\");\n\t\t\t$(\".carttotal\").text(\"$0.00\");\n\t\t};\n\n\t}", "title": "" }, { "docid": "1869a4cfb7899c062cff2fd6993cbca2", "score": "0.683862", "text": "function calTotalPrice() {\n var totalprice = 0;\n angular.forEach($scope.cartItems,function(key){\n totalprice += key.quantity * key.price;\n });\n $scope.total = totalprice;\n }", "title": "" }, { "docid": "3937273efc0711eb1d88b42b86c72e6d", "score": "0.6836173", "text": "function showTotals(){\n\n const total = [];\n const menus = document.querySelectorAll('.cart-item-price');\n\n menus.forEach(function(item) {\n total.push(parseInt(item.textContent));\n });\n // console.log(total);\n\n const sommeT = total.reduce(function(total, item)\n {\ntotal += item;\nreturn total;\n }, 0);\n document.getElementById('cart-total').textContent = sommeT;\n document.querySelector('.item-total').textContent = sommeT;\n document.getElementById('item-count').textContent = total.length;\n\n}", "title": "" }, { "docid": "beea59f02557d0fb0865ff6fa6419cb7", "score": "0.68311584", "text": "function countTotalPrice(items) {\n let cartTotalPrice = 0;\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const price = item.product.price;\n const quantity = item.quantity;\n cartTotalPrice += price * quantity;\n }\n return cartTotalPrice;\n}", "title": "" }, { "docid": "cb0a90788edff6dc7964400ace975fe9", "score": "0.6830876", "text": "function quantity(shoppingCart) {\n var result = 0;\n shoppingCart.forEach(function (item){\n result += item.quantity;\n });\n return display('<h3> Overall quantity is ' + result + '</h3>');\n}", "title": "" }, { "docid": "a112b0afc4441f85b9c7704366d151b5", "score": "0.6826483", "text": "function updateTotal() {\n\t$('.totalCost').text('Total Cost: $' + totalCost)\n}", "title": "" }, { "docid": "5034814926ea57b62ef9f1af3e4ac614", "score": "0.67880464", "text": "function cost(groceries) {\nvar total=0; \n for (var i=0; i<groceries.length; i++)\n {\n total+= groceries[i].price* groceries[i].quantity;\n }\n return total;\n}", "title": "" }, { "docid": "15510b7b67f5ce784e463f00d83ad88a", "score": "0.6784968", "text": "function updateTotal() {\n cartTotal.innerHTML = cartSubtotal.innerHTML;\n }", "title": "" }, { "docid": "732ff57e67f31d94153a8f4504cddfc4", "score": "0.6784189", "text": "function SumTotalPrice() {\n let total = 0\n state.cart.map((item) => {\n console.log(80, \"X\", item.qty)\n const price = item.qty * 80\n console.log(total, \"+\", price);\n total = total + price;\n console.log(\"total = \", total);\n return total;\n })\n return total;\n }", "title": "" }, { "docid": "26faf5951c2d5eeb352e1711f9f61c4b", "score": "0.6783492", "text": "function totalSummaryUpdate() {\n // updates cart subtotal price\n let cartSubtotal = 0;\n for (i=0; i < cartCollection.length; i++) {\n let priceFloat = Number(cartCollection[i].price.replace(/[^0-9\\.-]+/g,\"\"))\n cartSubtotal = cartSubtotal + priceFloat\n }\n // formats the price and ensures it's 2 digits \n let subtotalDisplay = document.getElementsByClassName(\"subtotal green no-margins\")[0];\n subtotalDisplay.innerHTML = `Subtotal: $${cartSubtotal.toFixed(2)}`;\n\n // updates cart total item count\n let quantityTotal = 0\n for (i=0; i < cartCollection.length; i++) {\n quantityTotal = quantityTotal + cartCollection[i].quantity;\n }\n let quantityDisplay = document.getElementsByClassName(\"total-items\")[0];\n // formats grammer to show \"1 item\" vs. multiple \"items\"\n if (quantityTotal == 1) {\n quantityDisplay.innerHTML = `${quantityTotal} total item`;\n } else {\n quantityDisplay.innerHTML = `${quantityTotal} total items`;\n }\n \n\n}", "title": "" }, { "docid": "fe7de40590197c137cee2628011195c6", "score": "0.6778656", "text": "function displayTotals(){\n let totalsInfos = document.querySelectorAll(\"#eachTotal\");\n let totalArr = [];\n let displayTotal = 0;\n\n for (i = 0; i < cartItems.length; i++){\n totalArr.push(Number(totalsInfos[i].innerHTML));\n }\n let sum = totalArr.reduce((acc, val) => {\n return acc + val;\n });\n displayTotal = sum.toFixed(2);\n totalPrice.innerHTML = `\n <div id=\"#subTotal\"> SUBTOTAL: $${displayTotal}</div> \n <button>PROCEED TO CHECKOUT</button>\n `;\n}", "title": "" }, { "docid": "04ec98b8fad1696b48769d917cd843c0", "score": "0.6776767", "text": "function computeTotals(key) {\n const product = cart[key]\n const totalPricePerTeddy = getTotalPricePerTeddy(product.quantity, product.price)\n document.querySelector(`[data-key=\"${key}\"] td:last-child`).innerHTML = totalPricePerTeddy;\n document.querySelector(`#total`).innerHTML = getTotalCart();\n }", "title": "" }, { "docid": "40c0ed8105833ba9e56050f0874bcf31", "score": "0.67742914", "text": "function updateTotalPrice() {\r\n var totalPrice = document.getElementById(\"checkoutPrice\");\r\n\r\n var counterNum = 0;\r\n var i = 0;\r\n totalPrice.innerHTML = \"\";\r\n\r\n while (i < cart.itemsCart.length) {\r\n counterNum += cart.itemsCart[i].totalPrice;\r\n i++;\r\n }\r\n}", "title": "" }, { "docid": "63dbe8e2ad014f2816e75b5f0bca88db", "score": "0.6773708", "text": "function updateCartTotal() {\n let cartRows = document.getElementsByClassName('product-container')\n let total = 0\n for (let i = 0; i < cartRows.length; i++) {\n let cartRow = cartRows[i]\n let priceElement = cartRow.getElementsByClassName('price-1')[0]\n let price = parseInt(priceElement.innerText)\n total = total + price\n }\n document.getElementsByClassName('price-2')[0].innerText = total\n document.getElementsByClassName('price-3')[0].innerText = total\n}", "title": "" }, { "docid": "e14f99c2795978636d60a06330a331bb", "score": "0.6753691", "text": "function getItemCost(item, price){\n const itemCost = document.getElementById(item);\n itemCost.innerText = price;\n updateTotal()\n}", "title": "" }, { "docid": "f15654d1848da332d658a75fe570bf0a", "score": "0.6753088", "text": "function total (cart) {\n return parseFloat(totalPreTax(cart) * 1.13).toFixed(2).toString()\n}", "title": "" }, { "docid": "e15e29413502bf40bb9cffece8b5a4c0", "score": "0.6745386", "text": "function totalPriceCalc() {\n subtotal = 0;\n let total = 0;\n for (let i = 0; i < shoppingBasket.length; i++) {\n const card = shoppingBasket[i];\n subtotal += card[\"price\"] * card[\"amount\"];\n total = subtotal + 4.55;\n }\n document.getElementById(\"sumwithoutshipping\").innerHTML = `${subtotal.toFixed(\n 2\n )} € `;\n document.getElementById(\"sumwithshipping\").innerHTML = `${total.toFixed(\n 2\n )} €`;\n}", "title": "" }, { "docid": "175d43ced9af56e068f6ec7d453a976a", "score": "0.6742706", "text": "function calculateTotal() {\n const macPrice = getProductValue('mac');\n const memoryPrice = getProductValue('memory');\n const storagePrice = getProductValue('storage');\n const deliveryPrice = getProductValue('delivery');\n\n const totalPrice = macPrice + memoryPrice + storagePrice + deliveryPrice;\n\n document.getElementById('total-price').innerText = totalPrice;\n const totalID = document.getElementById('total');\n totalID.innerText = totalPrice;\n getDiscount(totalPrice);\n}", "title": "" }, { "docid": "01c1e93f24a30b70f3d9761b855ade29", "score": "0.6727659", "text": "function totalPrice() {\n var prices = [];\n\n cart.cart.forEach(function (item) {\n var cartIndex = cart.cart.indexOf(item);\n prices.push(item.price * cart.cartQty[cartIndex]);\n });\n\n return eval(prices.join('+'));\n }", "title": "" }, { "docid": "3c44e8ccb9e97ae4e7f2fb3acab5ff5d", "score": "0.67072886", "text": "function cartTotal(){\nlet cartContainer = document.getElementsByClassName('cart-items')[0]\nlet cartRow = cartContainer.getElementsByClassName('cart-row')\nlet total = 0\nfor(let i = 0; i < cartRow.length; i++){\n let row = cartRow[i]\n let priceItem = row.getElementsByClassName('cart-price')[0]\n let quantityItem = row.getElementsByClassName('cart-quantity-input')[0]\n let price = parseFloat(priceItem.innerText.replace('R', ''))\n let quantity = quantityItem.value\n total = Math.round(total + (price * quantity))\n}\ntotal = Math.round(total * 100) / 100\ndocument.getElementsByClassName('cart-total-price')[0].innerHTML = 'R' + total\n\n}", "title": "" }, { "docid": "f9ab63ba858815dc7a055c118c1da995", "score": "0.66768974", "text": "function totalCalculation() {\n\n\t// Select all columns from table\n\tconnection.query(\"SELECT * FROM products\", \n\n\t\tfunction(err, res) {\n\t\t\tif (err) throw err;\n\n\t\t\t// Set totalItems variable equal to the number of items\n\t\t\ttotalItems = parseInt(res.length);\n\n\t\t\t// Run function to display item list\n\t\t\tshowMeTheItems();\n\n\t\t});\n}", "title": "" }, { "docid": "5e88ee02b9766780957089807133bca4", "score": "0.66751087", "text": "function updateCartTotal(){\nvar cartItemContainer=document.getElementsByClassName('my_list')[0]\nvar cartRows= cartItemContainer.getElementsByClassName('cart_total') \nvar total=0\n for (var i = 0; i <cartRows.length; i++) {\n var cartRow = cartRows[i]\n var priceElement=cartRow.getElementsByClassName('cart_total_price')[0]\n var quantityElement=cartRow.getElementsByClassName ('shop_item_quantity_input')[0]\n var price = parseFloat(priceElement.innerText.replace('dt', ''))\n var quantity=quantityElement.value\n price=total*quantity\n // total = Math.round(total * 100) / 100 if the total has,999999999\n document.getElementsByClassName('cart_total_price')[0].innerText=total +'DT'\n }\n }", "title": "" }, { "docid": "514351f82428ef7ab7c5daa59d87416d", "score": "0.6674874", "text": "function calculateAllTotal(){\nconsole.log(cartDOMItems)\n\ncartDOMItems.forEach(inItemh => {\n // console.log(parseInt((inItemh.querySelector(\".product_price\").innerText).toEnglishDigit()));\n totalAllhh = totalAllhh+parseInt((inItemh.querySelector(\".product_price\").innerText).toEnglishDigit());\n document.querySelector(\".total__cost\").innerText =(totalAllhh.toString()).toPersinaDigit();\n //console.log(totalAllhh)\n});\n//return totalAllhh;\n}", "title": "" }, { "docid": "e09293d93a82fe878e9ab9e1250ca911", "score": "0.6653631", "text": "function orderTotal(){\n \n \n let finalAmount = totalPrice.reduce((a,b)=>{\n return a + b;\n });\n\n let finalDiscount = totalDiscount.reduce((a,b)=>{\n return a + b;\n });\n discount = finalDiscount - finalAmount\n items1.innerText = totoalItems.length;\n items2.innerText = totoalItems.length;\n total_discount.innerText = \"-$\" + discount;\n total_value.innerText = \"$\" + finalAmount;\n total_amount.innerText = \"$\" + finalAmount;\n\n}", "title": "" }, { "docid": "000a3f507f46e118b1851091442152bd", "score": "0.6649784", "text": "function sumUpCart() {\n var cartSum = 0;\n for (var i = 0; i < cart.length; i++) {\n cartSum += cart[i].itemPrice * cart[i].itemQuantity;\n }\n return cartSum;\n}", "title": "" }, { "docid": "b59bb8c6470a2fb413fa2c28f4d6391e", "score": "0.6633263", "text": "cartTotal(state, getters) {\n //este getter devuelve un valor en base a otros getters\n return getters.getProductsOnCart.reduce(\n (total, current) => total = total + current.price * current.quantity, 0\n );\n }", "title": "" }, { "docid": "95e6db25afa3177d1300733914590a57", "score": "0.662325", "text": "function showItems() {\n const qty = getQty()\n cartQty.innerHTML = `You have ${qty} items in your cart`\n // console.log(`You have ${qty} items in your cart`)\n\n let itemStr = ''\n for (let i = 0; i < cart.length; i += 1) {\n const {name, price, qty} = cart[i]\n itemStr += `<li> \n ${name} $${price} x ${qty} = $${(qty * price).toFixed(2)} \n <button class='remove' data-name=${name}>Remove</button>\n <button class='add-one' data-name=${name}> + </button>\n <button class='remove-one' data-name=${name}> - </button>\n <input class='update' type='number' data-name=${name}>\n </li>`\n // console.log(`${cart[i].name} ${cart[i].price} x ${cart[i].qty}`)\n }\n itemList.innerHTML = itemStr\n\n // to calculate the total amount needed in \n const total = getTotal()\n cartTotal.innerHTML = `Total in cart: $${total}`\n}", "title": "" }, { "docid": "97c293cbb4335fbc6c5427a201ef28f4", "score": "0.6622379", "text": "_getotal(items) {\n let total = 0;\n items.forEach((item) => {\n total += item.price * item.quantity;\n });\n\n return total;\n }", "title": "" }, { "docid": "024523a0b8ae663de339e12b6c7214ad", "score": "0.6622355", "text": "function updateSbTotal() {\n let shoppingBasket = document.getElementsByClassName(\"basket\")[0];\n let sbRows = shoppingBasket.getElementsByClassName(\"sb-row\");\n let total = 0;\n let totalItem = 0;\n for (let i = 0; i < sbRows.length; i++) {\n let sbRow = sbRows[i];\n let priceElement = sbRow.getElementsByClassName(\"sb-price\")[0];\n let qtyElement = sbRow.getElementsByClassName(\"sb-qty-input\")[0];\n console.log(priceElement, qtyElement);\n let price = parseFloat(priceElement.innerText.replace(\"£\", \"\"));\n console.log(price);\n let quantity = qtyElement.value;\n console.log(quantity);\n console.log(price * quantity);\n total = total + price * quantity;\n console.log(total.toFixed(2));\n }\n total = Math.round(total * 100) / 100;\n document.getElementsByClassName(\"total-price1\")[0].innerText =\n \"Total:£\" + total.toFixed(2);\n document.getElementsByClassName(\"total-price\")[0].innerText =\n \"£\" + total.toFixed(2);\n document.getElementsByClassName(\"things\")[0].innerText =\n quantityInputs.length;\n }", "title": "" }, { "docid": "09502c287af5ec184ccbdb718bfb0dfd", "score": "0.66200495", "text": "calculateTotals() {\n this.totals.price = this.allItems.reduce( (total, item) => \n { return total + item.priceFinal; }, 0); \n this.totals.price.toFixed(2);\n \n this.totals.quantity = this.allItems.reduce( (total, item) => \n { return total + item.quantity; }, 0);\n \n this.totals.discount = this.allItems.reduce( (total, item) =>\n { return total + item.discountAmount; }, 0);\n this.totals.discount.toFixed(2);\n\n this.totals.originalPrice = this.allItems.reduce( (total, item) =>\n { return total + item.price; }, 0);\n this.totals.originalPrice.toFixed(2);\n }", "title": "" }, { "docid": "6bec51995691b72122d8ee68f1b0b1ff", "score": "0.66121614", "text": "function updateShoppingCartTotal() {\n let total = 0;\n let cantidadT=0;\n const shoppingCartTotal = document.querySelector('.shoppingCartTotal');\n const shoppingCartCantTotal = document.querySelector('.shoppingCartCantTotal');\n const shoppingCartItems = document.querySelectorAll('.shoppingCartItem');\n shoppingCartItems.forEach(shoppingCartItem => {\n const shoppingCartItemPriceElement = shoppingCartItem.querySelector('.shoppingCartItemPrice');\n const shoppingCartItemPrice = Number(shoppingCartItemPriceElement.textContent.replace('€',''));\n const shoppingCartItemQuantityElement = shoppingCartItem.querySelector('.shoppingCartItemQuantity');\n const shoppingCartItemQuantity = Number(shoppingCartItemQuantityElement.value);\n cantidadT = cantidadT + shoppingCartItemQuantity;\n total = total + (shoppingCartItemPrice * shoppingCartItemQuantity);\n });\n\n shoppingCartTotal.innerHTML = `$${total.toFixed(2)}`;\n shoppingCartCantTotal.innerHTML = `${cantidadT}pz`;\n \n}", "title": "" }, { "docid": "6b1d07101ed99ff45e44875a3a786beb", "score": "0.6610788", "text": "function totalSum(params) {\n\t\t\tclient\n\t\t\t\t.click(selectors.cart)\n\t\t\t\t.pause(uploadTimeout)\n\t\t\t\t.getText(selectors.priceForAllItems, function (result) {\n\t\t\t\t\t// TODO: Where is variable price declared and is it even used?\n\t\t\t\t\tprice = result.value;\n\t\t\t\t\tconsole.log(result)\n\t\t\t\t})\n\t\t\t\t.pause(timeout);\n\t\t}", "title": "" }, { "docid": "90738dcc78b93159c19a64c94437ffcb", "score": "0.6610252", "text": "function calcAll() {\n //Grabbing only the product rows from DOM, and setting up cart total\n let productRows = document.getElementsByClassName(\"product\");\n let cartTotal = 0;\n\n //Looping through all rows from within shopping cart to update subtotals\n for (let i = 0; i < productRows.length; i++) {\n let currentProduct = productRows[i]; //Needed to loop one row at a time\n let productQuantitity = Number(currentProduct.querySelector(\".qty input\").value);\n let productPrice = Number(currentProduct.querySelector(\".pu span\").innerText);\n let currentSubtot = currentProduct.querySelector(\".subtot\");\n let updatedSubtot = productQuantitity * productPrice; currentSubtot.innerHTML = \"$\" + updatedSubtot.toFixed(2);\n\n //Tallying up total amount after iterating through each row\n cartTotal += Number(updatedSubtot.toFixed(2));\n };\n //Manipulating DOM to show final cart total to customer\n document.querySelector(\"h2 > span\").innerHTML = cartTotal;\n}", "title": "" }, { "docid": "57f236467d8d50f41cb27a73efbca406", "score": "0.6608223", "text": "function theme_commerce_cart_total(variables) {\n try {\n return '<h3 class=\"ui-bar ui-bar-a ui-corner-all\">Order Total: ' +\n variables.order.commerce_order_total_formatted +\n '</h3>';\n }\n catch (error) { console.log('theme_commerce_cart_total - ' + error); }\n}", "title": "" }, { "docid": "ad2bab5ef2c9b54c3a2d88209cb58c85", "score": "0.66077036", "text": "function cartTotalPrice() {\r\n var totalCount = 0;\r\n const totalPrice = document.querySelector('.total-price');\r\n const shoppingCartsongs = document.querySelectorAll('.shoppingCartsong');\r\n\r\n shoppingCartsongs.forEach((shoppingCartsong) => {\r\n\r\n const songCartPriceElement = shoppingCartsong.querySelector('.shoppingCartsongPrice');\r\n const songCartPrice = Number(songCartPriceElement.textContent.replace('$', ''));\r\n\r\n const songCartQuantityElement = shoppingCartsong.querySelector('.shoppingCartsongQuantity');\r\n const songCartQuantity = Number(songCartQuantityElement.value);\r\n\r\n totalCount += songCartPrice * songCartQuantity;\r\n });\r\n\r\n totalPrice.innerHTML = `$${totalCount.toFixed(2)}`;\r\n }", "title": "" }, { "docid": "e8511bacfaf86fd540080843fa356f76", "score": "0.6605195", "text": "function totalCost() {\n\tknexInstance\n\t\t.from('shopping_list')\n\t\t.select('category')\n\t\t.sum('price as total')\n\t\t.groupBy('category')\n\t\t.then(res => console.log(res));\n}", "title": "" }, { "docid": "e5b3249e2415d32dc647bb3afa8a085c", "score": "0.6604897", "text": "setCartValues(cart) {\n /**\n * @param tempTotal - The total for the amount of the items i.e. price * totalNumberOfItems\n * @param itemsTotal - The item total number being added in the cart\n */\n\n let tempTotal = 0;\n let itemsTotal = 0;\n\n cart.map((item) => {\n tempTotal += item.price * item.itemTotalCount;\n itemsTotal += item.itemTotalCount;\n });\n\n cartTotal.innerText = parseFloat(tempTotal.toFixed(2));\n cartItems.innerText = itemsTotal;\n\n // console.log(cartTotal, cartItems);\n }", "title": "" }, { "docid": "0c9e26808a38aff537ddb280185c0b40", "score": "0.6602991", "text": "function recalculateOrderTotal () {\n\n // init total\n let currentTotal = 0;\n\n // loop through each cart item\n $('.cart-contents').each( item => {\n\n const currentQty = Number($(`#${item}-product-qty`).val());\n const currentPrice = Number($(`#${item}-product-price`).val());\n const currentShipping = Number($(`#${item}-shipping-service`).find(':selected').attr('data-cost'));\n\n currentTotal = currentTotal + (currentQty * currentPrice) + currentShipping;\n\n });\n\n // display order total\n setOrderTotal(currentTotal);\n\n}", "title": "" }, { "docid": "a49d1995f13a2c1fde9741194208e8fb", "score": "0.660103", "text": "total() {\n return this.items.reduce(\n function(total, item) {\n return total + item.pricePerUnit*item.quantity\n }, 0 \n ) \n }", "title": "" }, { "docid": "fc5dc3a207f2969d3d7cb595fa9db1f1", "score": "0.65986663", "text": "function getTotal(price) {\r\n c.log(\"im in cart.js\");\r\n c.log(\"price is: \"+price);\r\n var totalInt = total + price;\r\n total = parseFloat(totalInt);\r\n c.log(\"total is of type: \"+typeof(total));\r\n var totalFixed = total.toFixed(2); \r\n return totalFixed;\r\n}", "title": "" }, { "docid": "7fb2ea8baa3bdbc3539e99e5e3ea6b2e", "score": "0.65966177", "text": "function addTotalPrice(){\n\n // Variable for cart from localStorage\n let cart = JSON.parse(localStorage.getItem(\"cart\"))\n\n // Variable for price\n let price = 0\n\n // Looping out all the products in the cart\n cart.forEach((product) => {\n\n // Adding the price of the product to the price variable\n price = price + (product.product.price * product.quantity)\n\n })\n\n // Rendering out the total price\n document.getElementsByClassName(\"cart-total-price\")[0].innerText = 'Total pris:' + price + ' kr'\n}", "title": "" }, { "docid": "366e9ae109d87dc2f5552ccb060f271f", "score": "0.6590227", "text": "function totalPrice(items) {\n return items.reduce((acc, item) => acc + item.quantity * item.price, 0.0)\n}", "title": "" }, { "docid": "23caadb23d97a2c77ec2afe83f6af10b", "score": "0.6588369", "text": "function calculateTotalPrice() {\n let totalPrice = calculatePrice();\n totalPrice *= itemQuantity.value;\n return totalPrice.toFixed(2);\n }", "title": "" }, { "docid": "d394b4039e288ffd61c2551ebedcfe1b", "score": "0.6584136", "text": "function showTotalPrice(){\n const prices=[];\n const items=document.querySelectorAll('.cart-item-price');\n items.forEach(function(item){\n // console.log(item.textContent)\n prices.push(parseInt(item.textContent));\n });\n //console.log(prices);\n const total = prices.reduce(function(prices,item){\n prices+=item;\n return prices\n },0);\n //console.log(total);\n document.getElementById('cart-total').textContent = total;\n\n}", "title": "" }, { "docid": "9874c0da21832667914dc42bb4ea43c4", "score": "0.65805227", "text": "function updateItemsAmount(){\r\n var cartItems = document.getElementsByClassName('cart-items')[0];\r\n var Items = cartItems.getElementsByClassName('item');\r\n var totalItems = 0;\r\n \r\n for (var i = 0; i < Items.length; i++){\r\n var Item = Items[i];\r\n\r\n var itemQuantity = Item.getElementsByClassName('item-quantity')[0];\r\n var quantityElement = itemQuantity.getElementsByClassName('quantity')[0]; \r\n var itemAmount = parseInt(quantityElement.innerText);\r\n\r\n totalItems += itemAmount\r\n }\r\n document.getElementsByClassName('cart-num')[0].innerText = totalItems; \r\n}", "title": "" }, { "docid": "7bf464070bf25a393082b292399dc321", "score": "0.6567539", "text": "cartTotalprice(state) {\n let shops = state.cart.cartdata.shops;\n let totalprice = 0;\n for (let i in shops) {\n let goods = shops[i].goods;\n for (let n in goods) {\n // return goods[n].price*goods[n].total_num;\n totalprice += goods[n].price * goods[n].total_num;\n }\n }\n // console.log(totalprice);\n return totalprice;\n }", "title": "" }, { "docid": "333b657b206a2be77f5a48b053bf60fc", "score": "0.656079", "text": "function updateCounters(items) {\n let countTotal = 0;\n let costTotal = 0;\n for (let i = 0; i < items.length; i++) {\n countTotal += items[i].quantity;\n costTotal += items[i].price * items[i].quantity;\n }\n setTotalItemCount(countTotal);\n setCartTotal(costTotal);\n }", "title": "" }, { "docid": "3a4a2b8879bad0a142ea9ae663e0c07b", "score": "0.65413857", "text": "get totalPrice() {\n return self.items.reduce((sum, entry) => sum + entry.price, 0);\n }", "title": "" }, { "docid": "7a2db6f88cd8857abbfb751d5eb55952", "score": "0.6533468", "text": "function shoppingTotal() {\r\n let tmpTotal=objectsTotal();\r\n if(tmpTotal <50) {\r\n total = tmpTotal + shipFees;\r\n }\r\n else {\r\n total = tmpTotal;\r\n }\r\n console.log(\"total it: \"+total);\r\n\r\n priceUpdate();\r\n console.log(\"total it2: \"+total);\r\n }", "title": "" }, { "docid": "62457951d2341121435d497d4ed87844", "score": "0.65326494", "text": "actualizarTotal() {\n const cartStorage = Storage.getCart();\n let total = 0;\n\t\t\n\t\tcartStorage.forEach((prod) => {\n\t\t\tlet precioItem = prod.precio;\n\t\t\tlet cantItem = prod.amount;\n\n\t\t\ttotal += precioItem * cantItem;\n\t\t});\n\t\tStorage.saveTotal(total);\n\t\tcartTotal.innerText = Number(Storage.getTotal());\n\t\t\n }", "title": "" } ]
23cdf8d675e3f4eefb3c5a850aaf84f6
This processes a JS string into a Cline array of numbers, 0terminated. For LLVMoriginating strings, see parser.js:parseLLVMString function
[ { "docid": "5f27649f1fefa8eefc532966c820694b", "score": "0.0", "text": "function intArrayFromString(stringy, dontAddNull) {\n var ret = [];\n var t;\n var i = 0;\n while (i < stringy.length) {\n var chr = stringy.charCodeAt(i);\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(chr);\n i = i + 1;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" } ]
[ { "docid": "6ad0f154c95d5d32d5dae2462d431a9c", "score": "0.5853943", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n }", "title": "" }, { "docid": "dc841e9dbf8b3116fa5579a34fd25d11", "score": "0.5807783", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n\tvar ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n\tif (length) {\n\t\tret.length = length;\n\t}\n\tif (!dontAddNull) {\n\t\tret.push(0);\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "bfea83cc47d2d02e2da6e2e6d3f4b891", "score": "0.57886624", "text": "function intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "f1ae330292e864cf53c6dcce28b224ad", "score": "0.5726074", "text": "function cpp2js(str) {\n const nullIndex = str.indexOf(\"\\0\");\n if (nullIndex === -1)\n return str;\n return str.substr(0, nullIndex);\n}", "title": "" }, { "docid": "444ae739cc45ac0155460336f5f69ae2", "score": "0.54913694", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "3606c524bbb3f8df46a3504137103eb8", "score": "0.5470447", "text": "function h$jsstringLines1(n, x) {\n ;\n var m = n, l = x.length;\n if(n >= l) return -1;\n while(m < l) {\n if(x.charCodeAt(m++) === 10) {\n // found newline\n if(n > 0 && n === l-1) return -1; // it was the last character\n var r1 = (m-n<=1) ? \"\" : x.substr(n,m-n-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n { h$ret1 = (x.substr(n)); return (m); };\n}", "title": "" }, { "docid": "1b94906b97a8ec8bca640d38e644179c", "score": "0.544447", "text": "function getCodePoints(string){\n var returnarray = [];\n for(i = 0; i < string.length; i++){\n returnarray.push(string.codePointAt(i));\n };\nreturn returnarray;\n}", "title": "" }, { "docid": "7bcfc4c3e35c7118011885ab235f7e33", "score": "0.5388248", "text": "function getCodePoints(string) {\n var newArray = [];\n for (i = 0; i < string.length; i++) {\n newArray.push(string.codePointAt(i));\n\n }\n return newArray;\n}", "title": "" }, { "docid": "e4f0d8c6194a402602105404b6cad94b", "score": "0.5372197", "text": "function parseCode() {\r\n const code = fs.readFileSync(\"d12/input.txt\", \"utf-8\");\r\n return code.split(\"\\r\\n\").map(line => parseLine(line));\r\n}", "title": "" }, { "docid": "fded10842e308a9686242b108799f647", "score": "0.5294758", "text": "function caml_lex_array(s) {\n s = caml_bytes_of_string(s);\n var l = s.length / 2;\n var a = new Array(l);\n for (var i = 0; i < l; i++)\n a[i] = (s.charCodeAt(2 * i) | (s.charCodeAt(2 * i + 1) << 8)) << 16 >> 16;\n return a;\n}", "title": "" }, { "docid": "1396ebe3ae153f377821ed0ed87e1326", "score": "0.5280481", "text": "function generateCodeArray(code) {\n var lines = code.split('\\n');\n return lines;\n}", "title": "" }, { "docid": "29d74f3dd8946769792ac3f8e60c32b3", "score": "0.52073467", "text": "function addLineNumbers(str) {\n return str.split('\\n').map((line, ndx) => `${ndx + 1}: ${line}`).join('\\n');\n}", "title": "" }, { "docid": "be2b27b4229c8f2dfa312adfbc510de2", "score": "0.5184662", "text": "function readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, (0,_blockString_mjs__WEBPACK_IMPORTED_MODULE_3__.dedentBlockStringValue)(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_2__.syntaxError)(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_2__.syntaxError)(source, position, 'Unterminated string.');\n}", "title": "" }, { "docid": "be2b27b4229c8f2dfa312adfbc510de2", "score": "0.5184662", "text": "function readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, (0,_blockString_mjs__WEBPACK_IMPORTED_MODULE_3__.dedentBlockStringValue)(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_2__.syntaxError)(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_2__.syntaxError)(source, position, 'Unterminated string.');\n}", "title": "" }, { "docid": "3a5c4abf88679a76d5af1fd96c33604e", "score": "0.5178142", "text": "function intArrayFromString(stringy) {\n var ret = [];\n var t;\n var i = 0;\n while (i < stringy.length) {\n ret.push(stringy.charCodeAt(i));\n i = i + 1;\n }\n ret.push(0);\n return ret;\n}", "title": "" }, { "docid": "3a5c4abf88679a76d5af1fd96c33604e", "score": "0.5178142", "text": "function intArrayFromString(stringy) {\n var ret = [];\n var t;\n var i = 0;\n while (i < stringy.length) {\n ret.push(stringy.charCodeAt(i));\n i = i + 1;\n }\n ret.push(0);\n return ret;\n}", "title": "" }, { "docid": "26f0db3065dc553ab0492523203f4bf9", "score": "0.5144469", "text": "function ripOutCode(str) {\n var blocks = [];\n var blockCount = 0;\n var parsedStr = str;\n var regex = /(script|style).*{/g;\n var match,\n block,\n substr,\n braceCounter;\n while (match = regex.exec(str)) {\n substr = str.substring(match.index + match[0].length, str.length);\n braceCounter = 1;\n block = \"\";\n for (var c in substr) {\n if (substr[c] == '{')\n braceCounter++;\n else if (substr[c] == '}')\n braceCounter--;\n if (braceCounter == 0)\n break;\n block += substr[c];\n }\n\n blocks[blockCount] = block;\n var tempStr = str.substring(0, match.index + match[0].length) + ' <%=' + blockCount++ + '=%> ' + str.substring(match.index + match[0].length + block.length, str.length);\n str = tempStr;\n\n }\n return [str, blocks];\n}", "title": "" }, { "docid": "f83f14269a7b77908010f902f23a5dc6", "score": "0.5119695", "text": "function main() {\n let S = readLine();\n S = parseInt(S);\n try {\n // this is a hacky way of doing this in javascript since it doesn't handle exceptions well. (not a hard typed lang)\n new Array(S);\n console.log(S);\n } catch(err) {\n console.log('Bad String');\n }\n}", "title": "" }, { "docid": "895a7b4de864dcbae8267afd33e3efe3", "score": "0.51139605", "text": "function caml_lex_array(s) {\n var l = s.length / 2;\n var a = new Array(l);\n // when s.charCodeAt(2 * i + 1 ) > 128 (0x80)\n // a[i] < 0 \n // for(var i = 0 ; i <= 0xffff; ++i) { if (i << 16 >> 16 !==i){console.log(i<<16>>16, 'vs',i)}}\n // \n for (var i = 0; i < l; i++)\n a[i] = (s.charCodeAt(2 * i) | (s.charCodeAt(2 * i + 1) << 8)) << 16 >> 16;\n return a;\n}", "title": "" }, { "docid": "895a7b4de864dcbae8267afd33e3efe3", "score": "0.51139605", "text": "function caml_lex_array(s) {\n var l = s.length / 2;\n var a = new Array(l);\n // when s.charCodeAt(2 * i + 1 ) > 128 (0x80)\n // a[i] < 0 \n // for(var i = 0 ; i <= 0xffff; ++i) { if (i << 16 >> 16 !==i){console.log(i<<16>>16, 'vs',i)}}\n // \n for (var i = 0; i < l; i++)\n a[i] = (s.charCodeAt(2 * i) | (s.charCodeAt(2 * i + 1) << 8)) << 16 >> 16;\n return a;\n}", "title": "" }, { "docid": "cdd18b67fee127c7a1b59b8b3f493458", "score": "0.51101947", "text": "function split_linebreaks(s){//return s.split(/\\x0d\\x0a|\\x0a/);\ns=s.replace(acorn.allLineBreaks,'\\n');var out=[],idx=s.indexOf(\"\\n\");while(idx!==-1){out.push(s.substring(0,idx));s=s.substring(idx+1);idx=s.indexOf(\"\\n\");}if(s.length){out.push(s);}return out;}", "title": "" }, { "docid": "a26e16c083ef91a40b0d39463556aa6a", "score": "0.5108659", "text": "function line(text) {\n return [0, text];\n}", "title": "" }, { "docid": "8b0214facabb8a843ea8eec1bb296e81", "score": "0.50915605", "text": "function readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n _tokenKind.TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n (0, _blockString.dedentBlockStringLines)(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw (0, _syntaxError.syntaxError)(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw (0, _syntaxError.syntaxError)(\n lexer.source,\n position,\n 'Unterminated string.',\n );\n}", "title": "" }, { "docid": "a2f25a23cc56665ff416b6d9f893b562", "score": "0.5072188", "text": "function calculateScriptPosition(code_string, offset) {\n let line = 1;\n let column = 0;\n let found_col = false;\n while (offset >= 0) {\n const ch = code_string.charAt(offset);\n --offset;\n if (ch === '\\n') {\n ++line;\n found_col = true;\n }\n if (!found_col) {\n if (ch !== '\\r') {\n ++column;\n }\n }\n }\n return { line, column };\n}", "title": "" }, { "docid": "7d2a582dff0aaa26d0ac0e72c75d1538", "score": "0.5062733", "text": "function caml_array_of_string (s) {\n if (s.t != 4 /* ARRAY */) caml_convert_string_to_array(s);\n return s.c;\n}", "title": "" }, { "docid": "3695a849d35dcf7c106f2ffea77150c9", "score": "0.49927506", "text": "parseLine(data) {\n\t\tfor (let i = 0; i < data.length; i++)\n\t\t{\n\t\t\t// 13: \\r, 10: \\n\n\t\t\tif (data[i] == 13 && data[i + 1] == 10)\n\t\t\t{\n\t\t\t\treturn {\n\t\t\t\t\tline: data.toString('utf8', 0, i),\n\t\t\t\t\trest: data.toString('utf8', i + 2),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {line: data.toString('utf8')}\n\t}", "title": "" }, { "docid": "1ad3c1e7465756b3ed31d8da7eace019", "score": "0.4982675", "text": "function getCode(js) {\n return js .\n replace(/^[^]*?\\/\\/===START\\n/, '') .\n replace(/\\/\\/===END[^]*/, '');\n}", "title": "" }, { "docid": "92644645efe531a302631a18787568e9", "score": "0.49742448", "text": "function lexics(s) {\n parsedString = s;\n var m = [];\n let i = 0, l = s.length, k = 0, p = 0; \n\n for(;;) {\n\twhile (i < l && s.charAt(i) == ' ') {\n\t\ti++;\n\t}\n\tif(i >= l) {\n\t\tif(p > 0) {\n\t\t\terror(\"Unclosed parenthesis: \" + s);\n\t\t}\n\t\treturn m;\n\t}\n\tvar el = { t:' ' , v: \"\", pos: i };\n\tlet c = s.substr(i, 1), nc = null;\n\tif(i < l - 1) \t\n\t\tnc = s.substr(i + 1, 1);\n\n\tif (c == \"(\") {\n\t\tel.t = 'L'; \n\t\tp++;\n\t\ti++;\n }\n\telse if(c == \")\") {\n\t\tel.t = 'R';\n\t\tif(p <= 0) {\n\t\t\terror(\"Unpaired parenthesis:\" + s);\n\t\t}\n\t\tp--;\n\t\ti++;\n\t}\n\telse if (isDigit(c) || c ==\"-\" && nc != null && isDigit(nc)) {\n\t\tlet n = i;\n\t\twhile(n < s.length) {\n\t\t\tlet nc = s.charAt(++n);\n\t\t\tif(nc < '0' || nc > '9')\n\t\t\t\tbreak;\n\t\t}\n\t\tel.v = s.substr(i, n - i);\n\t\tel.t = 'N';\n\t\ti = n;\n\t}\n\telse if (\"+-*/\".indexOf(c) >= 0) {\n\t\tel.t = 'O';\n\t\tel.v = c;\n\t\ti++;\n\t}\n\telse if (\"xyz\".indexOf(c) >= 0) {\n\t\tif(i < l - 1 && s.charAt(i + 1) >= 'A')\n\t\t\terror(\"Wrong variable name: \" + s.substr(i));\n\t\tel.t = 'V';\n\t\tel.v = c;\n\t\ti++;\n\t}\n\telse {\n\t\tlet j = i;\n\t\twhile (j < l && s.charAt(j) >= 'A') {\n\t\t\tj++;\n\t\t}\n\t\tif (j > i) {\n\t\t\tlet fc = s.substr(i, j-i);\n\t\t\tif (fc == \"sinh\" || fc == \"cosh\" || fc == \"negate\") {\n\t\t\t\tel.t = 'S';\n\t\t\t\tel.v = fc;\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (el.t == ' ') {\n\t\terror(\"Unrecognized symbol: \" + s.substr(i));\n\t}\n\tm[k++] = el;\n }\n}", "title": "" }, { "docid": "edb0c037181df28eb3c04d56443bcdc2", "score": "0.49595368", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''))\n}", "title": "" }, { "docid": "016ad7b3bcd3b4f533116decba514cc1", "score": "0.49591944", "text": "function intArrayFromString(stringy, dontAddNull) {\n var ret = [];\n var t;\n var i = 0;\n while (i < stringy.length) {\n var chr = stringy.charCodeAt(i);\n if (chr > 0xFF) {\n assert(false, 'Character code ' + chr + ' (' + stringy[i] + ') at offset ' + i + ' not in 0x00-0xFF.');\n chr &= 0xFF;\n }\n ret.push(chr);\n i = i + 1;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.4955845", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.4955845", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.4955845", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.4955845", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "4925b561626b7b47a1337fa27a81b5f9", "score": "0.49522653", "text": "function tokenizeScript(s) {\n var lines = parseLines(s);\n var tokenizedLines = [];\n for (var i = 0, len = lines.length; i < len; ++i) {\n var line = lines[i];\n try {\n var tokens = tokenizeLine(line.text);\n tokenizedLines.push(tokens);\n } catch (lineError) {\n throw lineError;\n throw new ParseError(line.number, lineError.message);\n }\n }\n return tokenizedLines;\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" }, { "docid": "d80569b914f6d0dde8f662231de43e50", "score": "0.49481145", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "title": "" } ]
91673deb0a2077eeeb87bcacb7781fb9
handle the messages read from the WebSocket
[ { "docid": "f357a48515f83fd090da9b03b67edec8", "score": "0.0", "text": "function handleMessage(message) {\n const chrome = this;\n // command response\n if (message.id) {\n const callback = chrome._callbacks[message.id];\n if (!callback) {\n return;\n }\n // interpret the lack of both 'error' and 'result' as success\n // (this may happen with node-inspector)\n if (message.error) {\n callback(true, message.error);\n } else {\n callback(false, message.result || {});\n }\n // unregister command response callback\n delete chrome._callbacks[message.id];\n // notify when there are no more pending commands\n if (Object.keys(chrome._callbacks).length === 0) {\n chrome.emit('ready');\n }\n }\n // event\n else if (message.method) {\n chrome.emit('event', message);\n chrome.emit(message.method, message.params);\n }\n}", "title": "" } ]
[ { "docid": "ab728da601844a259a179fa4dfd75c53", "score": "0.84527373", "text": "_handleWebSocketMessages() {\n this._ws.on('message', data => {\n const { type, payload } = JSON.parse(data)\n\n switch (type) {\n case 'RELOADED':\n if (this._isConnected) {\n this._onReloaded()\n } else {\n this._onConnected(payload)\n }\n break\n }\n })\n }", "title": "" }, { "docid": "c1a18a462668b152e2b491f6ba47d168", "score": "0.7555182", "text": "_onWebsocketMessage(event) {\n /* Strip and split the message into lines, discarding empty lines */\n let lines = event.data.trim().split(\"\\r\\n\").filter((l) => l.length > 0);\n /* Log the lines to the debug console */\n if (lines.length === 1) {\n Util.DebugOnly(`ws recv> \"${lines[0]}\"`);\n } else {\n for (let [i, l] of Object.entries(lines)) {\n let n = Number.parseInt(i) + 1;\n if (l.trim().length > 0) Util.DebugOnly(`ws recv/${n}> \"${l}\"`);\n }\n }\n /* Process each line */\n for (let line of lines) {\n this._onWebsocketLine(line);\n }\n }", "title": "" }, { "docid": "c0e54f62029251a96ab54e124437ec6e", "score": "0.72317433", "text": "function handleMessage() {\n\tws.onmessage = function(response){\n\t\tvar msg = JSON.parse(response.data);\n\t\tvar mtp = msg.type;\n\t\tconsole.log(msg);\n\t\tif (mtp === \"INIT\") {\n\t\t\thandleInit(msg);\n\t\t} else if (mtp === \"CCHECK\") {\n\t\t\thandleCostCheck(msg);\n\t\t} else if (mtp === \"TCHECK\") {\n\t\t\thandleTargetCheck(msg);\n\t\t} else if (mtp === \"ETRADE\") {\n\t\t\thandleEnergyTrade(msg);\n\t\t} else if (mtp === \"END\") {\n\t\t\thandleTurnEnd(msg);\n\t\t} else {\n\t\t\tif (msg !== \"WAITING FOR OPPONENTS\"){\n\t\t\t\tconsole.log(\"UNRECOGNIZED\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "953962cbb8d8572d4f7ea1d5c2073d05", "score": "0.7223525", "text": "run(){\n const ws = new WebSocket(this.webSocketUrl)\n ws.onerror = this.error\n ws.onmessage = (event) => {\n var data = JSON.parse(event.data)\n this.addToBuffer(data)\n }\n }", "title": "" }, { "docid": "427892d47ac0bc4b75ed8a5b755ccfca", "score": "0.69900805", "text": "on_message(msg) {\n let request;\n try {\n request = JSON.parse(msg);\n } catch (err) {\n throw new HttpBodyThrowable(400, `Couldn't parse JSON from your websocket frame`);\n }\n if (this.isActive) {\n this.reqQueue.push(request);\n } else {\n this.isActive = true;\n this.processRequest(request);\n }\n }", "title": "" }, { "docid": "5a56432d9a9c402bd9c0f4af9e099584", "score": "0.6938363", "text": "_webSocketManagerOnMessage(event) {\n let content;\n if (event.content) {\n content = JSON.parse(event.content);\n }\n if (content && this._clientId === content.clientId) {\n if (content.jsonRpcMsg.method === \"idleConnection\") {\n this._clearIdleRtcPeerConnection();\n } else if (content.jsonRpcMsg.method === \"quotaBreached\") {\n this._logger.log(\"Number of active sessions are more then allowed limit for the client \" + this._clientId);\n this._closeRTCPeerConnection();\n this._publishError(\"multiple_softphone_active_sessions\", \"Number of active sessions are more then allowed limit.\");\n }\n }\n }", "title": "" }, { "docid": "5955a816b258e5d87cf48097ebc76ea3", "score": "0.68817747", "text": "listenWS(ws) {\n setTimeout(() => {\n console.log('Data processed', this.dataProcessed + 1);\n this.continueWS = false;\n }, GAME_DURATION + 500);\n ws.onmessage = (event) => {\n if (this.continueWS) {\n try {\n const data = JSON.parse(event.data);\n this.processPlayerData(data);\n } catch (e) {}\n }\n };\n }", "title": "" }, { "docid": "3f9be66de0ef160330aebb72686c9605", "score": "0.68399394", "text": "function handleDataChannelMessage(event) {\n\thandleWspMessage(JSON.parse(event.data));\n}", "title": "" }, { "docid": "35887e40423db268468af90c44636d05", "score": "0.6809442", "text": "receive(e) {\n const data = JSON.parse(e.data);\n this.dispatch(receiveWebSocketEvent(data));\n }", "title": "" }, { "docid": "702cf0f1c0ffdd87804b6043c01d8a71", "score": "0.6773335", "text": "received(data) {\n // Called when there's incoming data on the websocket for this channel\n $('#messages').append(data['message']);\n const newMessageElement = document.querySelector(\".message:last-child\")\n styleMessageAccordingToCurrentUser(newMessageElement, currentUserId);\n scrollBottom();\n }", "title": "" }, { "docid": "c82363e70753ff5154c23482c53bb6a2", "score": "0.67609096", "text": "[SOCKET_ONMESSAGE] (state, message) {\n console.log(SOCKET_ONMESSAGE)\n state.socket.message = message\n state.socket.receive = JSON.parse(message.data)\n console.log(state.socket.receive)\n }", "title": "" }, { "docid": "c3c723a7254d81dd6da49a03103f4a46", "score": "0.67594594", "text": "parseMessage(message){\r\n\t\tmessage = JSON.parse(message);\r\n\t\tswitch(message.op){\r\n\t\t\tcase 'register':\r\n\t\t\t\tif(!message.args)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tfor(let arg of message.args){\r\n\t\t\t\t\tconsole.log(arg)\r\n\t\t\t\t\tif(arg == 'graphic'){\r\n\t\t\t\t\t\tthis._graphicCallback = ()=>{\r\n\t\t\t\t\t\t\tthis.websocket.send(JSON.stringify({\"type\":\"graphic\",data:graphic}));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgraphic.on('packet',this._graphicCallback);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(arg == 'physics'){\r\n\t\t\t\t\t\tconsole.log(\"physics subscribed\")\r\n\t\t\t\t\t\tthis._physicsCallback = ()=>{\r\n\t\t\t\t\t\t\tthis.websocket.send(JSON.stringify({\"type\":\"physics\",data:physics}));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconsole.log(this._physicsCallback)\r\n\t\t\t\t\t\tphysics.on('packet',this._physicsCallback)\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase 'unregister':\r\n\t\t\t\tif(!message.args)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tfor(let arg of message.args){\r\n\t\t\t\t\tif(arg == 'graphic'){\r\n\t\t\t\t\t\tgraphic.removeListener('packet',this._graphicCallback);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(arg == 'physics'){\r\n\t\t\t\t\t\tphysics.removeListener('packet',this._physicsCallback);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase 'getstaticdata':\r\n\t\t\t\tthis.websocket.send(JSON.stringify(staticdata));\r\n\t\t\tbreak\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7491eb5ab8bcf30fe51fe29666cb49d1", "score": "0.6716373", "text": "function handleMessage(message) {\n currentMsg = JSON.parse(message);\n allMsgs.push(currentMsg);\n switch (currentMsg.type) {\n //post messages are the messages posted on the chat.\n case \"postMessage\":\n currentMsg.id = uuidv4();\n currentMsg.type = \"incomingMessage\";\n broadcastMsg(currentMsg);\n break;\n //post notifications can be users connecting, disconnecting or changing their name. Changes the name on current client connected.\n case \"postNotification\":\n currentMsg.type = \"incomingNotification\";\n wss.clients.forEach(function(client) {\n if (client.userConnected.id == currentMsg.id) {\n updateUserList(client.userConnected.username, activeUsers.allUsers, currentMsg.username);\n client.userConnected.username = currentMsg.username;\n } else { console.log(\"Nothing changed!\") }\n });\n currentMsg.id = uuidv4();\n //sends the new users to update online users list with new names or removing old names.\n sendUsers(activeUsers);\n broadcastMsg(currentMsg);\n break;\n default:\n // show an error in the console if the message type is unknown\n throw new Error(\"Unknown event type \" + data.type);\n }\n}", "title": "" }, { "docid": "d255c4b8fff084e91603f91c87a3d78e", "score": "0.67000556", "text": "setOnMessageHandler(handler) {\n const bufferKey = 'buffer';\n let packets = [];\n this.webSocket.onmessage = (evt) => {\n let fileReader = createFileReader();\n let queueEntry = { buffer: null };\n packets.push(queueEntry);\n fileReader.onload = (e) => {\n let t = e.target;\n queueEntry[bufferKey] = t.result;\n if (packets[0] === queueEntry) {\n while (0 < packets.length && packets[0][bufferKey]) {\n handler(packets[0][bufferKey]);\n packets.splice(0, 1);\n }\n }\n };\n fileReader.readAsArrayBuffer(evt.data);\n };\n }", "title": "" }, { "docid": "c4b2dc0ef87a0b748009087ca21168ab", "score": "0.6687444", "text": "onMessage(message) {\r\n let rawMessage;\r\n let requestId;\r\n let statusCode;\r\n let statusMessage;\r\n console.log('web socket received message');\r\n try {\r\n const { data } = message;\r\n const rawMessageString = this.arrayBufferToString(data);\r\n rawMessage = JSON.parse(rawMessageString);\r\n requestId = rawMessage.requestId;\r\n statusCode = rawMessage.status.code;\r\n statusMessage = rawMessage.status.message;\r\n }\r\n catch (e) {\r\n console.warn('MalformedResponse', 'Received malformed response message');\r\n console.log(message);\r\n return;\r\n }\r\n const gremlinResponse = new GremlinQueryResponse();\r\n gremlinResponse.rawMessage = rawMessage;\r\n gremlinResponse.requestId = requestId;\r\n gremlinResponse.statusCode = statusCode;\r\n gremlinResponse.statusMessage = statusMessage;\r\n console.log('preparing to excecute callback for request');\r\n // If we didn't find a waiting query for this response, emit a warning\r\n if (!this._queries[requestId]) {\r\n console.warn('OrphanedResponse', `Received response for missing or closed request: ${requestId}, status: ${statusCode}, ${statusMessage}`);\r\n return;\r\n }\r\n const query = this._queries[requestId];\r\n switch (statusCode) {\r\n case 200:// SUCCESS\r\n delete this._queries[requestId]; // TODO: optimize performance\r\n query.onMessage(gremlinResponse);\r\n query.onMessage(null);\r\n break;\r\n case 204:// NO_CONTENT\r\n delete this._queries[requestId];\r\n query.onMessage(null);\r\n break;\r\n case 206:// PARTIAL_CONTENT\r\n query.onMessage(rawMessage);\r\n break;\r\n case 407:// AUTHENTICATE CHALLANGE\r\n const challengeResponse = this.buildChallengeResponse(query);\r\n this._queue.push(challengeResponse);\r\n this.executeQueue();\r\n break;\r\n default:\r\n delete this._queries[requestId];\r\n console.error(statusMessage + ' (Error ' + statusCode + ')');\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "9ba1ec711073607d77fb39eb3dc0c1ea", "score": "0.6646591", "text": "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = JSON.parse(message.data)\n }", "title": "" }, { "docid": "9a3b42d4d26542d424753aac4d6d2192", "score": "0.6642356", "text": "_listen() {\n this.socket.addEventListener('message', (message) => {\n let data\n try {\n data = JSON.parse(message.data)\n } catch (error) {\n console.error('error parsing json request -', error)\n return\n }\n\n this.responseReceived = true\n\n switch (responseType(data)) {\n case RESPONSE_TYPE.SUB_ACK:\n this._subHandler(data)\n break\n case RESPONSE_TYPE.DATA:\n this._dataHandler(data)\n break\n case RESPONSE_TYPE.UNSUB_ACK:\n this._unsubHandler(data)\n break\n default:\n }\n })\n }", "title": "" }, { "docid": "f5f3752ccda044c090a4fd3d18fd0847", "score": "0.6615065", "text": "componentDidMount() {\n this.socket = new WebSocket('ws://localhost:3001');\n\n this.socket.onmessage = (event) => {\n const eventObject = JSON.parse(event.data);\n\n switch (eventObject.type) {\n case 'clientUpdate':\n this.setState({ clientSize: eventObject.content });\n break;\n\n case 'incomingNotification':\n case 'incomingMessage':\n const newMessages = this.state.messages.concat(eventObject);\n this.setState({ messages: newMessages });\n break;\n\n default:\n console.log('Error receiving message from server. Unknown message type:', eventObject.type);\n break;\n }\n }\n }", "title": "" }, { "docid": "14fa47817ec49c7feeadfa38eae929b3", "score": "0.65707266", "text": "SOCKET_ONMESSAGE (state, message) {\n console.log(\">>>>>>message received: \" + message.data)\n }", "title": "" }, { "docid": "6cb6afb514f3ccea9b6d7635f55c4eff", "score": "0.65705866", "text": "function onWebSocketMessage(event) {\n const messageObject = JSON.parse(event.data);\n if (messageObject.messageType === 'answer') {\n rtcPeerConnection.setRemoteDescription(new RTCSessionDescription(messageObject.payload));\n } else if (messageObject.messageType === 'candidate') {\n rtcPeerConnection.addIceCandidate(new RTCIceCandidate(messageObject.payload));\n console.log(messageObject.payload)\n }\n}", "title": "" }, { "docid": "17b635be1567cb9df292c4c328491db2", "score": "0.6555653", "text": "messageHandler(event) {\n var jsonMessage = JSON.parse(event.data);\n switch (jsonMessage.Key){\n case \"Init\":\n console.log(\"[TripCo] Init Reply\");\n this.initiateWebPage(jsonMessage);\n break;\n case \"Contient\":\n this.updateCountry(jsonMessage);\n break;\n case \"Country\":\n break;\n case \"Search\":\n console.log(\"[TripCo] Search Reply\");\n this.updateBackData(jsonMessage);\n break;\n case \"ReadXML\":\n console.log(\"[TripCo] ReadXML Reply\");\n this.updateBackData(jsonMessage);\n this.updateSelectedData(this.state.back_data);\n break;\n case \"DownloadXML\":\n this.download(jsonMessage);\n break;\n case \"PlanTrip\":\n this.setItinerary(jsonMessage);\n this.setImage(jsonMessage);\n break;\n }\n }", "title": "" }, { "docid": "de356cd45c17983980098d2a9abd4584", "score": "0.65480256", "text": "_initSocketEventHandlers() {\n pullSocket.on('message', (msg) => {\n var responseStatsArray = JSON.parse(msg.toString());\n //this._logger.log(responseStatsArray);\n this._localDataCache = this._localDataCache.concat(responseStatsArray);\n });\n\n subSocket.on('message', (topic, message) => {\n\n var messagePayload = JSON.parse(message.toString());\n //this._logger.log(`Received a message related to:${topic.toString()}, containing message:${message.toString()}`);\n\n switch (messagePayload.type) {\n case ActionTypes.SORT:\n {\n this._sortHandler(messagePayload);\n break;\n }\n case ActionTypes.GET_MEDIAN:\n {\n this._getMedianHandler(messagePayload);\n break;\n }\n case ActionTypes.GET_LOWER_UPPER_COUNTS:\n {\n this._getLowerUpperCountsHandler(messagePayload);\n break;\n }\n case ActionTypes.GET_EXACT_MEDIAN:\n {\n this._getExactMedianHandler(messagePayload);\n break;\n }\n case ActionTypes.AVERAGE:\n {\n this._averageHandler(messagePayload);\n break;\n }\n case ActionTypes.LOG:\n {\n this._logger.log(this._localDataCache);\n break;\n }\n case ActionTypes.RESET:\n {\n this._localDataCache = [];\n break;\n }\n }\n }\n );\n }", "title": "" }, { "docid": "4eb19645e65b4b4cd1d080102fe8c940", "score": "0.65395796", "text": "function onMessage(message) {\n\tmessage = JSON.parse(message.utf8Data);\n\n\tstoreUsername(this, message);\n\n\tconsole.log(\"Websocket: message: \" + this.remoteAddress + \": \" + message.type);\n\n\t// Try to find the message handler for this message type\n\tif (message.type in messageHandler) {\n\t\tmessageHandler[message.type](message, this);\n\t} else {\n\t\tconsole.log(\"Websocket: unknown payload type: \" + this.remoteAddress + \": \" + message.type);\n\t}\n}", "title": "" }, { "docid": "e10260900eb7557b09b12940f8581924", "score": "0.6537585", "text": "function onMessage(evt) {\n\tconsole.log(\"INFO: Message received\");\n\tvar received_msg = JSON.parse(evt.data);\n\tswitch(received_msg.code) {\n\t\tcase \"MESSAGE\":\n\t\t\tconsole.log(\"MESSAGE WITH CODE 0 RECEIVED\");\n\t\t\taddMsgToHistory(received_msg.user + \"> \" + received_msg.message);\n\t\t\tbreak;\n\t\tcase \"REFRESH\":\n\t\t\tconsole.log(\"MESSAGE WITH CODE 1 RECEIVED\");\n\t\t\t$(\"#hidden-refresh\").click();\n\t\t\tbreak;\n\t\tcase \"CLOSE\":\n\t\t\tconsole.log(\"MESSAGE WITH CODE 2 RECEIVED\");\n\t\t\t$(\"#hidden-refresh\").click();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"RECEIVED MESSAGE WITH UNKOWN CODE\");\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "2c83c613a2ff59b5511549a25304cf9c", "score": "0.65036994", "text": "function receiveMessage (event) {\n\t\t/*if(event.origin.indexOf('officedepot.com') < 0){\n\t\t\treturn;\n\t\t}*/\n\t\ttry {\n\t\t\tlet msgParsed = JSON.parse(event.data),\n\t\t\t\tpayload = JSON.stringify(msgParsed);\n\n\t\t\t//msgParsed.method = msgParsed.method.slice(0, -2);\n\n\t\t\tif (typeof wsClient[msgParsed.method] === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\t\tcatch(e) {\n\t\t\twsClient[msgParsed.method].apply(wsClient, [msgParsed]);\n\t\t\tconsole.error('Payload JSON is malformed');\n\t\t\tconsole.dir(e);\n\t\t}\n\t}", "title": "" }, { "docid": "87d263555262424d39e6e38756398dc0", "score": "0.6472916", "text": "constructor(props) {\n super(props);\n const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n\n var ws = io('localhost:4748', {jsonp: false});\n ws.binaryType = 'arraybuffer';\n\n ws.on('connect', function(socket) {\n console.log('connection');\n });\n\n ws.on('data', (e) => {\n // a message was received\n const data = e.data;\n console.log('message was received', data);\n\n try {\n const serverMessage = ServerMessageBuilder.ServerMessage.decode(data);\n console.log('serverMessage: ' + serverMessage);\n var view = new Uint8Array(data);\n var str = \"\";\n for(var i = 0; i < view.length; i++)\n {\n str += String.fromCharCode(view[i]);\n }\n console.log(str);\n\n switch (serverMessage.messageType) {\n case ServerMessageBuilder.ServerMessage.MessageType.RESPONSE:\n var response = serverMessage.response;\n var cmdId = response.cmdId;\n console.log('TODO RESPONSE');\n case ServerMessageBuilder.ServerMessage.MessageType.SESSION_EVENT:\n // TODO\n console.log('TODO SESSION_EVENT');\n break;\n case ServerMessageBuilder.ServerMessage.MessageType.GAME_EVENT_CONTAINER:\n // TODO\n console.log('TODO GAME_EVENT_CONTAINER');\n break;\n case ServerMessageBuilder.ServerMessage.MessageType.ROOM_EVENT:\n // TODO\n console.log('TODO ROOM_EVENT');\n break;\n }\n } catch (err) {\n console.log(\"Processing failed:\", err);\n var view = new Uint8Array(data);\n var str = \"\";\n for(var i = 0; i < view.length; i++)\n {\n str += String.fromCharCode(view[i]);\n }\n console.log(str);\n return;\n }\n });\n\n ws.on('error', (e) => {\n // an error occurred\n console.log(e.message);\n });\n\n ws.on('disconnect', (e) => {\n // connection closed\n console.log(e.code, e.reason);\n });\n\n const CommandLogin = CommandsBuilder.Command_Login;\n const commandLogin = new CommandLogin({\n 'user_name': 'totototo',\n 'password': 'toto',\n 'clientid': 'toto',\n 'clientver': 'mobclient-0.2 (2016-08-03)',\n 'clientfeatures': [\n 'client_id',\n 'client_ver',\n 'feature_set',\n 'room_chat_history',\n 'client_warnings'\n ]\n });\n\n const SessionCommand = CommandsBuilder.SessionCommand;\n const sessionCommand = new SessionCommand({\n '.Command_Login.ext': commandLogin\n });\n\n const CommandContainer = CommandsBuilder.CommandContainer;\n const commandContainer = new CommandContainer({\n 'sessionCommand': sessionCommand,\n 'cmd_id': 1\n });\n\n const encodedBuffer = commandContainer.encode();\n //const buffer = encodedBuffer.toBuffer();\n //const base64str = commandContainer.toBase64();\n\n // const result = client.write(encodedBuffer.view);\n ws.emit('data', encodedBuffer.toBuffer());\n //client.write(base64str);\n\n this.state = {\n dataSource: ds.cloneWithRows([\n 'John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin'\n ])\n };\n }", "title": "" }, { "docid": "0978bce350a58b5396f62f06f4b139dd", "score": "0.6457673", "text": "componentDidMount() {\n this.socket = new WebSocket('ws://localhost:3001')\n\n this.socket.onopen = () =>{\n console.log('server connected')\n }\n //listens for messages from server and set state dependending on the type of message sent back\n\n this.socket.addEventListener('message', (event) => {\n console.log('message recieved...')\n let message = JSON.parse(event.data)\n if(message.type === \"counter\"){\n console.log(message.data)\n this.setState({counter:message.data}) \n } else {\n this.setState({messages: [...this.state.messages, message] });\n }\n });\n\n }", "title": "" }, { "docid": "c3e5bee4cc76f6fd1fa46501470a40b6", "score": "0.6456541", "text": "async onWebsocketMessage({ data }) {\n this.logger.debug(`received a message on the WebSocket: ${data}`);\n // parse message into slack event\n let event;\n try {\n event = JSON.parse(data);\n }\n catch (parseError) {\n // prevent application from crashing on a bad message, but log an error to bring attention\n this.logger.error(`unable to parse incoming websocket message: ${parseError.message}`);\n return;\n }\n // internal event handlers\n if (event.type === 'hello') {\n this.stateMachine.handle('server hello');\n return;\n }\n // open second websocket connection in preparation for the existing websocket disconnecting\n if (event.type === 'disconnect' && event.reason === 'warning') {\n this.logger.debug('disconnect warning, creating second connection');\n this.stateMachine.handle('server disconnect warning');\n return;\n }\n // close primary websocket in favor of secondary websocket, assign secondary to primary\n if (event.type === 'disconnect' && event.reason === 'refresh_requested') {\n this.logger.debug('disconnect refresh requested, closing old websocket');\n this.stateMachine.handle('server disconnect old socket');\n // TODO: instead of using this event to reassign secondaryWebsocket to this.websocket,\n // use the websocket close event\n return;\n }\n // Define Ack\n const ack = async (response) => {\n this.logger.debug('calling ack', event.type);\n await this.send(event.envelope_id, response);\n };\n // for events_api messages, expose the type of the event\n if (event.type === 'events_api') {\n this.emit(event.payload.event.type, { ack, body: event.payload, event: event.payload.event });\n }\n else {\n // emit just ack and body for all other types of messages\n this.emit(event.type, { ack, body: event.payload });\n }\n // emitter for all slack events\n // used in tools like bolt-js\n this.emit('slack_event', { ack, type: event.type, body: event.payload });\n }", "title": "" }, { "docid": "40b31296adf8eff61182c6e65f2a2180", "score": "0.6436699", "text": "SOCKET_ONMESSAGE (state, message) {\n console.debug('socket', message)\n\n // https://github.com/alexbosworth/ln-service/blob/master/lightning/subscribe_to_transactions.js\n if (message.address || message.tokens) {\n refreshBalance(this)\n refreshInvoices(this)\n refreshPayments(this)\n }\n\n // https://github.com/alexbosworth/ln-service/blob/master/lightning/subscribe_to_graph.js\n if (message.public_key && message.updated_at) {\n refreshPeers(this)\n }\n\n // https://github.com/alexbosworth/ln-service/blob/master/lightning/subscribe_to_channels.js\n if (message.transaction_id || message.partner_public_key) {\n refreshChannels(this)\n }\n }", "title": "" }, { "docid": "b121157e74e12dfc10cd84aab2e078a7", "score": "0.6426046", "text": "function handleDataChannelOpen(){\n\twebSocket.send(JSON.stringify(['bye',{code: 101, description: 'Transferred'}]));\n\ttransferred = true;\n}", "title": "" }, { "docid": "832bb1230da5db01e2bb5c8099b546c9", "score": "0.6413589", "text": "msg_handler(message){\n let msg = message.content.data;\n if(msg.type == \"ERROR\"){this.createNotification(msg.body,'error')}\n if(msg.type == \"POSTERIOR\"){this.updateNodes(msg.body,'info')}\n if(msg.type == \"LOAD_GRAPH\"){this.load_graph(msg.body,'info')}\n }", "title": "" }, { "docid": "081a8d2d2705106214227dc9a1e682d3", "score": "0.6411396", "text": "onmessage() {\n log(`w->r@${clientId}`, 'Unexpected handler of message.');\n }", "title": "" }, { "docid": "63e90f4a75a7d25df91aadb613e1d319", "score": "0.6392855", "text": "onMessage() {\n \n const frames = Array.from(arguments)\n\n assert(frames.length >= 3)\n\n const empty = frames[0].toString()\n const header = frames[1].toString()\n\n assert(empty === '')\n assert(header === MDP.WORKER || header === MDP.CLIENT)\n\n this.liveness = this.heartbeatLiveness\n\n if (header === MDP.WORKER) this.processMessageAsWorker(frames)\n\n // this is a response from another worker\n if (header === MDP.CLIENT) this.processMessageAsClient(frames)\n\n }", "title": "" }, { "docid": "46280aa553e0e200a29b9095675c8a66", "score": "0.63874406", "text": "function onConnection(ws) {\n console.log(\"Handle connection start\");\n // listen on message \n ws.on(connectStatus.DISCONNECT, onDisconnect);\n ws.on(connectStatus.MESSAGE, onMessage);\n ws.on(connectStatus.IDENT, onIdentify);\n ws.on(connectStatus.GET_USER_LIST, onGetUserList)\n\n //identify the user\n function onIdentify(userID) {\n // TÌm trong mảng user nếu user đã tồn tại \n let user = users[userID];\n if (user) {\n // nếu user có tồn tại thêm kết nối (socket) vào mảng tài khoản đó ???\n user.push(ws);\n } else {\n // nếu chưa có user theo userid thì thêm mới với userID đó\n // Một user có thể có nhiều kết nối vậy nên gán theo mảng = [ws] chứ không phải = ws\n users[userID] = [ws];\n }\n\n // kiểm tra user đã có trên server chưa \n let userinfo = userlist[userID];\n if (!userinfo) {\n userlist[userID] = userID;\n }\n\n // không hiểu đoạn ws.id được định nghĩa ở đâu\n userByConnection[ws.id] = userID;\n reportNewUser(userID);\n }\n\n function onGetUserList(userid) {\n console.log(`get user list for ${userid}`);\n let userconnections = users[userid];\n console.log(`Danh sách user hiện tại`, userlist);\n // loại thằng hiện tại ra khỏi danh sách user cần gửi\n let newlist = getPassDownUserList(userid);\n\n console.log(`Danh sách user đưa xuống cho ${userid}`, newlist);\n\n if (userconnections) {\n userconnections.forEach(x => {\n x.emit(connectStatus.GET_USER_LIST, newlist);\n });\n }\n }\n\n\n\n // handle disconnection\n function onDisconnect() {\n console.log(\"Disconnect handle start\");\n // xóa các connection của user hiện tại \n // lấy user iD từ mảng userbyConnection chứa userID theo mã của connection ? Có còn cách nào nhanh hơn không , tại sao lại phải lấy từ đây ????\n // Có thể do không lấy được từ user đã đăng xuất AKA đóng mẹ nó cửa sổ đang kết nối nên mới phải làm cách này, khổ vl\n let userid = userByConnection[ws.id]\n if (userid) {\n // Xóa trong mảng userByConnection đã\n delete userByConnection[ws.id];\n let userConnections = users[userid];\n if (userConnections) {\n //console.log(\"Kết nối của user :\",userConnections);\n // vì 1 user có nhiều kết nối nên phải kiểm tra để xóa đúng kết nối đã disconnect\n if (userConnections.length > 1) {\n userConnections.forEach((userConnection, index) => {\n if (userConnection.id === ws.id) {\n userConnections.splice(index, 1);\n }\n });\n console.log(`User ${userid} vẫn còn ${userConnections.length} kết nối `);\n } else {\n // Xóa trong danh sách user (trong danh sách này mỗi thằng chỉ có 1 đối tượng)\n delete userlist[userid];\n // Thông báo có user vừa disconect và update lại danh sách các user online cho thằng khác\n updateUserList(userid);\n ws.broadcast.emit(connectStatus.BROADCAST, `user ${userid} disconnected`);\n delete users[userid];\n }\n }\n }\n\n console.log(\"Disconnected\");\n // Remove listeners\n ws.removeListener(connectStatus.message, onMessage);\n ws.removeListener(connectStatus.IDENT, onIdentify);\n ws.removeListener(connectStatus.DISCONNECT, onDisconnect);\n }\n\n //handle message receive\n function onMessage(message) {\n console.log(\"Nhận tin nhắn từ \",message.to);\n receiverConnections = users[message.to]; // Mảng này chứa kết nối chứ không chứa thông tin user\n \n if (receiverConnections) {\n console.log('Receiver ' + message.to + ' is online on this server');\n \n receiverConnections.forEach(connection => {\n console.log(\"emitting receiver\");\n connection.emit(connectStatus.MESSAGE, message);\n });\n \n } else {\n console.log('Receiver ' + message.to + ' is not online ')\n }\n\n // Vì một user có thể có nhiều kết nối nên phải update lại tất cả các kết nối của user cũng hiển thị tin nhắn \n senderConnections = users[message.from];\n if (senderConnections) { \n console.log(`Sender ${message.from} có ${senderConnections.length} kết nối`);\n console.log(\"emitting sender\");\n senderConnections.forEach(connection => {\n connection.emit(connectStatus.MESSAGE, message);\n });\n }\n }\n // Thông báo user mới connect với server\n function reportNewUser(userID) {\n // Báo cáo cho mấy thằng user là có thắng mới connect\n ws.broadcast.emit(connectStatus.BROADCAST, userID + ' Connected to server');\n updateUserList();\n\n // Hiển thị lại thông tin của thắng hiện vừa connect xem nó có mấy connection \n let userConnections = users[userID];\n console.log(`User ${userID} có ${userConnections.length} kết nối`);\n }\n}", "title": "" }, { "docid": "6a70e7e80218daca69b389b817a39575", "score": "0.63863134", "text": "function handleReceivingMessages()\n{\n // continue if the process is completed\n if (xmlHttpGetMessages.readyState == 4)\n {\n // continue only if HTTP status is \"OK\"\n if (xmlHttpGetMessages.status == 200)\n {\n try\n {\n // process the server's response\n readMessages();\n }\n catch(e)\n {\n // display the error message\n displayError(e.toString());\n }\n }\n else\n {\n // display the error message\n displayError(xmlHttpGetMessages.statusText);\n }\n }\n}", "title": "" }, { "docid": "84571fee7aec51851083e3a8c9bd9876", "score": "0.6380934", "text": "constructor(webSocketServerUrl) {\n super();\n\n const me = this;\n\n me.ws = new WS(webSocketServerUrl);\n\n me.ws.addEventListener(`open`, () => {\n process.nextTick(() => me.emit(`open`));\n debug(`Connected to ${webSocketServerUrl}`);\n });\n\n me.ws.addEventListener(`close`, () => {\n process.nextTick(() => me.emit(`close`));\n debug(`Connection has been closed`);\n });\n\n me.ws.addEventListener(`error`, (error) => {\n me.emit(`error`, error);\n debug(`Proxy client error: ${error}`);\n });\n\n me.ws.addEventListener(`ping`, (pingData) => {\n me.emit(`ping`, pingData);\n debug(`Ping from WebSocket server`);\n });\n\n me.ws.addEventListener(`message`, (event) => {\n try {\n let messages = JSON.parse(event.data);\n\n messages = messages.length ? messages : [messages];\n\n messages.forEach((message) => {\n const normalizedMessage = Message.normalize(message);\n\n me.emit(`message`, normalizedMessage);\n\n if (message.id) {\n me.emit(message.id, normalizedMessage);\n }\n });\n } catch (error) {\n debug(`Error on incoming message: ${error}`);\n }\n });\n }", "title": "" }, { "docid": "949d65df80a93acb13415b3cce96ef0b", "score": "0.6369984", "text": "function handleMessagesToApi() {\n var tmpRec = JSON.parse(toApiDiv.innerText);\n log(\"Received message from Content Script: \" + tmpRec.type);\n toApiDiv.innerText = \"\";\n switch (tmpRec.type) {\n case PORT_HEADLESS_GET_DUMP_ACK:\n var callback = getDumpCallbacks.shift();\n if (callback) { \n callback(tmpRec.data);\n }\n break;\n case PORT_HEADLESS_SEND_DUMP_ACK:\n var callback = sendDumpCallbacks.shift();\n if (callback) { \n callback(tmpRec.success);\n }\n break;\n case PORT_HEADLESS_MONITORING_ON_ACK:\n var monitoringOnCallback = monitoringOnCallbacks.shift();\n if (tmpRec.options && tmpRec.options.reload) {\n window.location.href = tmpRec.options.reload;\n } else {\n if (monitoringOnCallback) {\n monitoringOnCallback();\n } else {\n log(\"Expected monitoringOnCallback and got null instead.\")\n }\n }\n break;\n case PORT_HEADLESS_MONITORING_OFF_ACK:\n var monitoringOffCallback = monitoringOffCallbacks.shift();\n if (monitoringOffCallback) {\n monitoringOffCallback();\n } else {\n log(\"Expected monitoringOffCallback and got null instead.\")\n }\n break;\n default:\n // Unhandled message\n }\n}", "title": "" }, { "docid": "be97e2954f9b55d5b348c277c4d73c59", "score": "0.6363888", "text": "function handleIncomingMsg(evt) {\n\t\tvar received_msg = evt.data;\n\t\tvar json = $.parseJSON(evt.data);\n\t\tvar msg_array = [];\n\t\t$(json).each(function(i, val) {;\n\t\t\t$.each(val, function(k, v) {\n\t\t\t\tmsg_array.push(v);\n\t\t\t});\n\t\t});\n\t\t// Don't care about these...\n\t\tcounter++;\n\t\twriteToChat(\"<i>\" + msg_array[0] + \"</i> : <span id='x\" + counter + \"'>\" +\n\t\t\tmsg_array[1] + \"</span>\");\n\t\tif (counter % 3 == 0) {\n\t\t\t$(\"#x\" + counter).html(subtleMessages());\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(\"#x\" + counter).html(msg_array[1]);\n\t\t\t}, 300);\n\t\t}\n\t}", "title": "" }, { "docid": "6dbef2800fed0f2f79767e9cd0f577bb", "score": "0.6357833", "text": "onMessage(f) {\n this.sock.onmessage = (e) => {\n const obj = JSON.parse(e.data);\n console.log(obj.type);\n f(e.data);\n };\n }", "title": "" }, { "docid": "ce070f64e641dad523ab30cc3381407d", "score": "0.63561565", "text": "receiveMessage() {\n this.socket.on('add-message-response', (data) => {\n this.eventEmitter.emit('add-message-response', data);\n });\n }", "title": "" }, { "docid": "0a641d33feba7fa7b186231e6c7a8f76", "score": "0.6349735", "text": "_onMessage(topicUint8Array, messageUint8Array) {\n const topic = topicUint8Array.toString();\n let message\n if (messageUint8Array.length > 0) {\n message = JSON.parse(messageUint8Array.toString());\n } else {\n message = undefined;\n }\n \n if (this._watches.has(topic)) {\n const subscription = this._watches.get(topic);\n subscription.lastValue = message;\n for (const callback of subscription.callbacks) {\n callback(topic, message);\n }\n }\n }", "title": "" }, { "docid": "57c9c35ba2a978c72528d33405b32df7", "score": "0.63425654", "text": "function processMessage(event) \n {\n //Extract the message.\n var message = event; \n \n //Try to parse JSON message. Because we know that the server always returns\n //JSON this should work without any problem but we should make sure that\n //the massage is not chunked or otherwise damaged.\n try \n {\n var json = JSON.parse(message);\n } \n catch (exception) \n {\n console.log(\"This doesn't look like a valid JSON: \", message);\n return;\n }\n \n //NOTE: If you're not sure about the JSON structure\n //check the server source code above.\n if (json.msg === 'chat_message') \n { //It's a single message.\n \n //Let the user write another message.\n input.removeAttr('disabled');\n \n //Add a message.\n addMessage(json.data, new Date());\n \n slideScrollbar();\n } else \n {\n console.log(\"Hmm..., I've never seen JSON like this: \", json);\n }\n }", "title": "" }, { "docid": "3396e65c74fb75d2eb8c781b49668115", "score": "0.6331647", "text": "function receive(event){\n var data = JSON.parse(event.data);\n if (data.action == \"close\"){\n console.log(\"Closing connection.\");\n } else if (data.action == \"message\"){\n print(data.value);\n };\n}", "title": "" }, { "docid": "e1dd0055f1893cc932e5470c58006fc4", "score": "0.6321679", "text": "incomingMessage(e) {\n\n const msg = JSON.parse(e.data);\n\n // console.log(\"INCOMING MESSAGE:\");\n // console.dir(msg);\n\n const handler = this.messageHandlers[msg.type] || this.newMessage;\n handler.bind(this)(msg);\n\n }", "title": "" }, { "docid": "93b17f1149119ac49df960223dae6b18", "score": "0.6313789", "text": "function onMessage(event) {\n \n var messageFromServer = JSON.parse(event.data);\n \n if(messageFromServer.action === \"someOneIsTyping\") {\n processSomeOneIsTyping(messageFromServer);\n }\n \n if (messageFromServer.action === \"receiveMessage\") { \n processReceivedMsg(messageFromServer);\n }\n \n if(messageFromServer.action === \"recieveNewUser\") {\n processNewAddedUser(messageFromServer);\n }\n \n if(messageFromServer.action === \"showFailedToAddUserMsg\") {\n processFailedToAddUser(messageFromServer);\n }\n \n if(messageFromServer.action === \"userDeleted\") {\n processRemovedUser(messageFromServer);\n }\n \n if(messageFromServer.action === \"appendSentMessage\") {\n //var messageText = messageFromServer.messageText;\n appendMessage(messageFromServer);\n }\n \n if (messageFromServer[0].action === \"processSenders\") { \n var receivedArrOfSenders = []\n receivedArrOfSenders = messageFromServer;\n processReceivedSenders(receivedArrOfSenders);\n }\n \n}", "title": "" }, { "docid": "2db53b224315c1ff2be6980d4868e341", "score": "0.6307149", "text": "function messageHandler(e) {\n wsServer.clients.forEach((client) => {\n if (client.readyState === client.OPEN) {\n try {\n client.send(e);\n } catch (err) {\n log.error(err);\n }\n }\n });\n}", "title": "" }, { "docid": "a32f3fb7e22eb5ac115dd4fe73a7a66c", "score": "0.6300071", "text": "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n\n case 'play' :\n onPlay();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n \n case 'pause':\n onPause();\n break;\n \n case 'finish':\n onFinish();\n break;\n }\n }", "title": "" }, { "docid": "c89ea55d7cd36a5e794c831e62cdf475", "score": "0.6299485", "text": "componentDidMount() {\n this.socket = new WebSocket('ws://localhost:3001');\n this.socket.onmessage = (event) => {\n const data = JSON.parse(event.data);\n console.log(\"counter\", data)\n if (Number.isInteger(data)) {\n this.setState({\n counter: data\n })\n } else {\n this.setState({\n messages: [...this.state.messages, data]\n })\n }\n this.setState({\n loading: false\n })\n }\n }", "title": "" }, { "docid": "4cafaaccc6fb40414ac47b1b60ccf570", "score": "0.62903774", "text": "function handleConnection (ws) {\n let search = ws.upgradeReq.url.replace(/[\\/\\?]+/g, '');\n let query = querystring.parse(search);\n let userInfo = userModel.getInfoByToken(query.token);\n ws.info = userInfo;\n\n let len = wss.clients.length;\n ws.send({\n type : 'text',\n info : 'ok',\n content : `Welcome! No.${len} player.`\n });\n broadcast(wss, {\n type : 'text',\n info : 'ok',\n content : `${userInfo.nickname} join the game!`\n });\n\n bindClientMsg(ws);\n bindClientClose(ws);\n}", "title": "" }, { "docid": "f5f6fd075005237d4cf5ab53a2e9351f", "score": "0.627674", "text": "handleSocketMessage(payload) {\n if (!payload) {\n return;\n }\n\n //console.log(\"from Socket.IO server\", payload);\n\n switch (payload.type) {\n case (_socketIOEvents.CONNECT):\n this.handleConnect(payload.id);\n return;\n case (_socketIOEvents.JOIN_ROOM):\n this.handleJoinNewlyCreatedRoom(payload.payload.roomID);\n return;\n case (_socketIOEvents.GAME_START):\n this.handleGameStart(payload.payload);\n return;\n case (_socketIOEvents.GAME_ABORT):\n this.handleGameAbort(payload);\n return;\n case (_socketIOEvents.SEND_PLAYER_DETAILS):\n this.handleUpdatedPlayerDetails(payload.payload);\n return;\n case (_socketIOEvents.SEND_QUESTION):\n this.handleReceivedQuestion(payload.payload);\n return;\n case (_socketIOEvents.OPPONENT_ANSWERED):\n this.handleOpponentAnswered(payload.payload);\n return;\n case (_socketIOEvents.SYSTEM_MESSAGE):\n _appView.notify(payload.payload, payload.type, 'success');\n return;\n case (_socketIOEvents.BROADCAST):\n case (_socketIOEvents.MESSAGE):\n _appView.notify(payload.payload, payload.type, 'warning');\n return;\n case (_socketIOEvents.USER_DISCONNECTED):\n return;\n default:\n console.warn(\"Unhandled SocketIO message type\", payload);\n return;\n }\n }", "title": "" }, { "docid": "2a017af36e0e6c5cce306e9323f55a29", "score": "0.62729806", "text": "function handleMessage(msg) {\n // Emit received event so it can be handled elsewhere\n self.emit(name + ':received', msg.content.toString());\n }", "title": "" }, { "docid": "9b10e58d8a72889f0f2985152d82e34c", "score": "0.62641233", "text": "messageHandler(socket) {\r\n socket.on('message', message => {\r\n const data = JSON.parse(message); // transforms stringified json into a javascript object within the data variable\r\n //console.log('data', data); // confirms we are getting the data\r\n\r\n// CREATE A SWITCH CASE TO HANDLE THE DIFFERENT TYPES OF INCOMING MESSAGES\r\n switch(data.type) {\r\n case MESSAGE_TYPES.chain:\r\n this.blockchain.replaceChain(data.chain); // replaces the existing chain with the newest version\r\n break;\r\n case MESSAGE_TYPES.transaction:\r\n this.transactionPool.updateOrAddTransaction(data.transaction); // adds or updates a transaction to the pool\r\n break;\r\n case MESSAGE_TYPES.clear_transactions:\r\n this.transactionPool.clear();\r\n break;\r\n }\r\n \r\n // this.blockchain.replaceChain(data); // this replaces a socket's chain with the updated version - quieted when we addded the switch case\r\n });\r\n }", "title": "" }, { "docid": "8651890d69d17a46dab6f1b417e5d9a0", "score": "0.62557673", "text": "function firstHandler(data){if(called||self.readyState===WebSocket.CLOSED)return;called=true;socket.removeListener('data',firstHandler);ultron.on('data',realHandler);if(upgradeHead&&upgradeHead.length>0){realHandler(upgradeHead);upgradeHead=null;}if(data)realHandler(data);}// subsequent packets are pushed straight to the receiver", "title": "" }, { "docid": "8f4515a25980cb4792872438f4b1796e", "score": "0.6248391", "text": "_readMessage () {\n const message = this.messages.parseBuffer( this.dataBuffer );\n if ( message ) {\n this.emit( message.command, message );\n this._readMessage();\n }\n }", "title": "" }, { "docid": "5cf088b854563f5d43c34b8e3ed392c7", "score": "0.6237629", "text": "onMessage( msg ) {\n\n const data = JSON.parse( msg );\n const {id} = data;\n\n if(!id) {\n return;\n }\n\n if( id in this._on ) {\n this._on[ id ].forEach( fn => fn( data ) );\n }\n\n if( id in this._once ) {\n this._once[ id ].forEach( fn => fn( data ) );\n delete this._once[ id ];\n }\n }", "title": "" }, { "docid": "b0d598c81595c282fba7f3e2bb67617e", "score": "0.6237574", "text": "receivePacket(ws, message) {\n let packet = new Packet()\n packet.initWithArrayBuffer(new Uint8Array(message).buffer)\n const protocolId = packet.getUint32()\n // const packetId = packet.getUint32();\n this.dispatchers.forEach((dispatcher) => {\n if (\n protocolId == dispatcher.protocolId ||\n 0 == dispatcher.protocolId // all.Dispatcher\n )\n dispatcher.dispatch(this, ws, packet, this.handlers)\n })\n }", "title": "" }, { "docid": "5cd69b81167a32384e89595630786abb", "score": "0.62342125", "text": "function parseMessage(message, ws) {\n switch (message.type) {\n case \"directMessage\":\n sendDirectMessage(message.message);\n break;\n case \"registerClient\":\n registerClient(message, ws);\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "4a62f88dc06a86f0fe8ef13b4a5f17d0", "score": "0.6220327", "text": "function onMessage(event) {\n var receivedMessage = JSON.parse(event.data);\n console.log(event.data);\n if(receivedMessage.action === \"login\") {\n window.location.replace(\"main.jsp\");\n }\n else if(receivedMessage.action === \"usernames\") {\n loggedUsers = receivedMessage.data;\n getUsers(receivedMessage.data);\n $(\".activeUsers\").each(function() {\n fillActiveUsers($(this).attr(\"id\").substr(12));\n });\n } \n else if(receivedMessage.action === \"heartbeat\") {\n console.log(receivedMessage.data);\n }\n else if(receivedMessage.action === \"newChat\") {\n var receivedMessage = JSON.parse(event.data);\n openChat(receivedMessage);\n }\n else if(receivedMessage.action === \"sendMessage\") {\n var receivedMessage = JSON.parse(event.data);\n writeMessage(receivedMessage.data[0], receivedMessage.data[1], receivedMessage.data[2] );\n }\n else if(receivedMessage.action === \"removeChatUser\") {\n $(\"#groupchatlist-\" + receivedMessage.data[1] + \" #\" + receivedMessage.data[0] + \"-\" + receivedMessage.data[1]).remove();\n writeLeftRoomMsg(receivedMessage);\n fillActiveUsers(receivedMessage.data[1]); \n }\n else if(receivedMessage.action === \"addChatUser\") {\n writeJoinRoomMsg(receivedMessage);\n $(\"#groupchatlist-\" + receivedMessage.data[1]).append(\"<span><strong id=\" + receivedMessage.data[0] + \"-\" + receivedMessage.data[1] + \" style='color:#017D5A;'>\" + receivedMessage.data[0] + \"<br></strong></span>\"); \n fillActiveUsers(receivedMessage.data[1]);\n }\n}", "title": "" }, { "docid": "0dfb784971e68ac6e160138335d468f1", "score": "0.62170994", "text": "handleMessage(msg) {\n if (typeof msg === 'object') {\n console.log(\"Whiteboard object received\")\n this.setState({\n whiteboardJSON: msg,\n receivedJson: true,\n ready: true,\n })\n } else {\n this.setState({\n joinMsg: msg,\n })\n }\n }", "title": "" }, { "docid": "053b0b586abc123521a7740a27b2a38a", "score": "0.6186757", "text": "acceptIncomingMessage(){\r\n\r\n\r\n }", "title": "" }, { "docid": "b3c06a88ef22280d49c442be4b9bb0a6", "score": "0.61864245", "text": "function processMessage(msg) {\r\n // WebAPI.ServerMsg.decode()function is used to translate ArrayBuffer{} to\r\n // readable Message{} which contains information_report, logon_result,\r\n // market_data_subscription_status, real_time_market_data and so on\r\n var sMsg = WebAPI.ServerMsg.decode(msg);\r\n // console.log(sMsg);// uncomment to see the whole ServerMsg\r\n if (sMsg.logon_result)\r\n processLogonResult(sMsg.logon_result);// see function below\r\n}", "title": "" }, { "docid": "967dd30f3d0b36b1bdc5acdccb770f03", "score": "0.61851835", "text": "function handleMsgFromServer(content){\t\t\n\t\tif (content.body === webSockGoodbye){\n\t\t\tglobalWriteConsoleLog(\"server force disconnect\");\n\t\t\tdisconnectWebSocket();\n\t\t\t//redirect to invalidsession\n\t\t\twindow.open(\"/xFace/error/invalidsession\",\"_self\");\n\t\t}else if (content.body !== webSockAccept){\n\t\t\tvar landingPageInfo = JSON.parse(content.body);\n\t\t\tshowLandingPageInfo(landingPageInfo);\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "fb117bdfe6d0d95c54ebaadfc9321c00", "score": "0.6184649", "text": "handleWebsocketMsg(wsData) {\n if (wsData.type === 'wallet:address_history') {\n this.onNewTx(wsData);\n }\n }", "title": "" }, { "docid": "4e520b82641c6dd97b1d812b666da3b5", "score": "0.6183007", "text": "function onMessageArrived(message) {\n console.log(\n \"MQTT message recieved: \" + \"\\\"\" + message.payloadString + \"\\\"\" +\n \" MQTT topic: \" + \"\\\"\" + message.destinationName + \"\\\"\" +\n \" QoS: \" + \"\\\"\" + message.qos + \"\\\"\" +\n \" Retained: \" + \"\\\"\" + message.retained + \"\\\"\");\n\n if (message.destinationName.includes(\"/disconnect\")) {\n var jmessage = JSON.parse(message.payloadString);\n delete_room(jmessage.id);\n }\n if (message.destinationName.includes(\"/thermostat/temperature\")) {\n var jmessage = JSON.parse(message.payloadString);\n\n for(var i = 0; i < room_list.length; i++){\n if (jmessage.id === room_list[i].get_ID()){\n room_list[i].set_temperature(jmessage.unit.celsius);\n return;\n }\n }\n }\n if (message.destinationName.includes(\"/switch/state\")) {\n var jmessage = JSON.parse(message.payloadString);\n\n for(var i = 0; i < room_list.length; i++){\n if (jmessage.id === room_list[i].get_ID()){\n room_list[i].set_button_status(jmessage.state);\n return;\n }\n }\n }\n if (message.destinationName.includes(\"/ping/\")) {\n var jmessage = JSON.parse(message.payloadString);\n\n for(var i = 0; i < room_list.length; i++){\n if (jmessage.id === room_list[i].get_ID()){\n return;\n }\n }\n\n add_room(jmessage.id);\n }\n}", "title": "" }, { "docid": "3d85070ae685d4e6061889067eee00f3", "score": "0.6182182", "text": "componentDidMount() {\n var socket = new WebSocket(\"ws://localhost:3001\");\n socket.addEventListener('open', function (evt) {\n this.setState({socket : socket});\n this.state.socket.onmessage = evt => {\n const newMessage = JSON.parse(evt.data);\n this.setState({messages: this.state.messages.concat([newMessage])});\n\n if (newMessage.type === \"userConnected\") {\n if (!this.state.color) {\n this.setState({color: newMessage.content.color});\n }\n this.setState({totalUsers: newMessage.content.totalUsers});\n } else if (newMessage.type === \"postMessage\" || newMessage.type === \"incomingMessage\") {\n this.setState({\n totalUsers : newMessage.content.totalUsers,\n });\n } else if (newMessage.type === \"userDisconnected\") {\n this.setState({totalUsers: newMessage.content.totalUsers});\n }\n };\n }.bind(this));\n }", "title": "" }, { "docid": "54599abc0aa56ceb85c4360bbb0a4fdf", "score": "0.6179174", "text": "_onMessage(channel, rawMessage) {\n channel = channel.toString()\n debug('received raw message %o on channel %s', rawMessage.toString(), channel)\n\n if (rawMessage !== undefined) {\n let message = rawMessage\n\n if (!channel.match('__stream')) {\n try {\n message = this.encoder.unpack(message)\n } catch (err) {\n debug('received message with bad format on channel %s', channel)\n console.log(err)\n }\n }\n\n if (this._subscriptions[channel]) {\n for (let cb of this._subscriptions[channel]) {\n cb(channel, message)\n }\n }\n\n this.emit('message', channel, message)\n } else {\n debug('received null message on channel %s', channel)\n }\n }", "title": "" }, { "docid": "aaa2d2b89746963268642664cfb39e42", "score": "0.61789477", "text": "function handleMessage (message) {\n winston.debug('[STRATUM] recv: %j', message);\n\n // check the method.\n switch (message.method) {\n case 'mining.subscribe': // subscription request\n // handleSubscribe(message);\n break;\n case 'mining.extranonce.subscribe':\n // handleExtraNonceSubscribe(message)\n break;\n case 'mining.authorize': // authorization request\n // handleAuthorize(message)\n break;\n case 'mining.submit': // share submission\n _this.lastActivity = Date.now(); // update the activity for the client.\n // handleSubmit(message)\n break;\n case 'mining.get_transactions':\n // handleGetTransactions(message)\n break;\n case 'mining.capabilities':\n // handleCapabilities(message)\n break;\n case 'mining.suggest_target':\n // handleSuggestTarget(message)\n break;\n default:\n _this.emit('stratum.error', message);\n // errorReply(message.id, errors.stratum.METHOD_NOT_FOUND)\n break;\n }\n }", "title": "" }, { "docid": "125d9dd2cd48479cb7715ec2170a475e", "score": "0.6176541", "text": "received(data) {\n // Called when there's incoming data on the websocket for this channel\n $(\"[data-is='chat']\").val(data.message + '\\n');\n }", "title": "" }, { "docid": "b48b3c24c7fb6da611c10a9d5e20807b", "score": "0.6159247", "text": "createWebSocket() {\n var wsProtocol = 'wss://'\n if (location.protocol == 'http:') {\n wsProtocol = 'ws://'\n }\n var wsUserURL = wsProtocol + location.hostname + ':' + location.port + '/wsUser'\n console.log(wsUserURL)\n var webSocket = new WebSocket(wsUserURL);\n webSocket.onopen = (openEvent) => {\n this.setState({connected: true})\n console.log(\"WebSocket OPEN: \");\n this.requestDefaultConfig();\n this.requestDataPoints();\n this.requestRunStatus();\n };\n webSocket.onclose = (closeEvent) => {\n this.setState({connected: false})\n this.setState({dataConn: 0})\n this.setState({subjectConn: 0})\n console.log(\"WebSocket CLOSE: \");\n };\n webSocket.onerror = (errorEvent) => {\n this.setState({error: JSON.stringify(errorEvent, null, 4)})\n console.log(\"WebSocket ERROR: \" + JSON.stringify(errorEvent, null, 4));\n };\n webSocket.onmessage = (messageEvent) => {\n // Handle requests from WebDisplayInterface\n var wsMsg = messageEvent.data;\n var request = JSON.parse(wsMsg)\n // reset error message\n // this.setState({error: ''})\n var cmd = request['cmd']\n // message handler functions are prepended with 'on_'\n var cmd_handler = 'on_' + cmd\n if (this[cmd_handler]) {\n this[cmd_handler](request)\n } else {\n var errStr = \"Unknown message type: \" + cmd\n console.log(errStr)\n this.setState({error: errStr})\n }\n };\n this.webSocket = webSocket\n }", "title": "" }, { "docid": "709d43c18e17776f25b54374341b674c", "score": "0.6152465", "text": "function messageHandler(messageJson) {\n\n var type = messageJson.Type;\n var data = messageJson.Data;\n var user = messageJson.User;\n var userID = messageJson.SessionID;\n \n switch ( type ) {\n\n // Chat message received\n case \"ChatMessage\" :\n {\n if ( userID && !ongoingChatText[userID] ) {\n ongoingChatText[userID] = \"\";\n }\n\n if ( chatRecipientUserID && !ongoingChatText[chatRecipientUserID] ) {\n ongoingChatText[chatRecipientUserID] = \"\";\n }\n\n if ( chatRecipientUserID && (ourUserID === userID) ) {\n ongoingChatText[chatRecipientUserID] += styleMessage(user, data);\n }\n else {\n ongoingChatText[userID] += styleMessage(user, data);\n\n if ( userIsOnline(userID) ) {\n chatMessageReceivedHilight(userID);\n }\n }\n\n if ( (chatRecipientUserID === userID) || (ourUserID === userID) ) {\n appendToChat(user, data);\n }\n break;\n }\n\n case \"MessageReceivedAck\" :\n {\n clearChatUserHilight(userID);\n\n if ( chatRecipientUserID === userID ) {\n chatUserHilight(userID);\n }\n break;\n }\n\n case \"Unread\" :\n {\n chatMessageReceivedHilight(userID);\n break;\n }\n\n // Add/remove user name from list as they go on/off line\n case \"UserStateChange\" :\n {\n // Determine the type of state change\n switch ( data ) {\n\n case \"PopulateUserList\" :\n {\n if ( !( $( \"#\" + userID ).length ) ) {\n addUserToList(user, userID);\n }\n showUserOnlineIcon(userID);\n break;\n }\n\n case \"UserOnline\" :\n {\n // Add user if they are not alread listed\n if ( !( $( \"#\" + userID ).length ) ) {\n addUserToList(user, userID);\n }\n showUserOnlineIcon(userID);\n\n if ( chatRecipientUserID === userID ) {\n enableMessageControls(true);\n }\n\n break;\n }\n\n case \"UserOffline\" :\n {\n if ( !ongoingChatText[userID] ) {\n removeUserFromList(userID);\n }\n else {\n hideUserOnlineIcon(userID);\n }\n\n if ( chatRecipientUserID === userID ) {\n enableMessageControls(false);\n\n $( \"#chattingWith\" ).html(\"Nobody\");\n }\n\n break;\n }\n\n case \"HistoryWithUser\" :\n {\n if ( !( $( \"#\" + userID ).length ) ) {\n addUserToList(user, userID);\n }\n break;\n }\n\n }\n break;\n }\n\n case \"UserID\" :\n {\n ourUserID = userID;\n break;\n }\n\n default :\n {\n appendToChat(\"Invalid Received Data\");\n break;\n }\n\n }\n\n}", "title": "" }, { "docid": "536e4edb41011180fa02dae9ef550855", "score": "0.61514753", "text": "static handleMessage(event)\n\t{\n\t\t// Attempt to parse the response and extract the code.\n\t\t// Then, switch on the code and dispatch the message to the appropriate\n\t\t// message handler.\n\t\tlet response = JSON.parse(event.data);\n\t\tlet responseMessage = WSMessage.parseMessage(response);\n\n\t\tlet handler = responseHandlers[responseMessage.code];\n\t\tif( typeof handler === \"function\" )\n\t\t{\n\t\t\thandler(responseMessage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Error(`Message handler for opcode ${responseMessage.code} is not a function. Type: ${typeof handler}`);\n\t\t}\n\t}", "title": "" }, { "docid": "59c55723db30001e04e9d77918af219e", "score": "0.61457497", "text": "function onMessage(message) {\n //console.log(\"message received\");\n //console.log(\"onMessageArrived:\"+message.payloadString);\n message = JSON.parse(message.payloadString);\n if(message.id == clientId){\n if(message.state){\n state=message.state;\n }\n }\n }", "title": "" }, { "docid": "aa36872d7eb346226862b3424d2369b2", "score": "0.6143012", "text": "_onRead(msg) {\n\n let _this = this;\n\n let reply = {\n type: 'response',\n from: msg.to,\n to: msg.from,\n id: msg.id\n }\n log.info('[SyncherManager.onRead] new message', msg);\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('resource')) {\n _this._dataObjectsStorage.sync(msg.body.resource, true).then((dataObject)=>{\n reply.body = {\n code: 200,\n value: dataObject\n };\n\n log.info('[SyncherManager.onRead] found object: ', dataObject);\n\n _this._bus.postMessage(reply);\n }, (error)=>{\n reply.body = {\n code: 404,\n desc: error\n };\n\n log.warn('[SyncherManager.onRead] warning: ', error);\n\n _this._bus.postMessage(reply);\n\n });\n\n } else {\n reply.body = {\n code: 400,\n desc: 'missing body or body resource mandatory fields'\n };\n\n log.error('[SyncherManager.onRead] error. Missing body or body resource mandatory fields', msg);\n\n _this._bus.postMessage(reply);\n\n\n }\n\n }", "title": "" }, { "docid": "02eec4bc9b0beefbbff68829a12ee32b", "score": "0.6127238", "text": "run (callback) {\n while (true) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.fin = (buffer[0] & 0x80) !== 0\n this.#info.opcode = buffer[0] & 0x0F\n\n // If we receive a fragmented message, we use the type of the first\n // frame to parse the full message as binary/text, when it's terminated\n this.#info.originalOpcode ??= this.#info.opcode\n\n this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION\n\n if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n return\n }\n\n const payloadLength = buffer[1] & 0x7F\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (this.#info.fragmented && payloadLength > 125) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n return\n } else if (\n (this.#info.opcode === opcodes.PING ||\n this.#info.opcode === opcodes.PONG ||\n this.#info.opcode === opcodes.CLOSE) &&\n payloadLength > 125\n ) {\n // Control frames can have a payload length of 125 bytes MAX\n failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')\n return\n } else if (this.#info.opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n return\n }\n\n const body = this.consume(payloadLength)\n\n this.#info.closeInfo = this.parseCloseBody(false, body)\n\n if (!this.ws[kSentClose]) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n const body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n const closeFrame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(\n closeFrame.createFrame(opcodes.CLOSE),\n (err) => {\n if (!err) {\n this.ws[kSentClose] = true\n }\n }\n )\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.ws[kReadyState] = states.CLOSING\n this.ws[kReceivedClose] = true\n\n this.end()\n\n return\n } else if (this.#info.opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n const body = this.consume(payloadLength)\n\n if (!this.ws[kReceivedClose]) {\n const frame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body\n })\n }\n }\n\n this.#state = parserStates.INFO\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n } else if (this.#info.opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n\n const body = this.consume(payloadLength)\n\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body\n })\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n\n // 2^31 is the maxinimum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper > 2 ** 31 - 1) {\n failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n return\n }\n\n const lower = buffer.readUInt32BE(4)\n\n this.#info.payloadLength = (upper << 8) + lower\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n // If there is still more data in this chunk that needs to be read\n return callback()\n } else if (this.#byteOffset >= this.#info.payloadLength) {\n // If the server sent multiple frames in a single chunk\n\n const body = this.consume(this.#info.payloadLength)\n\n this.#fragments.push(body)\n\n // If the frame is unfragmented, or a fragmented frame was terminated,\n // a message was received\n if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {\n const fullMessage = Buffer.concat(this.#fragments)\n\n websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)\n\n this.#info = {}\n this.#fragments.length = 0\n }\n\n this.#state = parserStates.INFO\n }\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n break\n }\n }\n }", "title": "" }, { "docid": "5cbb42cc9426673b024e0eef814112a4", "score": "0.61259866", "text": "processIncomingMessage(msg) {\n let checkFlight;\n if (msg.isFragmented()) {\n // remember incomplete messages and try to assemble them afterwards\n this.incompleteMessages.push(msg);\n checkFlight = this.tryAssembleFragments(msg);\n }\n else {\n // the message is already complete, we only need to parse it\n this.completeMessages[msg.message_seq] = Handshake.Handshake.fromFragment(msg);\n checkFlight = true;\n }\n // check if the flight is the current one, and complete\n if (checkFlight) {\n const completeMsgIndizes = Object.keys(this.completeMessages).map(k => +k);\n // a flight is complete if it forms a non-interrupted sequence of seq-nums\n const isComplete = [this.lastProcessedSeqNum].concat(completeMsgIndizes).every((val, i, arr) => (i === 0) || (val === arr[i - 1] + 1));\n if (!isComplete)\n return;\n const lastMsg = this.completeMessages[Math.max(...completeMsgIndizes)];\n if (this.expectedResponses != null) {\n // if we expect a flight and this is the one, call the handler\n if (this.expectedResponses.indexOf(lastMsg.msg_type) > -1) {\n this.expectedResponses = null;\n // and remember the seq number\n this.lastProcessedSeqNum = lastMsg.message_seq;\n // call the handler and clear the buffer\n const messages = completeMsgIndizes.map(i => this.completeMessages[i]);\n this.completeMessages = {};\n if (lastMsg.msg_type === Handshake.HandshakeType.finished) {\n // for the finished flight, only buffer the finished message AFTER handling it\n this.bufferHandshakeData(...(messages.slice(0, -1)\n .filter(m => this.needsToHashMessage(m))\n .map(m => m.toFragment()) // TODO: avoid unneccessary assembly and fragmentation of messages\n ));\n }\n else {\n this.bufferHandshakeData(...(messages\n .filter(m => this.needsToHashMessage(m))\n .map(m => m.toFragment()) // TODO: avoid unneccessary assembly and fragmentation of messages\n ));\n }\n // handle the message\n try {\n this.handle[lastMsg.msg_type](messages);\n }\n catch (e) {\n this._isHandshaking = false;\n this.finishedCallback(null, e);\n return;\n }\n if (lastMsg.msg_type === Handshake.HandshakeType.finished) {\n // for the finished flight, only buffer the finished message AFTER handling it\n this.bufferHandshakeData(lastMsg.toFragment());\n }\n // TODO: clear a retransmission timer\n }\n }\n else {\n // if we don't expect a flight, maybe do something depending on the type of the message\n // TODO: react to server sending us rehandshake invites\n }\n }\n }", "title": "" }, { "docid": "42f90cd8bc0af04aab3094d88843c985", "score": "0.6125471", "text": "function connectToServerAndHandlingEvent() {\n\t// connection = new WebSocket('wss://webrtctest.poczta.onet.pl/ws/');\n\tconnection = new WebSocket('ws://localhost:7070');\n\t//Connection open event handler\n\tconnection.onopen = function () {\n\t\tif (loginStatus && connectionOff) {\n\t\t\tconsole.log(\"asking for reconect for: \",nickname);\n\t\t\tsend({\n\t\t\t\ttype: \"reconnect\",\n\t\t\t\tname: nickname,\n\t\t\t\totherName: connectedUser\n\t\t\t});\n\t\t}\n\t\t// /*_____________________________________________________*\n\t\t// \t* * Event Handler to receive messages from server * *\n\t\t// *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/\n\t\tconnection.onmessage = function (message) {\n\t\t\t//console.log('Client - received socket message: ' + message.data.toString());\n\n\t\t\tif (message.data === '__ping__') {\n\t\t\t\tconsole.log(\"ping\");\n\t\t\t\tws.send(JSON.stringify({ keepAlive: name }));\n\t\t\t} else {\n\t\t\t\tlet data;\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(message.data);\n\t\t\t\t} catch{\n\t\t\t\t\tconsole.log(\"filed to parse msg froms erver \");\n\t\t\t\t}\n\n\t\t\t\tswitch (data.type) {\n\t\t\t\t\tcase \"login\": \t\t\t\t\t//done \n\t\t\t\t\t\tonLogin(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"availableUsers\":\t\t\t\t//done \n\t\t\t\t\t\tonAvailableUsers(data.availableUsers);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"callRequest\":\t\t\t\t\t//done,\n\t\t\t\t\t\tonCallRequest(data.callType, data.name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"callAnswer\":\t\t\t\t\t//done,\n\t\t\t\t\t\tonCallAnswer(data.answer, data.name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"readyState\":\t\t\t\t\t// done,\n\t\t\t\t\t\tonReadyState(data.readyState);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"error\":\t\t\t\t\t\t//done.\n\t\t\t\t\t\tonError(data.error,data.errorGrade);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"offer\": \t\t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCOffer(data.offer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"answer\": \t\t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCAnswer(data.answer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"candidate\": \t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCCandidate(data.candidate);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"hangUp\":\t\t\t\t\t\t//do zrobienia\n\t\t\t\t\t\tonHangUp(0);\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.log(\"unexpected message from server: \", data);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n\tconnection.onerror = function (msg) {\n\t\tonError(`socket error: ${msg.toString()}`)\n\t}\n\n\t//on connection close \n\tconnection.onclose = function () {\n\t\tconnectionOff = true;\n\t\tif (loginStatus) {\n\t\t\tconnectToServerAndHandlingEvent();\n\t\t\t//connection.trigger(\"onopen_RECONNECT\")\n\t\t} else {\n\t\t\tconsole.log(\"disconnect from signal server\");\n\t\t}\n\t}\n\t// end of handler\n}", "title": "" }, { "docid": "0660c6c2148092212480c318d9c3bd84", "score": "0.6117807", "text": "_onMessage(msg) {\n if (Buffer.isBuffer(msg)) {\n // delete msg._isBuffer;\n const data = Buffer.from(msg);\n this.push(data);\n }\n else {\n this.push(msg);\n }\n }", "title": "" }, { "docid": "6c8a1186393ad572c0f3e74b413a32a2", "score": "0.6117123", "text": "static serverHandleMessageType(_message, _websocketClient) {\n let parsedMessage = null;\n try {\n parsedMessage = JSON.parse(_message);\n }\n catch (error) {\n console.error(\"Invalid JSON\", error);\n }\n // tslint:disable-next-line: no-any\n const messageData = parsedMessage;\n if (parsedMessage != null) {\n switch (parsedMessage.messageType) {\n case TYPES.MESSAGE_TYPE.ID_ASSIGNED:\n console.error(\"Id assignment received as Server\");\n break;\n case TYPES.MESSAGE_TYPE.LOGIN_REQUEST:\n ServerMain.addUserOnValidLoginRequest(_websocketClient, messageData);\n break;\n case TYPES.MESSAGE_TYPE.RTC_OFFER:\n ServerMain.sendRtcOfferToRequestedClient(_websocketClient, messageData);\n break;\n case TYPES.MESSAGE_TYPE.RTC_ANSWER:\n ServerMain.answerRtcOfferOfClient(_websocketClient, messageData);\n break;\n case TYPES.MESSAGE_TYPE.ICE_CANDIDATE:\n ServerMain.sendIceCandidatesToRelevantPeers(_websocketClient, messageData);\n break;\n default:\n console.log(\"Message type not recognized\");\n break;\n }\n }\n }", "title": "" }, { "docid": "91def7cca4058f06d27a151facdeac35", "score": "0.611464", "text": "function onMessage(message) {\n\n // Check what message we have received.\n switch (message.funct) {\n\n case \"StatusResponse\":\n\n // Device status information returned.\n // message: a message object containing the message details.\n if (message.attributes.showEject !== undefined && services.configService) {\n services.configService.set(\"show-eject\", message.attributes.showEject);\n }\n break;\n\n case \"ConfigurationResponse\":\n\n // Configuration information returned.\n _processConfigurationResponse(message);\n break;\n\n case \"Customer\":\n // Customer card has been inserted.\n // Set the customer details.\n if (services.customerService) {\n services.customerService.set(message);\n if (callbacks.fnOnCustomer) callbacks.fnOnCustomer();\n }\n break;\n case \"Update\":\n if (message.type === \"User\") {\n // Processes the Gamora Update Customer event.\n // Check what the message type is.\n if (services.customerService) {\n services.customerService.update(message);\n if (callbacks.fnOnCustomer) callbacks.fnOnCustomer();\n }\n }\n break;\n case \"Employee\":\n // If an employee card has been inserted, change to the slot tech web site (we need to add the EmployeeSession type).\n windowService.updateHref(message.typeAttributes.uri, 'EmployeeSession');\n break;\n\n case \"ChangeDisplayMode\":\n\n // If changing to Attract Mode, do not reload web site.\n if (message.attributes.type === \"Attract\") {\n\n // Tell the system to switch to attract mode.\n $rootScope.$broadcast('switchToAttract');\n } else {\n // Only proceed if we have a valid URI.\n if (message.typeAttributes.uri !== '') {\n //window.location.href = message.typeAttributes.uri + '?type=' + encodeURIComponent(message.attributes.type);\n windowService.updateHref(message.typeAttributes.uri, encodeURIComponent(message.attributes.type));\n\n }\n }\n break;\n\n case \"DeviceStatusChanged\":\n // TODO (CP): Commented out for now - will be implemented later.\n // Show relevant maintenance icons.\n //_processStatusChanged(message.attributes);\n break;\n\n case \"ReloadWebsite\":\n\n // Tell the system we need to reload the website (when appropriate).\n $rootScope.$broadcast('reloadWebsite');\n break;\n\n case \"ShowMessage\":\n // Show the message.\n // message: a message object containing the message details:\n // message.attributes.messageId: the Id of the message.\n // message.attributes.len: the length to display the message - zero equates to forever.\n if (callbacks.fnShowMessage) {\n // Extract message details.\n callbacks.fnShowMessage(message.attributes.messageId);\n\n } else {\n // use message service and user show method\n //showMessage(\"\", localisationService.get(messageId), \"\", \"\", (length > 0), timeOut, messageId);\n\n }\n break;\n\n case \"JackpotHit\":\n // Set the jackpot details.\n // message: a message object containing the message details:\n // message.attributes.jackpotId: the Id of the jackpot.\n // message.attributes.jackpotName: the jackpot name.\n // message.attributes.jackpotAmount: the jackpot amount.\n jackpotService.set(message);\n break;\n\n case \"HotSeatHit\":\n // Set the hot seat details.\n // message: a message object containing the message details:\n // message.attributes.promotionId: the Id of the promotion.\n // message.attributes.hotSeatName: the hot seat name.\n // message.attributes.freePlay: the free play amount (money).\n // message.attributes.points: the points amount (integer).\n // message.attributes.prize: the prize description.\n hotSeatService.set(message);\n break;\n }\n }", "title": "" }, { "docid": "7654c8632cc710ebc5bfb90bf55a1eca", "score": "0.6111604", "text": "function onmessage(msg) {\n envelope = JSON.parse(msg.data);\n console.log(envelope);\n\n channel.didGetData({\n message: envelope.message,\n });\n }", "title": "" }, { "docid": "bbdd2726c9d986dcbaf78bcae71ada80", "score": "0.6110382", "text": "function handleRequest(ws, message) {\n let response = null;\n const key = message.key;\n const data = message.data;\n\n if (data == null) return;\n\n switch (key) {\n case \"games\":\n response = sendGames(ws);\n break;\n\n case \"create\":\n response = createGame(ws, data);\n break;\n\n case \"join\":\n response = joinGame(ws, data);\n break;\n\n case \"session\":\n response = createSession(ws);\n break;\n\n case \"public\":\n response = getPrivateId(ws, data);\n break;\n\n case \"turn\": {\n const game = getGamePrivate(data.game);\n if (game != null) game.handleMove(data);\n break;\n }\n\n case \"boardRequest\": {\n const game = getGamePrivate(data.game);\n if (game != null) response = game.yinsh.getBoardJSON();\n break;\n }\n\n case \"name\":\n response = setName(ws, data);\n break;\n\n case \"row\": {\n const game = getGamePrivate(data.game);\n if (game != null) game.handleRingRemove(data);\n break;\n }\n\n default:\n console.log(`Unexpected request: '${message.key}'`);\n break;\n }\n\n if (response != null) {\n ws.send(JSON.stringify({ key: key, data: response }));\n }\n}", "title": "" }, { "docid": "b8f9e145713c100c41435c96692331ac", "score": "0.61098236", "text": "function handleData(data) {\n switch (data.type){\n case \"connected\":\n console.log(\"received connected\");\n break;\n case \"partial\":\n console.log(`Partial: ${data.elements.map(x => x.value).join(' ')}`);\n break;\n case \"final\":\n console.log(`Final: ${data.elements.map(x => x.value).join('')}`);\n const textElements = data.elements.filter(x => x.type === \"text\");\n lastResultEndTsReceived = textElements[textElements.length - 1].end_ts;\n break;\n default:\n // We expect all messages from the API to be one of these types\n console.error(\"Received unexpected message\");\n break;\n }\n}", "title": "" }, { "docid": "e9767af80a31d6234266e4310953e0b4", "score": "0.610647", "text": "function onMessage(msg) {\n let obj = JSON.parse(msg.data);\n let connectString\n\n switch(obj.type) {\n case \"player_join\":\n initialDrawBoard();\n connectString = obj.name + \" Connected\";\n insertConnectionMessage(connectString);\n break;\n case \"spectator_join\":\n if (!isLightPlayer && !isDarkPlayer) isSpectator = true;\n gameStarted = true;\n connectString = obj.name + \" Connected as Spectator\";\n insertConnectionMessage(connectString);\n break;\n case \"start_game\":\n gameStarted = true; //set the game status to start playing.\n isLightPlayer = obj.lightPlayer;\n isDarkPlayer = obj.darkPlayer;\n isSpectator = obj.spectator;\n lightPlayerTurn = obj.lightPlayerTurn;\n document.getElementById(\"turn-banner\").innerHTML =\n \"It is <b>\" + obj.turnName + \"'s</b> turn\";\n updateBoard_piece(obj);\n break;\n case \"update_game\":\n addUpdateToLog(obj.move); //Add the update to the log before switching players.\n console.log(obj.move);\n lightPlayerTurn = obj.lightPlayerTurn;\n document.getElementById(\"turn-banner\").innerHTML =\n \"It is <b>\" + obj.turnName + \"'s</b> turn\";\n updateBoard_piece(obj);\n break;\n case \"chat\":\n insertChat(obj.content);\n break;\n case \"error\":\n alert(obj.content);\n let logLast = document.querySelector(\".scrollBox p:nth-last-child(1)\");\n logLast.remove();\n //reset piece positions.\n resetPiecePositions();\n break;\n case \"spectator_leave\":\n //Write the message that the spectator has left. Allow gameplay to continue.\n insertConnectionMessage(obj.content);\n break;\n case \"player_leave\":\n //Write the message that the player has left. Gameplay will not be able to continue.\n insertConnectionMessage(obj.content);\n alert(obj.content);\n //Take action to close or redirect the browser.\n window.location = \"/index.html\";\n break;\n case \"king_taken\":\n //Write the message that the king has been taken. Gameplay will not continue.\n insertConnectionMessage(obj.content);\n alert(obj.content);\n window.location = \"/index.html\";\n break;\n case \"heartbeat_response\":\n console.log(\"Heartbeat response received\");\n break;\n case \"resignation\":\n insertConnectionMessage(obj.content);\n alert(obj.content);\n window.location = \"/index.html\";\n break;\n case \"draw_request_from_server\":\n receiveDrawRequest(obj.content);\n break;\n case \"draw_accepted\":\n insertConnectionMessage(obj.content);\n alert(obj.content);\n window.location = \"/index.html\";\n break;\n case \"draw_denied\":\n insertConnectionMessage(obj.content);\n alert(obj.content);\n //Play continues.\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "bbeacad7aab9800549808cabf819b084", "score": "0.61048836", "text": "function onMessageArrived(message) {\n console.log(\"Message arrived: topic=\" + message.destinationName + \", message=\" + message.payloadString);\n if (message.destinationName == \"DHT001\") {\n var tempHum = message.payloadString.split(\"/\");\n if (tempHum[0] == \"T\") {\n var temp = parseInt(tempHum[1], 10);\n document.getElementById(\"پذیرایی/حسگر دما\").innerHTML = temp + '&degC';\n addTempData(temp);\n }\n else {\n var hum = parseInt(tempHum[1], 10);\n document.getElementById(\"پذیرایی/حسگر رطوبت\").innerHTML = hum + '%';\n addHumData(hum);\n }\n }\n /*\n if (message.destinationName == \"tempSensor\") {\n document.getElementById(\"پذیرایی/حسگر دما\").innerHTML = message.payloadString + '&degC';\n var tempData = message.payloadString;\n addTempData(tempData);\n }\n else if (message.destinationName == \"humSensor\") {\n document.getElementById(\"پذیرایی/حسگر رطوبت\").innerHTML = message.payloadString + '%';\n var humData = message.payloadString;\n addHumData(humData);\n }\n */\n else if(message.destinationName == \"airQualitySensor\") {\n document.getElementById(\"پذیرایی/حسگر کیفیت هوا\").innerHTML = message.payloadString + 'ppm';\n var airData = message.payloadString;\n addAirData(airData);\n }\n else if (message.destinationName == \"node1\") {\n var switchState = message.payloadString;\n }\n}", "title": "" }, { "docid": "233c0fa6ccceca6161e9b92336ccd4a3", "score": "0.6097296", "text": "function messageReceived(message)\n {\n if (callback !== undefined)\n {\n var data = JSON.parse(message.data);\n callback(data);\n }\n }", "title": "" }, { "docid": "c99e76e8a26445d401f0fe116d63daf3", "score": "0.6075758", "text": "function communication() {\n window.addEventListener('message', function (event) {\n //console.log(\"receive something \", event);\n try {\n var data = JSON.parse(event.data);\n\n if (data.message === \"FirstConnection\") {\n Com.connection = true;\n Com.masterWindow = event.source;\n Com.masterWindowPath = event.origin;\n Com.id = data.id;\n\n data.message = \"FirstConnectionReceive\";\n Com.masterWindow.postMessage(JSON.stringify(data), event.origin);\n //console.log(\"Charts is ready to communicate.\");\n $(\"#WSLoading\").hide();\n $(\"#dialog-charts\").dialog(\"open\");\n }\n else if (Com.connection) {\n //Connection has been established process message\n //console.log(data.message);\n //If message has a windowType check for a message\n if (data.hasOwnProperty('source')) {\n if (data.message == dataSentString) {\n recieveRequestedData(data);\n }\n else if (data.message == temporalRadioChangeString) {\n recieveTemporalRadioChange(data);\n }\n else if (data.message == geographyRadioChangeString) {\n recieveGeographyRadioChange(data);\n }\n else if (data.message == callWebServSuccessString) {\n recieveWebServSuccess(data);\n }\n else if (data.message == loadingString) {\n recieveLoading();\n }\n else if (data.message == selectedProvidersChangeString) {\n recieveSelectedProvidersChange(data);\n }\n }\n }\n } catch (e) {\n console.log('invalid json', data);\n }\n //console.log(event);\n });\n}", "title": "" }, { "docid": "970ba7aa7f8ff5e0c2ec60940071193e", "score": "0.6073773", "text": "function handleMessage (message) {\n console.log('received message: ' + message.data);\n}", "title": "" }, { "docid": "a5cf9929c35a69cc69df3205fc4f3bdd", "score": "0.6062254", "text": "function initWebSocketClient() {\n\n \n (\"WebSocket\" in window) ? console.log(\"WebSocket is supported by your Browser!\") : console.log(\"WebSocket NOT supported by your Browser!\");\n\n // Connect to Web Socket\n var ws = new WebSocket(webSocket);\n\n // Set event handlers.\n ws.onopen = function() {\n console.log(\"WebSocket open\");\n };\n\n ws.onmessage = function(e) {\n\n // e.data contains received string.\n var response = jQuery.parseJSON(e.data);\n\n\t\tconsole.log(e.data)\n\n\t\tif(response.hasOwnProperty('returncode') && response['returncode'] == 0){\n\t\t\tif(response.hasOwnProperty('temperature')){\n\n\t\t\t\tupdateTemperature(response['temperature']);\n\n\t\t\t}\n\n\t\t// de refacut, toate trebuie sa contina returncode\n\t\t} else if(response.hasOwnProperty('state') && response.hasOwnProperty('fan') && response.hasOwnProperty('temperature')){\n\n\t\t\t\tupdateButtons(response['state'], response['fan'], response['temperature']);\n\n\t\t}\n\n };\n \n ws.onerror = function(e) {\n console.log(\"onerror\");\n console.log(e)\n };\n}", "title": "" }, { "docid": "735631495babf0feee660070583d546e", "score": "0.60558945", "text": "function receiveMessages() {\n\t\tsocket.on('dev broadcast', function(msg){\n\t\t\taddSticky(msg, 'dev')\t\t\t\n\t\t});\n\t\tsocket.on('auto broadcast', function(msg){\n\t\t\taddSticky(msg, 'auto')\t\t\n\t\t});\n\t\tsocket.on('qa broadcast', function(msg){\n\t\t\taddSticky(msg, 'qa')\t\t\t\n\t\t});\n\n\t\t//display stickies on reload\n\t\tsocket.on('sticky load', function(msg){\n\t\t\tif (loadStickies) {\n\t\t\t\tvar types = ['dev', 'auto', 'qa']\n\t\t\t\tfor (var i = 0; i < types.length;i++) {\n\t\t\t\t\tvar stickies = msg[0][types[i]]\n\t\t\t\t\tif (stickies) {\n\t\t\t\t\t\tconsole.log(stickies);\n\t\t\t\t\t\tfor (var j = 0; j < stickies.length; j++) {\n\t\t\t\t\t\t\taddSticky(stickies[j], types[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//prevent addional loads for other clients\n\t\t\t\tloadStickies = false;\n\t\t\t}\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "1e2dbda57ab5def3e5a8731732751267", "score": "0.6043588", "text": "componentDidMount() {\n const socket = new WebSocket(\"ws://localhost:3001\");\n this.setState({socket});\n socket.onmessage = (newMessage) => {\n newMessage = JSON.parse(newMessage.data);\n if (newMessage.type === \"online-users\") {\n this.setState({ onlineUsers: newMessage.content});\n }\n else {\n this.addMessage(newMessage);\n }\n }\n }", "title": "" }, { "docid": "387d768185d0eb71cb2c897c47eec860", "score": "0.6042623", "text": "handleMessageReceived(message) {\n this.messageList.push(message)\n }", "title": "" }, { "docid": "0af9fab377c3fab68390f1b02c9cf393", "score": "0.6028528", "text": "receiveMessage()\n {\n this.socket.on('message', (data) => {\n this.setState({ message: data })\n })\n\n }", "title": "" }, { "docid": "ee83400d74476bc620f76cc5a09b573b", "score": "0.6024078", "text": "function handleMessage(message) {\n console.log(message.data);\n}", "title": "" }, { "docid": "17306ac4c340a464bfd4fe9622622b65", "score": "0.6020489", "text": "function receivedMessage(event){\n\tvar pypath = './process_message/main.py'\n\tvar options = {mode:'text',args:[JSON.stringify(event)]}\n\tPythonShell.run(pypath,options,function(err,results){\n\t\tif(err) throw err\n\t\tfor(var idx=0; idx<results.length; idx++){\n\t\t\tvar messageData=JSON.parse(results[idx])\n\t\t\tconsole.log(\"received from python : \"+messageData)\n\t\t\tcallSendAPI(messageData)\n\t\t\tsetTimeout(function(){},7000);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.6014568", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "e8fef9a3718965b6dd5032cfc8081432", "score": "0.6010114", "text": "function incoming(evt) {\n\t\tvar event = xmlToDom(evt.data);\n\t\tvar params = event.getElementsByTagName(\"params\");\n\n\t\t//console.log(evt.data);\n\t\t\n\t\t//find the channel and call the callback\n\t\tvar channel = getChannel(event);\n\t\tvar payload = getParam(params[0], \"payload\");\n\n\t\tif(channel === \"ping\") {\n\t\t\tconsole.log(\"<lightwsd>: server ping\");\n\t\t\theartbeat_received = true;\n\t\t\t\n\t\t\tif(heartbeats_missed > 0)\n\t\t\t\tstatusChange(\"connected\");\n\t\t\t\n\t\t\theartbeats_missed = 0;\n\t\t\tpong();\n\t\t} else {\n\t\t\tsubscription_callbacks[String(channel)](unescape(payload));\n\t\t}\n\t}", "title": "" }, { "docid": "8b812374599559995549bcf53d57fedd", "score": "0.60085166", "text": "function MinimaWebSocketListener() {\n Minima.log(\"Starting WebSocket Listener @ \" + Minima.wshost);\n //Check connected\n if (MINIMA_WEBSOCKET) {\n MINIMA_WEBSOCKET.close();\n }\n //Open up a websocket to the main MINIMA proxy..\n MINIMA_WEBSOCKET = new WebSocket(Minima.wshost);\n MINIMA_WEBSOCKET.onopen = function () {\n //Connected\n Minima.log(\"Minima WS Listener Connection opened..\");\n //Now set the MiniDAPPID\n const uid = { \"type\": \"minidappid\", \"minidappid\": Minima.minidappid };\n //Send your name.. set automagically but can be hard set when debugging\n MINIMA_WEBSOCKET.send(JSON.stringify(uid));\n //Send a message\n MinimaPostMessage(\"connected\", \"success\");\n };\n MINIMA_WEBSOCKET.onmessage = function (evt) {\n //Convert to JSON\n const jmsg = JSON.parse(evt.data);\n let info = {};\n if (jmsg.event == \"newblock\") {\n //Set the new status\n Minima.block = parseInt(jmsg.txpow.header.block, 10);\n Minima.txpow = jmsg.txpow;\n //What is the info message\n info = { \"txpow\": jmsg.txpow };\n //Post it\n MinimaPostMessage(\"newblock\", info);\n }\n else if (jmsg.event == \"newtransaction\") {\n //What is the info message\n info = { \"txpow\": jmsg.txpow, \"relevant\": jmsg.relevant };\n //New Transaction\n MinimaPostMessage(\"newtransaction\", info);\n }\n else if (jmsg.event == \"newtxpow\") {\n //What is the info message\n info = { \"txpow\": jmsg.txpow };\n //New TxPoW\n MinimaPostMessage(\"newtxpow\", info);\n }\n else if (jmsg.event == \"newbalance\") {\n //Set the New Balance\n Minima.balance = jmsg.balance;\n //What is the info message\n info = { \"balance\": jmsg.balance };\n //Post it..\n MinimaPostMessage(\"newbalance\", info);\n }\n else if (jmsg.event == \"network\") {\n //What type of message is it..\n if (jmsg.details.action == \"server_start\" ||\n jmsg.details.action == \"server_stop\" ||\n jmsg.details.action == \"server_error\") {\n sendCallback(MINIMA_SERVER_LISTEN, jmsg.details.port, jmsg.details);\n }\n else if (jmsg.details.action == \"client_new\" ||\n jmsg.details.action == \"client_shut\" ||\n jmsg.details.action == \"message\") {\n if (!jmsg.details.outbound) {\n sendCallback(MINIMA_SERVER_LISTEN, jmsg.details.port, jmsg.details);\n }\n else {\n sendCallback(MINIMA_USER_LISTEN, jmsg.details.hostport, jmsg.details);\n }\n }\n else if (jmsg.details.action == \"post\") {\n //Call the MiniDAPP function..\n if (MINIMA_MINIDAPP_CALLBACK) {\n MINIMA_MINIDAPP_CALLBACK(jmsg.details);\n }\n else {\n Minima.minidapps.reply(jmsg.details.replyid, \"ERROR - no minidapp interface found\");\n }\n }\n else {\n Minima.log(\"UNKNOWN NETWORK EVENT : \" + evt.data);\n }\n }\n else if (jmsg.event == \"txpowstart\") {\n info = { \"transaction\": jmsg.transaction };\n MinimaPostMessage(\"miningstart\", info);\n if (Minima.showmining) {\n Minima.notify(\"Mining Transaction Started..\", \"#55DD55\");\n }\n }\n else if (jmsg.event == \"txpowend\") {\n info = { \"transaction\": jmsg.transaction };\n MinimaPostMessage(\"miningstop\", info);\n if (Minima.showmining) {\n Minima.notify(\"Mining Transaction Finished\", \"#DD5555\");\n }\n }\n };\n MINIMA_WEBSOCKET.onclose = function () {\n Minima.log(\"Minima WS Listener closed... reconnect attempt in 10 seconds\");\n //Start her up in a minute..\n setTimeout(function () { MinimaWebSocketListener(); }, 10000);\n };\n MINIMA_WEBSOCKET.onerror = function (error) {\n //let err = JSON.stringify(error);\n const err = JSON.stringify(error, [\"message\", \"arguments\", \"type\", \"name\", \"data\"]);\n // websocket is closed.\n Minima.log(\"Minima WS Listener Error ... \" + err);\n };\n}", "title": "" }, { "docid": "262c8845940e36daec1927f4f1eea4c7", "score": "0.6007058", "text": "function messageHandler(event) {\n var message = event.data;\n jewels = message.jewels;\n\n if (callbacks[message.id]) {\n callbacks[message.id](message.data);\n delete callbacks[message.id];\n }\n }", "title": "" }, { "docid": "409999740034d78367ea0bdfa62d1755", "score": "0.60050803", "text": "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n state.socket.updateAt = new Date();\n message.forEach(function(item){\n let sensor = state.sensors.find(sensor => (sensor.id == item.id));\n if (sensor == undefined) {\n item.active = false;\n item.target = 68;\n state.sensors.push(item);\n } else {\n sensor.value = item.value;\n }\n });\n }", "title": "" }, { "docid": "a854cc39acdecc66eb3af2ce0b2cc940", "score": "0.5999707", "text": "function tryHandleMessage() {\n\t\t\t\tif (bStatsCheckUnderWay)\n\t\t\t\t\tsetTimeout(tryHandleMessage, 100);\n\t\t\t\telse\n\t\t\t\t\tonWebSocketMessage.call(ws, message);\n\t\t\t}", "title": "" }, { "docid": "77e9260d0a7b3c11d32a9b8d71e3bed2", "score": "0.5996195", "text": "onPlayerMsg(wsClient, message){\n console.log('WS: player sent ' + message.type);\n let playerMsgType = {\n 'get-next': this.playerGetNextAction\n };\n playerMsgType[message.type].call(this, wsClient, message);\n }", "title": "" } ]
17ab47ee40c54d531234e618aabb718d
runs a single function in the async queue
[ { "docid": "6d558ebc716a96dbd856447bb1549343", "score": "0.0", "text": "function runSingle(task, domain) {\n\t try {\n\t task();\n\t\n\t } catch (e) {\n\t if (isNodeJS) {\n\t // In node, uncaught exceptions are considered fatal errors.\n\t // Re-throw them synchronously to interrupt flushing!\n\t\n\t // Ensure continuation if the uncaught exception is suppressed\n\t // listening \"uncaughtException\" events (as domains does).\n\t // Continue in next event to avoid tick recursion.\n\t if (domain) {\n\t domain.exit();\n\t }\n\t setTimeout(flush, 0);\n\t if (domain) {\n\t domain.enter();\n\t }\n\t\n\t throw e;\n\t\n\t } else {\n\t // In browsers, uncaught exceptions are not fatal.\n\t // Re-throw them asynchronously to avoid slow-downs.\n\t setTimeout(function () {\n\t throw e;\n\t }, 0);\n\t }\n\t }\n\t\n\t if (domain) {\n\t domain.exit();\n\t }\n\t }", "title": "" } ]
[ { "docid": "97d4f953ca167209d78134898601561f", "score": "0.6996469", "text": "anticipate(fAsynchronousFunction){this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}", "title": "" }, { "docid": "31520ae57d02b84d479861834ac9d7c9", "score": "0.6863436", "text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }", "title": "" }, { "docid": "37048b707d5a6e97a187266e75159288", "score": "0.6861339", "text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }", "title": "" }, { "docid": "3656103a3a7be76d54c35abb61b50e27", "score": "0.6792966", "text": "async 0(arg) {}", "title": "" }, { "docid": "fbf34a18bc9a491ff9808f82dd076447", "score": "0.6759449", "text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }", "title": "" }, { "docid": "6f50e1746e453fd465a833147b4febb3", "score": "0.6738761", "text": "_runTask() {\n this._orderQueue();\n\n const job = this.tasks.shift();\n const { task, args, resolve, reject } = job;\n\n this.taskRunning = true;\n\n task(...args)\n .then((...args) => {\n resolve(...args);\n this.taskRunning = false;\n this._next();\n })\n .catch((...args) => {\n reject(...args);\n this.taskRunning = false;\n this._next();\n });\n }", "title": "" }, { "docid": "8a3f2f16849e80cf23149e2dca24bf53", "score": "0.6658173", "text": "async processQueue () {\n\n // first in first out - call rpc with ws and msg\n var action\n while (action = this.queue.shift()) {\n try {\n await RPC[action[0]](action[1], action[2])\n } catch (e) { l(e) }\n }\n\n // l(\"Setting timeout for queue\")\n\n setTimeout(() => { me.processQueue() }, 50)\n }", "title": "" }, { "docid": "5ba00eb5d6fd2282ceec50d9332848d2", "score": "0.66519696", "text": "function runAsync() {\n console.log('run 1 after 1s')\n}", "title": "" }, { "docid": "42d3516dfa7b7ca4a146b7d7b7ddaf82", "score": "0.65027004", "text": "function runQueue(queue) {\n\t\twhile(queue.length > 0) {\n\t\t\tqueue.shift().run();\n\t\t}\n\t}", "title": "" }, { "docid": "42d3516dfa7b7ca4a146b7d7b7ddaf82", "score": "0.65027004", "text": "function runQueue(queue) {\n\t\twhile(queue.length > 0) {\n\t\t\tqueue.shift().run();\n\t\t}\n\t}", "title": "" }, { "docid": "c14b982ddd4893a82729e45a4c0104fa", "score": "0.64643025", "text": "function runQueue(queue) {\n\t\t\twhile(queue.length > 0) {\n\t\t\t\tqueue.shift().run();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "16903082f000b30d8947c042f28d01d0", "score": "0.6379602", "text": "run() {\n this.running = true;\n const qlen = this.queue.length;\n\n const next = () => {\n this.numProc--;\n if (this.numProc === 0 && this.queue.length === 0) {\n this.callback();\n } else {\n enqueue(); // eslint-disable-line no-use-before-define\n }\n };\n\n const enqueue = () => {\n if (this.numProc < this.maxProc && this.queue.length > 0) {\n // console.log('ADDING', this.numProc, 'running', this.queue.length, 'remaining');\n this.numProc++;\n this.queue.shift()(next);\n }\n };\n\n for (let i = 0; i < qlen; i++) {\n if (this.numProc >= this.maxProc) {\n break;\n }\n enqueue();\n }\n\n this.running = false;\n }", "title": "" }, { "docid": "fdba674e62db949de94272c1226a4a15", "score": "0.63558733", "text": "function run() {\n checkQueue.process(jobCallback);\n}", "title": "" }, { "docid": "05556eb6cb2982c463a2330bbc7327ed", "score": "0.6344689", "text": "function enqueue(func) {\n queue.push(func);\n }", "title": "" }, { "docid": "f2fcf2a0db29c57711611999ae439045", "score": "0.6306918", "text": "function run() {\n insertQueue.process(jobCallback);\n}", "title": "" }, { "docid": "6d82e7f65823df1545abb87249f7112d", "score": "0.63001657", "text": "function async(_function) {\r\n\tgetIt().async(function(t) {\r\n\t\t_function();\r\n\t});\r\n}", "title": "" }, { "docid": "dfb1f7751117a56e8398ae0750f2699a", "score": "0.62912446", "text": "function async(func) {\n setTimeout( func, 1 );\n }", "title": "" }, { "docid": "f16568d0dd562aa26b9c6d79ef7318c9", "score": "0.6282269", "text": "_run(cb) {\r\n\t\t\t\t\tcb();\r\n\t\t\t\t}", "title": "" }, { "docid": "3a0c9c9e700e8b878e136b74886486af", "score": "0.62260723", "text": "async 0() {}", "title": "" }, { "docid": "16b962f9044a5673c93c9630338bd82c", "score": "0.622061", "text": "runQueue() {\n _lib.callbackQueue.forEach((element) => {\n element.callback.apply(_lib, element.arguments);\n });\n\n // Empty queue\n _lib.callbackQueue = [];\n }", "title": "" }, { "docid": "238ad549ffb0f34c94c29914189f5586", "score": "0.62047285", "text": "[kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }", "title": "" }, { "docid": "871ee669e9dcbbeac3b464bcaf851135", "score": "0.6177456", "text": "function e$j(){return e$A.queueMicrotask?e$A.queueMicrotask:e=>{e$A.Promise.resolve().then(e);}}", "title": "" }, { "docid": "d12199f88a682f81d36b3bf05f97686d", "score": "0.61740994", "text": "function internalAsync(f) {\n if (globalQ) {\n globalQ.push(f);\n } else {\n globalQ = [f];\n async(dequeue);\n }\n}", "title": "" }, { "docid": "bcf3feedb76062b48e81fedac2c3b163", "score": "0.6173489", "text": "function doQueue(e) {\n var ApiToken = \"4c9ce8c698b79b00b244c3210238eafc\";\n var chatstoqueue = [24622178];\n callNextQueue(0, chatstoqueue, ApiToken);\n}", "title": "" }, { "docid": "129c9fdbfb82439862fe27f4f2f1a4f6", "score": "0.614948", "text": "enqueue(fn) {\n assert(this.queue, 'This browser has been destroyed');\n assert(typeof fn === 'function', 'eventLoop.enqueue called without a function');\n\n if (fn) {\n this.queue.push(fn);\n this.eventLoop.run();\n }\n }", "title": "" }, { "docid": "cda3cbdac9a21463af5f94d2a6561c2d", "score": "0.61444634", "text": "function mtGetQueueRoutine() {\r\n\tvar\ttmp;\r\n\tif(mtAllStopped() || (mtGetSoonQueue.length == 0 && mtGetQueue.length == 0)) {\r\n\t\twindow.setTimeout(mtGetQueueRoutine, Math.floor(Math.random() * 100) +200); //modify from 100ms to 300ms\r\n\t\treturn;\r\n\t}\r\n\ttmp = mtGetSoonQueue.shift();\r\n\tif(tmp == null)\r\n\t\ttmp = mtGetQueue.shift();\r\n\t_mtGet(tmp[0], mtGetQueueCallback, [tmp[1], tmp[2]]);\r\n}", "title": "" }, { "docid": "ac3203784768c8af59b2b15f467c5d23", "score": "0.6132071", "text": "function processQueue() {\n if (queue.length > 0) {\n working = true;\n setTimeout(function () {\n if (queue.length == 1) {\n working = false;\n }\n queue.shift().cb();\n processQueue();\n }, queue[0].delay);\n }\n }", "title": "" }, { "docid": "28594f6b6242b5bf4900911e88d039b1", "score": "0.6130572", "text": "async function f() {}", "title": "" }, { "docid": "f5512f3823e84d6ae72d4d62293a24d0", "score": "0.61243665", "text": "function callAsync(func) {\n setTimeout(func, 0);\n }", "title": "" }, { "docid": "55277d3cf206130473c97e895dcadba8", "score": "0.61225784", "text": "function run() {\n importQueue.process(jobCallback);\n}", "title": "" }, { "docid": "29f5768d8e4e9b3c957ad3d6fe47745d", "score": "0.6100787", "text": "dispatch() {\n if (!this.running) return\n if (!this.redis.connected) return setTimeout(this.dispatch.bind(this), 1000) // Wait 1s if not connected\n this.redis\n .zrangebyscoreAsync(Settings.redis.ordered_set_name, 0, Date.now())\n .then(hashes => {\n if (hashes.length)\n return this.redis\n .multi()\n .rpush(Settings.redis.queue_name, hashes[0])\n .zrem(Settings.redis.ordered_set_name, hashes[0])\n .execAsync()\n else \n throw new EmptyResultError()\n })\n .then(() => setImmediate(this.dispatch.bind(this)))\n .catch(err => {\n setTimeout(this.dispatch.bind(this), 1000)\n if (!(err instanceof EmptyResultError)) {\n this.emit('error', err) // If err is not expected, forward to external handler\n }\n })\n }", "title": "" }, { "docid": "caf9deefef2276543e10c099e720ab37", "score": "0.6094247", "text": "function simple() {\n var async = require('async'),\n concurrency = 2; //0 for infinity concurrency\n\n function worker(data, next) {\n console.log(data);\n next();\n }\n\n //Limited parallel execution\n var queue = async.queue(worker, concurrency);\n\n queue.push(1);\n queue.push([2, 3]);\n}", "title": "" }, { "docid": "24085d301a2e41a43bbff0237b25a439", "score": "0.6085481", "text": "function async(arg, callback) {\r console.log('cube \\''+arg+'\\', and return 2 seconds later');\r setTimeout(function() { callback(arg * 3); }, 2000);\r}", "title": "" }, { "docid": "cc04d3d15c2e1de7709b6b968d1d5832", "score": "0.60814774", "text": "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}", "title": "" }, { "docid": "cc04d3d15c2e1de7709b6b968d1d5832", "score": "0.60814774", "text": "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.6071201", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.6071201", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.6071201", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "3f6a37bd5aa278dda46ea9073205f440", "score": "0.60653967", "text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) {}\n }", "title": "" }, { "docid": "30b5ab9e6489f9b55fd130f79d1d7286", "score": "0.60607445", "text": "function enqueueExecution(s, f) {\n f();\n}", "title": "" }, { "docid": "1c94ed10605effb6da27e63620c97eed", "score": "0.6056776", "text": "function runNextTask() {\n defer(function () {\n try {\n tasks[currentTask](makeTaskDoneCallBack(false), makeTaskDoneCallBack(true));\n } catch (e) {\n makeTaskDoneCallBack(true)();\n }\n });\n }", "title": "" }, { "docid": "96e988df3375092f3f98c03f776c2f19", "score": "0.6027754", "text": "function doNext() {\n next++;\n if (queue [next]) {\n queue [next]();\n }\n}", "title": "" }, { "docid": "bfbeaa95d3e9db541a23088afb5ee283", "score": "0.6025445", "text": "function scheduleMicrotask(fn) {\n\t\t es6Promise._asap(this.bind(fn));\n\t\t}", "title": "" }, { "docid": "cca5072d1863938a2bdc4407fda8ac24", "score": "0.60135686", "text": "function executeLastQueue() {\n while (lastQueue.length) {\n var call = lastQueue.shift();\n if (typeof call.callback === 'function') {\n call.callback();\n }\n }\n }", "title": "" }, { "docid": "cd1eea033decb72c65d94ed43ad96b2d", "score": "0.6013564", "text": "_doQueue(cb) {\n\n // if there are calls in line, we favor them...\n // we queue our callback, and then call _servieAll which does it's rate check\n // removing this if will cause out of order callback execution, but why would you want that?\n if(this.callsWaiting() > 0) {\n this.blockedCalls.push(cb);\n this._serviceAll();\n return false;\n }\n\n let now = Date.now();\n let target = (now - this.startTime) * this.rate;\n if( (target - this.sent) >= 1 ) {\n this.sent++;\n // console.log(\"did run: \" + now);\n cb();\n return true;\n } else {\n\n // add to queue to run later\n this.blockedCalls.push(cb);\n\n // console.log('saved with ' + this.blockedCalls.length + ' in line');\n\n // schedule a run check for the future\n this._scheduleFutureService(cb, now);\n \n return false;\n }\n }", "title": "" }, { "docid": "f6b906218f463dd6c698f29df413a099", "score": "0.5987231", "text": "function run() {}", "title": "" }, { "docid": "eb935d43aa70eef95a4c290825de2227", "score": "0.59842485", "text": "_pick() {\n console.log(\"PICK\");\n console.log(\"queue len:\", this.queue.length);\n if (this.doingCount >= this.limit || this.queue.length === 0) {\n console.log(\"NO?\")\n return;\n }\n console.log(\"start pick\");\n this.doingCount += 1;\n const { f, resolve, reject } = this.queue.shift();\n (async () => {\n try {\n console.log(\"DO JOB F\");\n const result = await f();\n console.log(\"RESULT:\", result);\n resolve(result);\n } catch (err) {\n reject(err);\n } finally {\n this.doingCount -= 1;\n this._pick();\n }\n })();\n }", "title": "" }, { "docid": "411e21bffef32216214ce588f18afdad", "score": "0.598207", "text": "function runQueuedFunctions(data) {\n\t\tfor (var func of queuedFunctions) {\n\t\t\tfunc(data);\n\t\t}\n\t}", "title": "" }, { "docid": "9d9dcc194ece194c28a62dcbd55a60ab", "score": "0.5965828", "text": "function scheduleMicrotask(fn) {\n\t es6Promise._asap(this.bind(fn));\n\t}", "title": "" }, { "docid": "ba88d973fbf09e6896acc7949aa836f9", "score": "0.596563", "text": "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}", "title": "" }, { "docid": "ba88d973fbf09e6896acc7949aa836f9", "score": "0.596563", "text": "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}", "title": "" }, { "docid": "6dd1a333b39e52372ee93206369261a5", "score": "0.5960816", "text": "sendOne(i, fn) {\n // Execute the callback asynchronously\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n if (\n this.observers !== undefined &&\n this.observers[i] !== undefined\n ) {\n try {\n fn(this.observers[i]);\n } catch (e) {\n // Ignore exceptions raised in Observers or missing methods of an\n // Observer.\n // Log error to console. b/31404806\n if (\n typeof console !== \"undefined\" &&\n console.error\n ) {\n console.error(e);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.5955347", "text": "run() {}", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.5955347", "text": "run() {}", "title": "" }, { "docid": "b594491ae5748c8252749641ade8279a", "score": "0.59344125", "text": "function run() {\n if (!task && (task = stack.get())) {\n task.run();\n }\n }", "title": "" }, { "docid": "0711fabc263490ed2904222a61ee9d26", "score": "0.5921165", "text": "sendOne(i, fn) {\n // Execute the callback asynchronously\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n if (this.observers !== undefined && this.observers[i] !== undefined) {\n try {\n fn(this.observers[i]);\n } catch (e) {\n // Ignore exceptions raised in Observers or missing methods of an\n // Observer.\n // Log error to console. b/31404806\n if (typeof console !== 'undefined' && console.error) {\n console.error(e);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "87b3279976ce61b7412e6e30f145e266", "score": "0.5920294", "text": "cmd_await_all() {}", "title": "" }, { "docid": "74947c80c9251cc670421ef5003dba79", "score": "0.59124637", "text": "sendOne(i, fn) {\r\n // Execute the callback asynchronously\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.task.then(() => {\r\n if (this.observers !== undefined && this.observers[i] !== undefined) {\r\n try {\r\n fn(this.observers[i]);\r\n }\r\n catch (e) {\r\n // Ignore exceptions raised in Observers or missing methods of an\r\n // Observer.\r\n // Log error to console. b/31404806\r\n if (typeof console !== 'undefined' && console.error) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "41774be88e4e74e900bba9da41c275ec", "score": "0.5911697", "text": "checkQueue() {\n if (this.fnQueue.length > 0 && this.remaining !== 0) {\n let queuedFunc = this.fnQueue.splice(0, 1)[0];\n queuedFunc.callback();\n }\n }", "title": "" }, { "docid": "59dd7372f873b7a43ad7103e6a55fbdd", "score": "0.5902444", "text": "async asyncMethod() {}", "title": "" }, { "docid": "2bd191ba50f765dfa7884e0a8c68dc37", "score": "0.5902177", "text": "function run(){\n if (!task && (task = stack.get())){\n task.run();\n }\n }", "title": "" }, { "docid": "7d3b4456b083da29b2a596b03979cb95", "score": "0.5896156", "text": "async function first(){\n return \"We did it!\";\n}", "title": "" }, { "docid": "b573e6ad6fb61564adf9ea23f69951ed", "score": "0.58959967", "text": "run(k) {\n return AsyncM.ifAlive.bind(() => this.match(a => AsyncM.liftIO(k1 => k1(a.maybe(unit)(k))))((a, m) => AsyncM.liftIO(k1 => k1(a.maybe(unit)(k))).bind(_ => m.bind(s => s.run(k)))));\n }", "title": "" }, { "docid": "f660a6b3e02179f80f25c78c89c974c4", "score": "0.5877125", "text": "sendOne(i, fn) {\n // Execute the callback asynchronously\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n if (this.observers !== undefined && this.observers[i] !== undefined) {\n try {\n fn(this.observers[i]);\n }\n catch (e) {\n // Ignore exceptions raised in Observers or missing methods of an\n // Observer.\n // Log error to console. b/31404806\n if (typeof console !== 'undefined' && console.error) {\n console.error(e);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "d20f3aa4545a6b97bad5919153665bd9", "score": "0.58617", "text": "async execute(...args) {\n this.logger.debug('executing a queued task', this.status);\n return this.taskHandler.apply(this.taskHandler, args);\n }", "title": "" }, { "docid": "bc26f3cda480f8641e240c9fe0100830", "score": "0.5853253", "text": "run() {\n if (!this._isRunning) {\n return;\n }\n if (new Date().getTime() > this._when) {\n // Check if it should run once or just keep running.\n if (this._runOnce) {\n this._isRunning = false;\n this.removeFromArray();\n }\n else {\n this._when = new Date().getTime() + this._increment;\n }\n // Run our function.\n if (Array.isArray(this._args)) {\n this._function(this._args);\n }\n else {\n this._function();\n }\n }\n }", "title": "" }, { "docid": "e312e6064ddcde551fa663cf0bfa53db", "score": "0.58526134", "text": "function Queue(args, f) {\n // http://webreflection.blogspot.ie/2012/03/tweet-sized-queue-system.html\n setTimeout(args.next = function next() {\n return (f = args.shift()) ? !!f(args) || !0 : !1;\n }, 0);\n return args;\n}", "title": "" }, { "docid": "b5e11376bc602e9c001c6798caa83fc7", "score": "0.5842274", "text": "function queueCallback(err, resp) {\n// that.dropFirst();\n activelyProcessing--;\n }", "title": "" }, { "docid": "36b610521a970340b0a785e4417a720a", "score": "0.58171064", "text": "async Aa() {\n if (0 !== this.da.length) {\n try {\n await this.da[0](), this.da.shift(), this.rr.reset();\n } catch (t) {\n if (!zs(t)) throw t;\n // Failure will be handled by AsyncQueue\n k(\"AsyncQueue\", \"Operation failed with retryable error: \" + t);\n }\n this.da.length > 0 && \n // If there are additional operations, we re-schedule `retryNextOp()`.\n // This is necessary to run retryable operations that failed during\n // their initial attempt since we don't know whether they are already\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n // call scheduled here.\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\n // new backoff on every call, there is only ever a single additional\n // operation in the queue.\n this.rr.Xi((() => this.Aa()));\n }\n }", "title": "" }, { "docid": "6b17eafe6e608b02961b3d8ed5dbe793", "score": "0.5816224", "text": "async processEventQueue() {\n logger.debug(`ihlManager processEventQueue ${this.blocking} ${this.eventQueue.length}`);\n if (this.blocking) return;\n if (this.eventQueue.length) {\n this.blocking = true;\n const [fn, args] = this.eventQueue.shift();\n logger.debug(`ihlManager processEventQueue processing ${fn.name} ${this.eventQueue.length}`);\n await fn.apply(this, args);\n logger.debug(`ihlManager processEventQueue processed ${fn.name} ${this.eventQueue.length}`);\n this.blocking = false;\n if (this.eventQueue.length) {\n logger.debug(`ihlManager processEventQueue looping ${this.eventQueue.length}`);\n await this.processEventQueue();\n }\n }\n }", "title": "" }, { "docid": "b6aa2754070c0731a5412d0a207cea78", "score": "0.5814869", "text": "async function f(){\n\n return 1\n}", "title": "" }, { "docid": "2fac56bf2b901ab21b58203e78cf6958", "score": "0.57992667", "text": "anticipate(fAsynchronousFunction)\n\t{\n\t\tthis.operationQueue.push(fAsynchronousFunction);\n\t\tthis.checkQueue();\n\t}", "title": "" }, { "docid": "1c46110367457804c5504f9da68a2d38", "score": "0.5799256", "text": "async Aa() {\n if (0 !== this.da.length) {\n try {\n await this.da[0](), this.da.shift(), this.rr.reset();\n } catch (t) {\n if (!Gs(t)) throw t;\n // Failure will be handled by AsyncQueue\n x(\"AsyncQueue\", \"Operation failed with retryable error: \" + t);\n }\n this.da.length > 0 && \n // If there are additional operations, we re-schedule `retryNextOp()`.\n // This is necessary to run retryable operations that failed during\n // their initial attempt since we don't know whether they are already\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n // call scheduled here.\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\n // new backoff on every call, there is only ever a single additional\n // operation in the queue.\n this.rr.Xi((() => this.Aa()));\n }\n }", "title": "" }, { "docid": "43244a383ce540c55da1d61b248bb53c", "score": "0.5797326", "text": "runCallback_() {\n let callbacks;\n\n if (!this.updating() &&\n this.callbacks_.length) {\n callbacks = this.callbacks_.shift();\n this.pendingCallback_ = callbacks[1];\n callbacks[0]();\n }\n }", "title": "" }, { "docid": "4c2f76abf891bdb0939dbf0966ab485e", "score": "0.57937396", "text": "function processQueue() {\n\tif (queue.length == 0) {\n\t\tconsole.log('queue is empty')\n\t\treturn\n\t}\n\n\tvar item = queue.splice(0,1)[0]\n\tfetchFriendIds(item, -1, function() {\n\t\tsetTimeout(processQueue, 1*60*1000) //wait 1 minute\n\t})\n}", "title": "" }, { "docid": "f8733ceef9bbe9093672c44b1fc7a1b1", "score": "0.5793366", "text": "async ba() {\n // Operations in the queue prior to draining may have enqueued additional\n // operations. Keep draining the queue until the tail is no longer advanced,\n // which indicates that no more new operations were enqueued and that all\n // operations were executed.\n let t;\n do {\n t = this.fa, await t;\n } while (t !== this.fa);\n }", "title": "" }, { "docid": "f8733ceef9bbe9093672c44b1fc7a1b1", "score": "0.5793366", "text": "async ba() {\n // Operations in the queue prior to draining may have enqueued additional\n // operations. Keep draining the queue until the tail is no longer advanced,\n // which indicates that no more new operations were enqueued and that all\n // operations were executed.\n let t;\n do {\n t = this.fa, await t;\n } while (t !== this.fa);\n }", "title": "" }, { "docid": "ef39e57e3e5318014871108c1fd39235", "score": "0.5781533", "text": "async init() {\n\t\tawait Promise.all([...this._queue].map(fn => fn()));\n\t\tthis._queue.length = 0;\n\t}", "title": "" }, { "docid": "6a8ce0a8103ac5d0e1f3b7e8352281e2", "score": "0.5775688", "text": "async function z() {\n\tsetImmediate(function(){\n\t\tasync return function ab() { return 3 } ;\n\t}) ;\n}", "title": "" }, { "docid": "0889df873e739c976dd3af344fbed97a", "score": "0.5762721", "text": "next() {\n\t\tconst i = this.index++;\n\t\tconst at = this.queue[i];\n\t\tif(!at) {\n\t\t\treturn;\n\t\t}\n\t\tconst next = this.queue[this.index];\n\t\tat.fn();\n\t\tif(next) {\n\t\t\tconst delay = next.delay === undefined ? this.defaultDelay : next.delay;\n\t\t\tsetTimeout(() => this.next(), delay);\n\t\t}\n\t}", "title": "" }, { "docid": "5691d0ad7a1e356d99f6eaa169ddea52", "score": "0.5760486", "text": "async test() {\n //some testing\n }", "title": "" }, { "docid": "5f652bb88372a2713937597e435a791d", "score": "0.57556653", "text": "function invoke_callback(promise) {\n var queue = get_queue(promise, event)\n return callback && queue.flushed? callback.apply(promise, promise.value)\n : /* otherwise */ null }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.57541186", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.57541186", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "04af8bcfd5650a1663fd40de44818e6a", "score": "0.57530034", "text": "function myFunc ( id )\r\n\t\t{\r\n\t\t\tvar t = RequestQueue;\r\n\t\t\tvar func = t.que[id][0];\r\n\t\t\tdelete t.que[id];\r\n\t\t\t//dispQ ('RequestQueue.doit id='+ id); \r\n\t\t\tfunc();\r\n\t\t}", "title": "" }, { "docid": "89f6d20e845ce11cb8e0098e516930de", "score": "0.57485217", "text": "function asap(task){queue.push(task);if(!semaphore){suspend();flush();}}", "title": "" }, { "docid": "89f6d20e845ce11cb8e0098e516930de", "score": "0.57485217", "text": "function asap(task){queue.push(task);if(!semaphore){suspend();flush();}}", "title": "" }, { "docid": "e09bcb15f644f0c830358d71d0250889", "score": "0.57463646", "text": "function processQueue() {\n var current = undefined;\n if (wm.get(this).error && wm.get(this).failure) {\n wm.get(this).failure.call(this, wm.get(this).error);\n wm.get(this).error = undefined;\n wm.get(this).results = [];\n if (wm.get(this).always) {\n wm.get(this).always();\n }\n } else if (wm.get(this).results.length && (wm.get(this).success || wm.get(this).always)) {\n var resolver = wm.get(this).success || wm.get(this).always;\n while (wm.get(this).results.length) {\n current = resolver(wm.get(this).results.shift());\n if (wm.get(this).next && current !== undefined) {\n wm.get(this).next.resolve(current);\n }\n }\n }\n}", "title": "" }, { "docid": "3ccf81417964b5fa3d5c3861c6829852", "score": "0.57425165", "text": "function enqueue_wrap(fn) {\n return function () {\n if (this.queue.length && this.queue[this.queue.length - 1].method === fn) {\n return this.queue[this.queue.length - 1].promise;\n }\n\n const call_fn = () =>\n fn.apply(this, arguments).then(\n // finally\n data => {\n if (this.queue[0].method === fn) this.queue.shift();\n return data;\n },\n err => {\n if (this.queue[0].method === fn) this.queue.shift();\n throw err;\n }\n );\n\n let promise = this.queue.length > 0 ?\n this.queue[this.queue.length - 1].promise.then(call_fn, call_fn) :\n call_fn();\n\n this.queue.push({ method: fn, promise });\n return promise;\n };\n}", "title": "" }, { "docid": "6960fe98564a9fd363408d36084265e3", "score": "0.57394856", "text": "function x() { async(() => {}) }", "title": "" }, { "docid": "8795b66464fbb9f8f5de3fc5efb65a66", "score": "0.5736473", "text": "run (callback) {\n\t\tif (this.config.broadcastEngine.selected !== 'pubnub') {\n\t\t\treturn callback();\n\t\t}\n\t\tBoundAsync.series(this, [\n\t\t\tthis.listenOnClient,\t\t// listen on the client pubnub for the message we're going to send\n\t\t\tthis.sendRandomFromServer,\t// send a random message, simulating a message sent from the server\n\t\t\tthis.waitForMessage,\t\t// wait for it\n\t\t\tthis.clearTimer\t\t\t\t// clear the timer, so we don't trigger a failure\n\t\t], callback);\n\t}", "title": "" }, { "docid": "9ff1a3b7af0bcb65998f69ee7670c4e7", "score": "0.5735375", "text": "function queue(fn) {\n let lastPromise = Promise.resolve();\n return function(req) {\n let returnedPromise = lastPromise.then(() => fn(req));\n // If `returnedPromise` rejected, swallow the rejection for the queue,\n // but `returnedPromise` rejections will still be visible outside the queue\n lastPromise = returnedPromise.catch(() => {});\n return returnedPromise;\n };\n}", "title": "" }, { "docid": "253683b9ec590ed2265046e0b2b2e0e9", "score": "0.5718254", "text": "function enqueue(fn, delay) {\n if (delay) {\n return {timeout: setTimeout(fn, delay)};\n } else {\n return {immediate: setImmediate(fn)};\n }\n }", "title": "" }, { "docid": "45854ba33bae55695c503158236701d8", "score": "0.5710161", "text": "function rc(t, e) {\n const n = new j;\n return t.asyncQueue.enqueueAndForget((async () => {\n const s = await function(t) {\n return Wa(t).then((t => t.datastore));\n }(t);\n new Ua(t.asyncQueue, s, e, n).run();\n })), n.promise;\n}", "title": "" }, { "docid": "101677853d4e1f0453c2bebb5c099d29", "score": "0.56960475", "text": "function _executeFromQueue() {\n if (!sails.hooks.queues.isReady(config.queue.name)) {\n return;\n }\n for (let i = 0; i < config.queue.executor.batch; i++) {\n sails.hooks.queues.pop(config.queue.name)\n .then((res) => {\n if (res && res.message) {\n _processIndexData(res.message.index, res.message.body)\n .catch(e => {\n sails.log.debug(JSON.stringify(e));\n sails.log.error(e);\n });\n }\n });\n }\n }", "title": "" }, { "docid": "61ab62738a1ddae9fb66e95c7d572859", "score": "0.56889796", "text": "flush() {\n this._queue.splice(0).forEach((entry) => {\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\n });\n }", "title": "" }, { "docid": "61ab62738a1ddae9fb66e95c7d572859", "score": "0.56889796", "text": "flush() {\n this._queue.splice(0).forEach((entry) => {\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\n });\n }", "title": "" }, { "docid": "060330de4478d272939b93f4c975ccb7", "score": "0.56883126", "text": "queueCallback_(callback, done) {\n this.callbacks_.push([callback.bind(this), done]);\n this.runCallback_();\n }", "title": "" }, { "docid": "0ab4d6697a14e35033fa3f5c7c161339", "score": "0.56723404", "text": "_next() {\n if (this.tasks.length !== 0 && this.taskRunning === false) {\n this._runTask();\n }\n }", "title": "" }, { "docid": "35ca4df059d2fb2921565689f9af3190", "score": "0.5670311", "text": "function run() {\n if (timer) {\n return;\n }\n timer = window.setTimeout(() => {\n timer = null;\n try {\n processPending();\n } catch (ex) {\n console.error('microBus processing error', ex);\n }\n }, interval);\n }", "title": "" }, { "docid": "611ea6834b51576487b0d8bc60fbe444", "score": "0.56678355", "text": "dequeue(uuid) {\n let that = this;\n if (uuid) {\n var task = this.#list.findIndex((item) => item.uuid === uuid)\n } else {\n var task = this.#list.shift();\n }\n if (!task) return false\n\n this.#pendingList.push(task);\n this._taskHandle(task);\n task.timeoutHandle = setTimeout(() => {\n if (!task.done) {\n that.resume(task.uuid)\n }\n }, task.timeout);\n return true\n }", "title": "" } ]
4d534397fe6ca2a385f078900b069f18
[MSXLS] 2.5.198.27 ; [MSXLSB] 2.5.97.18
[ { "docid": "c1cbec0d37755ccbccff6f1020bf0c11", "score": "0.0", "text": "function parse_PtgArea(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);\n\treturn [type, area];\n}", "title": "" } ]
[ { "docid": "18c9f3a8a45febf5393a356e3bc14173", "score": "0.5704791", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "18c9f3a8a45febf5393a356e3bc14173", "score": "0.5704791", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "18c9f3a8a45febf5393a356e3bc14173", "score": "0.5704791", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.5682796", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.5682796", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.5682796", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "f89311375bfbddf6354de49f9c039f85", "score": "0.5597497", "text": "GetVersionEx()\r\n{\r\n return this.GetOneByteDataFromChaKey(GETVEREX); \r\n}", "title": "" }, { "docid": "da227530e80494cbfedbfe018effbcc2", "score": "0.55789226", "text": "function parse_XLSBCellParsedFormula(data, length) {\n\tvar cce = data.read_shift(4);\n\treturn parsenoop(data, length-4);\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.55379313", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "bca333d352ab52922c37e53e977bc596", "score": "0.5494611", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tblob.l += 2;\n\n\treturn blob.read_shift(2,'u');\n}", "title": "" }, { "docid": "40dd6794a403df75ffb3229aa058f502", "score": "0.548176", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.54666173", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.54666173", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.54666173", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.54666173", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5445541", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5445541", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5445541", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5445541", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5445541", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "b43794ba969255f3f7acb1dd1c96370f", "score": "0.5416057", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\t\tvar end = data.l + length;\n\t\tvar cce = data.read_shift(4);\n\t\tvar rgce = parse_Rgce(data, cce, opts);\n\t\tvar cb = data.read_shift(4);\n\t\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\t\treturn [rgce, rgcb];\n\t}", "title": "" }, { "docid": "c9fcdee514f823e41427d2309e9ded6b", "score": "0.5386565", "text": "function parse_SupBook(blob, length, opts) {\n\t\tvar end = blob.l + length;\n\t\tvar ctab = blob.read_shift(2);\n\t\tvar cch = blob.read_shift(2);\n\t\tvar virtPath;\n\t\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t\tvar rgst = blob.read_shift(end - blob.l);\n\t\topts.sbcch = cch;\n\t\treturn [cch, ctab, virtPath, rgst];\n\t}", "title": "" }, { "docid": "25df183ca19510014af37d8b544d8d25", "score": "0.5384846", "text": "function $core_SYSREQ_writeCurrentVerHeading()\n{\n\tdocument.writeln(HEADING_CURRENTVER);\n}", "title": "" }, { "docid": "7c0597f644480b038e34332668219ff1", "score": "0.5378529", "text": "function check_get_mver(blob) {\n\t\t// header signature 8\n\t\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t\t// clsid 16\n\t\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t\t// minor version 2\n\t\tvar mver = blob.read_shift(2, 'u');\n\n\t\treturn [blob.read_shift(2,'u'), mver];\n\t}", "title": "" }, { "docid": "d05fcf2dd1d0562cc81276ddcfa43b9f", "score": "0.5364368", "text": "function ip1385832() { return 'o.Re'; }", "title": "" }, { "docid": "3df588bbe41ee007b930a7a32500bc57", "score": "0.52189183", "text": "function Xe(t) {\n return t.isFoundDocument() ? t.version : st.min();\n}", "title": "" }, { "docid": "afa5cc5f1d25690f784888d096384499", "score": "0.5202812", "text": "function jh840714() { return 'xo.r'; }", "title": "" }, { "docid": "c5956de154502e97eb827ec9b22db790", "score": "0.5141261", "text": "function $core_SYSREQ_writeRequiredVerHeading()\n{\n\tdocument.writeln(HEADING_REQUIREDVER);\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51058376", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.50931275", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.50801325", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.50801325", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.50801325", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "3cab2dccb7229cbd6126a5508ad18f73", "score": "0.5051637", "text": "function getSpreadsheetVersion(ss=null) {\n let version = optsSheet(ss).getRange('B2').getValue();\n //let verArray = verStr.split(' ');\n //let version = +verArray[1]; // The '+' casts the string to a number\n //console.log(version + ' ' + getObjType(version));\n\n return (Math.round(version * 100) / 100).toFixed(2).toString();\n}", "title": "" }, { "docid": "7331156f41f72a7119b66ca495bc1136", "score": "0.504217", "text": "function ISO7064Mod11_10Check() {}", "title": "" }, { "docid": "2487fb72776a9e8c4dd3006363201e86", "score": "0.49959853", "text": "function jh1158822() { return 'xa'; }", "title": "" }, { "docid": "aee21740bbd32ef7e36e30d6465c53c9", "score": "0.49867857", "text": "function no_overlib() { return ver3fix; }", "title": "" }, { "docid": "3f4e403fb56393c178693dfd899d4743", "score": "0.49543598", "text": "function get_dec_name()\n{\n\treturn \"MB1003\"; \n}", "title": "" }, { "docid": "7162b1fc75a765185f3f0a1dcad4b5c2", "score": "0.49537578", "text": "function te404804() { return '(92'; }", "title": "" }, { "docid": "1b46f5d68cc908a8ab69da77b694c5b7", "score": "0.49492887", "text": "function ip1148532() { return '= 200'; }", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.4892508", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "cd1ed54f6ddadb89ea04ff975ca2ae03", "score": "0.48825377", "text": "function ip1509228() { return '1; x'; }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.48782685", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "72b30b9c32e86b8f91dc2acbfc616e67", "score": "0.4874323", "text": "function te970339() { return '= 0; '; }", "title": "" }, { "docid": "9555b184cc87bd0279683c4065859b37", "score": "0.48682335", "text": "function _0x2fc5b1(_0x21ef3d,_0x242443){var _0x3c5017=_0x21ef3d['bMarks'][_0x242443]+_0x21ef3d[_0xb489('0x208')],_0x4cafd5=_0x21ef3d[_0xb489('0x20e')][_0x242443];return _0x21ef3d['src'][_0xb489('0x214')](_0x3c5017,_0x4cafd5-_0x3c5017);}", "title": "" }, { "docid": "80d87dc78d3b5dc45e17b7c073c11a90", "score": "0.48553354", "text": "function\nStreamDemo_get_elt_202_(a4x1)\n{\nlet xtmp107;\nlet xtmp108;\nlet xtmp109;\nlet xtmp110;\nlet xtmp111;\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2553(line=214, offs=1) -- 2583(line=215, offs=23)\n// L1DCLnone1(H0Cnone1(...));\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2587(line=217, offs=1) -- 2619(line=218, offs=24)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7289(line=444, offs=1) -- 7338(line=446, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_get_2457_ = XATS2JS_a0ref_get\n;\nxtmp107 = a0ref_get_2457_(a4x1[2]);\n}\n;\n;\n} // val(H0Pvar(xs(56)))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2620(line=219, offs=1) -- 2651(line=220, offs=27)\n{\nxtmp108 = XATS2JS_lazy_eval(xtmp107);\nif(0!==xtmp108[0]) XATS2JS_patckerr0();\n;\nxtmp109 = xtmp108[1];\nxtmp110 = xtmp108[2];\n} // val(H0Pdapp(H0Pcon(strxcon_cons(4)); -1; H0Pvar(x0(57)), H0Pvar(xs(58))))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2652(line=221, offs=1) -- 2688(line=222, offs=28)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7443(line=455, offs=1) -- 7492(line=457, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_set_2496_ = XATS2JS_a0ref_set\n;\nxtmp111 = a0ref_set_2496_(a4x1[2], xtmp110);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(111)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(111)));\n} // val(H0Pnil())\n;\nreturn xtmp109;\n}", "title": "" }, { "docid": "a5e364d2a8905877bad656f44028f9a5", "score": "0.48468107", "text": "function te559582() { return 'eXOb'; }", "title": "" }, { "docid": "b135d4ea3dc7421d1f007533488213f8", "score": "0.48381424", "text": "function\nStreamDemo_get_elt_202_(a3x1)\n{\nlet xtmp143;\nlet xtmp144;\nlet xtmp145;\nlet xtmp146;\nlet xtmp147;\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2553(line=214, offs=1) -- 2583(line=215, offs=23)\n// L1DCLnone1(H0Cnone1(...));\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2587(line=217, offs=1) -- 2619(line=218, offs=24)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7289(line=444, offs=1) -- 7338(line=446, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_get_2457_ = XATS2JS_a0ref_get\n;\nxtmp143 = a0ref_get_2457_(a3x1[2]);\n}\n;\n;\n} // val(H0Pvar(xs(56)))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2620(line=219, offs=1) -- 2651(line=220, offs=27)\n{\nxtmp144 = XATS2JS_lazy_eval(xtmp143);\nif(0!==xtmp144[0]) XATS2JS_patckerr0();\n;\nxtmp145 = xtmp144[1];\nxtmp146 = xtmp144[2];\n} // val(H0Pdapp(H0Pcon(strxcon_cons(4)); -1; H0Pvar(x0(57)), H0Pvar(xs(58))))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2652(line=221, offs=1) -- 2688(line=222, offs=28)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7443(line=455, offs=1) -- 7492(line=457, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_set_2496_ = XATS2JS_a0ref_set\n;\nxtmp147 = a0ref_set_2496_(a3x1[2], xtmp146);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(147)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(147)));\n} // val(H0Pnil())\n;\nreturn xtmp145;\n}", "title": "" }, { "docid": "5b17cc65bcd30264d38201c68b31dcfe", "score": "0.4835807", "text": "ReadBSTR(int, int) {\n\n }", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.4821056", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "1d5944ba59e3f97550ec9d6e03ce8792", "score": "0.48148495", "text": "addVersionStruct(buf, pos) {\n buf.writeUInt8(10, pos);\n pos++;\n buf.writeUInt8(0, pos);\n pos++;\n buf.writeUInt16LE(18362, pos);\n pos += 2;\n buf.writeUInt32LE(0x0F000000, pos);\n pos += 4;\n return pos;\n }", "title": "" }, { "docid": "03b7c498be729f7b6bb71b666f52cd24", "score": "0.48102164", "text": "function te184543() { return 'b.le'; }", "title": "" }, { "docid": "db01fefad201d04303b9a7d3173a8077", "score": "0.48079425", "text": "function o1109(o247) {\n try {\no259[o1096 >> 2];\n}catch(e){}\n var o31;\n try {\no935.o939 = o82;\n}catch(e){}\n try {\no31 = ArrayBuffer.isView;\n}catch(e){}\n try {\nFunction.prototype;\n}catch(e){}\n try {\nreturn o308 | 0\n}catch(e){}\n }", "title": "" }, { "docid": "816a20287086e73729f8c034ebb55399", "score": "0.4804944", "text": "function\nStreamDemo2_xprint_849_(a2x1)\n{\nlet xtmp157;\nlet xtmp158;\nlet xtmp159;\n;\n{\nxtmp158 = 0;\ndo {\ndo {\nif(0!==a2x1[0]) break;\nxtmp158 = 1;\n} while(false);\nif(xtmp158 > 0 ) break;\ndo {\nif(1!==a2x1[0]) break;\n//L1PCKany();\nxtmp158 = 2;\n} while(false);\nif(xtmp158 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp158) {\ncase 1:\n{\nxtmp157 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp159 = a2x1[1];\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/synougat.dats: 3264(line=268, offs=1) -- 3332(line=273, offs=17)\nfunction\nprint_1_409_(a3x1)\n{\nlet xtmp161;\nlet xtmp162;\n;\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/synougat.dats: 3304(line=272, offs=3) -- 3330(line=272, offs=29)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/gbas.dats: 825(line=82, offs=1) -- 865(line=84, offs=26)\n// { // val-binding\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/gint.dats: 1899(line=71, offs=1) -- 1940(line=72, offs=34)\n// { // val-binding\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/g_print.dats: 344(line=33, offs=1) -- 472(line=42, offs=24)\n// { // val-binding\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/g_print.dats: 412(line=39, offs=1) -- 470(line=41, offs=31)\n;\n// } // val-binding\nconst // implval/fun\ngint_print_sint_1513_ = XATS2JS_gint_print_sint\n;\n// } // val-binding\nconst // implval/fun\ng_print_2168_ = gint_print_sint_1513_\n;\n// } // val-binding\nconst // implval/fun\ngl_print1_2233_ = g_print_2168_\n;\nxtmp161 = gl_print1_2233_(a3x1);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(161)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(161)));\n} // val(H0Pnil())\n;\n{\nxtmp162 = [-1];;\n}\n;\nreturn xtmp162;\n} // function // print_1(7)\n;\nxtmp157 = print_1_409_(xtmp159);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp157;\n}", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.47958142", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "3765f6d6bf25064107819184b0ce8dbe", "score": "0.47889858", "text": "function parse_Bes(blob) {\n\t\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\t\treturn t === 0x01 ? v : v === 0x01;\n\t}", "title": "" }, { "docid": "511037bf8d012bb0a3124bc1506bec7d", "score": "0.4786812", "text": "function parse_Ref8U(blob, length) {\n\t\tvar rwFirst = blob.read_shift(2);\n\t\tvar rwLast = blob.read_shift(2);\n\t\tvar colFirst = blob.read_shift(2);\n\t\tvar colLast = blob.read_shift(2);\n\t\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n\t}", "title": "" }, { "docid": "7ce251b2f5179715dbe6053b632949ac", "score": "0.47859478", "text": "function\nStreamDemo_get_elt_202_(a3x1)\n{\nlet xtmp129;\nlet xtmp130;\nlet xtmp131;\nlet xtmp132;\nlet xtmp133;\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2553(line=214, offs=1) -- 2583(line=215, offs=23)\n// L1DCLnone1(H0Cnone1(...));\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2587(line=217, offs=1) -- 2619(line=218, offs=24)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7289(line=444, offs=1) -- 7338(line=446, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_get_2457_ = XATS2JS_a0ref_get\n;\nxtmp129 = a0ref_get_2457_(a3x1[2]);\n}\n;\n;\n} // val(H0Pvar(xs(56)))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2620(line=219, offs=1) -- 2651(line=220, offs=27)\n{\nxtmp130 = XATS2JS_lazy_eval(xtmp129);\nif(0!==xtmp130[0]) XATS2JS_patckerr0();\n;\nxtmp131 = xtmp130[1];\nxtmp132 = xtmp130[2];\n} // val(H0Pdapp(H0Pcon(strxcon_cons(4)); -1; H0Pvar(x0(57)), H0Pvar(xs(58))))\n;\n// ././../../../StreamDemo/DATS/StreamDemo.dats: 2652(line=221, offs=1) -- 2688(line=222, offs=28)\n{\n{\n// /home/hwxi/Research/ATS-Xanadu/prelude/DATS/CATS/JS/prelude.dats: 7443(line=455, offs=1) -- 7492(line=457, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\na0ref_set_2496_ = XATS2JS_a0ref_set\n;\nxtmp133 = a0ref_set_2496_(a3x1[2], xtmp132);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(133)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(133)));\n} // val(H0Pnil())\n;\nreturn xtmp131;\n}", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.47821906", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.47821906", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.47821906", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" } ]
8a981f91749bbf32c1c2d679bafbe92a
Changes direction of snake (Map represents fourth quadrant in a cartesian plane)
[ { "docid": "651ffd8f2577d380d8b909d9b430080a", "score": "0.0", "text": "function newDir(event) {\n\t\tif (!cycleActive && gameInterval) {\n\t\t\tcycleActive = true;\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase leftArrow:\n\t\t\t\t\tif (lastDir !== rightArrow) { // conditionals prevent doubling back\n\t\t\t\t\t\tlastDir = leftArrow;\n\t\t\t\t\t\txd = -1 * bl;\n\t\t\t\t\t\tyd = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase upArrow:\n\t\t\t\t\tif (lastDir !== downArrow) {\n\t\t\t\t\t\tlastDir = upArrow;\n\t\t\t\t\t\txd = 0;\n\t\t\t\t\t\tyd = -1 * bl;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase rightArrow:\n\t\t\t\t\tif (lastDir !== leftArrow) {\n\t\t\t\t\t\tlastDir = rightArrow;\n\t\t\t\t\t\txd = 1 * bl;\n\t\t\t\t\t\tyd = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase downArrow:\n\t\t\t\t\tif (lastDir !== upArrow) {\n\t\t\t\t\t\tlastDir = downArrow;\n\t\t\t\t\t\txd = 0;\n\t\t\t\t\t\tyd = 1 * bl;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "cc1e637c8d5736299f71775ac4d9a1a3", "score": "0.75843674", "text": "function changeDir(e) {\n if(e.key == \"ArrowLeft\"){\n snake.direction = \"left\";\n }\n else if(e.key == \"ArrowRight\"){\n snake.direction = \"right\";\n }\n else if(e.key == \"ArrowUp\"){\n snake.direction = \"up\";\n }\n else if(e.key == \"ArrowDown\"){\n snake.direction = \"down\";\n }\n }", "title": "" }, { "docid": "3970843fae482fdfbabc877e693a4485", "score": "0.73974496", "text": "function changeSnakeDirection(event) {\n\t\tif (snake.isValidDirectionKey(event.which)) {\n\t\t\tsnake.setDirection(event.which);\n\t\t}\n\t}", "title": "" }, { "docid": "2caceb1bf1500ffc2114b3a51af12760", "score": "0.71870464", "text": "function updateDirection () {\r\n\toldDirection = direction;\r\n\tif (key.keyCode === 38 && (snake.length == 1 || oldDirection != \"down\")) direction = \"up\";\r\n\telse if (key.keyCode === 40 && (snake.length == 1 || oldDirection != \"up\")) direction = \"down\";\r\n\telse if (key.keyCode === 37 && (snake.length == 1 || oldDirection != \"right\")) direction = \"left\";\r\n\telse if (key.keyCode === 39 && (snake.length == 1 || oldDirection != \"left\")) direction = \"right\";\r\n}", "title": "" }, { "docid": "64dc947d1d381e36c7dc7c52a8fa2f58", "score": "0.7130673", "text": "function change_direction(event) {\n const LEFT_KEY = 37;\n const RIGHT_KEY = 39;\n const UP_KEY = 38;\n const DOWN_KEY = 40;\n const SPACE_KEY = 32;\n\n const keyPressed = event.keyCode;\n\n if (keyPressed === SPACE_KEY) {\n player1.boost = true;\n }\n\n // Prevent the snake from reversing\n if (player1.changing_direction) return;\n player1.changing_direction = true;\n\n if (keyPressed === LEFT_KEY && !player1.directions.right) {\n player1.dx = -player1.step;\n player1.dy = 0;\n }\n if (keyPressed === UP_KEY && !player1.directions.down) {\n player1.dx = 0;\n player1.dy = -player1.step;\n }\n if (keyPressed === RIGHT_KEY && !player1.directions.down.left) {\n player1.dx = player1.step;\n player1.dy = 0;\n }\n if (keyPressed === DOWN_KEY && !player1.directions.up) {\n player1.dx = 0;\n player1.dy = player1.step;\n }\n}", "title": "" }, { "docid": "cf49da6fa42a32d0abe4624b173af3cb", "score": "0.7121447", "text": "function controlSnake(e) {\r\n\t\tif(e.keyCode === 37 || e.keyCode === 65) {\r\n\t\t\tdirection = -1;\r\n\t\t} else if(e.keyCode === 38 || e.keyCode === 87) {\r\n\t\t\tdirection = -width;\r\n\t\t} else if(e.keyCode === 39 || e.keyCode === 68) {\r\n\t\t\tdirection = 1;\r\n\t\t} else if(e.keyCode === 40 || e.keyCode === 83) {\r\n\t\t\tdirection = width;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "362b9f426a775b3d4e57ee12418ed63f", "score": "0.7085907", "text": "function Direction(event){\n const leftKey = 37;\n const rightKey = 39;\n const upKey = 38;\n const downKey = 40;\n// Prevent snake from reversing\n if(changeDirection) return;\n changeDirection = true;\n const keyPressed = event.keyCode;\n const goingUp = dy === -10;\n const goingDown = dy === 10;\n const goingRight = dx === 10;\n const goingLeft = dx === -10;\n\n if(keyPressed === leftKey && !goingRight){\n dx = -10;\n dy = 0;\n }\n\n if(keyPressed === upKey && !goingDown){\n dx = 0;\n dy = -10;\n }\n\n if(keyPressed === rightKey && !goingLeft){\n dx = 10;\n dy = 0;\n }\n\n if(keyPressed === downKey && !goingUp){\n dx = 0;\n dy = 10;\n }\n}", "title": "" }, { "docid": "d008615927b7d11139dac8ddf1091fb6", "score": "0.6920848", "text": "function update (event){\n\n if (snake.length > 2){\n var xFim = (snake[snake.length-1].x == snake[snake.length-2].x);\n var yFim = (snake[snake.length-1].y == snake[snake.length-2].y);\n var xInicio = (snake[0].x == snake[1].x);\n var yInicio = (snake[0].y == snake[1].y);\n }\n if(event.keyCode == 37){\n if (direction != \"right\") direction = \"left\";\n else{\n if (snake.length < 4){\n snake.reverse();\n direction = \"left\";\n }\n else{\n if ((yFim) && (yInicio) && (snake[0].y != snake[snake.length-1].y) &&\n (snake[snake.length-1].x > snake[snake.length-2].x))\n snake.reverse();\n else{\n snake.reverse();\n direction = \"left\";\n }\n }\n }\n }\n if(event.keyCode == 38){\n if (direction != \"down\") direction = \"up\";\n else{\n if (snake.length < 4){\n snake.reverse();\n direction = \"up\";\n }\n else{\n if ((xFim) && (xInicio) && (snake[0].x != snake[snake.length-1].x) &&\n (snake[snake.length-1].y > snake[snake.length-2].y))\n snake.reverse();\n else{\n snake.reverse();\n direction = \"up\";\n }\n }\n }\n }\n if(event.keyCode == 39 ){\n if (direction != \"left\") direction = \"right\";\n else{\n if (snake.length < 4){\n snake.reverse();\n direction = \"right\";\n }\n else{\n if ((yFim) && (yInicio) && (snake[0].y != snake[snake.length-1].y) &&\n (snake[snake.length-1].x < snake[snake.length-2].x))\n snake.reverse();\n else{\n snake.reverse();\n direction = \"right\";\n }\n }\n }\n }\n if(event.keyCode == 40){\n if (direction != \"up\") direction = \"down\";\n else{\n if (snake.length < 4){\n snake.reverse();\n direction = \"down\";\n }\n else{\n if ((xFim) && (xInicio) && (snake[0].x != snake[snake.length-1].x) &&\n (snake[snake.length-1].y < snake[snake.length-2].y))\n snake.reverse();\n else{\n snake.reverse();\n direction = \"down\";\n }\n }\n }\n }\n}", "title": "" }, { "docid": "24873f74b605ebdbfcc89c27b2678bef", "score": "0.6905145", "text": "function updateSnakeCoordinates() {\n for (let i = 0; i < numSegments - 1; i++) {\n xCor[i] = xCor[i + 1];\n yCor[i] = yCor[i + 1];\n }\n switch (direction) {\n case 'right':\n xCor[numSegments - 1] = xCor[numSegments - 2] + diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'up':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] - diff;\n break;\n case 'left':\n xCor[numSegments - 1] = xCor[numSegments - 2] - diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'down':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] + diff;\n break;\n }\n}", "title": "" }, { "docid": "5e4dbc9c8d58be46eadb388e4114bdf2", "score": "0.69032526", "text": "function Snake() {\n this.currDir = 'n';\n // TODO: dynamic initial position\n this.position = [[4, 4], [5, 4], [6, 4]];\n}", "title": "" }, { "docid": "d353deefee22d3965d46afcf4b5c6a69", "score": "0.6894368", "text": "function keyPressed(e){ //changing snake direction according to the keypressed\n if(e.key == \"w\") {\n snake.direction = \"up\";\n }\n else if(e.key == \"s\") {\n snake.direction = \"down\";\n }\n else if(e.key == \"a\") {\n snake.direction = \"left\";\n }\n else {\n snake.direction = \"right\";\n }\n }", "title": "" }, { "docid": "7dbfcea0ef413b132bb1a61cef4c2bc8", "score": "0.68921244", "text": "function updateSnakePosition() {\n let currentSnakeHeadX = snake[0].x;\n let currentSnakeHeadY = snake[0].y;\n switch (direction) {\n case \"left\":\n snake.unshift({\n x: currentSnakeHeadX - box,\n y: currentSnakeHeadY\n });\n break;\n case \"right\":\n snake.unshift({\n x: currentSnakeHeadX + box,\n y: currentSnakeHeadY\n });\n break;\n case \"up\":\n snake.unshift({\n x: currentSnakeHeadX,\n y: currentSnakeHeadY - box\n });\n break;\n case \"down\":\n snake.unshift({\n x: currentSnakeHeadX,\n y: currentSnakeHeadY + box\n });\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "227916b08e975d26b06dd20b4e376af2", "score": "0.68548137", "text": "function keyPressed(e) {\n if (e.key == 'ArrowRight') {\n snake.direction = 'right';\n } else if (e.key == 'ArrowLeft') {\n snake.direction = 'left';\n } else if (e.key == 'ArrowDown') {\n snake.direction = 'down';\n } else if (e.key == 'ArrowUp') {\n snake.direction = 'up';\n }\n console.log(snake.direction);\n }", "title": "" }, { "docid": "53e668c682e6ac7b59cf1faec2462d39", "score": "0.6840517", "text": "function updateSnakeCoordinates() {\n\n for (let i = 0; i < numSegments - 1; i++) {\n X_COR[i] = X_COR[i + 1];\n Y_COR[i] = Y_COR[i + 1];\n }\n switch (direction) {\n case 'right':\n X_COR[numSegments - 1] = X_COR[numSegments - 2] + DIFF;\n Y_COR[numSegments - 1] = Y_COR[numSegments - 2];\n break;\n case 'up':\n X_COR[numSegments - 1] = X_COR[numSegments - 2];\n Y_COR[numSegments - 1] = Y_COR[numSegments - 2] - DIFF;\n break;\n case 'left':\n X_COR[numSegments - 1] = X_COR[numSegments - 2] - DIFF;\n Y_COR[numSegments - 1] = Y_COR[numSegments - 2];\n break;\n case 'down':\n X_COR[numSegments - 1] = X_COR[numSegments - 2];\n Y_COR[numSegments - 1] = Y_COR[numSegments - 2] + DIFF;\n break;\n }\n }", "title": "" }, { "docid": "65354d206349ad825565990c8381e0ec", "score": "0.683419", "text": "function giveChangeDirection(snake)\n{\n\tvar func = function(direction)\n\t{\n\t\tbody = snake.body[0];\n\t\tsnake.direction = direction;\n\t}\n\treturn func;\n}", "title": "" }, { "docid": "2e00c7317502db80012b5fc031d046d1", "score": "0.6807778", "text": "function keyPressed(e){\n\t\t\n\t\tif(e.key == \"ArrowRight\" && snake.direction != \"left\"){\n\t\t\tsnake.direction = \"right\";\n\t\t}\t\n\t\telse if(e.key==\"ArrowLeft\" && snake.direction != \"right\"){\n\t\t\tsnake.direction = \"left\";\n\t\t}\n\t\telse if(e.key==\"ArrowDown\" && snake.direction != \"up\"){\n\t\t\tsnake.direction = \"down\";\n\t\t}\n\t\telse if(e.key==\"ArrowUp\" && snake.direction != \"down\"){\n\t\t\tsnake.direction = \"up\";\n\t\t}\n\t\tconsole.log(snake.direction);\n\t}", "title": "" }, { "docid": "bbfa108dd9cff94cb509d60a8e18deaa", "score": "0.677686", "text": "function onKeyDown(key_pressed) {\n if (key_pressed === ARROW_DOWN && snake.direction !== UP) \n snake.direction = DOWN;\n if (key_pressed === ARROW_LEFT && snake.direction !== RIGHT)\n snake.direction = LEFT;\n if (key_pressed === ARROW_UP && snake.direction !== DOWN)\n snake.direction = UP;\n if (key_pressed === ARROW_RIGHT && snake.direction !== LEFT)\n snake.direction = RIGHT;\n \n}", "title": "" }, { "docid": "c485e361001cad17df989fd2333835f3", "score": "0.6754416", "text": "updateDirection(snake, direction) {\n if (!direction) return;\n \n const keyToDirection = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\",\n };\n \n if (direction in keyToDirection) {\n let nextDirection = keyToDirection[direction];\n if (!this.areOppositeDirections(snake.direction, nextDirection)) \n {\n /* copie of game state to update snake event | not good :( */\n this.gameState.status = snake.changeDirection(nextDirection, this.gameState);\n }\n }\n }", "title": "" }, { "docid": "8fdbcaeb1ecaf5dec432399aace679cd", "score": "0.6749053", "text": "function changeDirection (key) {\n if (playerLost) {\n return;\n }\n\n //Call moveSnake function every n seconds\n if (!gameActive) {\n if (\n (key === 37 && direction === 2) || \n (key === 38 && direction === 3) || \n (key === 39 && direction === 4) || \n (key === 40 && direction === 1)) {\n container.className = 'animate__animated animate__headShake';\n return;\n } \n else if(key === 37 || key === 38 || key === 39 || key === 40){\n helpBtn.className = 'hidden';\n gameActive = true;\n movementInterval = window.setInterval(moveSnake, n);\n }\n }\n if (key === 37) {\n if(direction === 4) {\n return;\n }\n if(direction !== 2) {\n direction = 4;\n startMovement();\n }\n } else if (key === 38) {\n if(direction === 1) {\n return;\n }\n if(direction !== 3) {\n direction = 1;\n startMovement();\n }\n } else if (key === 39) {\n if(direction === 2) {\n return;\n }\n if(direction !== 4) {\n direction = 2;\n startMovement();\n }\n } else if (key === 40) {\n if(direction === 3) {\n return;\n }\n if(direction !== 1) {\n direction = 3;\n startMovement();\n }\n }\n }", "title": "" }, { "docid": "9dd137e090420bbb9c4ea0eb0669589b", "score": "0.67242765", "text": "function control(e) {\n if (e.key === \"ArrowRight\") {\n snakeDirection = 1\n console.log(\"Right\")\n } else if (e.key === \"ArrowUp\") {\n snakeDirection = -width\n console.log(\"Up\")\n } else if (e.key === \"ArrowLeft\") {\n snakeDirection = -1\n console.log(\"Left\")\n } else if (e.key === \"ArrowDown\") {\n snakeDirection = +width\n console.log(\"Down\")\n }\n}", "title": "" }, { "docid": "ce91035daa292a40c4be45ecccce6f97", "score": "0.67060435", "text": "function changeDirection(direction) {\n if (state.status != \"Playing\") return;\n\n opposite = {\n right: \"left\",\n left: \"right\",\n up: \"down\",\n down: \"up\"\n }\n currentDirection = state.snake.direction;\n if (direction == opposite[currentDirection]) return;\n\n state.snake.direction = direction;\n}", "title": "" }, { "docid": "eac4466e8b7250c2d5f86a92336e3a47", "score": "0.67003256", "text": "function keyPressed(e){\n \tif(e.key==\"ArrowRight\" && snake.direction!=\"left\"){\n\n \t\tsnake.direction = \"right\";\n \t}\n \telse if(e.key==\"ArrowLeft\" && snake.direction!=\"right\"){\n \t\tconsole.log('ho');\n \t\tsnake.direction = \"left\";\n \t}\n \telse if(e.key == \"ArrowDown\" && snake.direction!=\"up\"){\n \t\tsnake.direction = \"down\";\n \t}\n\n \telse if(e.key == \"ArrowUp\" && snake.direction!=\"down\"){\n \t\tsnake.direction = \"up\";\n \t}\n\n \tconsole.log(snake.direction);\n }", "title": "" }, { "docid": "58814da4b8a4519182d586d804ed3bba", "score": "0.66938186", "text": "function keyPressed() {\n snake.changeDirection(keyCode)\n}", "title": "" }, { "docid": "2da0b0fb05e0a859cc1166784a541f03", "score": "0.6682397", "text": "function keyPressed(e){\n\t\tif(e.key == \"ArrowRight\"){\n\t\t\tsnake.direction = \"right\" \n\t\t}\n\t\telse if(e.key == \"ArrowLeft\"){\n\t\t\tsnake.direction = \"left\"\n\t\t}\n\t\telse if(e.key == \"ArrowUp\"){\n\t\t\tsnake.direction = \"up\"\n\t\t}\n\t\telse if(e.key == \"ArrowDown\"){\n\t\t\tsnake.direction = \"down\"\n\t\t}\n\t}", "title": "" }, { "docid": "c09570b92d170d5215dd0a656b65dbc3", "score": "0.66760445", "text": "function moveSnake(snake, dir) {\r\n const head = first(snake);\r\n return cons({x: head.x + dir.x, y: head.y + dir.y}, snake.slice(0, length(snake) - 1));\r\n}", "title": "" }, { "docid": "83cb3e672e9ea6bfbe931418d70c00fd", "score": "0.66549724", "text": "function moveSnake() {\n if (phase === INIT) {\n initGameState();\n }\n if (phase === PLAYING) {\n let nextDir = pendingMovement.length > 0 ? pendingMovement.shift() : dir;\n if (nextDir === RIGHT) {\n snake.shift();\n snake.push(\n new p5.Vector(\n snake[snake.length - 1].x + cellSize,\n snake[snake.length - 1].y\n )\n );\n }\n if (nextDir === LEFT) {\n snake.shift();\n snake.push(\n new p5.Vector(\n snake[snake.length - 1].x - cellSize,\n snake[snake.length - 1].y\n )\n );\n }\n if (nextDir === DOWN) {\n snake.shift();\n snake.push(\n new p5.Vector(\n snake[snake.length - 1].x,\n snake[snake.length - 1].y + cellSize\n )\n );\n }\n if (nextDir === UP) {\n snake.shift();\n snake.push(\n new p5.Vector(\n snake[snake.length - 1].x,\n snake[snake.length - 1].y - cellSize\n )\n );\n }\n }\n}", "title": "" }, { "docid": "7ab4e98d248d196bd23f39a26fac66dd", "score": "0.6654671", "text": "function keyPressed() {\n\n if (keyCode === UP_ARROW) {\n snake.direction = 4;\n } else if (keyCode === DOWN_ARROW) {\n snake.direction = 2;\n } else if (keyCode === RIGHT_ARROW) {\n snake.direction = 3;\n } else if (keyCode === LEFT_ARROW) {\n snake.direction = 1;\n }\n}", "title": "" }, { "docid": "d0b87d8d2f1fdc3b5ff437a407e6ecac", "score": "0.66185", "text": "function moveSnake(e) {\n squares[currentIndex].classList.remove('snake');\n\n if(e.keyCode === 39) {\n direction = 1;\n } else if (e.keyCode === 38) {\n direction = -width; // if we press the up arrow, the snake will go back ten divs, appearing to go up\n } else if (e.keyCode === 37) {\n direction = -1; // if we press left, the snake will go left one div\n } else if (e.keyCode === 40) {\n direction = +width; //if we press down, the snake head will instantly appear in the div ten divs from where you are now\n }\n }", "title": "" }, { "docid": "5d75bdeab96f7da82b93bbb6f18819f1", "score": "0.66161495", "text": "function moveSnake(snake, dir) {\n const head = first(snake);\n return cons({x: head.x + dir.x, y: head.y + dir.y}, snake.slice(0, length(snake) - 1));\n}", "title": "" }, { "docid": "5d75bdeab96f7da82b93bbb6f18819f1", "score": "0.66161495", "text": "function moveSnake(snake, dir) {\n const head = first(snake);\n return cons({x: head.x + dir.x, y: head.y + dir.y}, snake.slice(0, length(snake) - 1));\n}", "title": "" }, { "docid": "eae0bda818f01186c8eefa7cbd79a66a", "score": "0.6607246", "text": "function updateSnake() {\n \n // Move each of the pixels\n for (var i = snake.length - 1; i > 0; i--) {\n \n // Move the pixel to the previous location\n snake[i] = {\"x\":snake[i - 1].x, \"y\":snake[i - 1].y};\n \n }\n \n // Move the last location by speed\n snake[0] = {\"x\": snake[0].x + speed.dx, \"y\": snake[0].y + speed.dy}\n \n // Check if the head has wrapped\n if ((snake[0].x < 0 || snake[0].x >= gridSize) || (snake[0].y < 0 || snake[0].y >= gridSize)) {\n \n //DIE\n state = \"dead\";\n }\n \n}", "title": "" }, { "docid": "2eaef09f0554a7777e514c0c1d425889", "score": "0.65942067", "text": "function keyPressed(e){\n\t\t//to update the direction,we use conditional statements\n\t\tif(e.key==\"ArrowRight\"){\n\t\t\tsnake.direction=\"right\";\n\t\t}\n\t\telse if(e.key==\"ArrowLeft\"){\n\t\t\tsnake.direction=\"left\";\n\t\t}\n\t\telse if(e.key==\"ArrowDown\"){\n\t\t\tsnake.direction=\"down\";\n\t\t}\n\t\telse{\n\t\t\tsnake.direction=\"up\";\n\t\t}\n\n\t}", "title": "" }, { "docid": "8ee3f43bf657d2427d5f306afc3c69ac", "score": "0.6586088", "text": "function changeSnakePosition() {\r\n headX = headX + xVelocity;\r\n headY = headY + yVelocity;\r\n}", "title": "" }, { "docid": "2543f4fe782349217414b183a3132857", "score": "0.6557352", "text": "function positionSnake()\n{\n\tfor(var k=0;k<x.length;k++)\n\t{\n\t\tgrid[y[k]][x[k]]=1;\n\t}\n}", "title": "" }, { "docid": "64735a2cdc7e45ba3d02faea4934b414", "score": "0.65189314", "text": "function setDirectionForCoordinate() {\n\t\tvar coo = getCoordiante(left, top);\n\t\tcoordinates[coo] = direction;\t\n\t}", "title": "" }, { "docid": "13b7fae2dc66f0aed2a728c0fd3b1ef0", "score": "0.65180016", "text": "function updatePendingDirection(snake, left, up, right, down){\r\n\tdocument.addEventListener(\"keydown\", function(e){\r\n\t\tif(snake.pendingDir.length<2){\r\n\t\t\tvar last = snake.pendingDir[0]===undefined? snake.dir : snake.pendingDir[snake.pendingDir.length-1];\r\n\t\t\tif(e.which===left && (last != \"RIGHT\")){\r\n\t\t\t\tsnake.pendingDir.push(\"LEFT\");\r\n\t\t\t} else if(e.which===up && (last != \"DOWN\")){\r\n\t\t\t\tsnake.pendingDir.push(\"UP\");\r\n\t\t\t} else if(e.which===right && (last != \"LEFT\")){\r\n\t\t\t\tsnake.pendingDir.push(\"RIGHT\");\r\n\t\t\t} else if(e.which===down && (last != \"UP\")){\r\n\t\t\t\tsnake.pendingDir.push(\"DOWN\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t})\r\n}", "title": "" }, { "docid": "365d447ff3669949c435efb466aabf17", "score": "0.65013564", "text": "function setUpSnake(snake)\n{\n paintTile(snake.head.x, snake.head.y, m_iMap.backgroundColor, 0);\n paintTile(snake.body[snake.body.length - 1].x, snake.body[snake.body.length - 1].y, m_iMap.backgroundColor, 0);\n var tempSnakeData = snake.body.pop();\n\n if (snake.direction == m_sDirection.right)\n tempSnakeData = { x: ++snake.head.x, y: snake.head.y };\n\n if (snake.direction == m_sDirection.left)\n tempSnakeData = { x: --snake.head.x, y: snake.head.y };\n\n if (snake.direction == m_sDirection.down)\n tempSnakeData = { x: snake.head.x, y: ++snake.head.y };\n\n if (snake.direction == m_sDirection.up)\n tempSnakeData = { x: snake.head.x, y: --snake.head.y };\n\n snake.body.unshift(tempSnakeData);\n}", "title": "" }, { "docid": "56d8552fb87850c5ebc306246d645eb4", "score": "0.6469764", "text": "function moveSnake() {\n\t\tx = snake[0][0];\n\t\ty = snake[0][1];\n\n\t\tif(direction == \"right\") {\n\t\t\t++x;\n\t\t\tsnake.unshift([x, y]); // le nuove cordinate vengono aggiunte all'inizio dell'array snake\n\t\t\tsnake.pop(); // elimino l'ultimo elemnto dell'array snake\n\t\t};\n\t\tif (direction == \"left\") {\n\t\t\t--x;\n\t\t\tsnake.unshift([x,y]);\n\t\t\tsnake.pop();\n\t\t};\n\t\tif (direction == \"top\") {\n\t\t\t--y;\n\t\t\tsnake.unshift([x,y]);\n\t\t\tsnake.pop();\n\t\t};\n\t\tif (direction == \"bottom\") {\n\t\t\t++y;\n\t\t\tsnake.unshift([x,y]);\n\t\t\tsnake.pop();\n\t\t};\n\n\t\tif( x == food[0] && y == food[1]) {\n\t\t\tscore++;\n\t\t\tfoodPosition();\n\t\t} else {\n\t\t\t//snake.pop(); // Rimuove l'ultimo elemento dell'array snake\n\t\t}\n\n\t\tdirection = newDirection;\n\t\tmyCanvas.fillStyle = \"#fff\";\n\t\tsnakePiece = myCanvas.fillRect(0,0,500,500);\n\t\tmyCanvas.fillStyle = \"#000\";\n\t\tcreateSnake();\n\t\tcreateFood();\n\t}", "title": "" }, { "docid": "9050b014bea58ea9336e714656992aa8", "score": "0.64419186", "text": "function setDirection(path){\n if (path.length > 0){\n var tileSize = Global.map.tileWidth;\n\n var x = path[0].x *tileSize;\n var y = path[0].y*tileSize;\n\n if (sprite.x < x) { //going right\n if (sprite.y < y ){ //going up\n direction = (Math.abs(sprite.x - x) < Math.abs(sprite.y - y))?'down':'right';\n } else {\n direction = (Math.abs(sprite.x - x) < Math.abs(sprite.y - y))?'up':'right';\n }\n }else { //going left\n if (sprite.y < y ){ //going up\n direction = (Math.abs(sprite.x - x) < Math.abs(sprite.y - y))?'down':'left';\n } else {\n direction = (Math.abs(sprite.x - x) < Math.abs(sprite.y - y))?'up':'left';\n }\n }\n }\n }", "title": "" }, { "docid": "16f06492e391dc257ac832bf0705d2be", "score": "0.6440121", "text": "function fixDir(pt){\n pt.rightDirection = pt.anchor;\n pt.leftDirection = pt.anchor;\n}", "title": "" }, { "docid": "21b196a99805d8e6c16d38363c72279d", "score": "0.6423601", "text": "function control(e) {\r\n if (e.keyCode === 39 && blueSnake[0] != blueSnake[1] - 1) {\r\n blueDirection = 1;\r\n } else if (e.keyCode === 40 && blueSnake[0] != blueSnake[1] - WIDTH) {\r\n blueDirection = WIDTH;\r\n } else if (e.keyCode === 37 && blueSnake[0] != blueSnake[1] + 1) {\r\n blueDirection = -1;\r\n } else if (e.keyCode === 38 && blueSnake[0] != blueSnake[1] + WIDTH) {\r\n blueDirection = -WIDTH;\r\n } else if (e.keyCode === 68 && redSnake[0] != redSnake[1] - 1) {\r\n redDirection = 1;\r\n } else if (e.keyCode === 83 && redSnake[0] != redSnake[1] - WIDTH) {\r\n redDirection = WIDTH;\r\n } else if (e.keyCode === 65 && redSnake[0] != redSnake[1] + 1) {\r\n redDirection = -1;\r\n } else if (e.keyCode === 87 && redSnake[0] != redSnake[1] + WIDTH) {\r\n redDirection = -WIDTH;\r\n }\r\n}", "title": "" }, { "docid": "04567cd1abc3d20b9bc76ab07a809e41", "score": "0.6396469", "text": "function moveSnake()\n{\n\tif(!keyMove)//variable description in player.js\n\t{\n\t\tfollowingBody();\n\t\tif((horizontal)&&(negativeAxis))\n\t\t{\n\t\t\tif(x[0]==0)\n\t\t\t{\n\t\t\t\tx[0]=10;\n\t\t\t}\n\t\t\tx[0]--;\n\t\t}\n\t\telse if((horizontal)&&(!negativeAxis))\n\t\t{\n\t\t\tif(x[0]==9)\n\t\t\t{\n\t\t\t\tx[0]=-1;\n\t\t\t}\n\t\t\tx[0]++;\n\t\t}\n\t\telse if((!horizontal)&&(negativeAxis))\n\t\t{\n\t\t\tif(y[0]==9)\n\t\t\t{\n\t\t\t\t\ty[0]=-1;\n\t\t\t}\n\t\t\ty[0]++;\n\t\t}\n\t\telse//not horizontal and not negativeAxis\n\t\t{\n\t\t\tif(y[0]==0)\n\t\t\t{\n\t\t\t\ty[0]=10;\n\t\t\t}\n\t\t\ty[0]--;\n\t\t}\n\t}\n\tcheckBodyTouch();\n\tkeyMove=false;\n\tsetupGrid();\n\tGUIgrid();\n}", "title": "" }, { "docid": "9772f0cd233423e90c74b8388f33fe16", "score": "0.6381505", "text": "moveSnake() {\n const { direction, snakeCoords, board, snakeLength } = this.state;\n\n let newBoard = board.map(r => r.slice());\n\n let currSnakeUnitX = snakeCoords[0][0];\n let currSnakeUnitY = snakeCoords[0][1];\n let currDirection = direction;\n let i = 0;\n while (i < snakeLength) {\n if (currDirection === 'right') {\n\n newBoard = this.moveUnitRight(\n newBoard,\n currSnakeUnitX + 1,\n currSnakeUnitY);\n\n currSnakeUnitX--;\n\n } else if (currDirection === 'left') {\n newBoard = this.moveUnitLeft(\n newBoard,\n currSnakeUnitX - 1,\n currSnakeUnitY)\n currSnakeUnitX++;\n } else if (currDirection === 'up') {\n newBoard = this.moveUnitUp(\n newBoard,\n currSnakeUnitX,\n currSnakeUnitY + 1)\n currSnakeUnitY--;\n } else if (currDirection === 'down') {\n newBoard = this.moveUnitDown(\n newBoard,\n currSnakeUnitX,\n currSnakeUnitY - 1)\n currSnakeUnitY++;\n }\n i++;\n }\n\n this.setState(state =>({\n ...state,\n board: newBoard,\n }));\n }", "title": "" }, { "docid": "78643cabfc602bdb420323d138eb18b3", "score": "0.63441384", "text": "function control(e){\r\n squares[currentIndex].classList.remove('snake') \r\n if(e.keyCode === 39){\r\n direction = 1 //aim right\r\n }\r\n else if(e.keyCode === 38){\r\n direction = -width //aim up\r\n }\r\n else if(e.keyCode === 37){\r\n direction = -1 //aim left\r\n }\r\n else if(e.keyCode === 40){\r\n direction = +width //aim down\r\n }\r\n }", "title": "" }, { "docid": "4e89dd1bdffffcf0959a5daa3c6a8639", "score": "0.63318044", "text": "goUp(snake) {\n this.updateDirection(snake, { x: snake[0].x, y: snake[0].y - 1 }, this.DIRECTION.UP)\n }", "title": "" }, { "docid": "1799a893891cf24fa6b84e6b13f7eb20", "score": "0.6316368", "text": "steer(direction) {\n let heading;\n\n // exit if no direction specified\n if (direction == null) {\n return false;\n }\n\n // make sure we are allowed to turn\n if (this.turndelay > 0) {\n this.turndelay--;\n return false;\n }\n\n // change snake heading/veolicy towards desired direction\n // E = 0 deg, S = 90 deg, W = 180 deg, N = -90 deg\n heading = Math.round(playerSnake.heading);\n\n switch (direction) {\n case UP:\n // make sure we are not heading due south or due north\n if (heading != 90 && heading != -90) {\n // change heading towards NORTH direction\n if (playerSnake.vel.x > 0) {\n heading -= SNAKE_ANGULAR_VELOCITY;\n } else {\n heading += SNAKE_ANGULAR_VELOCITY;\n }\n if (heading <= -180) {\n heading += 360;\n } else if (heading > 180) {\n heading -= 360;\n }\n heading = Math.round(heading);\n playerSnake.heading = heading;\n\n console.log(\"UP: vx=\" , playerSnake.vel.x, \", heading=\", heading);\n\n playerSnake.vel.x = Math.cos(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n playerSnake.vel.y = Math.sin(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n this.justturned = true;\n this.turndelay = Math.round(SNAKE_TURNING_RADIUS/SNAKE_VELOCITY_SCALE);\n }\n break;\n case DOWN:\n // make sure we are not heading due north or due south\n if (heading != -90 && heading != 90) {\n // change heading towards NORTH direction\n if (playerSnake.vel.x > 0) {\n heading += SNAKE_ANGULAR_VELOCITY;\n } else {\n heading -= SNAKE_ANGULAR_VELOCITY;\n }\n if (heading <= -180) {\n heading += 360;\n } else if (heading > 180) {\n heading -= 360;\n }\n heading = Math.round(heading);\n playerSnake.heading = heading;\n\n console.log(\"DOWN:\" , heading);\n\n playerSnake.vel.x = Math.cos(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n playerSnake.vel.y = Math.sin(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n this.justturned = true;\n this.turndelay = Math.round(SNAKE_TURNING_RADIUS/SNAKE_VELOCITY_SCALE);\n }\n break;\n case LEFT:\n // make sure we are not heading due west or due east\n if (heading != 180 && heading != 0) {\n // change heading towards NORTH direction\n if (playerSnake.vel.y > 0) {\n heading += SNAKE_ANGULAR_VELOCITY;\n } else {\n heading -= SNAKE_ANGULAR_VELOCITY;\n }\n if (heading <= -180) {\n heading += 360;\n } else if (heading > 180) {\n heading -= 360;\n }\n heading = Math.round(heading);\n playerSnake.heading = heading;\n\n console.log(\"RIGHT:\" , heading);\n\n playerSnake.vel.x = Math.cos(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n playerSnake.vel.y = Math.sin(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n this.justturned = true;\n this.turndelay = Math.round(SNAKE_TURNING_RADIUS/SNAKE_VELOCITY_SCALE);\n }\n break;\n case RIGHT:\n // make sure we are not heading due east or due west\n if (heading != 0 && heading != 180) {\n // change heading towards NORTH direction\n if (playerSnake.vel.y > 0) {\n heading -= SNAKE_ANGULAR_VELOCITY;\n } else {\n heading += SNAKE_ANGULAR_VELOCITY;\n }\n if (heading <= -180) {\n heading += 360;\n } else if (heading > 180) {\n heading -= 360;\n }\n heading = Math.round(heading);\n playerSnake.heading = heading;\n\n console.log(\"RIGHT:\" , heading);\n\n playerSnake.vel.x = Math.cos(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n playerSnake.vel.y = Math.sin(heading * Math.PI / 180) * SNAKE_VELOCITY_SCALE;\n this.justturned = true;\n this.turndelay = Math.round(SNAKE_TURNING_RADIUS/SNAKE_VELOCITY_SCALE);\n }\n break;\n default:\n // no valid direction, maintain previous heading/velocity\n break;\n }\n\n return true;\n }", "title": "" }, { "docid": "541915c5f4de5df0ab41a92324977fbf", "score": "0.627541", "text": "moveSnake () {\n this.input.keyboard.on('keydown_RIGHT', () => {\n if (this.direction === this.up || this.direction === this.down) {\n this.heading = this.right\n }\n })\n\n this.input.keyboard.on('keydown_LEFT', () => {\n if (this.direction === this.up || this.direction === this.down) {\n this.heading = this.left\n }\n })\n\n this.input.keyboard.on('keydown_DOWN', () => {\n if (this.direction === this.left || this.direction === this.right) {\n this.heading = this.down\n }\n })\n\n this.input.keyboard.on('keydown_UP', () => {\n if (this.direction === this.left || this.direction === this.right) {\n this.heading = this.up\n }\n })\n }", "title": "" }, { "docid": "81a76d72070b2b96268a90af72a43f35", "score": "0.6231602", "text": "function getDirection(snake) {\n\n let lastKeyDown = 0;\n\n window.addEventListener('keydown', e => {\n let lastDir = snake.direction;\n let clickedKey = e.keyCode;\n let isArrowKey = Object.keys(keys).includes(String(clickedKey));\n let now = new Date();\n\n if (isArrowKey) {\n e.preventDefault();\n\n if (now - lastKeyDown > frameRate) {\n lastKeyDown = now;\n let keyDirection = keys[clickedKey];\n\n if (keyDirection !== opposites[lastDir]) {\n snake.direction = keyDirection;\n }\n }\n }\n });\n}", "title": "" }, { "docid": "62d2f0d8f3d821ae3e5a7d1f7f85c248", "score": "0.62068576", "text": "turn(dir) {\n\t\tif (this.direction.x == 0 && this.direction.y == 1) { // going up\n\t\t\tif (dir == \"left\")\n\t\t\t\tthis.direction.x = -1;\n\t\t\telse\n\t\t\t\tthis.direction.x = 1;\n\t\t\tthis.direction.y = 0;\n\t\t} else if (this.direction.x == 0 && this.direction.y == -1) { // going down\n\t\t\tif (dir == \"left\")\n\t\t\t\tthis.direction.x = 1; \n\t\t\telse\n\t\t\t\tthis.direction.x = -1; \n\t\t\tthis.direction.y = 0;\n\t\t} else if (this.direction.x == -1 && this.direction.y == 0) { // going left\n\t\t\tthis.direction.x = 0; \n\t\t\tif (dir == \"left\")\n\t\t\t\tthis.direction.y = -1;\n\t\t\telse\n\t\t\t\tthis.direction.y = 1;\n\t\t} else if (this.direction.x == 1 && this.direction.y == 0) { // going right\n\t\t\tthis.direction.x = 0;\n\t\t\tif (dir == \"left\")\n\t\t\t\tthis.direction.y = 1;\n\t\t\telse\n\t\t\t\tthis.direction.y = -1;\n\t\t}\n\t}", "title": "" }, { "docid": "ec8aed9b1adee3327915ae9549f48b1f", "score": "0.61926", "text": "function keyPressed(){\n if(keyCode === UP_ARROW){\n snake.vel = createVector(0, -1);\n }\n if(keyCode === DOWN_ARROW){\n snake.vel = createVector(0, 1);\n }\n if(keyCode === LEFT_ARROW){\n snake.vel = createVector(-1, 0);\n }\n if(keyCode === RIGHT_ARROW){\n snake.vel = createVector(1, 0);\n }\n}", "title": "" }, { "docid": "eef0cda16bd4bef42b3d2a461a077553", "score": "0.61729646", "text": "function switch_direction(d){\r\n fatman.des_dir = d;\r\n fatman.wantchange = true;\r\n}", "title": "" }, { "docid": "b59b949fc4a414f291e8188dda3cfef5", "score": "0.6165224", "text": "function moveSnakeForward() {\n tail0 = tail[0];\n for (let i = 0; i < tail.length - 1; i++) {\n tail[i] = tail[i + 1];\n }\n tail[totalTail - 1] = { tailX: snakeHeadX, tailY: snakeHeadY };\n snakeHeadX += xSpeed;\n snakeHeadY += ySpeed;\n}", "title": "" }, { "docid": "1b65a030b280916e75c1cfd2785c9975", "score": "0.61614823", "text": "function KeyPressed(e){\n console.log(\"You pressed a key\");\n if(e.key==\"ArrowRight\"){\n snake.direction = \"right\";\n }\n else if(e.key==\"ArrowLeft\"){\n snake.direction = \"left\";\n }\n \n else if(e.key==\"ArrowDown\"){\n snake.direction = \"down\";\n }\n \n else if(e.key==\"ArrowUp\"){\n snake.direction = \"up\";\n }\n }", "title": "" }, { "docid": "1627d2f980dd1deb36e206147d4c4f0b", "score": "0.6136334", "text": "function put_direction_on_map() {\n\tsetTimeout(function() {\n\t\twrite_direction_on_map(src, nearest_marker.x, nearest_marker.y);\n\t}, 600);\n}", "title": "" }, { "docid": "88baaa3b286a6320ad6a40b6734a6275", "score": "0.6132029", "text": "function createSnake() {\n\t\tfor(var i=0; i<snake.length; i++) {\n\t\t\tx = snake[i][0];\n\t\t\ty = snake[i][1];\n\t\t\tmyCanvas.fillRect(x*10,y*10,10,10);\n\t\t};\n\t\tgetDirection();\n\t}", "title": "" }, { "docid": "419bc468bfad50355b2d9a9322be2df2", "score": "0.61307985", "text": "function changeDirection() {\n\t// grab the key codes for the arrows keys\n\tconst LEFT_KEY = 37;\n\tconst RIGHT_KEY = 39;\n\tconst UP_KEY = 38;\n\tconst DOWN_KEY = 40;\n\t\n\t// grab which key was pressed\n\tconst keyPressed = event.keyCode;\n\t\n\t// setting the new direction\n\tconst goingUp = dy === -10;\n\tconst goingDown = dy === 10;\n\tconst goingRight = dx === 10;\n\tconst goingLeft = dx === -10;\n\t\n\t// check if the object is moving in the direction of the key press\n\tif (keyPressed === LEFT_KEY && !goingRight) {\n\t\tdx = -10;\n\t\tdy = 0;\n\t} else if (keyPressed === UP_KEY && !goingDown) {\n\t\tdx = 0;\n\t\tdy = -10;\n\t} else if (keyPressed === RIGHT_KEY && !goingLeft) {\n\t\tdx = 10;\n\t\tdy = 0;\n\t} else if (keyPressed === DOWN_KEY && !goingDown) {\n\t\tdx = 0;\n\t\tdy = 10;\n\t}\n}", "title": "" }, { "docid": "9a497e47a528a0dc654eb38ea511fac2", "score": "0.6129609", "text": "function control(e) {\n squares[currentIndex].classList.remove('snake')\n \n if(e.keyCode === 39) {\n direction = 1 //tourne a droite\n } else if (e.keyCode === 38) {\n direction = -width // va en haut \n } else if (e.keyCode === 37) {\n direction = -1 // tourne a gauche\n } else if (e.keyCode === 40) {\n direction = +width //va en bas\n }\n }", "title": "" }, { "docid": "4329388a48e9197de1587b2cae91e4a3", "score": "0.61293256", "text": "move(dir) {\n\n\tif(dir == \"L\") {\n this.x += 1;\n } else if (dir == \"R\") {\n this.x -= 1;\n }\n\n if (dir == \"U\") {\n this.y += 1;\n } else if (dir == \"D\") {\n this.y -= 1;\n }\n\n\t\t//wraparound logic\n if(this.x > 1000){\n\t\t\tthis.x = -500;\n\t\t}\n\t\tif(this.x < -500){\n\t\t\tthis.x = 1000;\n\t\t}\n\t\tif(this.y > 1000){\n\t\t\tthis.y = -500;\n\t\t}\n\t\tif(this.y < -500){\n\t\t\tthis.y = 1000;\n\t\t}\n }", "title": "" }, { "docid": "ea4e5906e74776cbe1a3f2773f9abe63", "score": "0.61226314", "text": "move(dir){\n\t\tif(dir == \"L\") {\n this.x += 1;\n } else if (dir == \"R\") {\n this.x -= 1;\n }\n\n if (dir == \"U\") {\n this.y += 1;\n } else if (dir == \"D\") {\n this.y -= 1;\n }\n\n\t\t//wraparound logic\n if(this.x > 1000){\n\t\t\tthis.x = -500;\n\t\t}\n\t\tif(this.x < -500){\n\t\t\tthis.x = 1000;\n\t\t}\n\t\tif(this.y > 1000){\n\t\t\tthis.y = -500;\n\t\t}\n\t\tif(this.y < -500){\n\t\t\tthis.y = 1000;\n\t\t}\n\t}", "title": "" }, { "docid": "df073d5f1e56bfe6162303374cc867af", "score": "0.6117336", "text": "function drawSnake(snake){\n fill('#b4342e');\n forEach(snake, s => {\n rect(s.x * dx, s.y * dy, dx, dy);\n });\n noStroke();\n}", "title": "" }, { "docid": "78b173fac7544a2d04ac47172fa0ba95", "score": "0.610259", "text": "function moveSnake() {\n for (var i = 0; i < snake.length; i++) {\n if(snake[i].rotating){\n\n // rotating here didn't have time to do rotation algorithm\n var r = snake[i].rotating;\n var rSig = r/Math.abs(r);\n var thet = Math.PI/2;\n\n if(i == 0)\n snake[i].mesh.rotation.z += 2*SNAKESPEED*snake[i].rotating*thet/UNITSIZE/2;\n else\n snake[i].mesh.rotation.z += SNAKESPEED*snake[i].rotating*thet/UNITSIZE/2;\n\n // if(rSig > 0) {\n// \t\t\t\tif(Math.abs(snake[i].mesh.rotation.z) % Math.PI <= Math.PI/2 && Math.abs(snake[i].mesh.rotation.z)) {\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[11].x = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\t//snake[i].mesh.geometry.vertices[11].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[1].x = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// // \t\t\t\t\t//snake[i].mesh.geometry.vertices[1].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(-2*snake[i].mesh.rotation.z);\n// \t\t\t\t} else {\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[11].x = UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\t//snake[i].mesh.geometry.vertices[11].y = -UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[1].x = UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// // \t\t\t\t\t//snake[i].mesh.geometry.vertices[1].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t}\n// \t\t\t} else {\n// \t\t\t\tif(Math.abs(snake[i].mesh.rotation.z) % Math.PI <= Math.PI/2 && Math.abs(snake[i].mesh.rotation.z)) {\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[11].x = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\t//snake[i].mesh.geometry.vertices[11].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[1].x = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// // \t\t\t\t\t//snake[i].mesh.geometry.vertices[1].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(-2*snake[i].mesh.rotation.z);\n// \t\t\t\t} else {\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[11].x = UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\t//snake[i].mesh.geometry.vertices[11].y = -UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t\tsnake[i].mesh.geometry.vertices[1].x = UNITSIZE/2 + (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// // \t\t\t\t\t//snake[i].mesh.geometry.vertices[1].y = UNITSIZE/2 - (UNITSIZE/(2*Math.sqrt(2))) * Math.sin(2*snake[i].mesh.rotation.z);\n// \t\t\t\t}\n// \t\t\t}\n//\n// \t\t\tsnake[i].mesh.geometry.verticesNeedUpdate = true;\n\n // if(snake[i].rBuff.r && Math.abs(snake[i].rotating) >= UNITSIZE/2) {\n// \t\t\t\tif(i==0)console.log(\"buffed: \"+ snake[i].rotating);\n// \t\t\t\t//buffRot(i);\n// \t\t\t\tnormRot(i);\n// \t\t\t} else {\n// \t\t\t\tif(i==0)console.log(\"didnt: \"+ snake[i].rotating);\n// \t\t\t\tnormRot(i);\n// \t\t\t}\n }\n //else\n if(snake[i].move.lat)\n snake[i].mesh.position.x += snake[i].move.val;\n else\n snake[i].mesh.position.y += snake[i].move.val;\n }\n}", "title": "" }, { "docid": "87c479ea413aa3b30ad04785e98487b9", "score": "0.6097905", "text": "function snakeInitialize() {\n snake = [];\n snakeLength = 5;\n snakeSize = 20;\n snakeDirection = \"right\";\n\n for (var i = snakeLength - 1; i >= 0; i--) {\n snake.push({\n x: i,\n y: 0\n });\n }\n}", "title": "" }, { "docid": "f1a0d22fe0f184952904c63269791dd7", "score": "0.6095616", "text": "updateSnake() {\r\n this.addNewCells();\r\n const direction = this.userInput.getDirection();\r\n \r\n // Moving body\r\n for (let i = this.snakeBody.length - 2; i>= 0; i--) {\r\n this.snakeBody[i + 1]= {...this.snakeBody[i]}\r\n }\r\n \r\n // Snake's head\r\n this.snakeBody[0].x += direction.x;\r\n this.snakeBody[0].y += direction.y; \r\n }", "title": "" }, { "docid": "6d86420195deae107d6f8b9eba3e0c16", "score": "0.6086104", "text": "function updateSnakeBlocks () {\r\n\tfor (i = snake.length - 1; i >= 1; i--) {\r\n\t\tsnake[i].x = snake[i - 1].x;\r\n\t\tsnake[i].y = snake[i - 1].y;\r\n\t}\r\n}", "title": "" }, { "docid": "6d2e8ff8128953d3b52cb97bbf8386f1", "score": "0.6073984", "text": "function changeDirection() {\n if (rotateLeft) {\n rotationAngle += 1.7;\n }\n if (rotateRight) {\n rotationAngle -= 1.7;\n }\n}", "title": "" }, { "docid": "8376d4ab7533885b1431c2df66760e83", "score": "0.60703254", "text": "function keyPressed(){\r\n //up\r\n if(keyCode === UP_ARROW){\r\n snake.vel = createVector(0, -20);\r\n snake.loc.add(snake.vel);\r\n }\r\n //down\r\n if(keyCode === DOWN_ARROW){\r\n snake.vel = createVector(0, 20);\r\n snake.loc.add(snake.vel);\r\n }\r\n //right\r\n if(keyCode === RIGHT_ARROW){\r\n snake.vel = createVector(20, 0);\r\n snake.loc.add(snake.vel);\r\n }\r\n //left\r\n if(keyCode === LEFT_ARROW){\r\n snake.vel = createVector(-20, 0);\r\n snake.loc.add(snake.vel);\r\n }\r\n \r\n \r\nfunction cols() {\r\n return floor(width / scl);\r\n}\r\n\r\nfunction rows() {\r\n return floor(height / scl);\r\n}\r\n\r\nfunction randomVector() {\r\n return createVector(floor(random(cols())), floor(random(rows())));\r\n}\r\n}", "title": "" }, { "docid": "33bd3844aa1def8b119b4e091ee2c239", "score": "0.6066991", "text": "changeMoveDirection(direction){\n\n if (direction === \"up\"){\n this.yChange = -1;\n this.xChange = 0;\n this.moveDirection = \"up\";\n\n }\n if (direction === \"down\"){\n this.yChange = 1;\n this.xChange = 0;\n this.moveDirection = \"down\";\n\n }\n if (direction === \"left\"){\n this.yChange = 0;\n this.xChange = -1;\n this.moveDirection = \"left\";\n\n }\n if (direction === \"right\"){\n this.yChange = 0;\n this.xChange = 1;\n this.moveDirection = \"right\";\n\n }\n\n }", "title": "" }, { "docid": "9e3e3696f326618aa5c5e540a92d6989", "score": "0.6066165", "text": "changeDirection()\n {\n this.fwd = getRandomUnitVector();\n }", "title": "" }, { "docid": "acb36a4d3a0607d3ad2a42c770e6aaff", "score": "0.6048168", "text": "function giveMove(snake)\n{\n\tvar func = function()\n\t{\n\t\tvar head = snake.body[0];\n\t\tvar xy = moveByDirection(head.x, head.y, snake.direction);\n\t\tfor(var i = snake.body.length-1; i != 0; i--)\n\t\t{\n\t\t\tsnake.body[i].x = snake.body[i-1].x;\n\t\t\tsnake.body[i].y = snake.body[i-1].y;\n\t\t}\n\t\thead.x = xy[0];\n\t\thead.y = xy[1];\n\t\t\n\t}\n\treturn func;\n}", "title": "" }, { "docid": "22e62119abdad00721bb3144bcb498b6", "score": "0.6047125", "text": "function moveSnake() {\n\n switch(currentDirection) {\n case DIRECTION.LEFT:\n xPos.unshift(xPos[0] - bitSize);\n yPos.unshift(yPos[0]);\n break;\n case DIRECTION.UP:\n xPos.unshift(xPos[0]);\n yPos.unshift(yPos[0] - bitSize);\n break;\n case DIRECTION.RIGHT:\n xPos.unshift(xPos[0] + bitSize);\n yPos.unshift(yPos[0]);\n break;\n case DIRECTION.DOWN:\n xPos.unshift(xPos[0]);\n yPos.unshift(yPos[0] + bitSize);\n break;\n }\n\n // Move the snake again\n isKeyPressed = false;\n\n // Check for collisions\n if (snakeSize >= 4) {\n if (collision() == true) {\n gameOver();\n return;\n }\n }\n\n // Move the snake\n if (xPos[0] == xFood && yPos[0] == yFood) {\n generateFood();\n snakeSize ++;\n currentScore ++;\n if (currentScore%3 == 0) {\n poop();\n }\n } else {\n xPos.pop();\n yPos.pop();\n }\n\n // Draw the snake in the new position\n drawSnake();\n}", "title": "" }, { "docid": "7b1fb242f2acbe8fa0d15c033fe8fb69", "score": "0.60438424", "text": "function changeDirection() {\n switch (directionVar) {\n case \"Up\":\n //move \"up\" only when previous direction is not \"down\"\n if (previousDir !== \"Down\") {\n direction = directionVar;\n xSpeed = 0;\n ySpeed = scale * -speed;\n }\n break;\n\n case \"Down\":\n //move \"down\" only when previous direction is not \"up\"\n if (previousDir !== \"Up\") {\n direction = directionVar;\n xSpeed = 0;\n ySpeed = scale * speed;\n }\n break;\n\n case \"Left\":\n //move \"left\" only when previous direction is not \"right\"\n if (previousDir !== \"Right\") {\n direction = directionVar;\n xSpeed = scale * -speed;\n ySpeed = 0;\n }\n break;\n\n case \"Right\":\n //move \"right\" only when previous direction is not \"left\"\n if (previousDir !== \"Left\") {\n direction = directionVar;\n xSpeed = scale * speed;\n ySpeed = 0;\n }\n break;\n }\n}", "title": "" }, { "docid": "717e1cfdb6cf0d713fc53865e67166a6", "score": "0.6042695", "text": "changeDirection() {\n\t\tconst direction = state.currentDirection || state.direction;\n\n\t\tswitch (direction) {\n\t\t\tcase 'right':\n\t\t\t\tstate.velX = state.speed;\n\t\t\t\tstate.velY = 0;\n\t\t\t\tbreak;\n\t\t\tcase 'left':\n\t\t\t\tstate.velX = -state.speed;\n\t\t\t\tstate.velY = 0;\n\t\t\t\tbreak;\n\t\t\tcase 'up':\n\t\t\t\tstate.velX = 0;\n\t\t\t\tstate.velY = -state.speed;\n\t\t\t\tbreak;\n\t\t\tcase 'down':\n\t\t\t\tstate.velX = 0;\n\t\t\t\tstate.velY = state.speed;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(`In pacman change direction function. Current direction: ${direction}`);\n\t\t}\n\t}", "title": "" }, { "docid": "74fe3b18e8d6e5630524b4e90848cc1b", "score": "0.6027256", "text": "function updateDirection(event) {\n\n // Play sound every time key is pressed\n document.getElementById('turn').play()\n\n // Store the last 2 directions pressed\n previousDirection = currentDirection\n currentDirection = event.keyCode\n\n // Depending on combination of events figure out final direction to take\n if (previousDirection == 39 && currentDirection == 37) { //was going right and pressed left, still go right\n currentDirection = 39\n } else if (previousDirection == 37 && currentDirection == 39) { //was going left and pressed right, still go left\n currentDirection = 37\n } else if (previousDirection == 38 && currentDirection == 40) { //was going up and pressed down, still go up\n currentDirection = 38\n } else if (previousDirection == 40 && currentDirection == 38) { //was going down and pressed up, still go down\n currentDirection = 40\n }\n\n }", "title": "" }, { "docid": "c5ba77efdb91254769fccc89ebe7f08e", "score": "0.60268784", "text": "function paint(x,y, who)\n{\n if (who == 'snake')\n {\n for (var i=0; i<snake.length; i++) {\n var spriteX = 0;\n var spriteY = 0;\n if (i===0) {\n if (newdir == 'up') {\n spriteX = 3;\n spriteY = 0;\n } else if (newdir == 'down') {\n spriteX = 4;\n spriteY = 1;\n } else if (newdir == 'left') {\n spriteX = 3;\n spriteY = 1;\n } else {\n spriteX = 4;\n spriteY = 0;\n }\n } else if (i===snake.length-1) {\n if (snake[i].y > snake[i-1].y) {\n //snake tail is following upwards\n spriteX = 3;\n spriteY = 2;\n } else if (snake[i].y < snake[i-1].y) {\n // snake tail is following downwards\n spriteX = 4;\n spriteY = 3;\n } else if (snake[i].x > snake[i-1].x ) {\n //snake tail going left\n spriteX = 3;\n spriteY = 3;\n } else {\n //snake tail going right\n spriteX = 4;\n spriteY = 2;\n }\n } else {\n if (snake[i].x < snake[i-1].x) {\n // snake heading right\n if (snake[i].y < snake[i+1].y) {\n spriteX = 0;\n spriteY=0;\n } else if (snake[i].y > snake[i+1].y) {\n spriteX = 0;\n spriteY = 1;\n } else {\n spriteX = 1;\n spriteY=0;\n }\n } else if (snake[i].x > snake[i-1].x) {\n //snake heading left\n if (snake[i].y < snake[i+1].y) {\n spriteX=2;\n spriteY=0;\n } else if (snake[i].y > snake[i+1].y) {\n spriteX=2;\n spriteY=2;\n } else {\n spriteX=1;\n spriteY=0;\n }\n } else if (snake[i].y > snake[i-1].y){\n //snake moving up\n if (snake[i].x > snake[i+1].x) {\n spriteX=2;\n spriteY=2;\n } else if (snake[i].x < snake[i+1].x){\n spriteX= 0;\n spriteY=1;\n } else {\n spriteX=2;\n spriteY=1;\n }\n } else {\n // snake moving down\n if (snake[i].x > snake[i+1].x) {\n spriteX=2;\n spriteY=0;\n } else if (snake[i].x < snake[i+1].x) {\n spriteX=0;\n spriteY=0;\n } else {\n spriteX =2;\n spriteY=1;\n }\n }\n }\n ctx.drawImage(snakeImage, spriteX*64, spriteY*64, 64, 64, snake[i].x*cell, snake[i].y*cell, cell, cell);\n }\n }\n else if (who == 'snake2')\n {\n for (var i=0; i<snake2.length; i++) {\n var spriteX = 0;\n var spriteY = 0;\n if (i===0) {\n if (newdir2 == 'up') {\n spriteX = 3;\n spriteY = 0;\n } else if (newdir2 == 'down') {\n spriteX = 4;\n spriteY = 1;\n } else if (newdir2 == 'left') {\n spriteX = 3;\n spriteY = 1;\n } else {\n spriteX = 4;\n spriteY = 0;\n }\n } else if (i===snake2.length-1) {\n if (snake2[i].y > snake2[i-1].y) {\n //snake2 tail is following upwards\n spriteX = 3;\n spriteY = 2;\n } else if (snake2[i].y < snake2[i-1].y) {\n // snake2 tail is following downwards\n spriteX = 4;\n spriteY = 3;\n } else if (snake2[i].x > snake2[i-1].x ) {\n //snake2 tail going left\n spriteX = 3;\n spriteY = 3;\n } else {\n //snake2 tail going right\n spriteX = 4;\n spriteY = 2;\n }\n } else {\n if (snake2[i].x < snake2[i-1].x) {\n // snake2 heading right\n if (snake2[i].y < snake2[i+1].y) {\n spriteX = 0;\n spriteY=0;\n } else if (snake2[i].y > snake2[i+1].y) {\n spriteX = 0;\n spriteY = 1;\n } else {\n spriteX = 1;\n spriteY=0;\n }\n } else if (snake2[i].x > snake2[i-1].x) {\n //snake2 heading left\n if (snake2[i].y < snake2[i+1].y) {\n spriteX=2;\n spriteY=0;\n } else if (snake2[i].y > snake2[i+1].y) {\n spriteX=2;\n spriteY=2;\n } else {\n spriteX=1;\n spriteY=0;\n }\n } else if (snake2[i].y > snake2[i-1].y){\n //snake2 moving up\n if (snake2[i].x > snake2[i+1].x) {\n spriteX=2;\n spriteY=2;\n } else if (snake2[i].x < snake2[i+1].x){\n spriteX= 0;\n spriteY=1;\n } else {\n spriteX=2;\n spriteY=1;\n }\n } else {\n // snake2 moving down\n if (snake2[i].x > snake2[i+1].x) {\n spriteX=2;\n spriteY=0;\n } else if (snake2[i].x < snake2[i+1].x) {\n spriteX=0;\n spriteY=0;\n } else {\n spriteX =2;\n spriteY=1;\n }\n }\n }\n ctx.drawImage(snake2Image, spriteX*64, spriteY*64, 64, 64, snake2[i].x*cell, snake2[i].y*cell, cell, cell);\n }\n }\n else if (who == 'frog')\n {\n ctx.drawImage(frogImage, x*cell, y*cell, cell, cell);\n }\n // else if (who == 'poison')\n // {\n // ctx.fillStyle = 'red';\n // ctx.strokeStyle = 'white';\n // ctx.beginPath();\n // ctx.arc((x+0.5)*cell, (y+0.5)*cell, cell/2 - 3, 0, 2*Math.PI);\n // ctx.stroke();\n // ctx.fill();\n // }\n}", "title": "" }, { "docid": "cda757fd1f8a854b0a997985f999d5f9", "score": "0.6024482", "text": "moveSnadder() {\n let tile = tiles[this.spot];\n this.spot += tile.snadder;\n }", "title": "" }, { "docid": "30a5613256405eab01ea0e8454022b99", "score": "0.59889406", "text": "function increaseSnakeLength()\n{\n\tx[x.length]=tpx;\n\ty[y.length]=tpy;\n}", "title": "" }, { "docid": "970ae7de2280fdd0caf0d7227377453f", "score": "0.5980075", "text": "function changeDirection(key) {\n\t\tswitch (key) {\n\t\t\t// Left\n\t\t\tcase mKeys.A:\n\t\t\tcase mKeys.ARROW_LEFT:\n\t\t\tif (mLastDirection.axis === \"y\") {\n\t\t\t\tmSelf.setDirection(\"left\");\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\t// Right\n\t\t\tcase mKeys.D:\n\t\t\tcase mKeys.ARROW_RIGHT:\n\t\t\tif (mLastDirection.axis === \"y\") {\n\t\t\t\tmSelf.setDirection(\"right\");\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\t// Up\n\t\t\tcase mKeys.W:\n\t\t\tcase mKeys.ARROW_UP:\n\t\t\tif (mLastDirection.axis === \"x\") {\n\t\t\t\tmSelf.setDirection(\"up\");\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\t// Down\n\t\t\tcase mKeys.S:\n\t\t\tcase mKeys.ARROW_DOWN:\n\t\t\tif (mLastDirection.axis === \"x\") {\n\t\t\t\tmSelf.setDirection(\"down\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "efa402cd23dcd3afacc212bf4ad7b02f", "score": "0.5975084", "text": "moveSnake() {\n this.hasCollusion();\n if (this.state.collusion) return false;\n let _snake = this.state.snake;\n if (this.state.direction === this.DIRECTION.UP) {\n this.goUp(_snake);\n }\n if (this.state.direction === this.DIRECTION.DOWN) {\n this.goDown(_snake);\n }\n if (this.state.direction === this.DIRECTION.RIGHT) {\n this.goRight(_snake);\n }\n if (this.state.direction === this.DIRECTION.LEFT) {\n this.goLeft(_snake);\n }\n this.foodCollusion();\n\n setTimeout(this.moveSnake, 100);\n }", "title": "" }, { "docid": "4f97c643f7f8e116413fe4869ad8412c", "score": "0.5957489", "text": "function move(direction) {\n\tif (direction == 1) {\n\t\tpacman.y--;\n\t\tpacman.moved = true;\n\t} else if (direction == 2) {\n\t\tpacman.x++;\n\t\tpacman.moved = true;\n\t} else if (direction == 3) {\n\t\tpacman.y++;\n\t\tpacman.moved = true;\n\t} else if (direction == 4) {\n\t\tpacman.x--;\n\t\tpacman.moved = true;\n\t}\n}", "title": "" }, { "docid": "9fe8e7b80a24c42bf386676cc58e200c", "score": "0.59487116", "text": "function putSnake(x, y) {\n for (let i = 0; i < snake.length; i++) {\n let snakeElement = snake[i];\n snakeElement.style.left = `${x + i * 10}px`;\n snakeElement.style.top = `${y}px`;\n }\n}", "title": "" }, { "docid": "040fb3a9fa20d917d648ac77dca436f7", "score": "0.5944302", "text": "function keyboardHandler(event) {\n\n // disabled movement after each key to prevent sudden reversing of direction\n // it was previously possible to change directions twice before\n // the snake position had updated. For example, while going right\n // the player could press up and quickly left, allowing the snake\n // to head left before heading up, causing a snake collision and\n // ending the game (when segments below 5 were checked for collisions)\n\n if ((event.keyCode === 39 || event.keyCode === 68)\n && snakeDirection !== \"left\" && snakeMovement !== \"disabled\") {\n // console.log(\"RIGHT key detected\");\n snakeDirection = \"right\";\n snakeMovement = \"disabled\";\n }\n else if ((event.keyCode === 37 || event.keyCode === 65)\n && snakeDirection !== \"right\" && snakeMovement !== \"disabled\") {\n // console.log(\"LEFT key detected\");\n snakeDirection = \"left\";\n snakeMovement = \"disabled\";\n }\n else if ((event.keyCode === 38 || event.keyCode === 87)\n && snakeDirection !== \"down\" && snakeMovement !== \"disabled\") {\n // console.log(\"UP key detected\");\n snakeDirection = \"up\";\n snakeMovement = \"disabled\";\n }\n else if ((event.keyCode === 40 || event.keyCode === 83)\n && snakeDirection !== \"up\" && snakeMovement !== \"disabled\") {\n // console.log(\"DOWN key detected\");\n snakeDirection = \"down\";\n snakeMovement = \"disabled\";\n }\n}", "title": "" }, { "docid": "2501caff47e34bd0766af876b332997b", "score": "0.5942514", "text": "function moveForward(){\n console.log(`moveForward was called`);\n switch(rover.direction){\n case \"N\":\n if (rover.y > 0) {\n rover.y--; \n rover.track.push([rover.x, rover.y]);\n }\n break;\n case \"S\":\n if (rover.y < 9) { \n rover.y++; \n rover.track.push([rover.x, rover.y]); \n }\n break;\n case \"E\": \n if (rover.x < 9) { \n rover.x++;\n rover.track.push([rover.x, rover.y]); \n }\n break;\n case \"W\":\n if (rover.x > 0) { \n rover.x--; \n rover.track.push([rover.x, rover.y]); \n }\n break;\n } \n console.log(`The new position of the rover is (${rover.x}, ${rover.y})`); \n }", "title": "" }, { "docid": "f6f63cb7ecba555f270ff6b7dc435545", "score": "0.5938233", "text": "move() {\n switch (this.direction) {\n case ALL_DIRECTION[0]:\n if (this.chackingMove({\n x: this.coordinates.x - 1,\n y: this.coordinates.y\n }))\n this.coordinates.x += -1;\n break;\n case ALL_DIRECTION[1]:\n if (this.chackingMove({\n x: this.coordinates.x,\n y: this.coordinates.y + 1\n }))\n this.coordinates.y += 1;\n break;\n case ALL_DIRECTION[2]:\n if (this.chackingMove({\n x: this.coordinates.x + 1,\n y: this.coordinates.y\n }))\n this.coordinates.x += 1;\n break;\n case ALL_DIRECTION[3]:\n if (this.chackingMove({\n x: this.coordinates.x,\n y: this.coordinates.y - 1\n }))\n this.coordinates.y += -1;\n break;\n }\n }", "title": "" }, { "docid": "fdff0f11ee6536652607cf36087f0f97", "score": "0.5931101", "text": "setNewDirection(){\n let dir = Math.floor( Math.random() * 12 );\n switch(dir%4) {\n case 0: this.speedY = (-1).mx(); this.speedX = 0; break;\n case 1: this.speedY = (1).mx(); this.speedX = 0; break;\n case 2: this.speedX = (-1).mx(); this.speedY = 0; break;\n case 3: this.speedX = (1).mx(); this.speedY = 0; break;\n }\n }", "title": "" }, { "docid": "a76117a3fe5af506a3a34bf109d4599e", "score": "0.59252435", "text": "function turnRight(){\n console.log(\"turnRight was called!\");\n switch (rover.direction){\n case \"N\":\n rover.direction = \"E\";\n break;\n case \"W\":\n rover.direction = \"N\";\n break;\n case \"S\":\n rover.direction =\"W\";\n break;\n case \"E\":\n rover.direction = \"S\";\n break;\n }\n}", "title": "" }, { "docid": "99a0c2f1b2e47c4507d3665c56305286", "score": "0.5917715", "text": "moveSnake(key){\r\n\t\tif (key == undefined) {\r\n\t\t\tthis.pos.x += this.speed.x\r\n\t\t}\r\n\t\telse if (key == `KeyD` && this.backMove.right == true || key == \"KeyA\" && this.backMove.left == false) {\r\n\t\t\tthis.pos.x += this.speed.x\r\n\t\t\tthis.backMove.top = this.backMove.buttom = true\r\n\t\t\tthis.backMove.left = false\r\n\t\t}\r\n\t\telse if (key == `KeyS` && this.backMove.buttom == true || key == \"KeyW\" && this.backMove.top == false) {\r\n \t\tthis.pos.y += this.speed.y\r\n \t\tthis.backMove.left = this.backMove.right = true\r\n \t\tthis.backMove.top = false\r\n\t\t}\r\n\t\telse if (key == `KeyW` && this.backMove.top == true || key == \"KeyS\" && this.backMove.buttom == false) {\r\n\t\t\tthis.pos.y -= this.speed.y\r\n\t\t\tthis.backMove.left = this.backMove.right = true\r\n\t\t\tthis.backMove.buttom = false\r\n\t\t}\r\n\t\telse if (key == `KeyA` && this.backMove.left == true || key == \"KeyD\" && this.backMove.right == false) {\r\n\t\t\tthis.pos.x -= this.speed.x\r\n\t\t\tthis.backMove.top = this.backMove.buttom = true\r\n\t\t\tthis.backMove.right = false\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn\r\n\t\t} \r\n\t}", "title": "" }, { "docid": "0f6dd119cc99b52c0abafde53c667557", "score": "0.5911213", "text": "function move(directions) {\n var playerPosition = room.split(\",\");\n for (var i = 0; i < playerPosition.length; i++) {\n playerPosition[i] = parseInt(playerPosition[i]);\n }\n // West and East\n if (directions[0] !== 0) {\n playerPosition[0] += directions[0];\n dom_map.style.left = \"calc(50% - \" + ((0.5 * mapWidth) + (playerPosition[0] * roomSize * 2)) + \"px)\";\n if (drawnPositions.indexOf(playerPosition[0] + \",\" + playerPosition[1] + \",\" + playerPosition[2]) === -1) {\n if (directions[1] === 0) {\n drawSquare(playerPosition);\n drawnPositions.push(playerPosition[0] + \",\" + playerPosition[1] + \",\" + playerPosition[2]);\n }\n }\n }\n // North and South\n if (directions[1] !== 0) {\n playerPosition[1] += directions[1];\n dom_map.style.top = \"calc((0.5 * (100% - 208px - 45px)) - \" + ((0.5 * mapWidth) - (playerPosition[1] * roomSize * 2)) + \"px)\";\n if (drawnPositions.indexOf(playerPosition[0] + \",\" + playerPosition[1] + \",\" + playerPosition[2]) === -1) {\n drawSquare(playerPosition);\n drawnPositions.push(playerPosition[0] + \",\" + playerPosition[1] + \",\" + playerPosition[2]);\n }\n }\n room = playerPosition[0] + \",\" + playerPosition[1] + \",\" + playerPosition[2];\n }", "title": "" }, { "docid": "fd1013e3e53273e4bf0cdb0220da4482", "score": "0.59079534", "text": "function keyPressed(){\n if (keyCode === UP_ARROW){\n snake.face(0, -1);\n }else if (keyCode === DOWN_ARROW){\n snake.face(0, 1);\n }else if (keyCode === LEFT_ARROW){\n snake.face(-1, 0);\n }else if (keyCode === RIGHT_ARROW){\n snake.face(1, 0);\n }\n}", "title": "" }, { "docid": "6d96e877c4265537fabf33dc6e7bf7e8", "score": "0.5907389", "text": "function onKeyDown(evt) {\r\n if (evt.keyCode == 39) {rightDown = true;snake.turn();}\r\n else if (evt.keyCode == 37) {leftDown = true;snake.turn();}\r\n else if(evt.keyCode == 38) {upDown = true;snake.turn();}\r\n else if (evt.keyCode == 40) {downDown = true;snake.turn();}\r\n}", "title": "" }, { "docid": "e66d0611df9e7e191e30aed35666728c", "score": "0.5906876", "text": "function turnLeft() { //function will check current direction\n console.log(\"turnLeft was called!\"); //rover is facing, turn left, and log coordinates\n\n switch (rover.direction) {\n case 'N':\n rover.direction = 'W';\n break;\n\n case 'S':\n rover.direction = 'E';\n break;\n\n case 'E':\n rover.direction = 'N';\n break;\n\n case 'W':\n rover.direction = 'S';\n break;\n }\n}", "title": "" }, { "docid": "86a430e35a946f498f95568da7517f73", "score": "0.5893905", "text": "moveSnake(){\r\n if(this.GameRunning){\r\n //var old_head = this.head;\r\n this.BoardArray[this.tail[0]][this.tail[1]] = false;\r\n if(this.direction == 'N'){\r\n if(this.head[1]-1 < 0){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n }\r\n else if(this.BoardArray[this.head[0]][this.head[1]-1]){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n }\r\n else{\r\n this.SnakeBody.unshift([this.head[0],this.head[1]-1])\r\n this.head[1] = this.head[1]-1;\r\n this.tail = this.SnakeBody[this.SnakeBody.length-1];\r\n this.SnakeBody.pop();\r\n \r\n }\r\n \r\n }\r\n else if(this.direction == 'E'){\r\n if(this.head[0]+1 > 13){\r\n this.GameRunning = false;\r\n return false;\r\n }\r\n else if(this.BoardArray[this.head[0]+1][this.head[1]]){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n }\r\n else{\r\n this.SnakeBody.unshift([this.head[0]+1,this.head[1]])\r\n this.head[0] = this.head[0]+1;\r\n this.tail = this.SnakeBody[this.SnakeBody.length-1];\r\n this.SnakeBody.pop();\r\n \r\n }\r\n }\r\n else if(this.direction == 'S'){\r\n if(this.head[1]+1 > 13){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n \r\n }\r\n else if(this.BoardArray[this.head[0]][this.head[1]+1]){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n }\r\n else{\r\n this.SnakeBody.unshift([this.head[0],this.head[1]+1])\r\n this.head[1] = this.head[1]+1;\r\n this.tail = this.SnakeBody[this.SnakeBody.length-1];\r\n this.SnakeBody.pop();\r\n \r\n }\r\n }\r\n // direction would be west\r\n else{\r\n if(this.head[0]-1 <0){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n\r\n }\r\n else if(this.BoardArray[this.head[0]-1][this.head[1]]){\r\n this.GameRunning = false;\r\n \r\n return false;\r\n \r\n }\r\n else{\r\n this.SnakeBody.unshift([this.head[0]-1,this.head[1]])\r\n this.head[0] = this.head[0]-1;\r\n this.BoardArray[this.head[0]][this.head[1]] = true;\r\n \r\n this.tail = this.SnakeBody[this.SnakeBody.length-1];\r\n this.SnakeBody.pop();\r\n \r\n \r\n }\r\n \r\n }\r\n\r\n this.BoardArray[this.head[0]][this.head[1]] = true;\r\n this.BoardArray[this.tail[0]][this.tail[1]] = true;\r\n return true;\r\n }\r\n else{\r\n window.location.reload(true);\r\n }\r\n }", "title": "" }, { "docid": "6ee95397031260cc35bce63c1b8b64c2", "score": "0.58799136", "text": "function changeDirection(direction) {\r\n let dir = direction\r\n queen.direction = dir;\r\n return dir;\r\n}", "title": "" }, { "docid": "052065ee189b3f6df86ed1b48ebad582", "score": "0.5879286", "text": "function animate() {\n\n // Check more when the snake is in unit space\n var check = (snake[0].mesh.position.x % UNITSIZE == 0) &&\n (snake[0].mesh.position.y % UNITSIZE == 0);\n if(check) {\n // Update directions\n for (var i = snake.length - 1; i > 0; i--) {\n snake[i].move = snake[i-1].move;\n snake[i].rotating = snake[i-1].rotating;\n snake[i].pivot = snake[i-1].pivot;\n snake[i].rBuff = snake[i-1].rBuff;\n snake[i].unitPos = new THREE.Vector3(snake[i].mesh.position.x,snake[i].mesh.position.y,snake[i].mesh.position.z);\n }\n if(direction != snake[0].move.dir && oppDir(direction) != snake[0].move.dir) {\n var next = getMoveVal(direction);\n var oldRot = snake[0].rotating;\n var rot = 1.0;\n if(snake[0].move.lat) {\n if(snake[0].move.val == next.val)\n rot = -1;\n } else if(snake[0].move.val != next.val)\n rot = -1;\n snake[0].rotating = rot;\n\n var rB = rBuff();\n rB.r = oldRot;\n rB.pivot = snake[0].pivot;\n //snake[0].rBuff = rB;\n\n // Update pivot for turn\n snake[0].pivot = new THREE.Vector3(0,0,0);\n switch (snake[0].move.dir) {\n case UP:\n snake[0].pivot.x = snake[0].mesh.position.x + rot * UNITSIZE/2;\n snake[0].pivot.y = snake[0].mesh.position.y - UNITSIZE/2;\n break;\n case DOWN:\n snake[0].pivot.x = snake[0].mesh.position.x - rot * UNITSIZE/2;\n snake[0].pivot.y = snake[0].mesh.position.y + UNITSIZE/2;\n break;\n case LEFT:\n snake[0].pivot.x = snake[0].mesh.position.x + UNITSIZE/2;\n snake[0].pivot.y = snake[0].mesh.position.y + rot * UNITSIZE/2;\n break;\n case RIGHT:\n snake[0].pivot.x = snake[0].mesh.position.x - UNITSIZE/2;\n snake[0].pivot.y = snake[0].mesh.position.y - rot * UNITSIZE/2;\n break;\n }\n\n snake[0].unitPos = new THREE.Vector3(snake[0].mesh.position.x,snake[0].mesh.position.y,snake[0].mesh.position.z);\n snake[0].move = next;\n\n snake[1].rotating += snake[0].rotating;\n snake[1].pivot = snake[0].pivot;\n } else {\n snake[0].rotating = 0;\n }\n\n // Food collision\n if(collision(food.mesh.position.x, food.mesh.position.y, snake.slice(0,1))) {\n grow();\n }\n\n // Self collision\n for(var y = 0; y < snake.length; y++) {\n if(collision(snake[0].mesh.position.x,snake[0].mesh.position.y,snake.slice(1,snake.length)))\n gameOver = true;\n }\n\n // Handle out of bounds\n outOfBounds()\n\n if(gameOver) {\n alert(\"Score was \"+score+\"!\");\n window.location.reload();\n }\n\n if(collision(food.mesh.position.x, food.mesh.position.y, snake.slice(0,1))) grow();\n }\n\n moveSnake();\n\n // Update camera\n if(FIRSTPERSON) {\n camera.position.x = snake[0].mesh.position.x;\n camera.position.y = snake[0].mesh.position.y;\n camera.position.x -= Math.sin(snake[0].mesh.rotation.z)*5*UNITSIZE;\n camera.position.y -= Math.cos(snake[0].mesh.rotation.z)*5*UNITSIZE;\n camera.lookAt(snake[0].mesh.position);\n }\n}", "title": "" }, { "docid": "504fb25f3ef3d6d23f6d851d0b6d542e", "score": "0.5872929", "text": "forwardSlash() {\n switch (this.dir) {\n case NORTH:\n case SOUTH: this.turnRight(); break;\n case EAST:\n case WEST: this.turnLeft(); break;\n default:\n }\n }", "title": "" }, { "docid": "4277caa90491b4bc8075fb7de03eef34", "score": "0.5870447", "text": "function moveSnake() {\n // if (snake.length === 1) {\n if (frameCount % 2 === 0) {\n for (let i = snake.length - 1; i >= 0; i--) {\n if (movingUp && snake[i].y > 1) {\n if ((isEating === false)) {\n previousLocation = snake.pop();\n grid[previousLocation.y][previousLocation.x] = 0;\n previousLocation.y -= 1;\n snake.push(snakeBlock);\n } \n // else {\n // snakeBlock.y -= 1;\n // previousLocation = snake.pop();\n // grid[previousLocation.y][previousLocation.x] = 0;\n // previousLocation.y -= 1;\n // snake.push(snakeBlock);\n // snake.push(snakeBlock);\n // }\n\n\n //attempt at adding snake length\n }\n\n if (movingDown && snake[i].y < rows - 2) {\n previousLocation = snake.pop();\n grid[previousLocation.y][previousLocation.x] = 0;\n previousLocation.y += 1;\n snake.push(snakeBlock);\n }\n if (movingRight && snake[i].x < cols - 2) {\n previousLocation = snake.pop();\n grid[previousLocation.y][previousLocation.x] = 0;\n previousLocation.x += 1;\n snake.push(snakeBlock);\n }\n if (movingLeft && snake[i].x > 1) {\n previousLocation = snake.pop();\n grid[previousLocation.y][previousLocation.x] = 0;\n previousLocation.x -= 1;\n snake.push(snakeBlock);\n }\n }\n }\n}", "title": "" }, { "docid": "d010b6f157ae3155701e6f013682d793", "score": "0.587037", "text": "update() {\n // erase the old tail before moving\n if (!this.isNewSegment) {\n this.eraseTail();\n }\n\n let newP = this.snake[0]; // new position\n\n // check direction value and move the position 1 space in that direction\n if (this.direction == 0) {\n newP = [newP[0] - 1, newP[1]];\n } else if (this.direction == 1) {\n newP = [newP[0], newP[1] - 1];\n } else if (this.direction == 2) {\n newP = [newP[0] + 1, newP[1]];\n } else if (this.direction == 3) {\n newP = [newP[0], newP[1] + 1];\n }\n\n // append new position\n this.snake.unshift(newP);\n\n // remove last position\n if (!this.isNewSegment) {\n this.snake.pop();\n } else {\n this.isNewSegment = false;\n }\n \n\n // check if new position is out of bounds\n this.checkOutOfBounds();\n\n // check if the snake ate its own tail\n this.checkTailStep();\n\n // if not out of bounds, draw the head\n // (not doing this resulted in drawing the head to a new linel)\n if (!this.outOfBounds) {\n // draw the new head\n this.drawHead();\n }\n\n // try to eat the apple\n this.eatApple();\n }", "title": "" }, { "docid": "9f62c1028e40406e091f84ed9f79e122", "score": "0.58624274", "text": "function init() {\n\n h = canvas.style.height;\n w = canvas.style.width;\n cs = 15;\n snake = {\n len: 5,\n color: \"red\",\n cells: [],\n direction: \"right\",\n createSnake: () => {\n console.log(\"running createSnake func.\")\n for (var i = this.len; i > 0; i--)\n this.cells.push({ x: i, y: 0 });\n },\n drawSnake: () => {\n for (var i = 0; i < this.cells.length; i++) {\n pen.fillStyle = this.color;\n pen.fillRect(this.cells[i].x * cs, this.cells[i].y * cs, cs, cs);\n }\n },\n updateSnake: () => {\n var headx = this.cells[0].x;\n var heady = this.cells[0].y;\n this.cells.pop();\n var nextx, nexty;\n if (this.direction == \"right\") {\n nextx = headx + 1;\n nexty = heady;\n this.cells.unshift({ nextx, nexty });\n }\n else if (this.direction == \"down\") {\n nextx = headx;\n nexty = heady + 1;\n this.cells.unshift({ nextx, nexty });\n }\n else if (this.direction == \"left\") {\n nextx = headx - 1;\n nexty = heady;\n this.cells.unshift({ nextx, nexty });\n }\n else {\n nexty = heady - 1; nextx = headx;\n this.cells.unshift({ nextx, nexty });\n }\n },\n };\n\n snake.createSnake();\n function keyPress(e) {\n if (e.key == \"ArrowRight\") {\n this.direction = \"right\";\n }\n else if (e.key == \"ArrowDown\") {\n this.direction = \"down\";\n }\n else if (e.key == \"ArrowLeft\") {\n this.direction = \"left\";\n }\n else {\n this.direction = \"up\";\n }\n }\n document.addEventListener(\"keydown\", keyPress);\n\n}", "title": "" }, { "docid": "71cf48ef1846f6a97f9d84b8112c7aa3", "score": "0.5852163", "text": "setPlayerDirection() {\n switch( gameConfig.previousData.direction ) {\n case 'down':\n return 0;\n case 'up':\n return 1;\n case 'left':\n return 2;\n case 'right':\n return 3;\n default:\n return 0;\n }\n }", "title": "" }, { "docid": "aa750855e99ece4c5f874880fdd0beab", "score": "0.58375764", "text": "function moveTheSnake(clickX, clickY) {\n\t\n\t\n\t//top\n\t//draw.rect(135, canvas.height-controlPadHeight, 55, 55, 'red');\n\t//bottom\n\t//draw.rect(135, canvas.height-controlPadHeight+100, 55, 55, 'red');\n\t//draw.rect(140, canvas.height-controlPadHeight, 50, 50, 'red');\n\t//left\n\t//draw.rect(80, canvas.height-controlPadHeight+50, 55, 55, 'green');\n\t//right\n\t//draw.rect(190, canvas.height-controlPadHeight+50, 55, 55, 'green');\n\t\tif (checkButtonRectCollision(clickX, clickY, 0, 0, 72, topUIHeight) == true) { \n\t\t\t//alert(\"Peace!\");\n\t\t\tquitGame();\n\t\t}\n\t\n\tif (clickX > 80 && clickX < 135 && clickY > canvas.height-controlPadHeight+50 && clickY < canvas.height-controlPadHeight+105) { //left\n\t\t\t\tif (p1.currentDir != 1)\n\t\t\t\t\tp1.currentDir = 3;\n\t\t\t\t\t//alert(\"hey \" + click.x + click.y);\n\t\t\t} else if (clickX > 190 && clickX < 245 && clickY > canvas.height-controlPadHeight+50 && clickY < canvas.height-controlPadHeight+105) { //right\n\t\t\t\tif (p1.currentDir != 3)\n\t\t\t\t\tp1.currentDir = 1;\n\t\t\t\t\t//alert(\"hey \" + click.x + click.y);\n\t\t\t} else if (clickX > 135 && clickX < 190 && clickY > canvas.height-controlPadHeight && clickY < canvas.height-controlPadHeight + 55) { //up\n\t\t\t\tif (p1.currentDir != 2)\n\t\t\t\t\tp1.currentDir = 0;\n\t\t\t\t\t//alert(\"hey \" + click.x + click.y);\n\t\t\t} else if (clickX > 135 && clickX < 190 && clickY > canvas.height-controlPadHeight+100 && clickY < canvas.height-controlPadHeight+155) { //down\n\t\t\t\tif (p1.currentDir != 0)\n\t\t\t\t\tp1.currentDir = 2;\n\t\t\t\t\t//alert(\"hey \" + click.x + click.y);\n\t\t\t}\n\t}", "title": "" }, { "docid": "48854efd780164f95c0ab63aed10c1a5", "score": "0.5833628", "text": "function changeDirection2(event) {\n\t\n\t var leftKey = 37;\n var rightKey = 39;\n var upKey = 38;\n var downKey = 40;\n \n if (changingDirection2) return;\n changingDirection2 = true;\n \n var keyPressed = event.keyCode;\n var goingUp = d1y === -10;\n var goingDown = d1y === 10;\n var goingRight = d1x === 10;\n var goingLeft = d1x === -10;\n\t\t\n if (keyPressed === leftKey && !goingRight) {\n d1x = -10;\n d1y = 0;\n }\n \n if (keyPressed === upKey && !goingDown) {\n d1x = 0;\n d1y = -10;\n }\n \n if (keyPressed === rightKey && !goingLeft) {\n d1x = 10;\n d1y = 0;\n }\n \n if (keyPressed === downKey && !goingUp) {\n d1x = 0;\n d1y = 10;\n }\n }", "title": "" }, { "docid": "36a1724ea788f58ce7a9e90c96403c48", "score": "0.5829112", "text": "function keyPressed() {\n let keys = {\n LEFT : [LEFT_ARROW, 65, 74],\n RIGHT : [RIGHT_ARROW, 68, 76],\n UP : [UP_ARROW, 87, 73],\n DOWN : [DOWN_ARROW, 83, 75],\n };\n for (let i=0; i < snakes.length; i++) {\n if (keyCode === keys.LEFT[i]) {\n snakes[i].setDir(-1, 0);\n } else if (keyCode === keys.RIGHT[i]) {\n snakes[i].setDir(1, 0);\n } else if (keyCode === keys.UP[i]) {\n snakes[i].setDir(0, -1);\n } else if (keyCode === keys.DOWN[i]) {\n snakes[i].setDir(0, 1);\n }\n }\n}", "title": "" }, { "docid": "46a5db6d3ac884b173f281671edb7f18", "score": "0.5825409", "text": "turnRight() {\n switch (this.direction) {\n case 'N':\n this.direction = 'E';\n break;\n case 'E':\n this.direction = 'S';\n break;\n case 'S':\n this.direction = 'W';\n break;\n case 'W':\n this.direction = 'N';\n break;\n default:\n }\n }", "title": "" } ]
07e3b92f7d2272339f0d353e337d310f
Draw a 'target bar'. name string to label the graph with unknown is this value unknown? value numeric value units units for value targets array of objects with "label" and "value" keys, to display on the graph
[ { "docid": "166dc45ad1261c3fc9339144cb34d5dc", "score": "0.7413192", "text": "function targetbarSVG({ width, name, unknown, value, units, targets }) {\n const height = 40\n\n // Always 25% larger than max target or value\n const targetValues = targets.map(t => t.value)\n const maxval = Math.max(value, ...targetValues) * 1.25;\n const xscale = width / maxval;\n\n const header =\n unknown === true\n ? `Not enough data`\n : `${value} ${units}`\n\n const drawLine = target => {\n const x = target.value * xscale\n\n return `\n <line x1=\"${x}\" y1=\"1\" x2=\"${x}\" y2=\"${height-1}\" stroke=\"rgba(99,86,71,0.8)\" stroke-dasharray=\"4.33 4.33\" />\n <text x=\"${x+5}\" y=\"${height-22}\" fill=\"rgba(99,86,71,0.8)\">\n ${target.value} ${units}\n </text>\n <text x=\"${x+5}\" y=\"${height-8}\" fill=\"rgba(99,86,71,0.8)\" style=\"font-weight: bold;\">\n ${target.label}\n </text>\n `\n }\n\n return `\n <div class='targetbar-head'>\n <span>${name}:</span>\n <span><b>${header}</b></span>\n </div>\n\n <svg viewBox=\"0 0 ${width} ${height}\" height=\"${height}\">\n <rect x=\"1\" y=\"1\" width=\"${width-2}\" height=\"${height-2}\" style=\"fill: rgba(99,86,71,0.2); stroke: rgba(99,86,71, 0.5); stroke-width: 2px\" />\n <rect x=\"1\" y=\"1\" width=\"${(value*xscale)-2}\" height=\"${height-2}\" fill=\"rgba(99,86,71,0.2)\" />\n\n ${unknown ? \"\" : targets.map(drawLine)}\n </svg>\n `\n}", "title": "" } ]
[ { "docid": "5720c3779bcaaa92e1d980c0cb3d62a1", "score": "0.64408284", "text": "createValueLabels(data) {\n\n if (data == null) return;\n\n // The labels\n let labels = [];\n\n // For each point, create a bar\n for (var i = 0; i < data.length; i++) {\n\n if (data[i].y == null) continue;\n\n // The single datum\n let value = data[i].y;\n\n // Transform the value if necessary\n if (this.props.valueLabelTransform) value = this.props.valueLabelTransform(value);\n\n // Positioning of the text\n let x = this.x(data[i].x);\n let y = this.y(data[i].y);\n let key = 'Label-' + Math.random();\n let label;\n\n if (this.props.valueLabelTransform) label = (\n <Text style={[styles.valueLabel, {color: this.state.settings.valueLabelColor}]}>{value}</Text>\n )\n\n // Define the left shift based on the length of the string\n let leftShift = 8;\n if (value.length == 1) leftShift = 4;\n else if (value.length == 2) leftShift = 7;\n else if (value.length == 3) leftShift = 10;\n\n // Create the text element\n let element = (\n <View key={key} style={{position: 'absolute', left: x - leftShift, top: y - 24, alignItems: 'center'}}>\n {label}\n </View>\n );\n\n labels.push(element);\n }\n\n return labels;\n }", "title": "" }, { "docid": "3b88747c7ecf0474eb8004890c2840ed", "score": "0.6281087", "text": "_drawLabel(scales, val) {\n const numbers = formatters.preciseMoneyRange(val[0].value, val[1].value);\n const label = d3.select(this.el).selectAll('.bar-label');\n\n const range = label.selectAll('.money-range')\n .data([numbers]);\n\n range.enter().append('text')\n .attr('class', 'money-range')\n .attr('y', 20)\n .attr('x', 15);\n\n range.text(d => d);\n\n range.exit().remove();\n }", "title": "" }, { "docid": "1bd712e1c394578572226fedb8c6aaee", "score": "0.5943111", "text": "function drawSingleValueBarChart(values,labels,tooltips,selector,width,height,color,y_max,bottom_margin) {\n // padding between bars, and for the X and Y axis labels (bottom and left)\n var padding_between_bars = 1;\n if (!bottom_margin) bottom_margin = 75;\n var left_margin = 50;\n var top_margin = 10;\n\n // the callbacks for mouse activity\n function mouseOverBar(value,index) {\n // the behavior here is to look for the SVG's containing div.graph elements, and position a div.charthover over it\n // be sure to enclose the SVG DIV in a div.graph, and set up CSS for div.graphhover\n var container = $(this).closest('.graphwrapper');\n container.find('.graphhover').remove();\n\n // add the tooltip, so we can get its width & height\n var tooltip = $('<div></div>').addClass('graphhover').html(tooltips[index]).appendTo(container);\n\n // get the mouse position relative to CENTER OF the SVG container\n // add the offset of the container and be sure the container uses position:relative, and voila\n var posx = d3.mouse(this)[0];\n var posy = d3.mouse(this)[1] - tooltip.height() + 13;\n tooltip.css({\n top: posy + 'px', left: posx + 'px'\n });\n }\n function mouseOutBar(value,index) {\n var container = $(this).closest('.graphwrapper');\n container.find('.graphhover').remove();\n }\n\n function determineBarHeightFromData(value) {\n // scale the height based on this value as a percentage of y_max\n // but also enforce a minimum, cuz it's difficult to mouse over a 1px-high rectangle\n var bar_height = Math.round(height * (value / y_max));\n if (bar_height < 4) bar_height = 4;\n return bar_height;\n }\n\n // automatic Y scaling: find the highest value of the supplied data, use that as the maximum Y\n if (! y_max) y_max = Math.max.apply(Math,values);\n\n // find the sum of the \n\n // create SVG element\n // add some extra padding for the X and Y axis labels\n var svg = d3.select(selector).append(\"svg\").attr(\"width\", width + left_margin).attr(\"height\", height + bottom_margin + top_margin);\n\n // create the rectangles for the bars, load the values, set up the width/height/x/y and color for the bars\n svg.selectAll(\"rect\").data(values).enter().append(\"rect\")\n .attr('transform','translate('+left_margin+','+top_margin+')')\n .attr(\"x\", function(datum,index) {\n // X position is this bar's number x the width of a bar\n return index * (width / values.length);\n })\n .attr(\"y\", function(datum,index) {\n // Y position is the height of the chart minus the height of the bar\n return height - determineBarHeightFromData(datum);\n })\n .attr(\"height\", function(datum,index) {\n return determineBarHeightFromData(datum);\n })\n .attr(\"width\", width / values.length - padding_between_bars)\n .attr(\"fill\", function(datum,index) {\n return color; // passed as a parameter\n })\n .on('mousemove', mouseOverBar).on('mouseout', mouseOutBar);\n\n // add the Y axis\n var y_scale = d3.scale.linear().domain([0,y_max]).range([height,0]);\n svg.append(\"g\").call( d3.svg.axis().scale(y_scale).orient(\"left\") )\n .attr('class','yaxis').attr('height',height).attr('transform','translate('+left_margin+','+top_margin+')');\n\n // add the X axis\n // the domain is the list of labels (X notches) and it is mapped onto a range of X values (positions)\n // so: generate the list of X positions for labels, calculate a scale for this\n var label_xs = [];\n for (var i=0, l=labels.length; i<l; i++) label_xs.push( (i+0.5) * (width / l) );\n var x_scale = d3.scale.ordinal().domain(labels).range(label_xs);\n svg.append(\"g\").call( d3.svg.axis().scale(x_scale).orient(\"bottom\") )\n .attr('class','xaxis').attr('transform','translate('+left_margin+','+(height+top_margin)+')')\n .selectAll(\"text\")\n .style(\"text-anchor\", \"start\")\n .attr(\"dx\", 10)\n .attr(\"dy\", (width/labels.length)*-0.10 )\n .attr(\"transform\", function(d) {\n return \"rotate(90)\";\n });\n}", "title": "" }, { "docid": "42c3bd068273f428723ed5edd930274a", "score": "0.58939135", "text": "function label_bars(){\n svg.selectAll(\"text.num\")\n .attr(\"id\", \"num\")\n .data(dataset)\n .enter()\n .append(\"text\")\n .text(function(d) {\n return d.length;\n })\n .attr(\"text-anchor\", \"middle\")\n .attr(\"x\", function(d, i) {\n return i * (w / dataset.length) + (w / dataset.length - barPadding) / 2;\n })\n .attr(\"y\", function(d) {\n return 140\n })\n // .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"11px\")\n .attr(\"fill\", \"white\");\n }", "title": "" }, { "docid": "3ca8be2109e149b3eca6b3a29624ba7e", "score": "0.57662636", "text": "function drawTypeBTab1()\n{\n var labels = ['Detection Threshold (Rare+/Flu+)', 'Minimum Flu+ Sample Size'];\n var x = [];\n var xChartLabelMap = {};\n var xTableLabelMap = {};\n var y;\n\n // range: detection threshhold (increments of 0.1)\n var min = 0.1;\n var max = 5;\n var numValues = 50;\n\n for(var i=0; i<numValues; i++)\n {\n // round to the nearest 100th\n var value = Math.round((min + i/(numValues-1)*(max-min)) * 100) / 100;\n\n // we need the 1/165 case\n if(value == 0.6)\n {\n value = 0.606;\n }\n\n x.push(value);\n\n // labels\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n if(value == 0.1)\n {\n // also get other special cases...\n // the label code is identical to above\n value = 0.1429;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n value = 0.1667;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n }\n }\n\n // final value for threshold 1/4\n value = 25.0;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n // use a parameters object to pass in any other input parameters to the evaluation function\n var parameters = new Object();\n parameters.population = calculatorTypeBInputs.population;\n parameters.surveillanceScale = calculatorTypeBInputs.surveillanceScale;\n parameters.confidenceLevel = calculatorTypeBInputs.confidenceLevel1;\n\n // evaluation for each x\n y = x.map(evaluateTypeB_FluSampleSize_vs_detectionThreshold, parameters);\n\n // separate DataTable objects for chart / table to allow for formatting\n var dataChart = arraysToDataTable(labels, [x, y]);\n var dataTable = dataChart.clone();\n\n // remove last row (1/4 threshold) from chart, since we don't want it drawn there...\n dataChart.removeRow(52);\n\n // chart: use xChartLabelMap as the x label\n var formatterChart = new labelFormatter(xChartLabelMap);\n formatterChart.format(dataChart, 0);\n\n // table: use xTableLabelMap as the x label\n var formatterChart = new labelFormatter(xTableLabelMap);\n formatterChart.format(dataTable, 0);\n\n var optionsChart = {\n title: '',\n hAxis : { title: labels[0], format: \"#.##'%'\" },\n vAxis : { title: labels[1] },\n legend : { position: 'none' },\n fontSize : chartFontSize\n };\n\n // need to specify width here (rather than in CSS) for IE\n var optionsTable = {\n width: '225px'\n };\n\n $(\"#calculatorB1_chart_table_description_div\").html(\"<span class='calculatorTooltip' title='\" + tooltipTypeBMinimumFluSampleSize + \"'>Minimum sample size (of Flu+ specimens)</span> required to detect a rare/novel influenza at a specified <span class='calculatorTooltip' title='\" + tooltipTypeBDetectionThreshold + \"'>detection threshold (Rare+/Flu+)</span>, with a confidence of \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \". These calculations assume a total population of \" + formatTextParameter(numberWithCommas(parameters.population)) + \". Use the mouse to view values in the sample size graph and scroll through sample size table.\");\n\n var chart = new google.visualization.LineChart(document.getElementById('calculatorB1_chart_div'));\n chart.draw(dataChart, optionsChart);\n\n var table = new google.visualization.Table(document.getElementById('calculatorB1_table_div'));\n var tableDataView = new google.visualization.DataView(dataTable);\n\n if(calculatorTypeBInputs.tableMode1 == \"simple\")\n {\n tableDataView.setRows([1,6,52]);\n }\n\n table.draw(tableDataView, optionsTable);\n\n // selection handling\n var thisObj = drawTypeBTab1;\n\n google.visualization.events.addListener(chart, 'select', chartSelectHandler);\n google.visualization.events.addListener(table, 'select', tableSelectHandler);\n\n function chartSelectHandler(e) { thisObj.selectHandler(chart.getSelection(), \"chart\"); }\n function tableSelectHandler(e) { thisObj.selectHandler(table.getSelection(), \"table\"); }\n\n thisObj.selectHandler = function(selectionArray, source)\n {\n if(selectionArray.length > 0 && selectionArray[0].row != null)\n {\n thisObj.selectedRow = selectionArray[0].row;\n\n if(source == \"table\")\n {\n // map to selected row in underyling data table\n thisObj.selectedRow = tableDataView.getTableRowIndex(thisObj.selectedRow);\n }\n\n // make sure row is valid\n if(thisObj.selectedRow >= x.length)\n {\n thisObj.selectedRow = 0;\n }\n\n // form new array with only this entry (to avoid multiple selections)\n // selection arrays are different between the chart and table...\n var newSelectionArrayChart = [{row:thisObj.selectedRow}];\n var newSelectionArrayTable = [{row:tableDataView.getViewRowIndex(thisObj.selectedRow)}];\n\n // select element in chart and table\n chart.setSelection(newSelectionArrayChart);\n table.setSelection(newSelectionArrayTable);\n\n if(parameters.surveillanceScale == \"National\")\n {\n $(\"#calculatorB1_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(xTableLabelMap[x[thisObj.selectedRow]]) + \" at a national level, the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" Flu+ specimens.\");\n }\n else\n {\n $(\"#calculatorB1_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(xTableLabelMap[x[thisObj.selectedRow]]) + \" (within the population under surveillance), the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" Flu+ specimens.\");\n }\n }\n }\n\n thisObj.selectHandler([{row:thisObj.selectedRow ? thisObj.selectedRow : 0}]);\n}", "title": "" }, { "docid": "e89de6a46115035407f6ecf09cbf3990", "score": "0.57499206", "text": "function ctTargetLineWithLabel(options) {\n return function ctTargetLineWithLabel(chart) {\n chart.on(\"created\", function (data) {\n let projectedY = data.chartRect.height() - data.axisY.projectValue(options.value, 0) + data.chartRect.y2;\n data.svg.elem(\"text\", {\n x: data.chartRect.x1 - options.offset,\n y: projectedY + options.offset,\n \"text-anchor\": \"end\",\n fill: \"white\"\n }, \"chart-text\").text(options.text)\n data.svg.elem(\"line\", {\n x1: data.chartRect.x1,\n x2: data.chartRect.x2,\n y1: projectedY,\n y2: projectedY\n }, options.className, true)\n });\n };\n}", "title": "" }, { "docid": "3b7f6022ec97dc53455633c20fdbcad8", "score": "0.5749762", "text": "function plotBarChart(otuIds, otuLabels, sampleVals){\n let trace1 = {\n y: otuIds.map(id => \"OTU ID \".concat(id)).reverse(),\n x: sampleVals.reverse(),\n type: \"bar\",\n orientation: 'h',\n text: otuLabels,\n hovertemplate: '%{text}<extra></extra>'\n };\n \n let data = [trace1];\n\n let layout = {\n\n};\n\n Plotly.newPlot(\"bar\", data, layout);\n}", "title": "" }, { "docid": "0bcd0182654c416e85037431a7605112", "score": "0.5741674", "text": "function setLabel(props){\n \n // set NaN as 0 \n var val = props[expressed];\n val = val ? val: 0;\n \n // round to 2 decimals\n var sqMi = Math.round(val * 100) / 100;\n \n // get state name\n state = props.name;\n \n //label content\n var labelAttribute = \"<h4>\" + state +\n \" has \" + sqMi + \" sq mi of \" + expressed + \"</h4>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n}", "title": "" }, { "docid": "2676a1e9520c55ed0fd941a2abe85cb8", "score": "0.5737482", "text": "function busDelayChart_manuallabels() {\n outputProcessor(\"getDifferRequiredProvidedTimeValuesTotal\").then(res => {\n labels = [\"0-5 mins\", \"6-10 mins\", \"11-14 mins\", \"15-18 mins\", \"19-20 mins\"]\n data = [0,0,0,0,0]\n for (var i=0;i<res.length;i++) {\n duration = (res[i][\"pickup\"]/60)+(res[i][\"delivery\"]/60)\n if (duration < 6) {\n data[0]++\n } else if (duration >= 6 && duration < 11) {\n data[1]++\n } else if (duration >= 11 && duration < 15) {\n data[2]++\n } else if (duration >= 15 && duration < 19) {\n data[3]++\n } else if (duration >= 19 && duration <= 20) {\n data[4]++\n } else {\n data[Math.floor(Math.random() * data.length)]++\n }\n }\n \n var virtual_stop_distance_chart_data_2 = {\n type: 'bar',\n data: {\n scaleStartValue: 0,\n labels: labels,\n datasets: [{\n label: 'Tempos de espera do usuario',\n backgroundColor: 'rgb(255, 99, 132)',\n borderColor: 'rgb(255, 99, 132)',\n data: data\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n fontSize: 40\n }\n }],\n xAxes: [{\n ticks: {\n fontSize: 40\n }\n }]\n },\n legend: {\n \"display\": true,\n \"labels\": {\n \"fontSize\": 40,\n }\n }\n }\n }\n \n new Chart(ctx, virtual_stop_distance_chart_data_2);\n });\n}", "title": "" }, { "docid": "6e57107a49f29e5dcff0862575e2ea20", "score": "0.573192", "text": "function barChart() {\n d3.json(\"samples.json\").then(data =>{\n var target = select.property(\"value\");\n for (var b = 0;b<data.names.length;b++) {\n if (target === data.names[b]) {\n\n var data_ids = data.samples[b].otu_ids;\n var sample_data_values = data.samples[b].sample_values;\n var data_lables = data.samples[b].otu_labels;\n\n var id_list = [];\n var smpl_list = [];\n var labels_list = [];\n\n for (var i = 0; i<10; i++) {\n id_list.push(\"OTU ID\"+data_ids[i]);\n labels_list.push(data_lables[i]);\n smpl_list.push(sample_data_values[i]);\n\n var trace_b = {\n type: \"bar\",\n x: smpl_list,\n y: id_list,\n text: labels_list,\n orientation: \"h\",\n };\n \n var barChart = [trace_b];\n \n var layout_b = {\n title:\"Data Values based on ID\",\n // colorway = c('#3d3b72'),\n };\n \n Plotly.newPlot(\"bar\",barChart,layout_b);\n\n };\n }\n }\n })\n}", "title": "" }, { "docid": "c3f1daeb1cc7f622d15b99f335cb426f", "score": "0.56972426", "text": "function drawTypeBTab2()\n{\n var labels = ['Detection Threshold (Rare+/Flu+)', 'Minimum MA-ILI Sample Size'];\n var x = [];\n var xChartLabelMap = {};\n var xTableLabelMap = {};\n var y;\n\n // range: detection threshhold (increments of 0.1)\n var min = 0.1;\n var max = 5;\n var numValues = 50;\n\n for(var i=0; i<numValues; i++)\n {\n // round to the nearest 100th\n var value = Math.round((min + i/(numValues-1)*(max-min)) * 100) / 100;\n\n // we need the 1/165 case\n if(value == 0.6)\n {\n value = 0.606;\n }\n\n // round to the nearest 100th\n x.push(value);\n\n // labels\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n if(value == 0.1)\n {\n // also get other special cases...\n // the label code is identical to above\n value = 0.1429;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n value = 0.1667;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n }\n }\n\n // final value for threshold 1/4\n value = 25.0;\n x.push(value);\n xChartLabelMap[value] = \"Detection Threshhold: \" + value + \"% (1/\" + Math.round(100. / value) + \")\";\n xTableLabelMap[value] = value + \"% (1/\" + Math.round(100. / value) + \")\";\n\n // use a parameters object to pass in any other input parameters to the evaluation function\n var parameters = new Object();\n parameters.population = calculatorTypeBInputs.population;\n parameters.surveillanceScale = calculatorTypeBInputs.surveillanceScale;\n parameters.confidenceLevel = calculatorTypeBInputs.confidenceLevel2;\n parameters.p = calculatorTypeBInputs.p2;\n\n // evaluation for each x\n y = x.map(evaluateTypeB_MAILISampleSize_vs_detectionThreshold, parameters);\n\n // separate DataTable objects for chart / table to allow for formatting\n var dataChart = arraysToDataTable(labels, [x, y]);\n var dataTable = dataChart.clone();\n\n // remove last row (1/4 threshold) from chart, since we don't want it drawn there...\n dataChart.removeRow(52);\n\n // chart: use xChartLabelMap as the x label\n var formatterChart = new labelFormatter(xChartLabelMap);\n formatterChart.format(dataChart, 0);\n\n // table: use xTableLabelMap as the x label\n var formatterChart = new labelFormatter(xTableLabelMap);\n formatterChart.format(dataTable, 0);\n\n var optionsChart = {\n title: '',\n hAxis : { title: labels[0], format: \"#.##'%'\" },\n vAxis : { title: labels[1] },\n legend : { position: 'none' },\n fontSize : chartFontSize\n };\n\n // need to specify width here (rather than in CSS) for IE\n var optionsTable = {\n width: '225px'\n };\n\n $(\"#calculatorB2_chart_table_description_div\").html(\"<span class='calculatorTooltip' title='\" + tooltipTypeBMinimumMAILISampleSize + \"'>Minimum sample size (of unscreened MA-ILI specimens)</span> required to detect a rare/novel influenza of influenza at the specified <span class='calculatorTooltip' title='\" + tooltipTypeBDetectionThreshold + \"'>detection threshold (Rare+/Flu+)</span>, with a confidence of \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \". These calculations assume a total population of \" + formatTextParameter(numberWithCommas(parameters.population)) + \" and a Flu+/MA-ILI prevalence of \" + formatTextParameter(parameters.p + \"%\") + \". Use the mouse to view values in the sample size graph and scroll through sample size table.\");\n\n var chart = new google.visualization.LineChart(document.getElementById('calculatorB2_chart_div'));\n chart.draw(dataChart, optionsChart);\n\n var table = new google.visualization.Table(document.getElementById('calculatorB2_table_div'));\n var tableDataView = new google.visualization.DataView(dataTable);\n\n if(calculatorTypeBInputs.tableMode2 == \"simple\")\n {\n tableDataView.setRows([1,6,52]);\n }\n\n table.draw(tableDataView, optionsTable);\n\n // selection handling\n var thisObj = drawTypeBTab2;\n\n google.visualization.events.addListener(chart, 'select', chartSelectHandler);\n google.visualization.events.addListener(table, 'select', tableSelectHandler);\n\n function chartSelectHandler(e) { thisObj.selectHandler(chart.getSelection(), \"chart\"); }\n function tableSelectHandler(e) { thisObj.selectHandler(table.getSelection(), \"table\"); }\n\n thisObj.selectHandler = function(selectionArray, source)\n {\n if(selectionArray.length > 0 && selectionArray[0].row != null)\n {\n thisObj.selectedRow = selectionArray[0].row;\n\n if(source == \"table\")\n {\n // map to selected row in underyling data table\n thisObj.selectedRow = tableDataView.getTableRowIndex(thisObj.selectedRow);\n }\n\n // make sure row is valid\n if(thisObj.selectedRow >= x.length)\n {\n thisObj.selectedRow = 0;\n }\n\n // form new array with only this entry (to avoid multiple selections)\n // selection arrays are different between the chart and table...\n var newSelectionArrayChart = [{row:thisObj.selectedRow}];\n var newSelectionArrayTable = [{row:tableDataView.getViewRowIndex(thisObj.selectedRow)}];\n\n // select element in chart and table\n chart.setSelection(newSelectionArrayChart);\n table.setSelection(newSelectionArrayTable);\n\n if(parameters.surveillanceScale == \"National\")\n {\n $(\"#calculatorB2_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(xTableLabelMap[x[thisObj.selectedRow]]) + \" at a national level, the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" MA-ILI specimens.\");\n }\n else\n {\n $(\"#calculatorB2_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(xTableLabelMap[x[thisObj.selectedRow]]) + \" (within the population under surveillance), the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" MA-ILI specimens.\");\n }\n }\n }\n\n thisObj.selectHandler([{row:thisObj.selectedRow ? thisObj.selectedRow : 0}]);\n}", "title": "" }, { "docid": "c867782e2bda9603508e9484186bd7c0", "score": "0.5695777", "text": "getDataTargetForBarChart() {\n var self = this;\n\n switch(self.getDataTypeForBarChart()) {\n case \"single\":\n self.dataSource.forEach(function(data, index) {\n let _stack = [];\n let _data = {\n \"max\": Helper.get(self.keys.value, data),\n \"stack\": [{\n \"name\" : Helper.get(self.keys.name, data),\n \"y0\" : 0,\n \"y1\" : Helper.get(self.keys.value, data),\n \"enable\" : true,\n }]\n };\n self.dataTarget.push(_data);\n });\n\n return self.dataTarget;\n break;\n\n case \"group\":\n var groups = self.groups;\n\n // Iterate over each group\n self.dataSource.forEach(function(data, index) {\n let _group = {\n \"max\" : null,\n \"stack\" : []\n },\n _dsArray = Helper.get(self.keys.value, data);\n\n // If Group has only 1 value, so MAX = this.value\n if (Helper.isArray(_dsArray)) {\n _group.max = Helper.max(_dsArray);\n } else {\n _group.max = _dsArray;\n }\n\n let _stack = [],\n _stackItem = {\n \"color\": \"#ffffff\",\n \"y0\": 0,\n \"y1\": 1,\n \"group\": \"\",\n \"name\": \"\",\n \"data-ref\": \"\",\n \"enable\" : true,\n },\n color = self.colorRange;\n\n // Iterate each single bar in a group\n if (Helper.isArray(_dsArray)) {\n _dsArray.forEach(function(d, i) {\n _stackItem = {\n \"color\": color(i),\n \"y0\": 0,\n \"y1\": d,\n \"group\": groups[i] || i,\n \"name\": Helper.get(self.keys.name, data),\n \"data-ref\": Helper.guid(),\n \"enable\" : true,\n };\n _stack.push(_stackItem);\n });\n } else {\n _stackItem = {\n \"color\": color(0),\n \"y0\": 0,\n \"y1\": _dsArray,\n \"group\": groups[0] || 0,\n \"name\": Helper.get(self.keys.name, data),\n \"data-ref\": Helper.guid(),\n \"enable\" : true,\n };\n _stack.push(_stackItem);\n }\n _group.stack = _stack;\n\n self.dataTarget.push(_group);\n });\n\n return self.dataTarget;\n break;\n\n case \"stack\":\n var stacks = self.stacks;\n\n // Iterate over each group\n self.dataSource.forEach(function(data, index) {\n let _group = {\n \"max\" : null,\n \"stack\" : []\n },\n _dsArray = Helper.get(self.keys.value, data);\n\n // If Group has only 1 value, so MAX = this.value\n if (Helper.isArray(_dsArray)) {\n _group.max = Helper.sum(_dsArray);\n } else {\n _group.max = _dsArray;\n }\n\n let _stack = [],\n _stackItem = {\n \"color\": \"#ffffff\",\n \"y0\": 0,\n \"y1\": 1,\n \"group\": \"\",\n \"name\": \"\",\n \"data-ref\": \"\",\n \"enable\" : true,\n },\n color = self.colorRange;\n\n // Iterate each single bar in a group\n if (Helper.isArray(_dsArray)) {\n let _tempY0 = 0;\n _dsArray.forEach(function(d, i) {\n _stackItem = {\n \"color\": color(i),\n \"y0\": _tempY0,\n \"y1\": _tempY0 + d,\n \"group\": stacks[i] || i,\n \"name\": Helper.get(self.keys.name, data),\n \"data-ref\": Helper.guid(),\n \"enable\" : true,\n };\n _stack.push(_stackItem);\n // Increase tempY0 by d to restore previous y0\n _tempY0 += d;\n });\n } else {\n _stackItem = {\n \"color\": color(0),\n \"y0\": 0,\n \"y1\": _dsArray,\n \"group\": stacks[0] || 0,\n \"name\": Helper.get(self.keys.name, data),\n \"data-ref\": Helper.guid(),\n \"enable\" : true,\n };\n _stack.push(_stackItem);\n }\n _group.stack = _stack;\n\n self.dataTarget.push(_group);\n });\n\n return self.dataTarget;\n break;\n\n default:\n return self.dataSource;\n break;\n }\n \n }", "title": "" }, { "docid": "779b431d48926b3f6440e2ef6957d3d2", "score": "0.5693528", "text": "function makeAndLabelBars (value) {\n var barPadding = 1; \n var labelyoffset = 0; \n myNS.svg1.selectAll(\"rect.issue\").remove(); \n myNS.svg1.selectAll(\"rect.issue\") \n\t.data(myNS.currSetBG)\n\t.enter()\n\t.append(\"rect\")\n\t.attr(\"class\", \"issue\")\n\t.attr(\"x\", function(d, i) {\n\t return myNS.x(i);\n\t})\n\t.attr(\"y\", function(d) {\n\t return myNS.y(parseInt(getMonthVal(d, value)));\n\t})\n\t.attr(\"width\", (myNS.wBG-2*myNS.p) / myNS.currSetBG.length - \n\t barPadding)\n\t.attr(\"height\", function(d) {\n\t return myNS.hBG - myNS.p - myNS.y(parseInt(getMonthVal(d, value)));\n\t})\n\t.attr(\"fill\", myNS.rectColor);\n}", "title": "" }, { "docid": "d7feb61f960e05117e4996fa58cccf4f", "score": "0.5638301", "text": "function bar(d) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n .selectAll(\"g\")\n .data(d.children)\n .enter().append(\"g\")\n .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\n .on(\"click\", down);\n\n bar.append(\"text\")\n .attr(\"x\", -6)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d.name; });\n\n bar.append(\"rect\")\n .attr(\"width\", function(d) { return x(d.value); })\n .attr(\"height\", barHeight);\n\n return bar;\n }", "title": "" }, { "docid": "f73c9cbe5606faa4674bab80d42fff7f", "score": "0.56316584", "text": "function updateLabels() {\n var optShowMaximum = _value.options.showMaximum;\n if (typeof optShowMaximum == 'undefined') {\n optShowMaximum = _representation.options.showMaximum;\n }\n var optOrientation = _value.options['orientation'];\n var texts = svg.select('.knime-x').selectAll('text');\n texts.each(function (d, i) {\n if (typeof wrapedPlotData[0].values[i] !== 'undefined') {\n var self = d3.select(this);\n self.text(wrapedPlotData[0].values[i].x);\n self.append('title').classed('knime-tooltip', true);\n }\n });\n var stacked = _value.options['chartType'];\n var extremValues = [];\n \tif(stacked == \"Grouped\") {\n \t\textremValues = getRoundedMaxValue(false);\t\n \t} else {\n \t\textremValues = getRoundedMaxValue(true);\n \t}\n \tvar minValue = extremValues[0];\n \tvar maxValue = extremValues[1];\n \t\n var tickAmount = chart.yAxis.ticks();\n if (tickAmount < 2) {\n tickAmount = 2;\n }\n\n var scale = d3.scale.linear().domain([minValue, maxValue]);\n\n var textsYMin, textsYMax;\n if (optShowMaximum) {\n if (optOrientation) {\n textsYMin = svg.select('.nv-axisMin-x').selectAll('text');\n textsYMax = svg.select('.nv-axisMax-x').selectAll('text');\n } else {\n textsYMin = svg.select('.nv-axisMin-y').selectAll('text');\n textsYMax = svg.select('.nv-axisMax-y').selectAll('text');\n }\n textsYMin.text(minValue);\n textsYMax.text(maxValue);\n }\n\n var labelTooltip = texts.selectAll('.knime-tooltip');\n var counter = 0;\n labelTooltip.each(function (d, i) {\n var self = d3.select(this);\n if (typeof plotData[0].values[counter] !== 'undefined') {\n self.text(plotData[0].values[counter].x);\n }\n counter++;\n });\n\n // Create titles for the Axis-Tooltips\n svg.select('.knime-y text.knime-axis-label').append('title').classed('knime-tooltip', true).text(\n _value.options['freqLabel']);\n svg.select('.knime-x text.knime-axis-label').append('title').classed('knime-tooltip', true).text(\n _value.options['catLabel']);\n }", "title": "" }, { "docid": "7d6f51a57efe32b1e7d14630b7ff2d6d", "score": "0.5627541", "text": "function bar(d) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n .selectAll(\"g\")\n .data(d.children)\n .enter().append(\"g\")\n .style(\"cursor\", function(d) { return (!d.children || d.nochildren) ? null : \"pointer\"; })\n .style('fill', '#A6A6A6')\n .on(\"click\", down);\n\n bar.append(\"text\")\n .attr(\"x\", -6)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d.name.length > 20 ? d.name.substring(0, 20) + '...' : d.name; });\n\n bar.append(\"rect\")\n .attr(\"width\", function(d) { return x(d.value); })\n .attr(\"height\", barHeight)\n .style('fill', function(d, i) { return d.color; })\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide);\n return bar;\n }", "title": "" }, { "docid": "4c6333004dcb05a7c7216f816e0323b9", "score": "0.5595171", "text": "function draw_js_barchart_with_label(data_chart, id, title, type) {\n var data_label = [];\n var data_value = [];\n\n for(var i=0;i<data_chart.length;i++) {\n data_label.push(data_chart[i].year);\n data_value.push(data_chart[i].count);\n }\n\n var ctx = document.getElementById(id);\n new Chart(ctx, {\n type: 'bar',\n plugins: [ChartDataLabels],\n data: {\n labels: data_label,\n datasets: [\n {\n label: title,\n data: data_value,\n backgroundColor: bg_colours[type]\n }\n ]\n },\n options: {\n events: [], // Disable hover and tooltip\n title: {\n display: true,\n text: title\n },\n legend: {\n display: false\n },\n scales:{\n xAxes: {\n stacked: true\n },\n yAxes: {\n stacked: true\n }\n },\n responsive: false,\n plugins: {\n datalabels: {\n anchor: 'end', // remove this line to get label in middle of the bar\n align: 'end'\n }\n }\n }\n });\n}", "title": "" }, { "docid": "4a552a5bc100b6cba36337f9cfcbfae8", "score": "0.5571574", "text": "plotDotPlot(target, story) {\n this.graph\n .xAxis('Memory used (MiB)')\n .title(story)\n .addData(JSON.parse(JSON.stringify(target)))\n .plotDot();\n }", "title": "" }, { "docid": "2e7282a5fc31caeaa957d1405ff5673b", "score": "0.5563318", "text": "function setLabel(props){\n\n if (expressed == attrArray[0]){\n labelTitle = \"Net Generation (MWh)\"\n }\n else if (expressed == attrArray[1]){\n labelTitle = \"Net Summer Capacity (GW)\"\n }\n else if (expressed == attrArray[2]){\n labelTitle = \"Average Retail Price (cents/kWh)\"\n }\n else if (expressed == attrArray[3]){\n labelTitle = \"Total Retail Sales (MWh)\"\n }\n else if (expressed == attrArray[4]){\n labelTitle = \"Carbon Dioxide Emission (Mt)\"\n };\n //label content\n var labelAttribute = \"<h1>\" + Math.round(props[expressed]) +\n \"</h1><b>\" + labelTitle + \"</b>\";\n\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.State + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.State);\n\n}", "title": "" }, { "docid": "710890158d82e7dcc3ef2f53b66fa0bb", "score": "0.5556888", "text": "function buildBar(barGraphNames,barGraphValues) {\n\n // Clear existing chart object\n d3.select(\"#bar-chart\").html(\"\");\n\n // Define the plot layout\n var layout = {\n autosize: true,\n title: \"Firms with Most Recalls\",\n titlefont: {\n size: 16,\n color: 'black' \n },\n height: 450,\n margin: {\n l: 40,\n r: 30,\n t: 50,\n b: 0,\n },\n xaxis: { \n title: \"Firm Name\",\n automargin: true,\n tickangle: 90\n },\n yaxis: { \n title: \"Recalls\",\n automargin: true\n }\n };\n\n // Define trace for bar chart\n var trace1 = {\n x: barGraphNames,\n y: barGraphValues,\n opacity: .7,\n marker: {\n color: \"#f16913\"\n },\n type: \"bar\"\n };\n\n var data = [trace1];\n\n // Plot the chart to a div tag with id \"bar-plot\"\n Plotly.newPlot(\"bar-chart\", data, layout,{displayModeBar: false, responsive: true}); \n\n}", "title": "" }, { "docid": "61210bfa9c973646fb6f878d22bf9bf3", "score": "0.5554455", "text": "function labelFn(label) {\n return 'y = ' + label;\n }", "title": "" }, { "docid": "752d37d8931253f5bd6d257fac3aeab0", "score": "0.55388075", "text": "function BarGraph(sequencenumber, valuenumber){\n\t//variables = sequence number, actual number value for each in sequence\n\t\n\t\n\t//150 x value highest 50 Y \n\t//each rectangle 50 units high, value number across\n\trect((150),50,xvaluenumber,50)\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}", "title": "" }, { "docid": "1a62b9d9018d2212434193711e0feaf9", "score": "0.55277133", "text": "function drawValues() {\r\n // change y axis (immmediate, no transition)\r\n var y = d3.scaleLinear().rangeRound([graphHeight, 0]).domain([0, 500]);\r\n d3.selectAll('.axis--y')\r\n .call(d3.axisLeft(y).ticks(12));\r\n\r\n d3.selectAll('.yAxisText')\r\n .text('$ (Millions)');\r\n\r\n // // transition total funds bars\r\n // graph.selectAll('.tBar')\r\n // .transition()\r\n // .duration(500)\r\n // .attr('y', function(d) {return y(d.total / 1e6)})\r\n // .attr('height', function(d) {return graphHeight - y(d.total / 1e6); });\r\n\r\n // transition reserve fund bars\r\n graph.selectAll(\".rBar\")\r\n //.transition()\r\n //.duration(500)\r\n .attr(\"y\", function(d) { return y(d.reserve_fund / 1e6); })\r\n .attr(\"height\", function(d) { return graphHeight - y(d.reserve_fund / 1e6); });\r\n\r\n // draw line\r\n //var pLine = d3.line()\r\n //.x(function(d) { return x(d.year) + (0.5 * x.bandwidth()); })\r\n //.y(function(d) { return y(0.05 * d.general_fund / 1e6); });\r\n //d3.selectAll('.pLine')\r\n //.transition()\r\n //.duration(500)\r\n //.attr('d', pLine);\r\n\r\n // place the label\r\n //d3.selectAll('.policyText')\r\n //.transition()\r\n //.duration(500)\r\n //.attr('y', y(270))\r\n }", "title": "" }, { "docid": "39bf5ee8bd67d867e4003b84d502a814", "score": "0.551536", "text": "function barLabels(xScaled, yScaled) {\n\n // make x and y axis\n var xAxis = d3.axisBottom(xScaled)\n var yAxis = d3.axisLeft(yScaled)\n\n // append ticks to x-axis\n d3.select(\".bars\")\n .append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + (height - yPadding) + \")\")\n .call(xAxis);\n\n // append x-label\n d3.select(\".bars\")\n .append(\"text\")\n .attr(\"class\", \"myLabelX\")\n .attr(\"y\", height - 10)\n .attr(\"x\", width / 2)\n .attr('text-anchor', 'middle')\n .text(\"Studies\");\n\n // append ticks to y-axis\n d3.select(\".bars\")\n .append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + xPadding + \",0)\")\n .call(yAxis);\n\n // append y-label\n d3.select(\".bars\")\n .append(\"text\")\n .attr(\"class\", \"myLabelY\")\n .attr(\"y\", 12)\n .attr(\"x\", -150)\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .text(\"Number of students enrolled\")\n}", "title": "" }, { "docid": "cc7f2c4559a41d92650fc3f8dbd2f0de", "score": "0.55116516", "text": "function drawMagnitudeLabels(){\n fill(128);\n // we increase i by the interval, breaking the values into sections\n for (var i=magnitudeMin; i<=magnitudeMax; i+=magnitudeInterval){\n noStroke();\n textSize(8);\n textAlign(RIGHT, CENTER);\n // map y to the plotting surface\n var y = map(i, magnitudeMin, magnitudeMax, y_bot, y_top);\n\n // write value\n text(floor(i), x_left-10, y);\n\n // add visual tick mark\n stroke(128);\n strokeWeight(1);\n line(x_left-4, y, x_left-1, y);\n }\n}", "title": "" }, { "docid": "bcd73e2976bf60c0fdc70afd8990bd33", "score": "0.55038995", "text": "function setLabel(props){\n\n //Choosing text that appears in label\n var labelAttribute = \"<center><h1>\" + props[expressed] + \"</h1></center>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name.replace(/\\s+/g, '') + \"_label\")\n .html(labelAttribute);\n\n var stateName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n\n}", "title": "" }, { "docid": "a05a4fc844aecdb8697c04ec1602f12c", "score": "0.55029374", "text": "function buildBar(el, o) {\n el.addClass('progress-bar-wrapper');\n el.append('<label>'+ o.name+ ' '+ o.value+ ' '+ o.suffix+ '</label><div class=\"progress-bar-text\"><div class=\"progress-bar init\"></div></div>');\n el.drawBar(o);\n }", "title": "" }, { "docid": "687f968d08afab52e8d4a946e69b1f55", "score": "0.54807305", "text": "function setLabel(props) {\n\n\t\t//label content\t\n\t\tvar labelAttribute = \"<h1>\" + props.id +\n\t\t\t\"</h1><br><b>\" + Math.floor(props[expressed]) + \"</b><p>(percentile)</p>\";\n\n\t\t//create info label div\n\t\tvar infolabel = d3.select(\"#map\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infolabel\")\n\t\t\t.attr(\"id\", props.id + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t} //end of setLabel", "title": "" }, { "docid": "cafb075772fd54275eaa34b1520ca824", "score": "0.5461282", "text": "function draw_target(x, y, target, setting) {\n var r_radius = setting.font_height / 3;\n if (r_radius < 1)\n r_radius = 1;\n var radius;\n if (setting.hover) {\n radius = r_radius * 1.2;\n } else {\n radius = r_radius;\n }\n var arc = {\n fillStyle: \"black\",\n x: x,\n y: y,\n radius: radius\n };\n if (setting.hover) {\n $.extend(arc, {\n fillStyle: \"red\",\n strokeStyle: \"black\",\n strokeWidth: radius * .8\n });\n }\n $(this).drawArc(arc);\n var text = {\n fillStyle: 'black',\n x: x + r_radius * 2,\n y: y,\n text: target.label\n };\n var text_size = $(this).measureText(text);\n text.x += text_size.width / 2;\n if (setting.hover) {\n $.extend(text, {\n fillStyle: 'red',\n strokeStyle: 'red',\n strokeWidth: setting.font_height / 15\n });\n }\n $(this).drawText(text);\n }", "title": "" }, { "docid": "bb25572a26d6798e2d4e38f4aa147f10", "score": "0.5456573", "text": "function drawGraph(data) {\n\tstack.push(data);\n\n\tvar target = document.getElementById('target_taxa')\n\n\tvar x = d3.scale.ordinal()\n\t\t.rangeRoundBands([0, width], .1)\n\t\t.domain(sortDescending(data).map(function(d) {\n\t\t\treturn d.key\n\t\t}));\n\n\tvar y = d3.scale.linear()\n\t\t.domain([0, getMax(data)])\n\t\t.range([height, 0]);\n\n\tvar xAxis = d3.svg.axis()\n\t\t.scale(x)\n\t\t.orient(\"bottom\");\n\n\tvar yAxis = d3.svg.axis()\n\t\t.scale(y)\n\t\t.orient(\"left\")\n\t\t.ticks(10);\n\n\tvar tip = d3.tip()\n\t\t.attr('class', 'd3-tip')\n\t\t.offset([-10, 0])\n\t\t.html(function(d) {\n\t\t\tif (d3.values(d)[1][2] != \"\") {\n\t\t\t\treturn d.key + \"<br/>(\" + d3.values(d)[1][2] + \")<br/>Annotated Taxa Count: \" + d3.values(d)[1][0];\n\t\t\t} else {\n\t\t\t\treturn d.key + \"<br/>Annotated Taxa Count: \" + d3.values(d)[1][0];\n\t\t\t}\n\n\t\t})\n\n\tvar svg = d3.select(\"#taxa\").append(\"svg\")\n\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t.append(\"g\")\n\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\tsvg.call(tip);\n\n\t//x axis label\n\tsvg.append(\"text\")\n\t\t.attr(\"class\", \"x label\")\n\t\t.attr(\"text-anchor\", \"end\")\n\t\t.attr(\"x\", width / 2)\n\t\t.attr(\"y\", height + 30)\n\t\t//.text(\"Taxa\")\n\n\tsvg.append(\"g\")\n\t\t.attr(\"class\", \"x axis\")\n\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t.call(xAxis); //Creates x axis label\n\n\tsvg.selectAll(\"text\")\n\t\t.call(wrap, x.rangeBand())\n\t\t.attr(\"y\", 0)\n\t\t.attr(\"x\", 50)\n\t\t.attr(\"transform\", \"rotate(45)\")\n\t\t.style(\"text-anchor\", \"start\");\n\n\t//hyperlink the x axis labels\n\td3.selectAll(\"text\")\n\t\t.filter(function(d) {\n\t\t\treturn typeof(d) == \"string\";\n\t\t})\n\t\t.style(\"cursor\", \"pointer\")\n\t\t.on(\"mouseover\", function(d) {\n\t\t\td3.select(this).style(\"fill\", \"blue\");\n\t\t})\n\t\t.on(\"mouseout\", function(d) {\n\t\t\td3.select(this).style(\"fill\", \"black\");\n\t\t})\n\t\t.on(\"click\", function(d) {\n\t\t\tconsole.log(data[d][1]);\n\t\t\tdocument.location.href = \"http://kb.phenoscape.org/#/taxon/\" + data[d][1];\n\t\t});\n\n\tvar yLine = svg.append(\"g\")\n\t\t.attr(\"class\", \"y axis\")\n\t\t.call(yAxis)\n\t\t.append(\"text\")\n\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t.attr(\"y\", -70)\n\t\t.attr(\"dy\", \".71em\")\n\t\t.style(\"text-anchor\", \"end\")\n\t\t.text(\"Annotated Taxa Count\");\n\n\tvar bars = svg.selectAll(\".bar\")\n\t\t.data(d3.entries(data))\n\t\t.enter().append(\"rect\")\n\t\t.attr(\"fill\", phenoBlue)\n\t\t.attr(\"class\", \"bar\")\n\t\t.attr(\"x\", function(d) {\n\t\t\treturn x(d.key);\n\t\t})\n\t\t.attr(\"width\", x.rangeBand())\n\t\t.attr(\"y\", function(d) {\n\t\t\treturn y(d3.values(d)[1][0]);\n\t\t})\n\t\t.attr(\"height\", function(d) {\n\t\t\treturn height - y(d3.values(d)[1][0]);\n\t\t})\n\t\t.on('mouseover', tip.show)\n\t\t.on('mouseout', tip.hide)\n\n\t//to go back on graph\n\tvar svg = d3.select('#taxa_button').on('click', function() {\n\t\tif (stack.length == 1) {\n\t\t\talert(\"Can't go back anymore\");\n\t\t} else {\n\t\t\tremoveEverything(tip, \"taxa\");\n\t\t\tconsole.log(stack.pop());\n\t\t\tdrawGraph(stack.pop());\n\t\t}\n\t});\n\n\t//update to get sub anatomies based on click\n\tbars.on('click', function(d, i) {\n\t\tvar spinner = new Spinner(opts).spin(target); //create loading spinner\n\t\tvar promise = new Promise(function(resolve, reject) {\n\t\t\tvar dataset = [];\n\t\t\tvar VTOurl = d3.values(d)[1][1];\n\t\t\tgetTaxaInRank(VTOurl, function(d) {\n\t\t\t\tif (d.length == 0) {\n\t\t\t\t\treject(Error(\"No more descending possible\"));\n\t\t\t\t}\n\t\t\t\tfor (var i in d) { //iterate through array of subtaxa\n\t\t\t\t\tget_total(d[i], function(i, total) {\n\t\t\t\t\t\tgetName(d[i], function(name, latin) {\n\t\t\t\t\t\t\tdataset[name] = [total, d[i], latin];\n\t\t\t\t\t\t\tif (Object.keys(dataset).length == d.length) {\n\t\t\t\t\t\t\t\tresolve(dataset); //new data to graph\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}.bind(null, i));\n\t\t\t\t}\n\t\t\t})\n\t\t\tsetTimeout(reject.bind(null, data), 10000);\n\t\t});\n\n\t\tpromise.then(function(result) {\n\t\t\tremoveEverything(tip, \"taxa\");\n\t\t\t//console.log(result);\n\t\t\tspinner.stop()\n\t\t\tdrawGraph(result);\n\t\t}, function(err) {\n\t\t\talert(\"No more descending possible\")\n\t\t\tspinner.stop()\n\t\t\t\t//removeEverything(tip, \"taxa\");\n\t\t\t\t//drawGraph(data);\n\t\t\tconsole.log(\"No more descending possible\", err);\n\t\t})\n\n\t});\n\n}", "title": "" }, { "docid": "0006bdd4ea245ec125137e7ab8f32df7", "score": "0.54518193", "text": "buildBar(){\n // dimensions for the bar and labels\n let barx = 30;\n let bary = 140;\n let barWidth = 900;\n let barHeight = 10;\n // Create the svg:defs element and the main gradient definition.\n let colors = [\"black\", \"lightgrey\"];\n // create a color gradient for the bar\n var grad = this.svg.append('defs')\n .append('linearGradient')\n .attr('id', 'grad')\n .attr('x1', '0%')\n .attr('x2', '100%')\n .attr('y1', '0%')\n .attr('y2', '0%')\n ;\n grad.selectAll('stop')\n .data(colors)\n .enter()\n .append('stop')\n .style('stop-color', function(d){ return d; })\n .attr('offset', function(d,i){\n return 100 * (i / (colors.length - 1)) + '%';\n })\n ;\n // create the bar\n let bar = this.svg.append('rect')\n .attr('x', barx)\n .attr('y', bary)\n .attr('width', barWidth)\n .attr('height', barHeight)\n .style('fill', 'url(#grad)')\n ;\n\n let scaler = d3.scaleLinear()\n .domain([0, 500])\n .range([barx, barWidth + barx])\n ;\n // holds the objects of the attributes that have been clicked\n let clickedAttributes = [];\n // remove function for arrays\n Array.prototype.remove = function() {\n var what, a = arguments, L = a.length, ax;\n while (L && this.length) {\n what = a[--L];\n while ((ax = this.indexOf(what)) !== -1) {\n this.splice(ax, 1);\n }\n }\n return this;\n };\n let thiss = this;\n // create the circles for the attributes and functionality\n this.svg.selectAll('circle')\n .data(this.totRank)\n .enter()\n .append('circle')\n .attr('cx', function (d) {return scaler(d[0].ranktot);})\n .attr('cy', bary + 5)\n .attr('r', '11')\n .style('fill', 'white')\n .style('stroke', function (d) {\n for (let i = 0; i < thiss.attrColor.length; i++){\n if (d[0].attrname == thiss.attrColor[i].attrname){\n return thiss.attrColor[i].attrcol\n }\n }\n })\n .style('stroke-width', 5)\n .on('click', function (d) {\n let color = \"\";\n for (let i = 0; i < thiss.attrColor.length; i++){\n if (d[0].attrname == thiss.attrColor[i].attrname){\n // return thiss.attrColor[i].attrcol\n color = thiss.attrColor[i].attrcol\n }\n }\n\n if (d3.select(this).attr('r') == 11){\n d3.select(this).attr('r', 15)\n }\n else {\n d3.select(this).attr('r', 11)\n }\n if (d3.select(this).style('fill') == 'white'){\n d3.select(this).style('fill', color)\n }\n else {\n d3.select(this).style('fill', 'white')\n }\n clickedAttributes.includes(d[0].attrname) ? clickedAttributes.remove(d[0].attrname) : clickedAttributes.push(d[0].attrname)\n thiss.barChart.updateSelectedAttributes(clickedAttributes);\n thiss.barChart.update();\n\n })\n ;\n // label the attribute circles\n this.svg.selectAll('text')\n .data(this.totRank)\n .enter()\n .append('text')\n .text(function (d) {\n for (let i = 0; i < thiss.attrColor.length; i++){\n if (d[0].attrname == thiss.attrColor[i].attrname){\n return thiss.attrColor[i].attrlabel\n }\n }\n })\n .style('font-size', '13px')\n // .style('font-family', \"Bahnschrift\")\n .style('font-family', \"Lato\")\n .attr(\"text-anchor\", \"start\")\n .attr('transform', (d, i) => {\n return 'translate( ' + (scaler(d[0].ranktot)) + `, ${bary-17}), rotate(-45)`;\n })\n ;\n // label the low attribute bar\n this.svg.append('text')\n .style('font-size', '20px')\n .style('font-family', 'Arvo')\n .attr('x', barx)\n .attr('y', bary + 60)\n .text('Does Not Affect Performance')\n .attr('text-anchor', 'start')\n ;\n this.svg.append('text')\n .style('font-size', '20px')\n .style('font-family', 'Arvo')\n .attr('x', barWidth + barx)\n .attr('y', bary + 60)\n .text('Affects Performance')\n .attr('text-anchor', 'end')\n ;\n let barTitle = this.svg.append('text')\n .text(\"Attribute\")\n .style(\"font-family\", 'Arvo')\n .style('font-size', '40px')\n .style('fill', 'black')\n .attr('text-anchor', 'start')\n .attr('transform', `translate(${barx}, 30), rotate(0)`)\n ;\n let barTitle2 = this.svg.append('text')\n .text(\"Importance Selector\")\n .style(\"font-family\", 'Arvo')\n .style('font-size', '20px')\n .style('fill', 'black')\n .attr('text-anchor', 'start')\n .attr('transform', `translate(${barx}, 60), rotate(0)`)\n ;\n }", "title": "" }, { "docid": "9e6d3ba253880a77123da2f88d3b7625", "score": "0.5436134", "text": "function barsPlot() {\r\n\r\n // Filter metadata comparing the ID from the dropdown and The \"id\" from the object\r\n var samples = sample.filter(data => data.id == dropdownID);\r\n\r\n // Get the top 10 sample values from sample_values, reverse to align them\r\n var sample_values = samples[0].sample_values.slice(0, 10).reverse();\r\n // console.log(sample_values);\r\n\r\n // Get the top 10 OTU IDs from otu_ids, reverse to align them\r\n var otu_ids = samples[0].otu_ids.slice(0, 10).reverse();\r\n // console.log(otu_ids);\r\n\r\n // Get the top 10 OTU labels from otu_labels\r\n var otu_labels = samples[0].otu_labels.slice(0, 10);\r\n // console.log(otu_labels);\r\n\r\n var trace1 = {\r\n x: sample_values,\r\n // Format the Y labels\r\n y: otu_ids.map(id => `OTU ${id}`),\r\n text: otu_labels,\r\n type: \"bar\",\r\n orientation: \"h\",\r\n marker: {\r\n color: \"#1978b5\"\r\n }\r\n };\r\n \r\n var layout = {\r\n yaxis:{\r\n tickmode:\"linear\",\r\n },\r\n margin: {\r\n l: 80,\r\n r: 80,\r\n t: 15,\r\n b: 15\r\n }\r\n };\r\n\r\n // Assign the trace to data and finally plot the visualization as a bar plot\r\n var data = [trace1];\r\n Plotly.newPlot(\"bar\", data, layout);\r\n }", "title": "" }, { "docid": "d53676aab5d759d1827e35de44b1fcdd", "score": "0.54329413", "text": "function setLabelPosition() {\n\tif (document.getElementById(\"rb1\").checked) {\n\t\tchart.labelRadius = 30;\n\t\tchart.labelText = \"[[title]]: [[value]]\";\n\t} else {\n\t\tchart.labelRadius = -30;\n\t\tchart.labelText = \"[[percents]]%\";\n\t}\n\tchart.validateNow();\n}", "title": "" }, { "docid": "7d8650dde632feb3d7e684a4b67e8c92", "score": "0.5424082", "text": "function createChart(labels, touchs, passes) {\n\n var options = {\n scaleLabel : \"<%=value%>\",\n scaleOverlay : true,\n scaleShowLabels : true\n };\n\n var data = {\n labels: labels,\n datasets: [\n {\n fillColor: \"rgba(220,220,220,0.5)\",\n strokeColor: \"rgba(220,220,220,1)\",\n data: passes\n },\n {\n fillColor: \"rgba(151,187,205,0.5)\",\n strokeColor: \"rgba(151,187,205,1)\",\n data: touchs\n }\n ]\n };\n\n var ctx = $(\"#chart\").get(0).getContext(\"2d\");\n var chart = new Chart(ctx).Bar(data, options);\n }", "title": "" }, { "docid": "b30cfb62b77a2037ead10f604caa2228", "score": "0.541554", "text": "function label() {\r\n let sizeLabel = createDiv('Vector Spacing');\r\n sizeLabel.position(10, 10);\r\n sizeLabel.style('font-family', 'Helvetica');\r\n sizeLabel.style('font-weight', 'bold');\r\n sizeLabel.style('font-size', '14px');\r\n\r\n let radiusLabel = createDiv('Wave Amplitude');\r\n radiusLabel.position(10, 50);\r\n radiusLabel.style('font-family', 'Helvetica');\r\n radiusLabel.style('font-weight', 'bold');\r\n radiusLabel.style('font-size', '14px');\r\n\r\n\r\n let speedLabel = createDiv('Step Speed');\r\n speedLabel.position(10, 100);\r\n speedLabel.style('font-family', 'Helvetica');\r\n speedLabel.style('font-weight', 'bold');\r\n speedLabel.style('font-size', '14px');\r\n\r\n let colorLabel = createDiv('Colors');\r\n colorLabel.position(10, 150);\r\n colorLabel.style('font-family', 'Helvetica');\r\n colorLabel.style('font-weight', 'bold');\r\n colorLabel.style('font-size', '14px');\r\n}", "title": "" }, { "docid": "caf6aa24ee3fc414cf8a80f64d9de8c9", "score": "0.5411723", "text": "function createChart(labels, touchs, passes, sonics) {\n\n var options = {\n scaleLabel : \"<%=value%>\",\n scaleOverlay : true,\n scaleShowLabels : true\n };\n\n var data = {\n labels: labels,\n datasets: [\n {\n fillColor: \"rgba(220,220,220,0.5)\",\n strokeColor: \"rgba(220,220,220,1)\",\n data: passes\n },\n {\n fillColor: \"rgba(151,187,205,0.5)\",\n strokeColor: \"rgba(151,187,205,1)\",\n data: sonics\n },{\n fillColor: \"rgba(10,87,05,0.5)\",\n strokeColor: \"rgba(151,187,205,1)\",\n data: touchs\n }\n ]\n };\n\n var ctx = $(\"#chart\").get(0).getContext(\"2d\");\n var chart = new Chart(ctx).Bar(data, options);\n }", "title": "" }, { "docid": "0b04814a8fa2d0beb034c43658ac9b76", "score": "0.5405201", "text": "showNameAndPriority(){\n fill(0)\n textSize(24);\n text(`${this.name}, ${this.priority}`,0, this.y);\n \n }", "title": "" }, { "docid": "cd5341b2ffb00c53f3fb754866fe64f4", "score": "0.54020613", "text": "function plot(target) {\n Plotly.plot(target, [{\n x: [1, 2, 3, 4, 5],\n y: [1, 2, 4, 8, 16]\n }], {\n margin: {\n t: 0\n }\n });\n }", "title": "" }, { "docid": "8a644cc1d0c1e26f7ae8b37b3ca0a57f", "score": "0.5368843", "text": "function renderGraph_target (h) {\n $('.chart').hide();\n $('.search_year_lead').hide();\n $('.search_year_quotaion').hide();\n $('.search_year_sum').hide();\n $('.chart_line').hide();\n $('.chart_bar').hide();\n $('.chart_target').show();\n $('.chart_target_detail').show();\n $('.chart_line_quotation').hide();\n\n var month = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var number = ['12.5','14','19','17','18','25.5','14.0','15.26','25.60','25.69','22.50'];\n\n var dataSource_target = [];\n\n var approved=0,_approved = 0;\n\n for (var i = 0; i < h.approved.length; i++) {\n approved += h.approved[i] << 0;\n }\n for (var x = 0; x < h._approved.length; x++) {\n _approved += h._approved[x] << 0;\n }\n\n $.each(h.approved, function (i,v) {\n if(h.approved[i] <=0 || h._approved[i] <=0){\n dataSource_target.push({type:month[i],value:numberWithCommas(0),number:0,target:numberWithCommas(h._target[i])});\n }else{\n var con_ = numberWithCommas(h._approved[i]);\n dataSource_target.push({type:month[i],value:numberWithCommas(v),number:con_,target:numberWithCommas(h._target[i])});\n }\n });\n\n //console.log(dataSource_target);\n\n $('#chart_target').dxChart('instance').option('dataSource', dataSource_target);\n $('#chart_target').dxChart('instance').render();\n\n $('#total_lead1').html(\"Quotation Approved \" + numberWithCommas(approved) + \" บาท\");\n $('#total_customer1').html(\"Quotation Non-Approved \" + numberWithCommas(_approved) + \" บาท\");\n\n //console.log(dataSource_target);\n}", "title": "" }, { "docid": "7163bf84f6bd1e95f056e7be35eafb63", "score": "0.53663886", "text": "function createBars(barToCreate, maxScale, state, title){\n var margin = {\n top: 20,\n right: 20,\n bottom: 30,\n left: 40\n },\n \n width = 300 - margin.left - margin.right,\n height = 350 - margin.top - margin.bottom;\n\n var x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1);\n\n var y = d3.scale.linear()\n .range([height, 0]);\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\");\n\n var svg = d3.select(\"#info\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\n // we just read the .csv to get the format for further use\n d3.csv(\"template/data.csv\", type, function(error, data) {\n\n // fill in the data from our lookup class\n data[0].global = (barToCreate(\"Overall\")[0] / getInhebitants(\"Overall\")[0]) * 100;\n data[0].local = (barToCreate(state)[0] / getInhebitants(state)[0]) * 100;\n \n data[1].global = (barToCreate(\"Overall\")[1] / getInhebitants(\"Overall\")[1]) * 100;\n data[1].local = (barToCreate(state)[1] / getInhebitants(state)[1]) * 100;\n \n x.domain(data.map(function(d) {\n return d.date;\n }));\n y.domain([0, d3.max(data, function(d) {\n return maxScale;\n })]);\n\n svg.append(\"text\")\n .attr(\"x\", (width / 2)) \n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"14px\") \n .style(\"text-decoration\", \"underline\") \n .text(title);\n \n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"% Per Inhebitant\");\n\n // make the smaller Bar\n var g = svg.selectAll(\".bars\")\n .data(data)\n .enter().append(\"g\")\n \n g.append(\"rect\")\n .attr(\"class\", \"bar1\")\n .attr(\"x\", function(d) {\n return x(d.date) + 10; // center it\n })\n .attr(\"width\", x.rangeBand() - 20) // make it slimmer\n .attr(\"y\", function(d) {\n return y(d.local);\n })\n .attr(\"height\", function(d) {\n return height - y(d.local);\n });\n \n // make the overlapping bigger bar\n g.append(\"rect\")\n .attr(\"class\", \"bar2\")\n .attr(\"x\", function(d) {\n return x(d.date);\n })\n .attr(\"width\", x.rangeBand())\n .attr(\"y\", function(d) {\n return y(d.global);\n })\n .attr(\"height\", function(d) {\n return height - y(d.global);\n });\t\n });\n\n // helper\n function type(d) {\n d.global = + d.global;\n d.local = + d.local;\n return d;\n }\n}", "title": "" }, { "docid": "5684ac6805c48b5c2b1e645809deca43", "score": "0.5360696", "text": "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 200)\n .attr('y', 20)\n .style('font-size', '16pt')\n .text(\"Pokemon: Special Defense vs Total Stats\")\n .attr('fill', 'grey');\n\n svgContainer.append('text')\n .attr('x', 350 )\n .attr('y', 490)\n .text('Sp. Def');\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, 260)rotate(-90)')\n .text('Total');\n }", "title": "" }, { "docid": "fc882f9b55cbc1960f6abbc8adf335cb", "score": "0.5358544", "text": "function drawLabels() {\n\t\t\n\t\tself.svg.selectAll('.label').data(self.data)\n\t\t .enter()\n\t\t .append('text')\n\t\t .text(function(d) {\n\t\t\t return d.name \n\t\t })\n\t\t .attr('x', 270)\n\t\t .attr('text-anchor', 'end')\n\t\t .attr('y', function(d, i) {\n\t\t\t return self.yScale.range([20, 130])(i)\n\t\t })\n\t}", "title": "" }, { "docid": "b9de627ad213015277672292393f003f", "score": "0.53567827", "text": "function buildCharts(sample) {\n // 2. Use d3.json to load and retrieve the samples.json file \n d3.json(\"static/js/samples.json\").then((data) => {\n // 3. Create a variable that holds the samples array. \n var samples = data.samples;\n var metaData = data.metadata;\n console.log(samples)\n // 4. Create a variable that filters the samples for the object with the desired sample number.\n var resultArray = samples.filter(sampleObj => sampleObj.id == sample);\n var metaDataArray = metaData.filter(sampleObj => sampleObj.id == sample);\n // 5. Create a variable that holds the first sample in the array.\n var result = resultArray[0];\n // console.log(result)\n metaDataSample= metaDataArray[0];\n // console.log(metaDataSample)\n // 6. Create variables that hold the otu_ids, otu_labels, and sample_values.\n let wfreq = metaDataSample.wfreq;\n let ids = result.otu_ids;\n let labels = result.otu_labels;\n let values = result.sample_values;\n // console.log(wfreq)\n // console.log(ids.slice(0,10))\n console.log(values.slice(0,10))\n // console.log(labels)\n // 7. Create the yticks for the bar chart.\n // Hint: Get the the top 10 otu_ids and map them in descending order \n // so the otu_ids with the most bacteria are last. \n\n // var yticks = ids.sort((a,b) => values[a] - values[b]).reverse().slice(0,10)\n\n // var yticks = ids.map(sampleObj => {\n // otu = \"OTU \"\n // return otu + sampleObj\n // }).slice(0,10).reverse()\n\n var yticks = ids.map(sampleObj => \"OTU \" + sampleObj).slice(0,10).reverse()\n \n // var yticks = ids.slice(0,10)\n // console.log(yticks)\n \n\n \n // 8. Create the trace for the bar chart.\n \n var barData = [{\n x: values.slice(0,10).reverse(),\n y: yticks,\n text: labels.slice(0,10).reverse(),\n type:\"bar\",\n orientation: \"h\"\n }];\n\n // 9. Create the layout for the bar chart. \n var barLayout = {\n title: {\n text: \"Top 10 Bacteria Cultures Found\",\n font: {\n color: \"white\"\n }\n },\n plot_bgcolor: \"333333\",\n paper_bgcolor: \"333333\",\n font:{\n color: \"white\"\n }\n };\n // 10. Use Plotly to plot the data with the layout. \n Plotly.newPlot(\"bar\", barData, barLayout)\n\n // 1. Create the trace for the bubble chart.\n \n var bubbleData = [{\n x: ids,\n y: values,\n text: labels,\n mode: \"markers\",\n marker: {\n color: ids,\n size: values,\n colorscale: \"Portland\"},\n \n \n \n }];\n\n // 2. Create the layout for the bubble chart.\n var bubbleLayout = {\n title: {\n text: \"Bacteria Culters per Sample\",\n font: {\n color: \"white\"\n }\n },\n plot_bgcolor: \"333333\",\n paper_bgcolor: \"333333\",\n yaxis: {\n tickcolor: \"grey\",\n tickwidth: 1,\n \n gridcolor: \"grey\",\n gridwidth: .25,\n \n zerolinecolor: \"grey\",\n zerolinewidth: 1,\n },\n xaxis: {\n tickcolor: \"grey\",\n tickwidth: .25,\n title: \"OTU ID\",\n gridcolor: \"grey\",\n gridwidth: 1, \n },\n font: {\n color: \"white\"\n }\n\n };\n\n // 3. Use Plotly to plot the data with the layout. \n Plotly.newPlot(\"bubble\", bubbleData, bubbleLayout)\n \n\n // 4. Create the trace for the gauge chart.\n var gaugeData = [{\n title: {text: \"<b>Belly Button Washing Frequency</b><br>Scrubs per Week\",\n font: {\n color: \"white\"\n }\n },\n value: wfreq,\n type: \"indicator\",\n mode: \"gauge+number\",\n gauge: {axis: {range: [null, 10], tickmode: \"auto\", nticks: 6}, \n bar: {color: \"black\"},\n steps: [\n {range: [0,2], color: \"red\"},\n {range: [2,4], color: \"orange\"},\n {range: [4,6], color: \"yellow\"},\n {range: [6,8], color: \"lightgreen\"},\n {range: [8,10], color: \"green\"}\n ]},\n \n }];\n \n // 5. Create the layout for the gauge chart.\n var gaugeLayout = { \n plot_bgcolor: \"333333\",\n paper_bgcolor: \"333333\",\n font: {\n color: \"white\"\n }\n };\n\n // 6. Use Plotly to plot the gauge data and layout.\n Plotly.newPlot(\"gauge\", gaugeData, gaugeLayout)\n\n\n\n });\n}", "title": "" }, { "docid": "6c60a6f9772515bc3205bc82e228a2ab", "score": "0.53561443", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"data range:\"+props.RowLabels;\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.RowLabels + \"_label\")\n .html(labelAttribute);\n console.log(infolabel);\n\n\tvar datarange = 'frequency:' + props[\"Count_of_distance_from_home\"];\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(datarange);\n}", "title": "" }, { "docid": "bfdac9dc0b5fb66599c654ab854efc75", "score": "0.53540397", "text": "function setBars () {\r\n\t\t\t$(element).find('[data-value]').each(function () {\r\n\t\t\t\tvar value = parseFloat($(this).attr('data-value')),\r\n\t\t\t\t\tstepsCount = value / step,\r\n\t\t\t\t\tstepDim = scaleValue(step);\r\n\t\t\t\t$(this).css('height', stepsCount * stepDim + 'px')\r\n\t\t\t\t//$(this).css('height', scaleValue(value) + 'px')\r\n\t\t\t\t// The top margin defines the empty space between the top of the chart and the top of each bar.\r\n\t\t\t\t.css('margin-top', $(element).height() - $(this).height());\r\n\t\t\t\t//.css('margin-top', scaleValue(max - value));\r\n\t\t\t\t// Wrap the value label so we can style it\r\n\t\t\t\t$(this).wrapInner('<span class=\"label screen-reader-text\"></span>');\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "10b45def5d94a202ff87549873364432", "score": "0.53530234", "text": "function BarChartCanvas(id, category, streams, bar_color){\n var ctx = document.getElementById(id).getContext('2d');\n canvasBar = new Chart(ctx, {\n type: 'bar',\n data: {\n // labels: first(10,category),\n labels: category,\n datasets: [{data: streams, \n label: 'Model Weight', \n backgroundColor: [bar_color], \n borderWidth: 2,\t\n datalabels:{\n anchor:'end',\n align:'top',\n font:{\n weight:'bolder',\n size:14\n }\n\n }\n }]\n },\n plugins: [ChartDataLabels],\n options: {\n legend:{\n display:false\n },\n scales: {\n y: {\n display: true,\n title: {text:\"Importance\", display:true, color:'black', font: {size: 16, family:\"Poppins\",weight:\"bold\"}},\n ticks: {color : 'gray', font: {family:\"Poppins\"}},\n },\n // x: {\n // display: true,\n // title: {text: \"Features\", display:true, color:'black', font: {size: 16, family:\"Poppins\",weight:\"bold\"}},\n // ticks: {color : 'gray', font: {family:\"Poppins\"}},\n // },\n },\n plugins:{ \n legend: {\n display: false\n },\n }\n // plugins: {legend: {display:true, labels:{color:'black',font: {family:\"Poppins\"}}}}\n }\n });\n return canvasBar\n}", "title": "" }, { "docid": "5fd952829c4a16b51b487642728ec259", "score": "0.53273576", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n \n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute);\n \n var stateName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "title": "" }, { "docid": "65e0f18e503da6440d4e912bdfce8d38", "score": "0.53194743", "text": "function insertLabel (labelPoints, target) {\n if (!target) { target = 'user'; }\n\n var pointData, pov, point, path, param = {},\n labelColors = svl.misc.getLabelColors(),\n labelDescriptions = svl.misc.getLabelDescriptions(),\n iconImagePaths = svl.misc.getIconImagePaths(),\n length = labelPoints.length,\n points = [];\n\n\n for (var i = 0; i < length; i += 1) {\n pointData = labelPoints[i];\n pov = {\n heading: pointData.originalHeading,\n pitch: pointData.originalPitch,\n zoom: pointData.originalZoom\n };\n point = new Point();\n\n if ('PhotographerHeading' in pointData && pointData.PhotographerHeading &&\n 'PhotographerPitch' in pointData && pointData.PhotographerPitch) {\n point.setPhotographerPov(parseFloat(pointData.PhotographerHeading), parseFloat(pointData.PhotographerPitch));\n }\n\n point.resetSVImageCoordinate({\n x: parseInt(pointData.svImageX, 10),\n y: parseInt(pointData.svImageY, 10)\n });\n\n\n point.setProperties({\n fillStyleInnerCircle : labelColors[pointData.LabelType].fillStyle,\n lineWidthOuterCircle : 2,\n iconImagePath : iconImagePaths[pointData.LabelType].iconImagePath,\n originalCanvasCoordinate: pointData.originalCanvasCoordinate,\n originalHeading: pointData.originalHeading,\n originalPitch: pointData.originalPitch,\n originalZoom: pointData.originalZoom,\n pov: pov,\n radiusInnerCircle : properties.pointInnerCircleRadius,\n radiusOuterCircle : properties.pointOuterCircleRadius,\n strokeStyleOuterCircle : 'rgba(255,255,255,1)',\n storedInDatabase : false\n });\n\n points.push(point)\n }\n\n path = new Path(points);\n\n param.canvasWidth = svl.canvasWidth;\n param.canvasHeight = svl.canvasHeight;\n param.canvasDistortionAlphaX = svl.alpha_x;\n param.canvasDistortionAlphaY = svl.alpha_y;\n param.labelId = labelPoints[0].LabelId;\n param.labelerId = labelPoints[0].AmazonTurkerId;\n param.labelType = labelPoints[0].LabelType;\n param.labelDescription = labelDescriptions[param.labelType].text;\n param.labelFillStyle = labelColors[param.labelType].fillStyle;\n param.panoId = labelPoints[0].LabelGSVPanoramaId;\n param.panoramaLat = labelPoints[0].Lat;\n param.panoramaLng = labelPoints[0].Lng;\n param.panoramaHeading = labelPoints[0].heading;\n param.panoramaPitch = labelPoints[0].pitch;\n param.panoramaZoom = labelPoints[0].zoom;\n\n param.svImageWidth = svl.svImageWidth;\n param.svImageHeight = svl.svImageHeight;\n param.svMode = 'html4';\n\n if ((\"PhotographerPitch\" in labelPoints[0]) && (\"PhotographerHeading\" in labelPoints[0])) {\n param.photographerHeading = labelPoints[0].PhotographerHeading;\n param.photographerPitch = labelPoints[0].PhotographerPitch;\n }\n\n var newLabel = svl.labelFactory.create(path, param);\n\n if (target === 'system') {\n systemLabels.push(newLabel);\n } else {\n svl.labelContainer.push(newLabel);\n }\n }", "title": "" }, { "docid": "5dadcf107d14a35dee2579a9e7924654", "score": "0.5318285", "text": "function drawHBar(ctx, target, bounds, label) {\n ctx.fillStyle = '#222';\n const xLeft = Math.floor(target.x);\n const xRight = Math.ceil(target.x + target.width);\n const yMid = Math.floor(target.height / 2 + target.y);\n const xWidth = xRight - xLeft;\n // Don't draw in the track shell.\n ctx.beginPath();\n ctx.rect(bounds.x, bounds.y, bounds.width, bounds.height);\n ctx.clip();\n // Draw horizontal bar of the H.\n ctx.fillRect(xLeft, yMid, xWidth, 1);\n // Draw left vertical bar of the H.\n ctx.fillRect(xLeft, target.y, 1, target.height);\n // Draw right vertical bar of the H.\n ctx.fillRect(xRight, target.y, 1, target.height);\n const labelWidth = ctx.measureText(label).width;\n // Find a good position for the label:\n // By default put the label in the middle of the H:\n let labelXLeft = Math.floor(xWidth / 2 - labelWidth / 2 + xLeft);\n if (labelWidth > target.width || labelXLeft < bounds.x ||\n (labelXLeft + labelWidth) > (bounds.x + bounds.width)) {\n // It won't fit in the middle or would be at least partly out of bounds\n // so put it either to the left or right:\n if (xRight > bounds.x + bounds.width) {\n // If the H extends off the right side of the screen the label\n // goes on the left of the H.\n labelXLeft = xLeft - labelWidth - 3;\n }\n else {\n // Otherwise the label goes on the right of the H.\n labelXLeft = xRight + 3;\n }\n }\n ctx.fillStyle = '#ffffff';\n ctx.fillRect(labelXLeft - 1, 0, labelWidth + 1, target.height);\n ctx.textBaseline = 'middle';\n ctx.fillStyle = '#222';\n ctx.font = '10px Roboto Condensed';\n ctx.fillText(label, labelXLeft, yMid);\n}", "title": "" }, { "docid": "fa22dc4ae38103d3af3eb14974fe6250", "score": "0.5316009", "text": "constructor(svg, predicted_value, min_value, max_value, title='Predicted value', log_coords = false) {\n\n if (min_value == max_value){\n var width_proportion = 1.0;\n } else {\n var width_proportion = (predicted_value - min_value) / (max_value - min_value);\n }\n\n\n let width = parseInt(svg.style('width'))\n\n this.color = d3.scale.category10()\n this.color('predicted_value')\n // + 2 is due to it being a float\n let num_digits = Math.floor(Math.max(Math.log10(Math.abs(min_value)), Math.log10(Math.abs(max_value)))) + 2\n num_digits = Math.max(num_digits, 3)\n\n let corner_width = 12 * num_digits;\n let corner_padding = 5.5 * num_digits;\n let bar_x = corner_width + corner_padding;\n let bar_width = width - corner_width * 2 - corner_padding * 2;\n let x_scale = d3.scale.linear().range([0, bar_width]);\n let bar_height = 17;\n let bar_yshift= title === '' ? 0 : 35;\n let n_bars = 1;\n let this_object = this;\n if (title !== '') {\n svg.append('text')\n .text(title)\n .attr('x', 20)\n .attr('y', 20);\n }\n let bar_y = bar_yshift;\n let bar = svg.append(\"g\");\n\n //filled in bar representing predicted value in range\n let rect = bar.append(\"rect\");\n rect.attr(\"x\", bar_x)\n .attr(\"y\", bar_y)\n .attr(\"height\", bar_height)\n .attr(\"width\", x_scale(width_proportion))\n .style(\"fill\", this.color);\n\n //empty box representing range\n bar.append(\"rect\").attr(\"x\", bar_x)\n .attr(\"y\", bar_y)\n .attr(\"height\", bar_height)\n .attr(\"width\",x_scale(1))\n .attr(\"fill-opacity\", 0)\n .attr(\"stroke\", \"black\");\n let text = bar.append(\"text\");\n text.classed(\"prob_text\", true);\n text.attr(\"y\", bar_y + bar_height - 3).attr(\"fill\", \"black\").style(\"font\", \"14px tahoma, sans-serif\");\n\n\n //text for min value\n text = bar.append(\"text\");\n text.attr(\"x\", bar_x - corner_padding)\n .attr(\"y\", bar_y + bar_height - 3)\n .attr(\"fill\", \"black\")\n .attr(\"text-anchor\", \"end\")\n .style(\"font\", \"14px tahoma, sans-serif\")\n .text(min_value.toFixed(2));\n\n //text for range min annotation\n let v_adjust_min_value_annotation = text.node().getBBox().height;\n text = bar.append(\"text\");\n text.attr(\"x\", bar_x - corner_padding)\n .attr(\"y\", bar_y + bar_height - 3 + v_adjust_min_value_annotation)\n .attr(\"fill\", \"black\")\n .attr(\"text-anchor\", \"end\")\n .style(\"font\", \"14px tahoma, sans-serif\")\n .text(\"(min)\");\n\n\n //text for predicted value\n // console.log('bar height: ' + bar_height)\n text = bar.append(\"text\");\n text.text(predicted_value.toFixed(2));\n // let h_adjust_predicted_value_text = text.node().getBBox().width / 2;\n let v_adjust_predicted_value_text = text.node().getBBox().height;\n text.attr(\"x\", bar_x + x_scale(width_proportion))\n .attr(\"y\", bar_y + bar_height + v_adjust_predicted_value_text)\n .attr(\"fill\", \"black\")\n .attr(\"text-anchor\", \"middle\")\n .style(\"font\", \"14px tahoma, sans-serif\")\n\n\n\n\n\n //text for max value\n text = bar.append(\"text\");\n text.text(max_value.toFixed(2));\n // let h_adjust = text.node().getBBox().width;\n text.attr(\"x\", bar_x + bar_width + corner_padding)\n .attr(\"y\", bar_y + bar_height - 3)\n .attr(\"fill\", \"black\")\n .attr(\"text-anchor\", \"begin\")\n .style(\"font\", \"14px tahoma, sans-serif\");\n\n\n //text for range max annotation\n let v_adjust_max_value_annotation = text.node().getBBox().height;\n text = bar.append(\"text\");\n text.attr(\"x\", bar_x + bar_width + corner_padding)\n .attr(\"y\", bar_y + bar_height - 3 + v_adjust_min_value_annotation)\n .attr(\"fill\", \"black\")\n .attr(\"text-anchor\", \"begin\")\n .style(\"font\", \"14px tahoma, sans-serif\")\n .text(\"(max)\");\n\n\n //readjust svg size\n // let svg_width = width + 1 * h_adjust;\n // svg.style('width', svg_width + 'px');\n\n this.svg_height = n_bars * (bar_height) + bar_yshift + (2 * text.node().getBBox().height) + 10;\n svg.style('height', this.svg_height + 'px');\n if (log_coords) {\n console.log(\"svg width: \" + svg_width);\n console.log(\"svg height: \" + this.svg_height);\n console.log(\"bar_y: \" + bar_y);\n console.log(\"bar_x: \" + bar_x);\n console.log(\"Min value: \" + min_value);\n console.log(\"Max value: \" + max_value);\n console.log(\"Pred value: \" + predicted_value);\n }\n }", "title": "" }, { "docid": "a729655cdb179b0653c949c59381e4a3", "score": "0.5313635", "text": "function add_label_y_axes(label_name){\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left + 20)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .style(\"fill\", \"red\")\n .text(label_name); \n\n}", "title": "" }, { "docid": "2478c20cfe959cd693ef94f70846b14d", "score": "0.5310434", "text": "function move_labels(selection) {\n selection.transition()\n .duration(1000)\n // .attr(\"x\", d => ramp_x(min_x_avg)-3)\n .attr(\"y\", (d, i) => ramp_y(d.order_y))\n .style(\"fill\", d => d.text_color)\n .text(d => d.exam_name)\n ;\n }", "title": "" }, { "docid": "d674e0523dd18f6b44d356831b713c92", "score": "0.531013", "text": "function setLabel(props){\n\t//label content\n\tvar labelAttribute = \"<h1>\" + props[expressed] + \"%\"\n\t\t\"</h1>\";\n\n\t//create info label div\n\tvar infolabel = d3.select(\"body\")\n\t\t.append(\"div\")\n\t\t.attr(\"class\", \"infolabel\")\n\t\t.attr(\"id\", props.name + \"_label\")\n\t\t.html(labelAttribute);\n\n\tvar regionName = infolabel.append(\"div\")\n\t\t.attr(\"class\", \"labelname\")\n\t\t.html(props.name);\n}", "title": "" }, { "docid": "19d339f0e539e36e9e56722f814c4a93", "score": "0.5309378", "text": "function animateOn (value, oldValue, duration = 1000, ease = d3.easeExp) {\n let data = [_data[0], value]\n g.selectAll('.bar')\n .data(data)\n .enter().append('rect')\n .attr('class', (d, i) => i === 0 ? 'bar-average' : 'bar-patient')\n .attr('x', function (d, i) {\n return x(titleArray[i])\n })\n .attr('y', height)\n .transition().duration(duration)\n .ease(ease)\n .attr('y', function (d) { return y(d) })\n .attr('height', function (d) { return height - y(d) })\n .attr('width', x.bandwidth())\n\n g.selectAll('.chart-bars-axis--x').remove()\n const bottomAxis = g.append('g')\n .attr('class', 'chart-bars-axis--x')\n .attr('transform', 'translate(0,' + height + ')')\n .call(d3.axisBottom(x))\n\n bottomAxis.selectAll('.tick text').attr('y', -20)\n }", "title": "" }, { "docid": "51e20db944a755d4369cf12889618897", "score": "0.5308017", "text": "function barChart(pdata) {\n var sample_values = pdata.sample_values;\n var otu_ids = pdata.otu_ids;\n var otu_labels = pdata.otu_labels;\n\n// Data information for plotly\ndata = [{\n x: sample_values.slice(0,10).reverse(),\n y: otu_ids.slice(0,10).map(val => \"OTU \" + val + \" \").reverse(),\n type: 'bar',\n orientation: 'h',\n text: otu_labels.slice(0,10),\n}]\n\nvar layout = {\n showlegend:false\n}\n\nPlotly.newPlot(\"bar\", data, layout);\n\n}", "title": "" }, { "docid": "69fd58bfa75dd3fe0c3933938f977e64", "score": "0.53038454", "text": "function barNew(d, svg, x, xAxis, width, height,index) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n \t .selectAll(\"g\")\n .data(d.children)\n\t\t.enter().append(\"g\")\n .on(\"mouseover\",function(d,i){\n \t\tif(index==currentPos){\n\t\t\t\tvar txt=d3.select(\"#\"+d.id);\n\t\t\t\ttxt.style('color',colorSelected);\n\t\t\t}\n })\n .on(\"mouseout\",function(d,i){\n \t\tif(index==currentPos){\n\t\t\t\tvar txt=d3.select(\"#\"+d.id);\n\t\t\t\ttxt.style('color',null);\n \t\t}\n });\n\n\n bar.append(\"text\")\n .attr(\"x\", -6)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d.name; });\n\n\n bar.append(\"rect\")\n .attr(\"width\", function(d) { return x(d.value); })\n .attr(\"height\", barHeight) \n .style(\"cursor\", function(d) { return \"pointer\"; }) \n .on(\"click\", function(d,i){\n \tif(txt!=null){\n \t\ttxt.style('color',null);\n \t}\n \tdownNew(d, i, svg, x, xAxis, width, height,1,index,0,0);\n });\n\t //.attr(\"title\",function(d){return d.value});\n\t \n return bar;\n}", "title": "" }, { "docid": "6797f7dcc5acb5d5cecff1bc494e1e00", "score": "0.5301453", "text": "function updateBarGraph(obj){\n var carbPct = obj[\"currentCarbs\"]/obj[\"carbs\"]*100;\n var proteinPct = obj[\"currentProtein\"]/obj[\"protein\"]*100;\n var fatPct = obj[\"currentFat\"]/obj[\"fat\"]*100;\n $(\"#carb-bar-filler\").css(\"width\", carbPct.toString() + \"%\");\n $(\"#protein-bar-filler\").css(\"width\", proteinPct.toString() + \"%\");\n $(\"#fat-bar-filler\").css(\"width\", fatPct.toString() + \"%\");\n\n $(\"#carb-label\").text(\"Carbs \" + obj[\"currentCarbs\"].toPrecision(3) + \"/\" + obj[\"carbs\"]);\n $(\"#protein-label\").text(\"Protein \" + obj[\"currentProtein\"].toPrecision(3) + \"/\" + obj[\"protein\"]);\n $(\"#fat-label\").text(\"Fat \" + obj[\"currentFat\"].toPrecision(3) + \"/\" + obj[\"fat\"]);\n\n\n\n\n}", "title": "" }, { "docid": "d8ad1052831d892626d0298118f8f53a", "score": "0.5301247", "text": "function makeLabels() {\n svgPlotContainer\n .append(\"text\")\n .attr(\"x\", 320)\n .attr(\"y\", 40)\n .style(\"font-size\", \"14pt\")\n .text(\"Population Over Time\");\n\n svgPlotContainer\n .append(\"text\")\n .attr(\"x\", 440)\n .attr(\"y\", 550)\n .style(\"font-size\", \"10pt\")\n .text(\"Year\");\n\n svgPlotContainer\n .append(\"text\")\n .attr(\"transform\", \"translate(45, 350)rotate(-90)\")\n .style(\"font-size\", \"10pt\")\n .text(\"Population (millions)\");\n }", "title": "" }, { "docid": "a198266c3cd835e5d36570dfaf980d7a", "score": "0.529901", "text": "function buildCharts(sample) {\n // 2. Use d3.json to load and retrieve the samples.json file \n d3.json(\"samples.json\").then((data) => {\n // 3. Create a variable that holds the samples array. \n var samples = data.samples;\n \n // 4. Create a variable that filters the samples for the object with the desired sample number.\n var resultArray = samples.filter(sampleObj => sampleObj.id == sample);\n \n // 5. Create a variable that holds the first sample in the array.\n var first_sample=resultArray[0];\n \n // 6. Create variables that hold the otu_ids, otu_labels, and sample_values.\n var otu_ids=first_sample.otu_ids;\n var otu_labels=first_sample.otu_labels;\n var sample_values=first_sample.sample_values;;\n var otu_ids_formated=[];\n var otu_array=[];\n\n // 8. Create the trace for the bar chart. \n // 9. Create the layout for the bar chart. \n // Slice the first 10 objects for plotting// Reverse the array due to Plotly's defaults\n\n for (i = 0; i < otu_ids.length; i++) {otu_ids_formated.push('OTU '.concat(otu_ids[i]));}\n\n for (i = 0; i < otu_ids.length; i++) {otu_array[i]=[otu_ids_formated[i],otu_labels[i],sample_values[i]];}\n\n //https://riptutorial.com/javascript/example/3443/sorting-multidimensional-array\n otu_array.sort(function(a, b) {return a[2] - b[2];})\n otu_array10 = (otu_array.slice(-10))\n\n // 7. Create the yticks for the bar chart.\n // Hint: Get the the top 10 otu_ids and map them in descending order \n // so the otu_ids with the most bacteria are last. \n var xdata = [];\n var ydata =[];\n var lables = [];\n \n for (i = 0; i < otu_array10.length; i++) \n {\n xdata[i]= otu_array10[i][2]\n ydata[i]=otu_array10[i][0]\n lables[i] = otu_array10[i][1]\n }\n\n // Trace1 for the Bar Graph Data\n var trace1 = { x: xdata, y: ydata,text: lables, name: \"Greek\", type: \"bar\", orientation: \"h\"};\n // data\n var datas = [trace1];\n // Apply the group bar mode to the layout\n var layout = {title: \"Sample Bacteria\", margin: {l: 100,r: 100,t: 100,b: 100} };\n // 10. Use Plotly to plot the data with the layout. \n Plotly.newPlot(\"bar\", datas, layout);\n\n\n\n // 1. Create the trace for the bubble chart.\n var trace2 = {\n x:otu_ids_formated , y:sample_values , text:otu_labels,mode: 'markers', marker:{color:otu_ids_formated,size: sample_values}\n }; \n var bubbleData = [trace2];\n \n // 2. Create the layout for the bubble chart.\n var bubbleLayout = {\n title: 'Marker Size',\n showlegend: false,\n height: 500,\n width: 1200 \n };\n \n // 3. Use Plotly to plot the data with the layout.\n Plotly.newPlot('bubble', bubbleData, bubbleLayout);\n \n\n\n //deliverable 3\n\n //get the washing frequency\n var metadata = data.metadata;\n var resultArray = metadata.filter(sampleObj => sampleObj.id == sample);\n var result = resultArray[0];\n //console.log(result);\n //console.log(Object.keys(result));\n //log(result['wfreq']);\n\n\n //var gaugedata = [{\n // domain: { x: [0, 1], y: [0, 1] },\n\t//\tvalue: result['wfreq'],\n\t//\ttitle: { text: \"Washing Frequency\" },\n\t//\ttype: \"indicator\",\n//\t\tmode: \"gauge+number\"\n\n // }];\n\n var gaugedata = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: result['wfreq'],\n title: { text: \"WashingFrequency\" },\n type: \"indicator\",\n mode: \"gauge+number+delta\",\n gauge: {\n axis: { range: [null, 10] },\n steps: [\n { range: [0, 3], color: \"red\" },\n { range: [3, 6], color: \"yellow\" },{ range: [6, 10], color: \"white\" }\n ]\n \n }\n }\n];\n\n var gaugelayout = { width: 600, height: 500, margin: { t: 0, b: 0 } };\n Plotly.newPlot('gauge', gaugedata, gaugelayout);\n\n });\n}", "title": "" }, { "docid": "f0a437663d74efa58fbc4ca1de19b6d7", "score": "0.5280025", "text": "function update_labels(totalETX = etxPathVals) {\n\n let node = d3.selectAll('.node');\n\n console.log(node);\n\n //Reset labels\n node.selectAll(\"text\").remove();\n\n node.append(\"text\")\n .text((d) => totalETX[d.id].toFixed(2))\n .attr(\"x\", (d) => d.x)\n .attr(\"y\", (d) => d.y);\n}", "title": "" }, { "docid": "c755a6e1882af946630121d5d948511e", "score": "0.52746737", "text": "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 300)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Pokemon: Special Defense vs Total Stats\");\n\n svgContainer.append('text')\n .attr('x', 470)\n .attr('y', 790)\n .style('font-size', '10pt')\n .text('Sp. Def');\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, 390)rotate(-90)')\n .style('font-size', '10pt')\n .text('Total');\n }", "title": "" }, { "docid": "a39ce58f27b399692ecf3f320f4b47d6", "score": "0.5272748", "text": "show(exp, label, div) {\n let svg = div.append('svg').style('width', '100%');\n let colors=['#5F9EA0', this.colors_i(label)];\n let names = [`NOT ${this.names[label]}`, this.names[label]];\n if (this.names.length == 2) {\n colors=[this.colors_i(0), this.colors_i(1)];\n names = this.names;\n }\n let plot = new Barchart(svg, exp, true, names, colors, true, 10);\n svg.style('height', plot.svg_height + 'px');\n }", "title": "" }, { "docid": "d342ef8f7fb552cd9b3b7f69ea11f91c", "score": "0.5265869", "text": "function acceptedRequestAndOcupationRateChart_manualvalues() {\n var acceptedRequestRate = [ 0.6451612903225806*100 , 0.7419354838709677*100 , 0.8548387096774194*100 , 0.9516129032258065*100 , 0.9838709677419355*100 , 1.0*100 ]\n var ocupacionVehiculo = [ 0.525*100 , 0.5037878787878789*100 , 0.4976190476190476*100 , 0.4852491258741259*100 , 0.4464646464646465*100 , 0.40969696969696967*100 ]\n labels = [\"5 buses\",\"6 buses\",\"7 buses\",\"8 buses\",\"9 buses\",\"10 buses\"]\n var virtual_stop_distance_chart_data_2 = {\n type: 'bar',\n data: {\n scaleStartValue: 0,\n labels: labels,\n datasets: [{\n label: '% peticións aceptadas',\n backgroundColor: ['rgb(69, 105, 144)','rgb(69, 105, 144)','rgb(69, 105, 144)','rgb(16, 82, 177)','rgb(69, 105, 144)','rgb(69, 105, 144)'],\n borderColor: 'rgb(69, 105, 144)',\n data: acceptedRequestRate\n },\n {\n label: '% ocupación do vehículo',\n backgroundColor: ['rgb(255, 99, 132)','rgb(255, 99, 132)','rgb(255, 99, 132)','rgb(252, 56, 80)','rgb(255, 99, 132)','rgb(255, 99, 132)'],\n borderColor: 'rgb(255, 99, 132)',\n data: ocupacionVehiculo\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n min: 0,\n fontSize: 40\n }\n }],\n xAxes: [{\n ticks: {\n fontSize: 40\n }\n }]\n },\n legend: {\n \"display\": true,\n \"labels\": {\n \"fontSize\": 40\n }\n }\n }\n }\n new Chart(ctx, virtual_stop_distance_chart_data_2);\n}", "title": "" }, { "docid": "e9ea387377f3f95881c4f5da2c39e726", "score": "0.5265658", "text": "function setLabelNode(node) {\n var elemName = node.data('name');\n if (node.data('type') == DftTypes.BE) {\n var rate = node.data('rate');\n if (rate < 0.001 && rate != 0) {\n var num = new Number(rate);\n rate = num.toExponential();\n }\n var repair = node.data('repair');\n if (repair < 0.001 && repair != 0) {\n var num = new Number(repair);\n repair = num.toExponential();\n }\n if (repair != 0) {\n node.data('label', elemName + ' (\\u03BB: ' + rate + ', r: ' + repair + ')');\n } else {\n node.data('label', elemName + ' (\\u03BB: ' + rate + ')');\n }\n } else if (node.data('type') == DftTypes.BOT) {\n node.data('label', elemName);\n } else if (node.data('type') == DftTypes.COMPOUND) {\n node.data('label', elemName);\n } else if (node.data('type') == DftTypes.VOT) {\n var voting = node.data('voting') + \"/\" + node.data('children').length;\n node.data('label', elemName + ' (' + voting + ')');\n } else if (node.data('type') == DftTypes.PDEP) {\n var probability = node.data('probability');\n node.data('label', elemName + ' (P: ' + probability + ')');\n } else {\n node.data('label', elemName);\n }\n}", "title": "" }, { "docid": "90cca658ee3034e6974edefef3a507fd", "score": "0.52625865", "text": "function showLabel(d, i) {\n this.parentNode.appendChild(this);\n var startDate = d.est;\n var endDate = d.dis1;\n d3.selectAll(\"rect.bar\").transition().duration(600).style(\"fill\", function (d) {\n\n if (d.x >= startDate && d.x <= endDate) {\n return \"goldenrod\";\n }\n\n if (d.x == currYear) {\n return currYearColor;\n }\n\n });\n\n tooltip.transition().duration(200).style(\"opacity\", .8);\n tooltip.html(tooltipText(d));\n }", "title": "" }, { "docid": "d418c63bfe6365db1171a70705c8953d", "score": "0.5259755", "text": "static drawLabels(x, ys, offsetX, labels, values, highlightText, textAlignment) {\n stroke(0);\n textAlign(textAlignment);\n for (let i = 0; i < ys.length; i++) {\n if (highlightText && values[i] > 0.5) fill(0, 255, 0);\n else fill(255);\n text(labels[i], x + offsetX, ys[i]);\n }\n }", "title": "" }, { "docid": "dfd2dbda5c06909370b32bba446a213e", "score": "0.5250801", "text": "function buildBar(BarSampleID){\n //Pull passed sample ID's data from json\n d3.json(\"data/samples.json\").then(function (data){\n //create variable to hold all sample data for filtering\n var allSampleData = data.samples;\n // filter using sample ID passed into build function returns array\n var filteredData = allSampleData.filter(function(sampleData){\n return sampleData.id == BarSampleID;\n });\n //convert returned array\n var barSampleData = filteredData[0];\n\n //bar chart values from instructions\n // values for bar chart\n var sample_values = barSampleData.sample_values;\n //labels for bar chart\n var otu_ids = barSampleData.otu_ids;\n //hovertext for bar chart\n var otu_labels = barSampleData.otu_labels\n\n //Trace for Bar chart\n var barTrace = [{\n //xvalues: slice to only pull 10\n x: sample_values.slice(0,10),\n //yvalues: slice to only pull 10 map to assign text values to each of the y values\n y: otu_ids.slice(0,10).map(function (otuID){\n return `OTU ${otuID}`\n }),\n //graph type\n type: \"bar\",\n // making barchart horizontal\n orientation: 'h',\n //tooltip\n text: otu_labels\n }];\n\n //Layout for bar chart\n barLayout = {\n title:\"Top 10 OTUs found in that individual\",\n xaxis:{title: \"Sample Values\"},\n yaxis:{title: \"OTU ID's\"}\n }\n //Plot the barchart\n Plotly.newPlot(\"barLocation\",barTrace,barLayout);\n });\n}", "title": "" }, { "docid": "d076311b56ab1c28683a1474d594ebc9", "score": "0.52484417", "text": "function make_tat_plot(target, k, tat_l, tat, title){\n try {\n var overTop = false;\n if(target === undefined){ throw 'Target missing'; }\n if(k === undefined){ throw 'Key missing'; }\n if(tat_l === undefined){ throw 'tat_l missing'; }\n if(tat === undefined){ throw 'tat missing'; }\n aim = tat_l[k];\n now = tat[k];\n ninetieth = tat[k+'_90th'];\n if(aim === undefined){ throw 'aim missing'; }\n if(now === undefined){ throw 'now missing'; }\n if(title === undefined){\n title = Math.round(now)+' days'\n }\n if(now > aim * 2.5){\n now = aim * 2.6;\n overTop = true;\n }\n $(target).highcharts({\n chart: {\n type: 'gauge',\n height: 120,\n backgroundColor:'rgba(255, 255, 255, 0.1)'\n },\n title: {\n text: title,\n floating: true,\n y: 60\n },\n pane: {\n startAngle: -45,\n endAngle: 45,\n background: null,\n center: ['50%', '170%'],\n size: 270\n },\n tooltip: { enabled: false },\n credits: { enabled: false },\n yAxis: {\n min: 0,\n max: aim * 2.5,\n minorTickWidth: 0,\n tickPosition: 'outside',\n tickPositions: [0, aim],\n labels: {\n rotation: 'auto',\n distance: 20\n },\n plotBands: [{\n from: 0,\n to: aim,\n color: '#55BF3B',\n innerRadius: '100%',\n outerRadius: '105%'\n },\n {\n from: aim,\n to: aim * 2,\n color: '#DDDF0D',\n innerRadius: '100%',\n outerRadius: '105%'\n },\n {\n from: aim * 2,\n to: aim * 3,\n color: '#DF5353',\n innerRadius: '100%',\n outerRadius: '105%'\n }]\n },\n plotOptions: {\n gauge: {\n dataLabels: { enabled: false },\n dial: { radius: '100%' }\n }\n },\n series: [{\n name: '90th Percentile',\n data: [ninetieth],\n },{\n name: 'Turn Around Time',\n data: [now],\n }]\n },\n // Move needle if over limit\n function (chart) {\n if(overTop){\n var mul = 2.6\n setInterval(function () {\n if(mul == 2.6){ mul = 2.52; }\n else { mul = 2.6; }\n chart.series[0].points[0].update(aim * mul, false);\n chart.redraw();\n }, 200);\n }\n });\n } catch(err) {\n $(target).addClass('coming_soon').text('coming soon');\n }\n}", "title": "" }, { "docid": "e24a71237844961d9c9d726418b0ab1a", "score": "0.5234862", "text": "function getLabel() {\n if(points === 0 ) return options.noValues;\n if (prevRange === 0) return \" > \" + range+ \" \"+ options.frequency;\n else return range + \" - \" + (prevRange-1)+ \" \"+options.frequency ;\n }", "title": "" }, { "docid": "f678862e32b04a5a9a1fc6118994d29d", "score": "0.52332586", "text": "function display(chart_value,target){\n\n var strokeDashOffsetValue = 100 - chart_value;\n var doughnut = document.querySelector(target);\n doughnut.style[\"stroke-dashoffset\"] = strokeDashOffsetValue;\n}", "title": "" }, { "docid": "8b2a38aa2acf1fbb0b439720ab30a7b1", "score": "0.52162576", "text": "function setBar(data, mode) {\n // remove current bar chart first\n d3.select(\".bar\").selectAll(\"div\").remove();\n var sum = 0;\n for (var i=0; i<data.length; i++) {\n sum += data[i];\n }\n var x = d3.scaleLinear()\n .domain([0, d3.max(data)])\n .range([0, 400]);\n\n if (mode == \"historic\") {\n var severity = [\"O\",\"A\",\"B\",\"C\",\"D\",\"E\",\"N.A\"];\n d3.select(\".bar\")\n .selectAll(\"div\")\n .data(data)\n .enter().append(\"div\")\n .style(\"width\", function (d) {\n return x(d) + \"px\";\n })\n .style(\"background-color\", function(d,i){\n return colors[i];\n })\n .text(function (d,i) {\n return \"Severity \"+ \"[\"+severity[i]+\"] \"+(d*100/sum).toFixed(1)+\"%\";\n });\n }\n var labelWidth = 0;\n\n if (mode == \"explore\") {\n var list = [\"current: \", \"updated: \"];\n d3.select(\".bar\")\n .selectAll(\"div\")\n .data(data)\n .enter().append(\"div\")\n .style(\"width\", function (d) {\n return x(d)+ \"px\";\n })\n .style(\"height\", \"60px\")\n .style(\"background-color\", function(d,i){\n return colors[i];\n })\n .text(function (d,i) {\n return \"Response time \"+list[i]+Math.round(d/60)+\" min, \"+Math.round(d%60)+ \"sec\";\n })\n .style(\"font-size\", \"16px\")\n .attr(\"dy\", \".95em\");\n }\n \n console.log(\"-->Bar chart success\");\n document.getElementsByClassName(\"loading\")[1].style.display= \"none\";\n}", "title": "" }, { "docid": "702c185846ff0a6434b01ccebc2ba823", "score": "0.5213263", "text": "function showbarChart(sample, name) {\n var showData = getTop10OOTU(sample, name);\n //create trace for display\n var traceDisplay1 = [{\n // x value \n x: showData.map(item => item.sampleValues).reverse(),\n // y value \n y: showData.map(item => 'OTU ' + item.otuId).reverse(),\n // set y value as the lable \n labels: showData.map(item => 'OTU ' + item.otuId).reverse(),\n //show label for text display \n text: showData.map(item => item.otuLabel).reverse(),\n //show bar chart\n type: \"bar\",\n //set the orient\n orientation: \"h\"\n }];\n // Bar layout\n var disPlayLayout1 = {\n title: { text: \"The top 10 OTUs\" },\n autosize: true,\n // height: 400,\n // width: 400,\n margin: {\n l: 100,\n r: 10,\n b: 20,\n t: 30,\n pad: 0\n },\n showlegend: false\n };\n //Plotly to plot bar chart layout \n Plotly.newPlot(\"bar\", traceDisplay1, disPlayLayout1, { displayModeBar: false });\n}", "title": "" }, { "docid": "f38d23e4b7c0449bfae9a86d76739e9e", "score": "0.52097476", "text": "function BarGraph(num = 40) {\n\tfor (let i = 0; i < num; i += 1) {\n\t const value = Math.floor(Math.random() * 200);\n\n\t const block = document.createElement(\"div\");\n\t block.classList.add(\"block\");\n\t block.style.height = `${value * 3}px`;\n\t block.style.transform = `translateX(${i * 30}px)`;\n\n\t const blockLabel = document.createElement(\"label\");\n\t blockLabel.classList.add(\"block__id\");\n\t blockLabel.innerHTML = value; \n\n\t block.appendChild(blockLabel);\n\t data_container.appendChild(block);\n }\n}", "title": "" }, { "docid": "5908c20365ed6c8a20b0fe66ce497099", "score": "0.5208095", "text": "function Plots(index) {\n \n \n // Set up arrays for horizontal bar chart & gauge chart\n var sampleSubjectOTUs = data.samples[index].otu_ids; \n console.log(sampleSubjectOTUs);\n var sampleSubjectFreq = data.samples[index].sample_values;\n var otuLabels = data.samples[index].otu_labels //creating variables to call our json data and to make it an array, it will be called down below\n //when we make our top ten list\n \n var washFrequency = data.metadata[+index].wfreq; //the + turns the array into numberic data. This is used for the gauge\n console.log(washFrequency); //simple console log \n \n \n // Populate Demographic Data card\n var demoKeys = Object.keys(data.metadata[index]); //the keys within the metadata index\n var demoValues = Object.values(data.metadata[index]) //values of the metadata index\n var demographicData = d3.select('#sample-metadata'); //created a class to call our objects values \n \n // clear demographic data\n demographicData.html(\"\"); \n \n for (var i = 0; i < demoKeys.length; i++) {\n \n demographicData.append(\"p\").text(`${demoKeys[i]}: ${demoValues[i]}`); // this will append all the paragraph values in the html text box and will \n //will allow for the data to be cleared \n };\n \n \n // Slice and reverse data for horizontal bar chart\n var topTenOTUS = sampleSubjectOTUs.slice(0, 10).reverse();\n var topTenFreq = sampleSubjectFreq.slice(0, 10).reverse();\n var topTenToolTips = data.samples[0].otu_labels.slice(0, 10).reverse();\n var topTenLabels = topTenOTUS.map((otu => \"OTU \" + otu)); //creates our label to our data \n var reversedLabels = topTenLabels.reverse(); //creating our top ten list from our arrays from above. We use the .slice and .reverse commands\n \n // Set up trace\n var trace1 = {\n x: topTenFreq,\n y: reversedLabels,\n text: topTenToolTips,\n name: \"\",\n type: \"bar\",\n orientation: \"h\"\n };\n //This is creating the horizontial bar chart\n // data\n var barData = [trace1]; //putting that chart into a variable we can callback later \n \n // Apply layout\n var layout = {\n title: \"Top 10 OTUs\",\n margin: { //creating the margin on the html page\n l: 75,\n r: 75,\n t: 75,\n b: 50\n } //This is laying out where the bar chart will be located on the webpage\n };\n \n // Render the plot to the div tag with id \"plot\"\n Plotly.newPlot(\"bar\", barData, layout); //using Plotly command to plot the bar chart\n \n // Set up trace\n trace2 = {\n x: sampleSubjectOTUs,\n y: sampleSubjectFreq,\n text: otuLabels,\n mode: 'markers',\n marker: {\n color: sampleSubjectOTUs,\n opacity: [1, 0.8, 0.6, 0.4],\n size: sampleSubjectFreq\n }\n }\n //creating our buble chart, similar steps as above for the horizontial bar chart \n //data\n var bubbleData = [trace2];\n \n // Apply layout\n var layout = {\n title: 'OTU Frequency',\n showlegend: false,\n height: 600,\n width: 930\n }\n \n // Render the plot to the div tag with id \"bubble-plot\"\n Plotly.newPlot(\"bubble\", bubbleData, layout)\n \n // Gauge chart\n \n var trace3 = [{\n domain: {x: [0, 1], y: [0,1]},\n type: \"indicator\",\n mode: \"gauge+number\",\n value: washFrequency,\n title: { text: \"Belly Button Washes Per Week\" },\n gauge: {\n axis: { range: [0, 9], tickwidth: 0.5, tickcolor: \"black\" },\n bar: { color: \"#669999\" },\n bgcolor: \"white\",\n borderwidth: 2,\n bordercolor: \"transparent\",\n steps: [\n { range: [0, 1], color: \"#fff\" },\n { range: [1, 2], color: \"#e6fff5\" },\n { range: [2, 3], color: \"ccffeb\" },\n { range: [3, 4], color: \"b3ffe0\" },\n { range: [4, 5], color: \"#99ffd6\" },\n { range: [5, 6], color: \"#80ffcc\" },\n { range: [6, 7], color: \"#66ffc2\" },\n { range: [7, 8], color: \"#4dffb8\" },\n { range: [8, 9], color: \"#33ffad\" }\n \n ],\n }\n }]; //creating a our gauge. This gauge calls out how many times a week our patient wash their bully button. Not as complicated as you think.\n \n gaugeData = trace3;\n \n var layout = {\n width: 600,\n height: 500,\n margin: { t: 0, b: 0 }\n };\n \n Plotly.newPlot(\"gauge\", gaugeData, layout);\n \n } //Just like our other graphs, it's a three part process; (trace, create variable for plot, create layout, and use Plotly to plot)", "title": "" }, { "docid": "60eda388634062d2380a1b6005c79190", "score": "0.5207512", "text": "function text() {\n this.append(\"span\")\n .attr(\"class\", function(d){ return \"chart-text \" + d.class })\n .call(function() {\n this.append(\"span\")\n .attr(\"class\", \"chart-label\")\n .text(function(d){ return d.label });\n this.append(\"span\")\n .attr(\"class\", \"chart-value\")\n .text(function(d){ return d.value });\n });\n this.node().chart = { update: function(d) {\n d3.select(this).select(\".chart-value\")\n .text(d.value);\n }};\n }", "title": "" }, { "docid": "518709d6ae46d3868da3ff910b334c39", "score": "0.5203401", "text": "function tick() {\n path.attr(\"d\", function(d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = Math.sqrt(dx * dx + dy * dy);\n return \"M\" +\n d.source.x + \",\" +\n d.source.y + \"A\" +\n dr + \",\" + dr + \" 0 0,1 \" +\n d.target.x + \",\" +\n d.target.y;\n });\n\n node\n .attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\"; })\n\n // add names \n names\n .attr(\"transform\", function(d) {\n return \"translate(\" + (d.x + 12) + \",\" + (d.y + 3) + \")\"; \n });\n}", "title": "" }, { "docid": "37391b299b678859579bb25bb7def549", "score": "0.5201415", "text": "function setLabel(props) {\n\n\t\t//Check for data on the state, replace \"undefined\" if no data\n\t\tif (props[expressed] == undefined) {\n\t\t\tvar cur_label = \"No Data\"\n\t\t} else {\n\t\t\tvar cur_label = props[expressed]\n\t\t}\n\n\t\t//label content\n\t\tvar labelAttribute = \"<h1>\" + cur_label +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//create info label div\n\t\tvar infolabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infolabel\")\n\t\t\t.attr(\"id\", props.STUSPS + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tvar regionName = infolabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.STUSPS);\n\t}", "title": "" }, { "docid": "ef481aea2c3e584822b5d86dacaba0c9", "score": "0.51963764", "text": "function setLabel(props) {\n //label content\n \n var classState = \"<p><b>\" + props[expressed + \"_Count\"] + \"</b><small> gyms offer \" + expressed + \" in <b>\" + props.postal + \"</b></small></p>\";\n var count = \"<p>(<b>\" + props[expressed] + \"</b><small> gyms per million people)</small></p>\";\n var labelAttribute = classState + count;\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.postal + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "title": "" }, { "docid": "1f42d28748e7fae79e105599f28f4314", "score": "0.5196101", "text": "function ticked() {\n link\n .attr(\"x1\", function (d) { return d.source.x; })\n .attr(\"y1\", function (d) { return d.source.y; })\n .attr(\"x2\", function (d) { return d.target.x; })\n .attr(\"y2\", function (d) { return d.target.y; });\n\n // node\n // .attr(\"cx\", function (d) { return d.x; })\n // .attr(\"cy\", function (d) { return d.y; });\n\n label\n .attr(\"dx\", function (d) { return d.x + 10; })\n .attr(\"dy\", function (d) { return d.y - 10; });\n\n monster\n .attr(\"transform\", function (d) { return 'translate(' + (d.x - 10) + ',' + (d.y - 10) + ')' })\n }", "title": "" }, { "docid": "22a09f666b6c8c7df5aeb19322090656", "score": "0.51843184", "text": "function drawValues() {\n\t\t\n\t\tself.svg.selectAll('.value').data(self.data)\n\t\t .enter()\n\t\t .append('text')\n\t\t .attr('class', 'value')\n\t\t .attr('x', 270)\n\t\t .attr('text-anchor', 'end')\n\t\t .attr('y', function(d, i) {\n\t\t\t return self.yScale.range([290, 180])(i)\n\t\t })\n\t\t \n\t\tself.svg.selectAll('.value').data(self.data)\n\t\t .text(function(d) {\n\t\t\t return Math.floor(d.value)\n\t\t })\n\t}", "title": "" }, { "docid": "25d23e84b76e9fcfc6d4f97d808329bf", "score": "0.5180685", "text": "function drawTarget() {\n push();\n strokeWeight(4);\n fill(targetFill, targetHealth);\n imageMode(CENTER);\n image(target, targetX, targetY, targetRadius * 2, targetRadius * 2);\n // Add a secondary circle as a \"countdown\" to when the target has lost all health\n ellipse(targetX, targetY, targetHealth * 0.8);\n pop();\n}", "title": "" }, { "docid": "38e44f94e41a4b4401a532c140f28b54", "score": "0.5178721", "text": "function createDataCharts(bellyButtonId) {\n // use d3 library to read in `samples.json`\n d3.json(\"./samples.json\").then(function(data) {\n var samplesData = data.samples;\n var resultArray = samplesData.filter(object => object.id == bellyButtonId);\n var result = resultArray[0];\n console.log(result);\n\n //Use `otu_ids` as the labels for the bar chart\n var ids = result.otu_ids; //could do --data.samples[0].otu_ids;-- as well\n console.log(ids);\n\n //Use `sample_values` as the values for the bar chart\n var sampleValues = data.samples[0].sample_values;// could do --result.samples-- as well\n console.log(sampleValues);\n \n var otuLabels = result.otu_labels;\n console.log(otuLabels);\n \n var topIds = data.samples[0].otu_ids.slice(0, 10).reverse();\n \n var otuName = topIds.map((data) => \"OTU \" + data);\n console.log(`OTU IDS: ${otuName}`);\n\n //Build Horizontal Bar Chart\n var barTrace = {\n x: sampleValues.slice(0, 10).reverse(),\n y: otuName,\n text: otuLabels.slice(0, 10).reverse(), //Use `otu_labels` as the hovertext for the chart\n type: 'bar',\n orientation: 'h'\n };\n \n var data = [barTrace];\n \n var barLayout = {\n title: `Top 10 OTUs`\n };\n \n Plotly.newPlot('bar', data, barLayout);\n\n // Create Bubble Chart\n\n var bubbleTrace = {\n x: ids,\n y: sampleValues,\n text: otuLabels,\n margin: {t:40},\n mode: \"markers\",\n marker: {\n colorscale: [\n ['0.0', 'rgb(165,0,38)'],\n ['0.111111111111', 'rgb(215,48,39)'],\n ['0.222222222222', 'rgb(244,109,67)'],\n ['0.333333333333', 'rgb(253,174,97)'],\n ['0.444444444444', 'rgb(254,224,144)'],\n ['0.555555555556', 'rgb(224,243,248)'],\n ['0.666666666667', 'rgb(171,217,233)'],\n ['0.777777777778', 'rgb(116,173,209)'],\n ['0.888888888889', 'rgb(69,117,180)'],\n ['1.0', 'rgb(49,54,149)']\n ],\n color: ids,\n size: sampleValues\n }\n \n };\n\n var bubbleData = [bubbleTrace];\n \n var bubbleLayout = {\n title: \"Bubble Chart\",\n };\n \n Plotly.newPlot(\"bubble\", bubbleData, bubbleLayout);\n });\n }", "title": "" }, { "docid": "e5bdc01726554916f3cc42cd06c20a39", "score": "0.51657337", "text": "function buildBarPlot(data){ \n console.log(data.sample_values);\n // Slice the first 10 samples for plotting\n sliced_OTU_Ids_Data = data.otu_ids.slice(0,10);\n sliced_sample_values_Data = data.sample_values.slice(0,10);\n sliced_labels = data.otu_labels.slice(0,10);\n\n\n // Reverse the array to accommodate Plotly's defaults\n OTU_Ids_reversedData = sliced_OTU_Ids_Data.reverse();\n sample_values_reversedData = sliced_sample_values_Data.reverse();\n labels_reversedData = sliced_labels.reverse();\n\n plot_otu_ids = OTU_Ids_reversedData.map(i =>\"OTU \"+ i);\n\n console.log(plot_otu_ids);\n console.log(sample_values_reversedData);\n console.log(labels_reversedData);\n\n // Trace for Bar Plot\n var trace1 = {\n x: sample_values_reversedData,\n y: plot_otu_ids,\n text: labels_reversedData,\n marker: {\n color: '#1179b0'},\n type: \"bar\",\n orientation: \"h\"\n };\n\n // data\n var data = [trace1];\n\n // create layout variable to set plots layout\n var layout = {\n title: \"Top 10 OTUs\"\n }\n\n // Render the plot to the div tag with id \"bar\"\n Plotly.newPlot(\"bar\", data,layout);\n}", "title": "" }, { "docid": "aa141fe03c6eec50144ae1d5ddc3f24c", "score": "0.51646876", "text": "function gaugeChart () {\n d3.json(\"samples.json\").then(data =>{\n var target = select.property(\"value\");\n for (var b = 0;b<data.names.length;b++) {\n if (target === data.names[b]) {\n\n var trace_3 = {\n value: data.metadata[b].wfreq,\n title: { text: \"W-Frequency\" },\n mode: \"gauge+number\",\n type: \"indicator\",\n gauge: {\n axis: { range: [null, 9], tickwidth: 1, tickcolor: \"red\" },\n bar: { color: \"yellow\" },\n bgcolor: \"white\",\n borderwidth: 2,\n bordercolor: \"grey\",\n steps: [\n { range: [0, 1], color: \"limegreen\" },\n { range: [1, 2], color: \"green\" },\n { range: [2, 3], color: \"teal\" },\n { range: [3, 4], color: \"cyan\" },\n { range: [4, 5], color: \"blue\" },\n { range: [5, 6], color: \"indigo\" },\n { range: [6, 7], color: \"purple\" },\n { range: [7, 8], color: \"magenta\" },\n { range: [8, 9], color: \"red\" }\n ],\n }\n };\n \n var gaugeChart = [trace_3];\n Plotly.newPlot(\"gauge\",gaugeChart);\n }\n }\n })\n}", "title": "" }, { "docid": "ba7d352f6d4fd4098faaa85dafc9dcb5", "score": "0.5163743", "text": "function drawbarChart(data,targetId) {\n var view1 = new google.visualization.DataView(data);\n view1.setColumns([0, 1, 2, 3, 4, 5, 6]); /* columns in data table*/\n var options1 = {\n\n chartArea: {\n left: \"3%\",\n top: \"10%\",\n\n width: \"94%\"\n },\n bar: {\n groupWidth: \"95%\"\n },\n legend: {\n position: \"none\"\n },\n isStacked: true,\n\n hAxis: {\n format: ';',\n\n },\n vAxis: {\n direction: -1, /* value responsible for making the normal bar chart as butterfly chart */\n\n },\n animation: {\n duration: 1000,\n easing: 'out',\n startup: true\n },\n annotations: { /* text decoration for labels */\n\n textStyle: {\n\n fontSize: 13,\n bold: true,\n italic: true,\n // The color of the text.\n color: '#871b47',\n // The color of the text outline.\n auraColor: '#d799ae',\n // The transparency of the text.\n opacity: 0.8\n }\n }\n };\n var formatter1 = new google.visualization.NumberFormat({\n pattern: ';'\n });\n\n formatter1.format(data, 4)\n formatter1.format(data, 1)\n var chart1 = new google.visualization.BarChart(document.getElementById(targetId));\n chart1.draw(view1, options1);\n}", "title": "" }, { "docid": "a450569e4bc8f1bc534de2d95fb47d1f", "score": "0.5151811", "text": "function drawHorizontalbarChart(barChartId, fData){\n\t\n\tfData.forEach(function(d) {\n\t\tif (d.ZONE!=null){\n\t\t\td.label = d.ZONE.NAME;\n\t\t}\n\t\tif (d.NO_EVENTS!=null){\n\t\t\td.value = d.NO_EVENTS; \n\t\t} else if (d.FEE!=null){\n\t\t\td.value = d.FEE\n\t\t}\n\t});\n\n\t//Empty the div\n\t$(barChartId).empty();\n\t\n var div = d3.select(barChartId).append(\"div\").attr(\"class\", \"toolTip\");\n\n var axisMargin = 20,\n margin = 40,\n valueMargin = 4,\n width = parseInt(d3.select(barChartId).style('width'), 10),\n height = parseInt(d3.select(barChartId).style('height'), 10),\n barHeight = (height-axisMargin-margin*2)* 0.85/fData.length,\n barPadding = 5,\n fData, bar, svg, scale, xAxis, labelWidth = 0;\n\n max = d3.max(fData, function(d) { return d.value; });\n\n svg = d3.select(barChartId)\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n\n bar = svg.selectAll(\"g\")\n .data(fData)\n .enter()\n .append(\"g\");\n\n bar.attr(\"class\", \"bar\")\n .attr(\"cx\",0)\n .attr(\"transform\", function(d, i) {\n return \"translate(\" + margin + \",\" + (i * (barHeight + barPadding) + barPadding) + \")\";\n });\n\n bar.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\") //vertical align middle\n .text(function(d){\n return d.label;\n }).each(function() {\n labelWidth = Math.ceil(Math.max(labelWidth, this.getBBox().width));\n });\n\n scale = d3.scale.linear()\n .domain([0, max])\n .range([0, width - margin*2 - labelWidth]);\n\n xAxis = d3.svg.axis()\n .scale(scale)\n .tickSize(-height + 2*margin + axisMargin)\n .orient(\"bottom\");\n\n bar.append(\"rect\")\n .attr(\"transform\", \"translate(\"+labelWidth+\", 0)\")\n .attr(\"height\", barHeight)\n .attr(\"width\", function(d){\n return scale(d.value);\n });\n\n bar.append(\"text\")\n .attr(\"class\", \"value\")\n .attr(\"y\", barHeight / 2)\n .attr(\"dx\", -valueMargin + labelWidth) //margin right\n .attr(\"dy\", \".35em\") //vertical align middle\n .attr(\"text-anchor\", \"end\")\n .text(function(d){\n return (d.value);\n })\n .attr(\"x\", function(d){\n var width = this.getBBox().width;\n return Math.max(width + valueMargin, scale(d.value));\n });\n\n svg.insert(\"g\",\":first-child\")\n .attr(\"class\", \"axisHorizontal\")\n .attr(\"transform\", \"translate(\" + (margin + labelWidth) + \",\"+ (height - axisMargin - margin)+\")\")\n .call(xAxis);\n}", "title": "" }, { "docid": "9122a9f0b69a3cb807e73c1d3bc776fb", "score": "0.5145041", "text": "function makeLabels() {\r\n svgLineGraph.append('text')\r\n .attr('x', 10)\r\n .attr('y', 40)\r\n .style('font-size', '14pt')\r\n .text(\"Population size over time Per Country\");\r\n\r\n svgLineGraph.append('text')\r\n .attr('x', 230)\r\n .attr('y', 490)\r\n .style('font-size', '10pt')\r\n .text('Year');\r\n\r\n svgLineGraph.append('text')\r\n .attr('transform', 'translate(15, 300)rotate(-90)')\r\n .style('font-size', '10pt')\r\n .text('Population in millions');\r\n }", "title": "" }, { "docid": "9246d396c38d56793cb4162414c1f6ed", "score": "0.5144316", "text": "function makePercentageBar(arr, name, totalBudget) {\n //Margin conventions\n var margin = { top: 10, right: 50, bottom: 20, left: 1 };\n\n var width = $(\".g-chart\").width(),\n height = 100 - margin.top - margin.bottom;\n\n var barHeight = 35;\n\n //Appends the svg to the chart-container div\n d3.select(\".g-chart\").append(\"h6\")\n .attr(\"class\", \"mt-0 mb-1\")\n .attr(\"id\", \"data\"+name)\n .text(name);\n\n var svg = d3.select(\".g-chart\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n //Creates the xScale \n var xScale = d3.scale.linear()\n .range([0, width]);\n\n //Creates the yScale\n var y0 = d3.scale.ordinal()\n .rangeBands([height, 0], 0)\n .domain([name]);\n\n //Defines the y axis styles\n var yAxis = d3.svg.axis()\n .scale(y0)\n .orient(\"left\");\n\n //Defines the y axis styles\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\")\n .tickFormat(function (d) { return d + \"%\"; })\n .tickSize(height);\n\n //Get the percentage number\n var cost = 0;\n\n if (arr.length > 0 ) {\n arr.forEach(function (element) {\n cost += parseFloat(element.expenseCost);\n });\n var perc = cost/parseFloat(totalBudget)*100;\n \n if (perc > 100) {\n perc = 100;\n }\n } else {\n var perc = 0;\n }\n\n //Local data\n var data = [{ \"category\": name, \"num\": perc, \"num2\": 100 }];\n\n var tempArr = [];\n\n if (arr.length > 0) {\n arr.forEach(e => {\n tempArr.push([e.expenseName.trim(), e.expenseCost]);\n });\n \n var tip = d3.tip().attr('class', 'd3-tip').offset([-10, 0]).html(function (d) {\n tempArr.sort(function(a, b) {return b[1] - a[1]});\n var sum = 0;\n var html = \"\";\n tempArr.forEach(e => {\n sum += e[1];\n })\n if (sum < totalBudget) {\n sum = totalBudget;\n }\n tempArr.forEach(e => {\n html += \"<strong>\" + e[0] + \": </strong><span class='details'>$\" + e[1].toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,') + \" --------> \" + (e[1]/sum*100).toFixed(2) + \"% of used expense<br></span>\"\n })\n return html;\n });\n \n svg.call(tip);\n }\n\n\n //Draw the chart\n ready(data);\n\n function ready(data) {\n\n //FORMAT data\n data.forEach(function (d) {\n d.num = +d.num;\n d.num2 = +d.num2;\n });\n\n //Sets the max for the xScale\n var maxX = d3.max(data, function (d) { return d.num2; });\n\n //Gets the min for bar labeling\n var minX = d3.min(data, function (d) { return d.num; });\n\n //Defines the xScale max\n xScale.domain([0, maxX]);\n\n //Appends the y axis\n var yAxisGroup = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n //Appends the x axis \n var xAxisGroup = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .call(xAxis);\n\n //Binds the data to the bars \n var categoryGroup = svg.selectAll(\".g-category-group\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"g-category-group\")\n .attr(\"transform\", function (d) {\n return \"translate(0,\" + y0(d.category) + \")\";\n })\n .on('mouseover', function (d) {\n tip.show(d);\n d3.select(this).style('opacity', 1).style('stroke-width', 3);\n })\n .on('mouseout', function (d) {\n tip.hide(d);\n d3.select(this).style('opacity', 0.8).style('stroke-width', 0.3);\n });\n\n //Appends background bar \n var bars2 = categoryGroup.append(\"rect\")\n .attr(\"width\", function (d) { return xScale(d.num2); })\n .attr(\"height\", barHeight - 1)\n .attr(\"class\", \"g-num2\")\n .attr(\"rx\", 7)\n .attr(\"transform\", \"translate(0,4)\");\n\n //Appends main bar \n var bars = categoryGroup.append(\"rect\")\n .attr(\"width\", function (d) { return xScale(d.num); })\n .attr(\"height\", barHeight - 1)\n .attr(\"class\", \"g-num\")\n .attr(\"rx\", 7)\n .attr(\"transform\", \"translate(0,4)\")\n .style(\"fill\", function (d) {\n if (d.num >= 80) {\n return \"rgb(207, 35, 35)\";\n } else if (d.num >= 60) {\n return \"rgb(242, 145, 75)\";\n } else if (d.num >= 40) {\n return \"rgb(242, 237, 75)\";\n } else if (d.num >= 20) {\n return \"rgb(200, 242, 75)\";\n } else {\n return \"rgb(128, 242, 75)\";\n }\n });\n\n //Binds data to labels\n var labelGroup = svg.selectAll(\"g-num\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"g-label-group\")\n .attr(\"transform\", function (d) {\n return \"translate(0,\" + y0(d.category) + \")\";\n });\n\n\n //Appends main bar labels \n var barLabels = labelGroup.append(\"text\")\n .text(function (d) { return d.num.toFixed(3) + \"%\"; })\n .attr(\"x\", function (d) {\n if (minX > 32) {\n return xScale(d.num) - 37;\n }\n else {\n return xScale(d.num) + 6;\n }\n })\n .style(\"fill\", function (d) {\n if (minX > 32) {\n return \"white\";\n }\n else {\n return \"#696969\";\n }\n }) \n .attr(\"y\", y0.rangeBand() / 1.6)\n .attr(\"class\", \"g-labels\");\n\n //RESPONSIVENESS\n d3.select(window).on(\"resize\", resized);\n\n function resized() {\n\n //new margin\n var newMargin = { top: 10, right: 10, bottom: 20, left: 1 };\n\n\n //Get the width of the window\n var w = d3.select(\".g-chart\").node().clientWidth;\n console.log(\"resized\", w);\n\n //Change the width of the svg\n d3.select(\"svg\")\n .attr(\"width\", w);\n\n //Change the xScale\n xScale\n .range([0, w]);\n\n //Update the bars\n bars\n .attr(\"width\", function (d) { return xScale(d.num); });\n\n //Update the second bars\n bars2\n .attr(\"width\", function (d) { return xScale(d.num2); });\n\n //Updates bar labels\n barLabels\n .attr(\"x\", function (d) {\n if (minX > 32) {\n return xScale(d.num) - 37;\n }\n else {\n return xScale(d.num) + 6;\n }\n })\n .attr(\"y\", y0.rangeBand() / 1.6)\n\n //Updates xAxis\n xAxisGroup\n .call(xAxis);\n\n //Updates ticks\n xAxis\n .scale(xScale)\n\n };\n\n }\n}", "title": "" }, { "docid": "8506bc12bae2d9377cd954ee7627cab9", "score": "0.5143897", "text": "renderLabelY(){\n const labelGroup = this.chartGroup.append(\"g\");\n\n this.yAxisList.forEach((axis, index) => {\n const label = labelGroup.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - this.margin.left + (index * this.offset))\n .attr(\"x\", 0 - (this.chartHeight / 2))\n .attr(\"dy\", \"1em\")\n .attr(\"value\", index)\n .text(axis.label);\n\n if(index == this.selectAxisY){\n label.classed(\"active\", true);\n label.classed(\"inactive\", false);\n }\n else{\n label.classed(\"active\", false);\n label.classed(\"inactive\", true);\n }\n\n label.on(\"click\", (_d, i, nodes) =>{\n const label = d3.select(nodes[i]);\n const value = label.attr(\"value\");\n \n if(value != this.selectAxisY)\n {\n this.updateAxisY(value, true);\n }\n });\n });\n\n this.yLabelGroup = labelGroup;\n }", "title": "" }, { "docid": "0643bc1e0c517a3704cdcf7b0c8d47df", "score": "0.5141102", "text": "plot(chart, width, height) {\n\n const xScale = d3.scaleBand()\n .domain(sorted_snitches_top.map(d => d[0]))\n .range([0, width])\n .padding(.02);\n const yScale = d3.scaleLinear()\n .domain([0, d3.max(sorted_snitches_top, d => d[1])])\n .range([height, 0])\n const colorScale = d3.scaleSequential().domain([2,11])\n .interpolator(d3.interpolateViridis );\n\n const div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0)\n\n chart.selectAll('.bar')\n .data(sorted_snitches_top)\n .enter()\n .append('rect')\n .classed('bar', true)\n .attr('x', d => xScale(d[0]))\n .attr('y', d => yScale(d[1]))\n .attr('height', d => (height - yScale(d[1])))\n .attr('width', d => xScale.bandwidth())\n .style('fill', (d, i) => colorScale(i + 2))\n\n chart.selectAll('.bar-label')\n .data(sorted_snitches_top)\n .enter()\n .append('text')\n .classed('bar-label', true)\n .attr('x', d => xScale(d[0]) + xScale.bandwidth()/2)\n .attr('dx', 0)\n .attr('y', d => yScale(d[1]))\n .attr('dy', -6)\n .text(d => d[1]);\n\n const xAxis = d3.axisBottom()\n .tickPadding(6)\n .scale(xScale);\n\n chart.append('g')\n .classed('x-axis', true)\n .attr('transform', `translate(0,${height })`)\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"dx\", \"4.0em\")\n .attr(\"dy\", \"0.9em\")\n .attr(\"transform\", \"rotate(45)\" )\n .style('font-size', '11px')\n .style('margin-top', '10px');;\n\n const yAxis = d3.axisLeft()\n .ticks(5)\n .scale(yScale);\n\n chart.append('g')\n .classed('y-axis', true)\n .attr('transform', 'translate(0,0)')\n .call(yAxis);\n\n chart.select('.x-axis')\n .append('text')\n .attr('x', width/2)\n .attr('y', 140)\n .attr('fill', '#000')\n .style('font-size', '20px')\n .style('text-anchor', 'middle')\n .style('margin-top', '60px')\n .style('padding', '10px')\n .text('Website');\n\n chart.select('.y-axis')\n .append('text')\n .attr('x', 0)\n .attr('y', 0)\n .attr('transform', `translate(-50, ${height/2}) rotate(-90)`)\n .attr('fill', '#000')\n .style('font-size', '20px')\n .style('text-anchor', 'middle')\n .text('Number of Trackers');\n\n }", "title": "" }, { "docid": "7112ef9d719cf7277a67930da6652435", "score": "0.51370066", "text": "function displaybarChart (sample, name) {\n var dataDisplay = Top10OTU(sample,name);\n\n var trace1 = [{\n // X-value, Y-value, labels and text\n type: \"bar\",\n x: dataDisplay.map(item => item.sampleValues).reverse(),\n y: dataDisplay.map(item => 'OTU' + item.outID).reverse(),\n labels: dataDisplay.map(item => 'OTU' + item.outID).reverse(),\n text: dataDisplay.map( item => item.otuLabel).reverse(),\n orientation: \"h\"\n\n }];\n\n // Layout of bar\n var barLayout = {\n autosize: true,\n margin: {\n l: 100,\n r: 10,\n b: 20,\n t:30,\n pad:0\n },\n showlegend: false\n };\n Plotly.newPlot(\"bar\", trace1, {displayModeBar: false});\n}", "title": "" }, { "docid": "e87a1195fa283b5b49eef94bea57c4f3", "score": "0.5136914", "text": "function init() {\nd3.json(\"data/samples.json\").then(function(data) {\n var subject = Object.entries(data.metadata[0]);\n var samples = Object.values(data.samples);\n console.log(subject);\n console.log(samples);\n //Creating variables that hold the initial values for sample_values, otu_lables, and otu_ids\n var samples= data.samples[0].sample_values\n var Ids= data.samples[0].otu_ids;\n var Labels = data.samples[0].otu_labels;\n \n// Creating a Bar chart using sample_values as the values.\n var trace1 = {\n // Slicing the first 10 values for the x axis\n x: samples.slice(0, 10),\n // Creating lables for chart \n y: Ids.map(x => `OTU ${x}`),\n // Slicing the first 10 names of the otu_lables as the hovertext for the chart\n text: Labels.slice(0, 10),\n \n type: \"bar\",\n // Orienting the bar chart to be horizontal \n orientation: \"h\"\n };\n\n// Creating an array for the bar chart.\n var chart = [trace1];\n \n // Defining the bar chart values\n var chartLayout = {\n title: \"Top 10 Operational Taxonomic Units\",\n xaxis: {\n title: \"Sample Values\"\n },\n yaxis: {\n categoryorder: \"total ascending\"\n }\n };\n// Plotting the chart to a div tag with id \"bar\" and including the chart and chartLayout arrays.\n Plotly.newPlot(\"bar\", chart, chartLayout)\n\n// Creating a bubble chart using sample_values as the values.\n var trace2 = {\n // Slicing the first 25 values for the x axis\n x: samples.slice(0, 25),\n // Creating lables for chart \n y: Ids.map(x => `${x}`),\n\n mode:\"markers\",\n marker: {\n\n size: samples.slice(0,25),\n\n // Slicing the first 8 names of the otu_lables as the hovertext for the chart\n text: Labels.slice(0, 8),\n \n // Associate color to the OTU IDs\n color: Ids\n },\n // Slicing the first 25 names of the otu_lables as the hovertext for the chart\n text: Labels.slice(0, 25),\n };\n// Creating data array for plot\n var Bubble = [trace2];\n\n // Defining the plot layout\n var bubbleLayout = {\n title: \"Top 25 Operational Taxonomic Units v.s Sample Values\",\n showlegend: false,\n };\n\n // Plotting the bubble chart to a div tag with \"bubble\" id and include the Bubble and bubbleLayout arrays\n Plotly.newPlot(\"bubble\", Bubble, bubbleLayout);\n\n//Creating demographics function for the demographic info card. \nvar demographics = function () {\n d3.json('data/samples.json').then(function(data) {\n Object.entries(data.metadata[0]).forEach(function([key, value]) {\n d3.select('#sample-metadata').append('p')\n .text(`${key}: ${value}`)\n })\n })\n};\ndemographics();\n\n //Creating a gauge chart plot.\n var data3 = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: data.metadata[6].wfreq,\n title: { text: \"Belly Button Washing frequency\" },\n type: \"indicator\",\n mode: \"gauge+number\",\n gauge: {\n // Setting axis at a 0 to 10 range of washes per week.\n axis: {range: [0, 10] },\n }\n }\n];\n\nconsole.log(data.metadata[6].wfreq)\n\nvar layout3 = { width: 500, height: 500, margin: { t: 0, b: 0 } };\nPlotly.newPlot('gauge', data3);\n});\n}", "title": "" }, { "docid": "bddf0af3589910b0225f54b17922fb7e", "score": "0.5135169", "text": "function drawTypeBTab3()\n{\n var labels = ['Flu+ Sample Size', 'MA-ILI Sample Size'];\n var x = [];\n var y;\n\n // use a parameters object to pass in any other input parameters to the evaluation function\n var parameters = new Object();\n parameters.population = calculatorTypeBInputs.population;\n parameters.surveillanceScale = calculatorTypeBInputs.surveillanceScale;\n parameters.confidenceLevel = calculatorTypeBInputs.confidenceLevel3;\n parameters.p = calculatorTypeBInputs.p3;\n parameters.detectionThreshold = calculatorTypeBInputs.detectionThreshold3;\n\n // dynamically set range based on parameters\n var idealFluSampleSize = Math.log(1. - parameters.confidenceLevel/100.) / Math.log(1. - parameters.detectionThreshold/100.);\n\n if(parameters.surveillanceScale == \"State\")\n {\n // finite population correction\n idealFluSampleSize = idealFluSampleSize * Math.sqrt((parameters.population - idealFluSampleSize) / (parameters.population - 1.));\n }\n\n if(parameters.surveillanceScale == \"National\")\n {\n idealFluSampleSize = idealFluSampleSize * parameters.population / nationalPopulation;\n }\n\n // range: Flu+ sample size\n var min = 0;\n var max = Math.ceil(idealFluSampleSize);\n var numValues = max - min + 1;\n\n // limit number of values\n if(numValues > 100)\n {\n numValues = 100;\n }\n\n for(var i=0; i<numValues; i++)\n {\n var value = min + i/(numValues-1)*(max-min);\n\n // round to the nearest integer\n x.push(Math.round(value));\n }\n\n // evaluation for each x\n y = x.map(evaluateTypeB_MAILISampleSize_vs_FluSampleSize, parameters);\n\n // labels with percentages\n xLabelMap = {};\n yLabelMap = {};\n\n for(var i=0; i<y.length; i++)\n {\n // round to nearest tenth of a percent\n xLabelMap[x[i]] = x[i] + \" (\" + Math.round(x[i]/(x[i]+y[i])*100.*10.)/10. + \"%)\";\n yLabelMap[y[i]] = y[i] + \" (\" + Math.round(y[i]/(x[i]+y[i])*100.*10.)/10. + \"%)\";\n }\n\n // separate DataTable objects for chart / table to allow for formatting\n var dataChart = arraysToDataTable(labels, [x, y]);\n var dataTable = dataChart.clone();\n\n // chart: use x label in tooltip\n var formatterChart = new google.visualization.NumberFormat( {pattern: \"Flu+ Sample Size: #\"} );\n formatterChart.format(dataChart, 0);\n\n var optionsChart = {\n title: '',\n hAxis : { title: labels[0] },\n vAxis : { title: labels[1] },\n legend : { position: 'none' },\n fontSize : chartFontSize\n };\n\n // table: user labels with percentages\n var formatterTableX = new labelFormatter(xLabelMap);\n var formatterTableY = new labelFormatter(yLabelMap);\n\n formatterTableX.format(dataTable, 0);\n formatterTableY.format(dataTable, 1);\n\n // need to specify width here (rather than in CSS) for IE\n var optionsTable = {\n width: '225px'\n };\n\n $(\"#calculatorB3_chart_table_description_div\").html(\"Combinations of <span class='calculatorTooltip' title='\" + tooltipTypeBFluSampleSize + \"'>Flu+</span> and <span class='calculatorTooltip' title='\" + tooltipTypeBMAILISampleSize + \"'>unscreened MA-ILI</span> sample sizes may be required to detect a rare/novel influenza specimen with prevalence (Rare+/Flu+) that has reached the detection threshold of \" + formatTextParameter(parameters.detectionThreshold + \"% (1/\" + Math.round(100. / parameters.detectionThreshold) + \")\") + \", with a confidence of \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \". These calculations assume a total population of \" + formatTextParameter(numberWithCommas(parameters.population)) + \" and a Flu+/MA-ILI prevalence of \" + formatTextParameter(parameters.p + \"%\") + \". Many more unscreened MA-ILI specimens are typically required than Flu+ specimens to achieve the same power of detection, particularly when the overall prevalence of influenza (Flu+/MA-ILI) is low.\");\n\n var chart = new google.visualization.LineChart(document.getElementById('calculatorB3_chart_div'));\n chart.draw(dataChart, optionsChart);\n\n var table = new google.visualization.Table(document.getElementById('calculatorB3_table_div'));\n table.draw(dataTable, optionsTable);\n\n // selection handling\n var thisObj = drawTypeBTab3;\n\n google.visualization.events.addListener(chart, 'select', chartSelectHandler);\n google.visualization.events.addListener(table, 'select', tableSelectHandler);\n\n function chartSelectHandler(e) { thisObj.selectHandler(chart.getSelection()); }\n function tableSelectHandler(e) { thisObj.selectHandler(table.getSelection()); }\n\n thisObj.selectHandler = function(selectionArray)\n {\n if(selectionArray.length > 0 && selectionArray[0].row != null)\n {\n thisObj.selectedRow = selectionArray[0].row;\n\n // make sure row is valid\n if(thisObj.selectedRow >= x.length)\n {\n thisObj.selectedRow = 0;\n }\n\n // form new array with only this entry (to avoid multiple selections)\n var newSelectionArray = [{row:selectionArray[0].row}];\n\n // select element in chart and table\n chart.setSelection(newSelectionArray);\n table.setSelection(newSelectionArray);\n\n if(parameters.surveillanceScale == \"National\")\n {\n $(\"#calculatorB3_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(parameters.detectionThreshold + \"% (1/\" + Math.round(100. / parameters.detectionThreshold) + \")\") + \" at a national level, the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" MA-ILI and \" + formatTextParameter(numberWithCommas(x[thisObj.selectedRow])) + \" Flu+ specimens (with \" + formatTextParameter(parameters.p + \"%\") + \" Flu+/MA-ILI prevalence).\");\n }\n else\n {\n $(\"#calculatorB3_chart_table_report_div\").html(\"To be \" + formatTextParameter(parameters.confidenceLevel + \"%\") + \" confident of detecting 1 or more rare/novel influenza events at a prevalence of \" + formatTextParameter(parameters.detectionThreshold + \"% (1/\" + Math.round(100. / parameters.detectionThreshold) + \")\") + \" (within the population under surveillance), the PHL must test \" + formatTextParameter(numberWithCommas(y[thisObj.selectedRow])) + \" MA-ILI and \" + formatTextParameter(numberWithCommas(x[thisObj.selectedRow])) + \" Flu+ specimens (with \" + formatTextParameter(parameters.p + \"%\") + \" Flu+/MA-ILI prevalence).\");\n }\n }\n }\n\n thisObj.selectHandler([{row:thisObj.selectedRow ? thisObj.selectedRow : 0}]);\n}", "title": "" }, { "docid": "4c0586ae355b951492ad857ac3cf7add", "score": "0.513016", "text": "function BarChart(data, options){\n var barThickness = options.barThickness || 20;\n var barSpace = options.barSpace || 5;\n var me = this;\n var w = options.width || 100;\n var x = options.x || 0;\n var y = options.y || 0;\n var titleHeight = options.titleHeight || 24;\n var barColor = options.barColor || 0;\n var bars = [];\n var text = [];\n var buffer = titleHeight*1.5;\n var myTitle = defaultBarChartTitle;\n var myData = null;\n var svgTitle;\n var barPos = function(d, i){\n bars.push(this);\n return buffer + (i * (barThickness+barSpace));\n };\n var textPos = function(d, i){\n text.push(this);\n return buffer + (barThickness*.9)+(i * (barThickness+barSpace));\n };\n var dataFunc = function(d){\n return d.value*dataScale;\n };\n\n var dataScale = w / Math.max.apply(null, data);\n\n var svg = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"height\", data.length*(barThickness+barSpace)+buffer)\n .attr(\"width\", w)\n .attr(\"viewBox\", \"0 0 \"+w+\" \"+titleHeight*1.5);\n\n this.title = function(title){\n myTitle = title;\n svgTitle = svg.append(\"text\")\n .text(title)\n .attr(\"y\", titleHeight)\n .attr(\"font-size\", titleHeight+'px')\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"fill\", \"black\")\n .attr(\"x\", w/2)\n .style(\"text-anchor\", \"middle\");\n };\n\n this.title(defaultBarChartTitle);\n\n\n this.display = function(title, dataSet, color){\n barColor = color;\n myTitle = title;\n me.clear();\n myData = dataSet;\n d3.select('body').property(\"scrollTop\", 0);\n\n bars.length = 0;\n text.length = 0;\n var maxVal = 1;\n if(dataSet.length > 0){\n mergeSort(dataSet, function(d){return -d.value;});\n maxVal = dataSet[0].value;\n }\n dataScale = w / maxVal;\n var clicker = function(d){\n var path = d3.select(pathRef[d.label][0]);\n path.on(\"click\")(path.data()[0]);\n };\n\n\n var mouseOver = function(bar){\n d3.select(bar).style(\"fill\", rgbToHTML(dataColorsBold[barColor]));\n };\n var mouseOut = function(bar){\n d3.select(bar).style(\"fill\", rgbToHTML(dataColorsLight[barColor]));\n };\n\n svg.attr(\"height\", dataSet.length*(barThickness+barSpace)+buffer)\n .selectAll(\"rect\")\n .data(dataSet)\n .enter()\n .append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", barPos)\n .style(\"height\", barThickness)\n .style(\"width\", dataFunc)\n .style(\"fill\", rgbToHTML(dataColorsLight[barColor]))\n .style(\"cursor\", \"pointer\")\n .on(\"mouseover\", function(d, i){\n mouseOver(bars[i], text[i]);\n })\n .on(\"mouseout\", function(d, i){\n mouseOut(bars[i], text[i]);\n })\n .on(\"click\", clicker);\n svg.selectAll(\"text\")\n .data(dataSet)\n .enter()\n .append(\"text\")\n\n .attr(\"x\", 0)\n .attr(\"y\", textPos)\n .style(\"text-anchor\", \"start\")\n .attr(\"fill\", \"black\")\n .text(function(d){return d.label+\"(\"+d.value.toLocaleString()+\")\";})\n .attr(\"font-size\", (barThickness*.9)+'px')\n .attr(\"font-family\", \"sans-serif\")\n .style(\"cursor\", \"pointer\")\n .on(\"click\", clicker)\n .on(\"mouseover\", function(d, i){\n mouseOver(bars[i]);\n })\n .on(\"mouseout\", function(d, i){\n mouseOut(bars[i]);\n });\n me.title(title);\n svg.attr(\"viewBox\", \"0 0 \"+svg.attr(\"width\")+\" \"+svg.attr(\"height\"));\n };\n this.size = function(width){\n w = width;\n svg.attr(\"width\", w);\n if(myData !== null){\n me.display(myTitle, myData, barColor);\n }\n };\n\n this.clear = function(){\n svg.selectAll(\"*\").remove();\n myData = null;\n svg.attr(\"height\", titleHeight*1.5);\n var oldBox = svg.attr(\"viewBox\");\n if(oldBox !== null){\n var split = oldBox.split(\" \");\n split[3] = titleHeight*1.5;\n var newBox = split.join(\" \");\n svg.attr(\"viewBox\", newBox);\n }\n }\n\n}", "title": "" }, { "docid": "b9fdead29484e7fccdba9ac290a99f53", "score": "0.5129052", "text": "function _clickChild(d){\n //console.log(d);\n var taxonName = d.name;\n var barData = [];\n var sampleNames = [\"sample1\", \"sample2\", \"sample3\", \"sample4\"];\n \n sampleNames.forEach(function(sample){\n \n barData.push({\"name\":sample, taxonName: d.name, \"value\":d.value*100, color: color(d.name) });\n });\n \n //remove the previous draw chart and create a new bar chart \n // for current taxon\n d3.select(\"#sampleBar\").select(\"svg\").remove();\n var taxBar = taxonBar(); \n var containerBar = d3.select(\"#sampleBar\")\n .datum(barData)\n .call(taxBar);\n \n }", "title": "" }, { "docid": "c193e60b6554c611e89eb743eed41425", "score": "0.51265067", "text": "function updateBar(newValue) {\n // Sanity check the value\n var value = newValue;\n if (newValue === undefined) {\n value = cfg.scaleMin;\n }\n else if (value > cfg.scaleMax) {\n if (cfg.scaleMaxRelative) {\n cfg.scaleMax = cfg.scaleMax * 10;\n } else {\n value = cfg.scaleMax;\n }\n }\n else if (value < cfg.scaleMin) {\n value = cfg.scaleMin;\n }\n var valueForColor = value;\n\n // Turn value into a percentage of the max angle\n value = (value - cfg.scaleMin) / cfg.scaleMax;\n value = value * valueScale;\n\n // Create the bar.\n // If we've specified a barAngle, then only a small knob is required\n // Otherwise we start from the beginning\n var start, end;\n if (cfg.barAngle !== 0) {\n start = value - knobAngle;\n if (start < 0) {\n start = 0;\n }\n end = start + (knobAngle * 2);\n if (end > fullAngle) {\n end = fullAngle;\n start = end - (knobAngle * 2);\n }\n\n start = start + startAngle;\n if (start > Math.PI * 2) {\n start -= Math.PI * 2;\n }\n end = end + startAngle;\n }\n else {\n start = startAngle;\n end = value + startAngle;\n }\n if (end > Math.PI * 2) {\n end -= Math.PI * 2;\n }\n\n var color;\n // Calculate the bar color\n if (typeof cfg.barColor === \"string\") {\n color = cfg.barColor;\n }\n else {\n var A = color2rgb(cfg.barColor[0]);\n var B = color2rgb(cfg.barColor[1]);\n var gradient = [];\n for (var c = 0; c < 3; c++) {\n gradient[c] = A[c] + (B[c] - A[c]) * valueForColor / cfg.scaleMax;\n }\n\n color = rgb2color(gradient);\n }\n\n var arc = getArc(pathRadius, start, end);\n\n var path = \"\";\n path += '<path d=\"M' + arc.sX + ' ' + arc.sY;\n path +=\n ' A ' + pathRadius + ' ' + pathRadius + ',0,' + arc.dir + ',1,' + arc.eX + ' ' + arc.eY + '\" ';\n path += 'stroke=\"' + color + '\" ' +\n 'stroke-linecap=\"' + cfg.lineCap + '\" ' +\n 'stroke-width=\"' + cfg.barWidth + '\" ' +\n 'fill=\"transparent\"' +\n '/>';\n\n if (newValue) {\n path += '<text text-anchor=\"middle\" x=\"' + center + '\" y=\"' + center + '\">' +\n '<tspan class=\"dialgauge-value\">' + newValue.toFixed(1) + '</tspan>';\n }\n\n if (cfg.units != undefined) {\n path += '<tspan dx=\"3\" class=\"dialgauge-unit\">' + cfg.units + '</tspan>';\n }\n path += '</text>';\n\n\n $scope.gauge =\n $sce.trustAsHtml('<svg width=\"100%\" height=\"100%\"><g ' + scaling +'>' + staticPath + path +\n '</g></svg>');\n }", "title": "" }, { "docid": "53a2a65070632233716ffc5095f5a46a", "score": "0.5124183", "text": "function make_balance_plot(target, aim, now, prev, subtext){\n try {\n if(target === undefined){ throw 'Target missing'; }\n if(aim === undefined){ throw 'aim missing'; }\n if(now === undefined){ throw 'now missing'; }\n if (!Array.isArray(now)){\n my_plotlines=[{\n color: '#666666',\n width: 4,\n value: now,\n zIndex: 1000\n }];\n }else{\n my_plotlines = Array();\n chroma_colors = chroma.scale(['#AF2323','#4c85cc','#259F0B']).colors(now.length);\n for (i in now){\n my_plotlines.push({\n name:'serie'+i,\n color : chroma_colors[i],\n dataLabels: {enabled: true},\n width: 4,\n zIndex: 1000,\n value: now[i]\n });\n }\n }\n $(target).highcharts({\n chart: {\n type: 'bar',\n height: 95,\n spacingBottom: 10,\n spacingTop: 0,\n backgroundColor:'rgba(255, 255, 255, 0.1)',\n plotBackgroundColor:'#ed8c83',\n plotBorderColor: '#FFFFFF',\n plotBorderWidth: 16\n },\n xAxis: {\n categories: ['Queue'],\n title: { text: null },\n labels: { enabled: false },\n tickWidth: 0,\n lineWidth: 0\n },\n yAxis: [{\n min: 0,\n max: aim * 5,\n title: { text: null },\n opposite: true,\n labels: {\n y: -3,\n },\n tickPositions: [ 0, aim, aim * 4, aim * 5 ],\n plotBands: [{\n color: '#8ad88b',\n from: aim,\n to: aim * 4\n }],\n plotLines: my_plotlines\n },{\n min: 0,\n max: aim * 5,\n title: {\n text: subtext,\n y: 5,\n style: { 'font-size': 14 }\n },\n labels: { enabled: false },\n gridLineWidth: 0,\n }],\n title: { text: null },\n legend: { enabled: false },\n credits: { enabled: false },\n series: [\n { data: [0] },\n { data: [0], yAxis: 1 }\n ]\n });\n } catch(err) {\n console.log(err);\n $(target).addClass('coming_soon').text('coming soon');\n }\n}", "title": "" }, { "docid": "a182964c1bfeacc22146edef3b589744", "score": "0.51133823", "text": "function setLegend(){\n legend = svg.selectAll('text')\n .data(labels)\n .attr(\"x\", function(d, i) { return legendScale(i) })\n .attr(\"y\", svgHeight - legendMargin)\n .attr(\"dy\", \"0.75em\")\n .attr(\"text-anchor\", function(d) { return d.textAnchor })\n .style(\"fill\", blue)\n .text(function(d) { return d.value }) \n}", "title": "" }, { "docid": "1194dbe20f698a8a13c072aa79c76a36", "score": "0.51127255", "text": "function drawWinLossBarGraph(canvas_name, values, poscolor, negcolor) {\r\n\t\t\t\t\tdrawingCanvas = document.getElementById(canvas_name);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t// Check the element is in the DOM and the browser supports canvas\r\n\t\t\t\t\tif(drawingCanvas && drawingCanvas.getContext) {\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tvar height \t\t= drawingCanvas.height;\r\n\t\t\t\t\t\tvar width \t\t= drawingCanvas.width;\r\n\t\t\t\t\t\tvar x \t\t\t= 0;\r\n\t\t\t\t\t\tvar count \t\t= 0;\r\n\t\t\t\t\t\tvar xmargin\t\t= 2;\r\n\t\t\t\t\t\tvar ymargin \t= 2;\r\n\t\t\t\t\t\tvar xpad\t\t= 2;\r\n\t\t\t\t\t\tvar color\t\t= \"\";\r\n\t\t\t\t\t\tvar barheight\t= 0;\r\n\t\t\t\t\t\tvar barwidth\t= 0;\r\n\t\t\t\t\t\tvar scale \t\t= Math.max.apply(Math, values);\r\n\t\t\t\t\t\tvar floor \t\t= Math.min.apply(Math, values);\r\n\t\t\t\t\t\tvar centery\t\t= 0;\r\n\t\t\t\t\t\tvar range \t\t= 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Not sure if setting these to 0 is the best way, but I think it's the most expected handling of weird values\r\n\t\t\t\t\t\tif (floor > 0) {\r\n\t\t\t\t\t\t\tfloor = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (scale < 0) {\r\n\t\t\t\t\t\t\tscale = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// If these colors weren't set, use defaults\r\n\t\t\t\t\t\tif (poscolor == \"\") {\r\n\t\t\t\t\t\t\tposcolor = \"#00FF00\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (negcolor == \"\") {\r\n\t\t\t\t\t\t\tnegcolor = \"#FF0000\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Calculate the width of each bar based on the canvas width and the number of values\r\n\t\t\t\t\t\tbarwidth = width / (values.length * xpad);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Start at the first margin\r\n\t\t\t\t\t\tx = xmargin;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Find the total range so we can scale the bars\r\n\t\t\t\t\t\trange = scale - floor;\r\n\t\t\t\t\t\tcentery = height * 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Loop through and draw each bar\r\n\t\t\t\t\t\tfor (i in values) {\r\n\r\n\t\t\t\t\t\t\t// Set color\r\n\t\t\t\t\t\t\tcolor = poscolor;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (values[i] < 0) {\r\n\t\t\t\t\t\t\t\tcolor = negcolor;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Scale bar height\r\n\t\t\t\t\t\t\tbarheight = ((values[i] / range) * height);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Draw the bar\r\n\t\t\t\t\t\t\tcontext = drawingCanvas.getContext('2d');\t\t\t\t\r\n\t\t\t\t\t\t\tcontext.fillStyle = color; \r\n\t\t\t\t\t\t\tcontext.fillRect (x, centery, barwidth, (barheight*(-1)));\t\t\r\n\t\t\t\t\t\t\tx = x + barwidth + xpad;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t}", "title": "" }, { "docid": "9600faa6baefed8a20924405cf503b4b", "score": "0.5111621", "text": "function populateLabels(config, labelTemplateString, labels, numberOfSteps, graphMin, graphMax, stepValue) {\n if (labelTemplateString) {\n //Fix floating point errors by setting to fixed the on the same decimal as the stepValue.\n if (!config.logarithmic) { // no logarithmic scale\n for (var i = 0; i < numberOfSteps + 1; i++) {\n labels.push(tmpl(labelTemplateString, {\n value: fmtChartJS(config, 1 * ((graphMin + (stepValue * i)).toFixed(getDecimalPlaces(stepValue))), config.fmtYLabel)\n }));\n }\n } else { // logarithmic scale 10,100,1000,...\n var value = graphMin;\n while (value < graphMax) {\n labels.push(tmpl(labelTemplateString, {\n value: fmtChartJS(config, 1 * value.toFixed(getDecimalPlaces(stepValue)), config.fmtYLabel)\n }));\n value *= 10;\n }\n }\n }\n }", "title": "" } ]
6dee1d5f302cd1cff7415d6cb22fc41d
Cat Show Show only the selected cat
[ { "docid": "0baa6583f731de8cc18a5c094bfa837b", "score": "0.75817597", "text": "function catShow(catChoice){\n catSelected = catChoice;\n\n $('div .cat-unit').each(function(){\n if($(this).attr('id') == catSelected.catID){\n $(this).show();\n }else{\n $(this).hide();\n }\n });\n}", "title": "" } ]
[ { "docid": "47a82ef0b6a5a7630eb961fbffc18c91", "score": "0.7401451", "text": "function selectCat(cat) {\n self.selected = angular.isNumber(cat) ? $scope.cats[cat] : cat;\n self.toggleList();\n }", "title": "" }, { "docid": "a94e4bde8417634a61c74e5898cc900b", "score": "0.68985915", "text": "function displayCategories(cat) {\n var output=\"\";//\"<option value=''>-------</option>\";\n\n for(var i=0; i<cat.length; i++){\n var category= cat[i].name;\n output+=\n \"<option value='\"+category+\"'>\"+category+\"</option>\";\n }\n $(\"#categorySelect\").html(output);\n getEvents();\n }", "title": "" }, { "docid": "44127ff3300d5a9a42eac47c20abe30f", "score": "0.6859015", "text": "function displayCat(e) {\n if (e.target && e.target.classList.contains('cat')) {\n let i = e.target.dataset.index;\n updateHTML(i);\n }\n}", "title": "" }, { "docid": "3e5e989f7919907fd9f4f17680d654ef", "score": "0.6567148", "text": "function showCategoriesFuntions(){\n $(\".categories\").show();\n }", "title": "" }, { "docid": "3dd065145853bfd3c1434e8419696e5e", "score": "0.651242", "text": "listFresh() {\r\n document.querySelector('.cat-select').textContent = model.activeCat.name;\r\n document.querySelector('.selected-cat').textContent = model.activeCat.name;\r\n }", "title": "" }, { "docid": "1b0eb2f31b83400c419c1f1d2d4fb433", "score": "0.6416859", "text": "function showCategory(category){\n\t\tconsole.log(category);\n\t\tvar box = newDetailBox({\n\t\t\t\t\tselectedCategory:category,\n\t\t\t\t\tboxType:'categoryBox'\n\t\t\t\t});\n\t\tshowAdditionalFeatures(category);\n\t\tvar categoryListMarkup =\n\t\t\t'<div class=\"wc-mc-detail-box-content\">'+\n\t\t\t\t'<ul class=\"wc-mc-items-list\">';\n\t\tfor (var i = 0; i < s.controls.featuresList.length; i++) {\n\t\t\tvar thisFeature = s.controls.featuresList[i];\n\t\t\tif (thisFeature.tags.indexOf(category) !== -1){\n\t\t\t\tvar listItemMarkup =\n\t\t\t\t\t'<li role=\"menuitem\">'+\n\t\t\t\t\t\t'<a class=\"wc-item-link wc-mc-place-button wc-mc-button\" data-show-place=\"{\\'placeId\\'\\:\\''+thisFeature.id+'\\'}\" title=\"'+thisFeature.name+'\">'+\n\t\t\t\t\t\t\t'<span class=\"wc-text\">'+thisFeature.name+'</span><svg class=\"wc-icon\" viewBox=\"0 0 32 32\"><use xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"'+Globals.s.svgFilePath+'#icon-arrow-right\"></use></svg>'+\n\t\t\t\t\t\t'</a>'+\n\t\t\t\t\t'</li>';\n\t\t\t\tcategoryListMarkup += listItemMarkup;\n\t\t\t}\n\t\t}\n\t\tcategoryListMarkup += '</ul></div>';\n\t\tbox.append(categoryListMarkup);\n\t\tsetTimeout(function() {showDetailBox(box);}, 100);/*[1]*/\n\t\t\n\t}", "title": "" }, { "docid": "1b7777ef9218e7e815fafcee6b4d540a", "score": "0.63439786", "text": "function displayCategoryFilter() {\r\n\t\t\tvar $filterContainer = $('<div id=\"filter-container\"></div>'),\r\n\t\t\t\tcatHtml = jrtmpl(tmpl.categories, {\r\n\t\t\t\t\tcategories: o.categories\r\n\t\t\t\t});\r\n\t\t\t$filterBtn = $('<div />', {\r\n\t\t\t\t\"id\": o.filterBtnId,\r\n\t\t\t\t\"html\": \"<span>\" + o.texts.allText + \"</span>\"\r\n\t\t\t}).click(doOnFilterClick).appendTo($filterContainer);\r\n\t\t\t$catHolder = $('<div />', {\r\n\t\t\t\t\"id\": o.categoryHolderId,\r\n\t\t\t\t\"html\": catHtml\r\n\t\t\t}).appendTo($filterContainer);\r\n\r\n\t\t\t$galleryContainer.prepend($filterContainer);\r\n\t\t}", "title": "" }, { "docid": "e2799adc5c9571ff9eb29f274c996d6c", "score": "0.63395935", "text": "function categoryFilter() {\n\t\t$(\".category.\" + catergoryName).show(\"400\"); // Show the filter items\n\t\t$(\".category:not(.\" + catergoryName + \")\").hide(\"400\"); // Hide the non-filter items\n\t\t$(\".filter-menu li[data-filter='\" + catergoryName + \"']\").addClass(\"active\").siblings(\"li\").removeClass(\"active\"); // Active (colored) the category name \n\t}", "title": "" }, { "docid": "ccbbeaf5a261790f4120e944150d40c2", "score": "0.6292562", "text": "show_category_on_item_form(){\n let categories = this.get_categories() \n let category = this.select_element(\"#category\")\n\n categories.forEach(function(cat){\n\n let option = document.createElement(\"option\")\n option.setAttribute(\"value\", `${cat.id}`)\n option.innerHTML = `${cat.name}`\n category.appendChild(option)\n })\n\n\n }", "title": "" }, { "docid": "995416468ad3a298753d2f30c44fdafe", "score": "0.6275393", "text": "function showCatArticle(){\n\t\t$.ajax({\n\t\t\ttype:'ajax',\n\t\t\turl:CONFIG.server+'Vente/findCategorie',\n\t\t\tasync:true,\n\t\t\tdataType:'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tvar showpage='';\n\t\t\t\tshowpage+='<select>';\n\t\t\t\tshowpage+='<option>Choisir Un article</option>';\n\t\t\t\tfor (var i=0; i <data.total; i++) {\n\t\t\t\t\tshowpage+='<option class=\"item_article\" data=\"'+data[i].libelle+'\" value=\"'+data[i].id_cat+'\">'+data[i].libelle+'</option>';\n\t\t\t\t}\n\t\t\t\tshowpage+='</select>';\n\t\t\t\tvar showform='inserer les element du tableau';\n\t\t\t\t$('#showlibelle').html(showpage);\n\t\t\t\t$('#showform').html(showform);\n\t\t\t},\n\t\t\terror:function(data){\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "4510215fd0463bdb9c4730371e0a97dd", "score": "0.6229347", "text": "function switchCategories(){\n //si je clique sur tout afficher\n $('.showCatAll').click(function(){\n $('.article').show();\n });\n $('.showCat1').click(function(){\n $('.article').hide();\n $('.cat1').show();\n });\n $('.showCat2').click(function(){\n $('.article').hide();\n $('.cat2').show();\n });\n $('.showCat3').click(function(){\n $('.article').hide();\n $('.cat3').show();\n });\n}", "title": "" }, { "docid": "68623b19016269cbceeec2104706ee3e", "score": "0.6227139", "text": "selectedCategorie() {\n this.souscategorieProvider.getSousCatByCategorie(this.selectedId).then(list => {\n this.lesSousCategories = list;\n })\n this.sousCatVisible = true;\n }", "title": "" }, { "docid": "d3e4fdaf25a2ef257bc7dac917aa8491", "score": "0.6204703", "text": "function categorySelect(){\n\n var e = $(\"#demo-category :selected\").text();\n allProjects = document.querySelectorAll(\".projectCategory\");\n\n if (e == \"All\") {\n allProjects.forEach((prj, i) => {\n prj.style.display = \"block\";\n });\n }else {\n\n for (var i = 0; i < allProjects.length; i++) {\n if (allProjects[i].className.includes(e)) {\n allProjects[i].style.display = \"block\";\n }else {allProjects[i].style.display = \"none\";}\n }\n }\n}", "title": "" }, { "docid": "0a00e1dd6832c158bebce5879b978f9e", "score": "0.6168238", "text": "getSelectedCat() {\n console.log('selectors.getSelectedCat called');\n if (!this.state.entities || !this.state.selectedCatId || !this.state.entities.cats) return undefined;\n return this.state.entities.cats[this.state.selectedCatId]\n }", "title": "" }, { "docid": "7abf13c8a3d1e0a658620cae8bc16a9d", "score": "0.61643445", "text": "function appendCat(cat) {\n $('#cat-container').append(\n '<li>' +\n '<h2>' + cat.name + '</h2>' +\n '<h3>' + cat.product + '</h3>' +\n '</li>'\n );\n }", "title": "" }, { "docid": "1d11c81b940e71c48ede5fe18c09c7fe", "score": "0.6156688", "text": "function change_by_cat(cat_data)\n {\n $('.title').html(cat_data.text());\n\n $('.title_desc').html(cat_data.data('desc'));\n\n }", "title": "" }, { "docid": "ea87f8ddf2581d443a41148e04944a26", "score": "0.6153893", "text": "function showCatigories(categories) {\nconsole.log(`В списке ${categories.length} категории`);\n}", "title": "" }, { "docid": "ccd502889f40dfa192df9d88aecd7844", "score": "0.6152702", "text": "editCat(cat) {\n this.dialogVisible = true;\n this.catEditing = cat;\n this.upsertText = 'Edit';\n this.title = cat.title;\n this.description = cat.description;\n }", "title": "" }, { "docid": "f1709390af7586f803bf298228e14646", "score": "0.6150933", "text": "function openCategory() {\r\n prdCat.setAttribute(\r\n \"style\",\r\n \"visibility:visible; pointer-events: all; opacity: 1\"\r\n );\r\n}", "title": "" }, { "docid": "b95fa80e51d66f0fa62e0b7e5dc13d24", "score": "0.614266", "text": "displayCategories(){\n const categoryList = cocktail.getCategories()\n .then(categories => {\n const catList = categories.categories.drinks;\n\n //Append a first option without vale\n const firstOption = document.createElement('option');\n firstOption.textContent = '- Select -';\n firstOption.value='';\n document.querySelector('#search').appendChild(firstOption);\n\n //Append into the Select\n catList.forEach(category =>{\n const option = document.createElement('option');\n option.textContent = category.strCategory;\n option.value = category.strCategory.split(' ').join('_');\n document.querySelector('#search').appendChild(option);\n })\n })\n }", "title": "" }, { "docid": "ebd14eea0fb25208da730ef7d0c04117", "score": "0.61075103", "text": "function chooseCategory(chosen) {\n const choices = document.getElementsByClassName(\"choices\");\n\n for (i = 0; i < choices.length; i++) {\n choices[i].style.display = \"none\";\n }\n\n document.getElementById(chosen).style.display = \"flex\";\n}", "title": "" }, { "docid": "2b442485c35d18d1371ba262f8f5e946", "score": "0.60881865", "text": "function showCategoriesList(e) {\n\tshowCategories();\n}", "title": "" }, { "docid": "afbf8213c47887dced4cfb11f24b90b0", "score": "0.6087515", "text": "function hideCatText() {\n for (let n = 0; n < cat.name.length; n++) {\n $(`.imageText${n + 1}`).hide();\n };\n }", "title": "" }, { "docid": "703a16b4def312bc078989b13ba30542", "score": "0.60802054", "text": "show (req, res) {\n res.render('show-category', {category: req.category});\n }", "title": "" }, { "docid": "c1054621ca9aaadfabc8d36bdb694c49", "score": "0.60774606", "text": "function category_filter() {\n Array.prototype.forEach.call(card = document.getElementsByClassName('card'), element => {\n if (!element.attributes.categories.value.includes(document.getElementById('category_selector').value)) element.style.display = 'none';\n else element.style.display = 'inline-block';\n });\n}", "title": "" }, { "docid": "c1d640de614371d99d2bec9c53dd414a", "score": "0.6076371", "text": "function showCategories() {\r\n let categories = [];\r\n for (let i = 0; i < data.length; i++) {\r\n categories.push(data[i].category);\r\n }\r\n categories = removeDuplicates(categories.sort());\r\n\r\n let out = \"\";\r\n out += \"Suggested categories : \";\r\n for (let i = 0; i < categories.length; i++) {\r\n out +=\r\n \"<span onclick='category.value=this.innerText' tabindex='0'>\" +\r\n categories[i] +\r\n \"</span>\";\r\n }\r\n suggestedCategory.innerHTML = out;\r\n}", "title": "" }, { "docid": "96d8ffc84e0f269e248e2a767d0539c7", "score": "0.6073812", "text": "function show($cat) {\n elements = document.querySelectorAll('.projects');\n for (var i = 0, max = elements.length; i < max; i++) {\n elements[i].style.display = \"none\";\n }\n elements = document.querySelectorAll('.projects[data-category=\"' + $cat + '\"]');\n\n if(elements.length == 0)document.querySelector(\".empty\").style.display = \"flex\"\n\n for (var i = 0, max = elements.length; i < max; i++) {\n elements[i].style.display = \"flex\";\n }\n}", "title": "" }, { "docid": "aa9f23dc2d1e2be93f56bb3cfa3ea26c", "score": "0.604828", "text": "function onDropCategoryClicked(){\n\t\tcurrCategory = $(this).text();\n\t\tsetupGallery(oData.catalogue, currCategory, currSection);\n\t}", "title": "" }, { "docid": "b0c8d49e6c96e3a2fe99853d7f293e80", "score": "0.6014912", "text": "showCategories() {\n const categories = cocktailAPI.getDrinkCategories()\n .then(data => {\n const catList = data.categories.drinks;\n\n // Append the first option without a value\n const firstOption = document.createElement('option');\n firstOption.textContent = '- Select -';\n document.querySelector('#search').appendChild(firstOption);\n\n // Append into <select>\n catList.forEach(category => {\n const option = document.createElement('option');\n option.textContent = category.strCategory;\n option.value = category.strCategory.split(' ').join('_');\n document.querySelector('#search').appendChild(option);\n });\n });\n }", "title": "" }, { "docid": "81a57622dc73ee82afb9bec6aff1bb18", "score": "0.60088533", "text": "function selectCategory(){\n changedText.textContent = this.value;\n\n //use selected to filter\n const categoryArr = filterByCategory(seedArr, changedText.innerHTML);\n console.log(categoryArr);\n\n //are there seeds in this category\n if(categoryArr != ''){\n //set display to empty\n const element = document.querySelector('.seedCardsContainer');\n while (element.hasChildNodes()) {\n element.removeChild(element.firstChild);\n }\n \n //display selected category's seeds \n categoryArr.forEach((obj) => {\n showInDom('.seedCardsContainer', displaySeed(obj)); \n }); \n } else {\n //set display to empty \n const element = document.querySelector('.seedCardsContainer');\n while (element.hasChildNodes()) {\n element.removeChild(element.firstChild);\n }\n }\n}", "title": "" }, { "docid": "9be55489c94fd741af83f5d4907f391f", "score": "0.6001856", "text": "function show(category) {\n for (var i = 0; i < gmarkers.length; i++) {\n if (gmarkers[i].mycategory == category) \n gmarkers[i].setVisible(true);\n }\n document.getElementById(category).checked = true;\n $('#'+category).prop('checked', true);\n }", "title": "" }, { "docid": "0d3bcaf69da92dccdf5eb5e7d7fddc55", "score": "0.59868634", "text": "function getCategory(category) {\n selectedCategory = category;\n}", "title": "" }, { "docid": "dfcfc002479b0e4a38ac1da1befd0cbf", "score": "0.59828717", "text": "function createCat(cat) {\n let i = cats.indexOf(cat);\n return `<div>\n <h3>${cat.name}</h3>\n <p>Clicks: ${cat.clicks}</p>\n <img data-index=\"${i}\" src=\"${cat.img}\">\n </div>`;\n}", "title": "" }, { "docid": "74037556662ebc29386cf7cb01469c85", "score": "0.5975357", "text": "renderCat() {\r\n // clear container of previous cat\r\n document.querySelector('.cat-container').innerHTML = '';\r\n \r\n let kittyContainer = document.createElement('SECTION');\r\n kittyContainer.id = model.activeCat.id;\r\n kittyContainer.classList.add('kittyContainer', model.activeCat.name);\r\n \r\n let kittyHeader = document.createElement('H3');\r\n kittyHeader.classList.add('instruction');\r\n kittyHeader.textContent = 'Click on ' + model.activeCat.name + '!';\r\n \r\n let catImage = document.createElement('IMG');\r\n catImage.classList.add('cat');\r\n catImage.src = model.activeCat.url;\r\n \r\n let counter = document.createElement('DIV');\r\n counter.classList.add('counter');\r\n counter.textContent = 'Clicks: ';\r\n \r\n let clickCounter = document.createElement('SPAN');\r\n clickCounter.classList.add('click-count');\r\n clickCounter.textContent = model.activeCat.click;\r\n \r\n counter.appendChild(clickCounter);\r\n \r\n kittyContainer.append(kittyHeader, catImage, counter);\r\n \r\n const parent = document.querySelector('.cat-container');\r\n parent.appendChild(kittyContainer);\r\n }", "title": "" }, { "docid": "dc2fc4453c2ef60554fb5b0247877aa1", "score": "0.5955499", "text": "function loadCategory() {\n var index = getCategoryIndex(categoriesListEl.value);\n if (index === -1) {\n return;\n }\n var category = currentProps.categories[index];\n if (!category) {\n return;\n }\n muteChange = true;\n currentSelectedCatIndex = index;\n document.getElementById(\"category_id\").value = category.id;\n document.getElementById(\"category_name\").value = category.name || '';\n\n loadProperties();\n muteChange = false;\n }", "title": "" }, { "docid": "8f84860bc57d243abb4e14c7bfd74f07", "score": "0.5937058", "text": "function mCat(){\n\t\tvar itemCategories = [\"All\",\"Auto\",\"Electronics\",\"Clothes\",\"Jewelry\",\"Furniture\",\"Pets\",\"Household\",\"Collectables\",\"Books\"];\n\t\tvar formTag = document.getElementsByTagName(\"form\");// form tag is an array of all form tags\n\t\t\tmSelect = document.createElement(\"select\");\n\t\t\tselectLi = walk(\"select\"),\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tmSelect.setAttribute(\"id\", \"SearchCategory\");\n\t\tfor(var i=0, c=itemCategories.length; i<c; i++){\n\t\t\tvar mOption = document.createElement(\"option\");\n\t\t\tvar optText = itemCategories[i];\n\t\t\tmOption.setAttribute(\"value\", optText);\n\t\t\tmOption.innerHTML = optText;\n\t\t\tmSelect.appendChild(mOption);\n\t\t}\n\t\tselectLi.appendChild(mSelect);\n\t}", "title": "" }, { "docid": "e8f5b37ac8d54d510ab243815e297278", "score": "0.58819526", "text": "function verGanga() {\r\n $('.ganga[categoria=\"'+category+'\"]').show();\r\n $('.ganga[categoria=\"'+category+'\"]').css('transform', 'scale(1)');\r\n }", "title": "" }, { "docid": "66be6eaacea3d6f81c9791f22ccf82f8", "score": "0.5877263", "text": "function byCat()\n{\n document.getElementById('cat-list').style.display='block';\n let cat = document.getElementById(\"cat\").value;\n if(cat == 'select')\n {\n viewLoads();\n }\n else{\n var i;\n var f=false;\n var text=\"<table class='tab'><tr><th>Task Name</th><th>Todo date</th><th>Category</th><th>Mark as done</th><th>isPublic</th><th>Reminder</th><th>Reminder Date</th><th>Todo Image</th></tr>\";\n for (i = 0; i < usertodo.length; i++) \n {\n if(usertodo[i].username == username) \n { \n if(usertodo[i].catStudy == cat || usertodo[i].catSports == cat || usertodo[i].catOther == cat)\n {\n f=true;\n text+=\"<tr>\"+tableShow(i)+\"</tr>\";\n }\n }\n }\n text+=\"</table>\";\n if(f == true){\n document.getElementById(\"cat-list\").innerHTML= text;\n }\n else{\n document.getElementById(\"cat-list\").innerHTML = \"No Data Available\";\n }\n }\n}", "title": "" }, { "docid": "4ad168526dedefa3e91c620a16587288", "score": "0.5868713", "text": "function showCategories($this){\n\n var $thisMenu = $this.parents(\".category-main\"),\n child = \".category-sub-all\",\n expandedClass = \"expanded\";\n\n if($thisMenu.hasClass(expandedClass)){\n $thisMenu.find(child).slideUp(\"fast\");\n $thisMenu.removeClass(expandedClass);\n }else{\n\n //Collapse all current open categories\n //$(\".category-main\").each(function(){\n // if($(this).hasClass(expandedClass)){\n // $(this).find(child).hide();\n // $(this).removeClass(expandedClass);\n // }\n //});\n\n $thisMenu.find(child).slideDown(\"fast\");\n\n $thisMenu.addClass(expandedClass);\n }\n }", "title": "" }, { "docid": "cfd72a3d43d9c2be1018629b802406d2", "score": "0.585958", "text": "function showCategories() {\n\t$.categoryListView.hide();\n\tif (!isCategoryListViewVisible) {\n\t\tisCategoryListViewVisible = true;\n\t\t$.categoryListView.show();\n\t} else {\n\t\tisCategoryListViewVisible = false;\n\t}\n\n}", "title": "" }, { "docid": "310be32a3a6ca3bd6476ed83259a48c2", "score": "0.583824", "text": "function hideCat(){\n document.getElementById(\"cat\").classList.toggle(\"hideCat\")\n}", "title": "" }, { "docid": "525f3ad4988d9c39df961fba7947d1c4", "score": "0.58362323", "text": "getCatItems(cat) {\n // Filter all items, returning those matching the category title\n const catItems = this.items.filter(item => {\n if(item.category == cat)\n return true;\n });\n\n return catItems;\n }", "title": "" }, { "docid": "af6f576a219b4b76fa111363075f1c71", "score": "0.5834427", "text": "function filterMentorsBy(evt) {\n var category = evt.target.value;\n $('.mentor-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.mentor-filterable').show();\n }\n}", "title": "" }, { "docid": "1b7939344e6e26dc08520d9c9498847f", "score": "0.5825058", "text": "selectCatBreed(breed) {\n this.setState({\n breed,\n cats: []\n });\n if (breed) {\n this.loadCatalogue(1, breed);\n }\n }", "title": "" }, { "docid": "6b87d423a844fbbd53855560b617563a", "score": "0.58223015", "text": "function onChangeCategory() {\n var category = $('#category-select').val();\n if (!(selectedCategory && selectedCategory == category)) {\n selectedCategory = category;\n loadFeed();\n }\n}", "title": "" }, { "docid": "15e9bd193b92fdd3d704eba65ac14838", "score": "0.5821028", "text": "function showCategories(categoryId) {\n\t\t\t// alert(categoryId);\n\t\t$.ajax({\n\t\t\turl: \"../controllers/show_items.php\",\n\t\t\tmethod: \"POST\",\n\t\t\tdata: {categoryId:categoryId},\n\t\t\tsuccess: (data) => {\n\t\t\t\t$('#products').html('');\n\t\t\t\t$('#products').html(data);\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "1e892e1787eb5ba6053806979a387838", "score": "0.5820313", "text": "function hideCats () {\r\n\t//hides all cats\r\n\tfor (i = 0; i < allCats.length; i++) {\r\n\t\tallCats[i].style.visibility = 'hidden'\r\n\t}\r\n}", "title": "" }, { "docid": "16feeec507399baacbe14fb5b6e50164", "score": "0.5806565", "text": "function chocoCategories(){\nif($(\".choclate-categories\").length){\n\t$(\".choclate-categories li.has-child > a\").before('<span class=\"expand\">+</span>');\n\t\t$(\".choclate-categories li a\").on(\"click\", function() {\n\t\t\tif($(this).next(\"ul.cat-list\").is(\":visible\"))\n\t\t\t{\n\t\t\t\t$(this).prev(\".expand\").text(\"+\");\n\t\t\t\t$(this).next(\"ul.cat-list\").slideUp();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(\".choclate-categories li .expand\").text(\"+\");\n\t\t\t\t$(\"ul.cat-list\").slideUp();\n\t\t\t\t$(this).prev(\".expand\").text(\"-\");\n\t\t\t\t$(this).next(\"ul.cat-list\").slideDown();\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d1be4c527b0d55996e061146d6f7254f", "score": "0.5803762", "text": "function CategeorySelector(props) {\n // get the real category json from the DB\n\n let categories = [];\n categories = props.categories;\n\n return (\n <select value={props.value} onChange={props.func} name=\"category\" dir=\"rtl\">\n {categories.map((object, i) => {\n return (\n <option key={i} value={object.type}>\n {object.type}\n </option>\n );\n })}\n </select> \n );\n\n}", "title": "" }, { "docid": "330bb6899e5175be340d682c76b4e92e", "score": "0.58023715", "text": "function changeCat(category){\n vm.searchCat = category;\n search();\n }", "title": "" }, { "docid": "5e94ec0356be6ac397be56ce8aec2fa2", "score": "0.5795398", "text": "function showCategory() {\r\n showTemplate(category_template, current_category);\r\n $(\".animal-thumbnail\").click(function () {\r\n var index = $(this).data(\"id\");\r\n current_animal = current_category.animals[index];\r\n showTemplate(animal_template, current_animal);\r\n $(\".breadcrumb\").append(breadcrumb_template({\r\n type: \"animal\",\r\n name: current_animal.name\r\n }));\r\n $(\"#animal-crumb\").click(function () {\r\n return false;\r\n });\r\n });\r\n}", "title": "" }, { "docid": "c27e566cb29fb51c8dc6f3a38aa46763", "score": "0.57935995", "text": "handleCategoryClick(category) {\n //rememebering the selected category or setting it to null if you click on it the second time just to close it\n if (this.props.subCategoryToShow == category) {\n this.props.dispatch(hideSubCategories());\n } else {\n this.props.dispatch(showSubCategories(category));\n }\n }", "title": "" }, { "docid": "da85a968bbda5e42d750aa738eb59d22", "score": "0.57760715", "text": "function handleCategoryClick(e) {\t\t\t\t\n\tshowItemsInCategory(e.row.categoryId,e.row.categoryName);\n}", "title": "" }, { "docid": "3967403ee3a1629ceee25fc89d4de4d1", "score": "0.5775157", "text": "static categoriesShowCategoryTreeButton(){\n for (const [key, value] of Object.entries(document.querySelectorAll('.category-main-categories'))) {\n let categoryid = value.getAttribute('category');\n value.addEventListener(\"click\",function(){general.showTree(categoryid);}) \n }\n\n AfterRenders.categorySettingsButtons();\n }", "title": "" }, { "docid": "46a09007384dab6748b70068963d1e20", "score": "0.5763198", "text": "function showOptions(videos) {\n let categories = [];\n let ids = [];\n for (let i = 0; i < videos.length; i++) {\n let category = videos[i].category_name;\n let id = videos[i].category_id;\n\n if (categories.indexOf(category) === -1) {\n categories.push(category);\n }\n if (ids.indexOf(id) === -1) {\n ids.push(id);\n }\n }\n let options = `<option value='0' selected>\n 所有分類\n </option>`;\n\n // Sort the options, put the options into a temporary array\n let tpmArr = [];\n\n for (let i = 0; i < categories.length; i++) {\n let id = ids[i];\n let category = categories[i];\n tpmArr[i] += `<option value='${id}'>${category}</option>`;\n }\n\n // Sort it by value\n tpmArr.sort();\n tpmArr.forEach(arr => {\n options += arr;\n });\n categorySelect.innerHTML += options;\n}", "title": "" }, { "docid": "54965a0982d7e1cf012697c835a4b8e0", "score": "0.57614523", "text": "function updateCurrentlySelectedTitle(category) {\r\n \r\n //get categories\r\n var categories = getLSRow(window.iUserName, 'favoriteCategories').split('|');\r\n var numCat = categories.length;\r\n //check if the index is out of bounds\r\n if(category >= numCat)\r\n return;\r\n //change the display bar\r\n var displayBar = document.getElementById('currentSelectedCategoryDisplay');\r\n displayBar.innerText = categories[category] + '';\r\n //change the list display\r\n var displayList = document.getElementById('currentSelectedCategory');\r\n displayList.innerText = '\\t\\t\\t' + categories[category] + '\\r\\n';\r\n}", "title": "" }, { "docid": "14eb04c695777911c0ab743acbc11a53", "score": "0.5758802", "text": "function cat(catArray){\r\n const cats = [\r\n {\r\n name: \"Blob\",\r\n age: 10\r\n },\r\n {\r\n name: \"Harold\",\r\n },\r\n {\r\n name: \"Blurt\",\r\n age: 21\r\n }\r\n ];\r\n }", "title": "" }, { "docid": "39625828f554f6d314a8cced470730fe", "score": "0.57521087", "text": "function category_start(category_name, category_desc, selected)\n {\n category_id = \"emot_category_\" + category_name;\n emot_html.push(\"<div id='\" + category_id + \"'>\"); \n\n var opt = new Option(category_desc, category_id);\n //emot_category.options[emot_category.options.length] = opt;\n emot_category.add(opt);\n\n selected = selected || false;\n opt.selected = selected;\n }", "title": "" }, { "docid": "b82c054ee65488f1684f1148ab98a155", "score": "0.57251346", "text": "onSelectedCategory(category) {\n this.searchProduct = \"\";\n // this.elements.productList.forEach(element => {\n // console.log(element.title)\n // document.getElementById(element.title).style.display = \"block\"\n // })\n console.log(this.category[this.liveCategory].name)\n this.$emit(\"onselectedcategory\", category);\n console.log(category)\n }", "title": "" }, { "docid": "ed245ec2d9c811850167872974c79f8e", "score": "0.57007", "text": "function generateCategoryDropDown( SelectedCatObj ) {\n var optionStr = '<option value=\"\"> -- select -- </option>';\n $.each(SelectedCatObj, function(i, catObj ){\n optionStr += '<option value=\"'+catObj[\"category_id\"]+'\" parent_category_id=\"'+catObj[\"parent_category_id\"]+'\" service_type_id=\"'+catObj[\"service_type_id\"]+'\"\">'+catObj[\"category_title\"]+'</option>';\n });\n\n $(\"#CategoryDropDown\").html( optionStr );\n }", "title": "" }, { "docid": "54aa1b8a2837615af4c5f3b9d8c8eb02", "score": "0.56940186", "text": "function selectCategory(category) {\n\t jQuery('.category-list li').removeClass('active');\n\t if (!category)\n\t category = '*'\n\t jQuery('.category-list li[data-category-id=\"' + category + '\"]').each(function() {\n\t var activeItem = $(this);\n\t activeItem.addClass('active');\n\t jQuery('.category-selected').text(activeItem.data('value'));\n\t })\n }", "title": "" }, { "docid": "9b17f3d0a2ba1af21aa7df991d121ad1", "score": "0.5688908", "text": "function filter() {\n var category = document.getElementById(\"category\");\n var cat1 = category.options[category.selectedIndex].value;\n \n if (cat1 ==\"Breakfast\") {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"block\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"none\";\n\n } \n else if (cat1 == \"Lunch\") {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"block\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"none\";\n } \n else if (cat1 == 'Dinner') {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"block\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"none\";\n } \n else if (cat1 == \"Dessert\") {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"block\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"none\";\n } \n else if (cat1 == \"Beverage\") {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"block\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"none\";\n } \n else if (cat1 == \"Snack\") {\n document.getElementsByClassName(\"Breakfast\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Lunch\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dinner\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Dessert\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Beverage\")[0].style.display = \"none\";\n document.getElementsByClassName(\"Snack\")[0].style.display = \"block\";\n } \n else {\n console.log(\"Did not work\");\n }\n }", "title": "" }, { "docid": "d7fdf9b7ffbb1891af1cd6fee9d56d32", "score": "0.568748", "text": "function listCats() {\n\t\t// Create variables for the DOM content.\n\t\tlet catsContainer = document.querySelector('.cats-container'),\n\t\t\tcatLink;\n\n\t\t// Loop through the allCats data to list the cats.\n\t\tallCats.forEach(function(cat, ind) {\n\t\t\t// Create the cat's link.\n\t\t\tcatLink = document.createElement('a');\n\t\t\tcatLink.href = '#';\n\t\t\tcatLink.innerHTML = cat.name;\n\n\t\t\t// Append the link to the container.\n\t\t\tcatsContainer.appendChild(catLink);\n\n\t\t\t// Add an event listener to change the displayed cat.\n\t\t\tcatLink.addEventListener('click', (function(id) {\n\t\t\t\treturn function() {\n\t\t\t\t\tdisplayCat(id);\n\t\t\t\t}\n\t\t\t})(ind));\n\t\t});\n\t}", "title": "" }, { "docid": "c9632525a9d2919eb4ad3a84021ab4bd", "score": "0.5673384", "text": "show_category() {\n\n let categories = this.category_list\n var self = this;\n categories.forEach(function (category) {\n self.add_category(category)\n })\n\n // console.log(categories)\n }", "title": "" }, { "docid": "eeec6b4a2eaa168ba976272f3d66983b", "score": "0.56711745", "text": "function getCat() {\n const urlCat = 'http://localhost:3000/categories'\n const catBoard = $(\".category\");\n catBoard.append([\n $(`<h3 style=\"text-align: center; margin-top: 1rem\">`).html(`Categories`),\n $(`<div class=\"catBtn\">`).append($(`<button class=\"btn btn-flat waves-effect btn-outline-info col-12 mt-3 mb-3\">`).append($(`<div class=\"allCats\">`).append($(`<h4>All Categories</h4>`))))\n ])\n $.get(urlCat, null, (data, req) => {\n data.forEach((cats, i) => {\n const cat = $('<div class=\"catBtn\">').append($(`<button class=\"btn btn-flat waves-effect btn-outline-info col-12 mt-3 mb-3\">`)\n .append($(`<div>`).html(`<h4>${cats.name}</h4>`).on('click', () => {\n urlByCat = `http://localhost:3000/categories/${i +1}/posts`;\n $('.addedCard').remove();\n dataToCard();\n })));\n catBoard.append(cat);\n });\n });\n }", "title": "" }, { "docid": "afe9fd3021b8460244c448022fe14242", "score": "0.5663578", "text": "hideUniformCategory(list, category) {\n list.set('hideCategory', category && !category.get(\"has_children\"));\n }", "title": "" }, { "docid": "705ab1d6607b7aabe6e5e6c48fe4d230", "score": "0.56551206", "text": "function renderCategoryFilter() {\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: '/api/categories',\n\t\t\t\tcontentType:\"application/json\",\n\t\t\t\tsuccess: successCategory\n\t\t\t});\n\t}", "title": "" }, { "docid": "46e419b2543a9ea26f17c74811e9b88f", "score": "0.5655082", "text": "function CategoryFunction() {\n\t var category;\n\t var idx = document.getElementById(\"selectCategory\").selectedIndex;\n\n\t switch(idx) {\n\n\t\tcase 0:\n\t\t\tgetList();\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\tcategory = \"Biography\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcategory = \"Business\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcategory = \"Finance\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tcategory = \"Fashion\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcategory = \"Computers\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tcategory = \"History\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tcategory = \"Home\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tcategory = \"Crafts and Hobbies\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tcategory = \"Romance\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tcategory = \"Science and Nature\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tcategory = \"Poetry\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\tcategory = \"Comics\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t\tcase 13:\n\t\t\tcategory = \"Food and Wine\";\n\t\t\tgetCategoryBooks(category);\n\t\t\tbreak;\n\t }\n\t }", "title": "" }, { "docid": "59831a8d1f811ab3d5d1498f8bf92c9f", "score": "0.5651221", "text": "function categoriaProd(){\n setControladorCategoria(false);\n }", "title": "" }, { "docid": "9272c750559adba0883ce4abb0db6fed", "score": "0.56378543", "text": "function hideCategories() {\n\t\t\n\t\t$(\"#categoryList\").addClass(\"hide\");\n\t}", "title": "" }, { "docid": "d79a37d97ea44d89e1e793ea51d061da", "score": "0.56282896", "text": "async editCategory() {\n let list = document.getElementById(\"categorieslist\");\n let categoryNameFix = cal.view.formatStringForCSSRule(gCategoryList[list.selectedIndex]);\n let currentColor = categoryPrefBranch.getCharPref(categoryNameFix, \"\");\n\n let params = {\n title: await document.l10n.formatValue(\"category-edit-label\"),\n category: gCategoryList[list.selectedIndex],\n color: currentColor,\n };\n if (list.selectedItem) {\n gSubDialog.open(this.mCategoryDialog, { features: \"resizable=no\" }, params);\n }\n }", "title": "" }, { "docid": "1400bf0fde2c01d1a15b33558b39c5ee", "score": "0.562348", "text": "function BrowseCategory() {\n var BrowseCategory = document.getElementById(\"BrowseCategory\");\n \n if (BrowseCategory.style.visibility === \"hidden\" || BrowseCategory.style.visibility === \"\") {\n BrowseCategory.style.visibility = \"visible\";\n BrowseCategory.style.opacity = \"1\";\n BrowseCategory.style.top = \"0px\";\n } else {\n BrowseCategory.style.visibility = \"hidden\";\n }\n }", "title": "" }, { "docid": "6ae64b46a9a6223c9aef21cb2367b3f1", "score": "0.5623346", "text": "function isotopeCatSelection() {\r\n\r\n\r\n\t\t$('.portfolio-items:not(\".carousel\")').each(function(){\r\n\r\n\t\t\tvar isotopeCatArr = [];\r\n\t\t\tvar $portfolioCatCount = 0;\r\n\t\t\t$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){\r\n\t\t\t\tif($(this).find('a').length > 0) {\r\n\t\t\t\t\tisotopeCatArr[$portfolioCatCount] = $(this).find('a').attr('data-filter').substring(1);\t\r\n\t\t\t\t\t$portfolioCatCount++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t////ice the first (all)\r\n\t\t\tisotopeCatArr.shift();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar itemCats = '';\r\n\t\t\t\r\n\t\t\t$(this).find('> div').each(function(i){\r\n\t\t\t\titemCats += $(this).attr('data-project-cat');\r\n\t\t\t});\r\n\t\t\titemCats = itemCats.split(' ');\r\n\t\t\t\r\n\t\t\t////remove the extra item on the end of blank space\r\n\t\t\titemCats.pop();\r\n\t\t\t\r\n\t\t\t////make sure the array has no duplicates\r\n\t\t\titemCats = $.unique(itemCats);\r\n\t\t\t\r\n\t\t\t////if user has chosen a set of filters to display - only show those\r\n\t\t\tif($(this).attr('data-categories-to-show').length != 0 && $(this).attr('data-categories-to-show') != 'all') {\r\n\t\t\t\t$userSelectedCats = $(this).attr('data-categories-to-show').replace(/,/g , ' ');\r\n\t\t\t\t$userSelectedCats = $userSelectedCats.split(' ');\r\n\t\t\t\t\r\n\t\t\t\tif(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');\r\n\t\t\t} else {\r\n\t\t\t\t$userSelectedCats = itemCats;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t////Find which categories are actually on the current page\r\n\t\t\tvar notFoundCats = [];\r\n\t\t\t$.grep(isotopeCatArr, function(el) {\r\n\r\n\t\t \tif ($.inArray(el, itemCats) == -1) notFoundCats.push(el);\r\n\t\t \tif ($.inArray(el, $userSelectedCats) == -1) notFoundCats.push(el);\r\n\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//manipulate the list\r\n\t\t\tif(notFoundCats.length != 0){\r\n\t\t\t\t$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){\r\n\t\t\t\t\tif($(this).find('a').length > 0) {\r\n\t\t\t\t\t\tif( $.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats) != -1 ){ \r\n\t\t\t\t\t\t\t$(this).hide(); \r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$(this).show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "2fd997337cb3e331104dabf316c01404", "score": "0.56195027", "text": "getCategories() {\n return categories.map((cat, i) => {\n let color = '#e59244'\n if (this.state.currCategory === cat) {\n color = 'rgb(45, 50, 174)'\n }\n return (<li key={cat}>\n <CategoryButton label={cat} style={{backgroundColor: color}} onClick={(e) => {\n this.setState({ currCategory:cat })\n }\n } \n />\n </li>)\n })\n }", "title": "" }, { "docid": "aa42640e0c67e3c1577d3669043b535a", "score": "0.56111354", "text": "function showCategories()\n{\n\t//Displaying all existing chefs at a table\n\t$.post('../classes/Categories.php',{'show_categories_list':1},function(data){ \n\t\t$('.categories').html(data);\n\t});\n}", "title": "" }, { "docid": "c7805d34b52860c833c468e2a8d105b1", "score": "0.56028783", "text": "function toggleFields() {\n if ($(\"#category\").val() === \"NEW\")\n $(\"#newCat\").show();\n else\n $(\"#newCat\").hide();\n }", "title": "" }, { "docid": "effacedb77b250b812d210d7e893ed85", "score": "0.5600852", "text": "function set_category(cate) {\n\tcategory = cate;\n}", "title": "" }, { "docid": "733040b1a2eab101ac9320d430c327df", "score": "0.5592549", "text": "function view_products_category() {\n var self = this;\n var options = U.clone(self.query);\n\n options.category = self.req.path.slice(1).join('/');\n\n var category = F.global.categories.find('linker', options.category);\n if (!category)\n return self.throw404();\n\n self.repository.category = category;\n\n if (self.query.manufacturer)\n self.repository.manufacturer = F.global.manufacturers.findItem('linker', self.query.manufacturer);\n\n self.$query(options, function (err, data) {\n\n if (!data.items.length)\n return self.throw404();\n\n self.title(category.name);\n self.view('products-category', data);\n });\n}", "title": "" }, { "docid": "08e0bc5e05acd0a0a2c834713a973b62", "score": "0.5590251", "text": "function selectObjectList(e, cat, data) {\n $(\"#bottom-container\").show();\n var target, targetId, objectKey;\n target = e.target;\n targetId = target.getAttribute(\"id\");\n displayImage(targetId, cat, data);\n objectKey = data[cat][targetId].name;\n loadInfoSelection(objectKey, cat);\n}", "title": "" }, { "docid": "495e00bcad8e852864c6ab99613c097f", "score": "0.55873775", "text": "function initializeCategoryFilter() {\n var $filterCategoryItems = $(checkBox).click(function(){\n $('.categories').hide();\n var $selected = $(checked).map(function (index, element) {\n return '.' + $(element).val()\n });\n var categories = $.makeArray($selected).join(',');\n categories ? $(categories).show() : $('.categories').show();\n });\n}", "title": "" }, { "docid": "ab578d7b2473ae5c93a5010fb438703b", "score": "0.55848056", "text": "handleShow() {\n this.setState({\n show: true,\n thumbnail: this.props.cat.thumbnail,\n birthdate: this.props.cat.birthdate,\n name: this.props.cat.name,\n owner: this.props.cat.owner_name,\n\n })\n }", "title": "" }, { "docid": "f94d615aee894c75b42e7c0e53773074", "score": "0.55724895", "text": "function Category() {\n }", "title": "" }, { "docid": "4dba33a9daba2c596afd2f3a9c28ddb5", "score": "0.55680126", "text": "function selectCategoryList(e) {\n var target, targetId, objectUrl;\n target = e.target;\n targetId = target.getAttribute(\"id\") || $(this).attr(\"id\");\n objectUrl = \"categories/\" + targetId;\n //LoadObjectList function is called\n loadObjectList(objectUrl, targetId);\n $(\"#category-list\").hide();\n $(\"#object-list\").empty();\n $(\"#object-list, #menu-title span\").show();\n}", "title": "" }, { "docid": "a71b18cbd10e35a07ea3df7a91c60199", "score": "0.55675596", "text": "function mostrarCategorias(contador){\n let boton= $('#filtro>a').eq(0);\n let menuCategoria=$('.splide, .removeFilter');\n //Función que contiene el contador utilizado para mostrar tanto el menú de categorías como el de perfil.\n condicionDespliegue(boton,contador,menuCategoria);\n}", "title": "" }, { "docid": "468709cdb9ba4e607ec0bbfaeabf5c42", "score": "0.5567257", "text": "function showSubcategories(category) {\n\n // Highlight only the category selected\n var allCategories = document.getElementsByClassName(\"category\");\n for (var i = 0; i < allCategories.length; i++) {\n allCategories[i].style.color = \"white\";\n }\n var currentCategory = document.getElementById(category);\n currentCategory.style.color = \"orange\";\n\n // Get index in categories\n var index = categoriesArray.indexOf(category);\n var subcategories = subcategoriesArray[index];\n\n // Fill subcategories div\n var subcatColumn = document.getElementById('subcategories');\n var innerText = \"<ul>\";\n for (var i = 0; i < subcategories.length; i++) {\n innerText += \"<a href='#'><li class='nav-subcategory' id='\" + subcategories[i] + \"' onmouseover='highlightSubcategory(\\\"\" + subcategories[i] + \"\\\")'>\" + subcategories[i] + \"</li></a>\"\n }\n innerText += \"</ul>\"\n subcatColumn.innerHTML = innerText;\n}", "title": "" }, { "docid": "bd1bb46ae52ecc9a27bd88818cddce0a", "score": "0.55632395", "text": "function SetCategory() {\n}", "title": "" }, { "docid": "c2f4e2ac140a4ad7595f83861eb10c91", "score": "0.5562093", "text": "function category_selected(){\n\tvar category=this.id;\n\tvar newAlarms=[];\n\tfor(var i=0;i<alarms.length;i++){\n\t\tif(alarms[i].category==category){\n\t\t\tnewAlarms.push(alarms[i]);\n\t\t}\n\t}\n\tnewAlarms.sort(newComparetor);\n\tshowAlarms(newAlarms);\n}", "title": "" }, { "docid": "8a7240df45bb07aefb5b5a59010284e8", "score": "0.55618274", "text": "getCategories() {}", "title": "" }, { "docid": "8a7240df45bb07aefb5b5a59010284e8", "score": "0.55618274", "text": "getCategories() {}", "title": "" }, { "docid": "a1d0649f259fcc4cd1e35b6556fbb4d8", "score": "0.55613804", "text": "function catDisplay(){\n var catUnit;\n var catName;\n var catImage;\n var catSource;\n\n for (var i = 0, kittyCount = catArray.length; i < kittyCount; i++){\n catUnit = '<div class=\"cat-unit\" id=\"' + catArray[i].catID + '\"><figure id=\"' + catArray[i].catID + '\"></figure></div>';\n catName = '<figcaption><h3>' + catArray[i].name + '</h3></figcaption>';\n catImage = '<picture><img src=\"' + catArray[i].image + '\" alt=\"picture of kitten\"></picture>';\n catSource = '<figcaption>Kitten thanks to <a href=\"' + catArray[i].sourceURL + '\">' + catArray[i].source + '</a></figcaption>';\n\n $('#cat-arena').append(catUnit);\n $('figure:last').append(catName);\n $('figure:last').append('<figcaption class=\"kitInfo\">I has been clicked <span id=\"span' + catArray[i].catID + '\">' + catArray[i].count + '</span> times</figcaption>');\n $('figure:last').append(catImage);\n $('figure:last').append(catSource);\n }\n}", "title": "" }, { "docid": "ce2734d18afa5a9202d574d124e122a4", "score": "0.55586666", "text": "function returncatproj(category){\n display_cat_projects(category);\n}", "title": "" }, { "docid": "16cd08e2ce3f9eae3b74e716ee383c96", "score": "0.5558332", "text": "function filterWork(cat){\n\t\n\t$('#category-menu-list').find('a').on('click',function(){\n\t\t$('#category-menu-list').find('a').removeClass('active-work');\n\t\t$(this).addClass('active-work');\n\t\tvar category = $(this).text();\n\t\tvar categoryJoined = category.split(' & ').join('-').split(' ').join('-');\n\t\tif (cat == undefined) {\n\t\t\tvar url = templateURL + '/ajax-search.php?cat=' + categoryJoined;\n\t\t}else{\n\t\t\tvar url = templateURL + '/ajax-search.php?cat=' + cat;\n\t\t}\n\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: url,\n\t\t\tsuccess: function(response){\n\t\t\t\t$('#work-container').html('');\n\t\t\t\t$('#work-container').append(response);\n\t\t\t\taudioVideoModal();\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "bf0fd615a7332132242a848d531503d2", "score": "0.5557324", "text": "function renderCatTemplate() {\n const templateString = document.getElementById(\"cat-template\").textContent;\n const templateFunc = Handlebars.compile(templateString);\n const allCats = document.getElementById('allCats');\n allCats.innerHTML = templateFunc({ cats });\n \n allCats.addEventListener(\"click\", onShowStatusCodeClick);\n\n function getCardParent(element) {\n const className = \"info\";\n let node = element.parentElement;\n\n while (node != null) {\n if (node.classList.contains(className)) {\n return node;\n }\n\n node = node.parentElement;\n }\n\n return node;\n };\n\n function onShowStatusCodeClick({ target }) {\n if(!target.classList.contains('showBtn')) {\n return;\n }\n\n const card = getCardParent(target); \n const status = card.querySelector('.status');\n status.style.display = status.style.display ? '' : 'none';\n }\n }", "title": "" }, { "docid": "be99a18c610d64e179578e536ee789d3", "score": "0.55475324", "text": "function updateCategory(category) {\n\tselectedCategory = category;\n\t\n\t$(\"#typeFilter .dropdownSelected\").html(category);\n\t\n\tgeoJson.reshow();\n}", "title": "" }, { "docid": "d0de1512e95b98509ee072cfb346fa8c", "score": "0.55419767", "text": "selectTxtCat(category) {\n this.setState({\n categoryTxt: category\n })\n }", "title": "" }, { "docid": "ec988869d404f8acdf0a767e9bd4b1c1", "score": "0.55390364", "text": "function displaySelection() {\r\n let selection = selectDisplay.options[selectDisplay.selectedIndex].text;\r\n\r\n //if user wants to see all the emojis available..\r\n if (selection === \"Display All\") {\r\n renderHTML(allEmojis, displayEmoji);\r\n }\r\n //If user wants to see single category displayed.\r\n else {\r\n //create an empty list for the emoji's\r\n let singleCategoryEmoji = [];\r\n\r\n //get all the emoji's of a category and append to the singleCategoryEmoji list\r\n for (let emoji of allEmojis) {\r\n if (emoji.category === selection) {\r\n singleCategoryEmoji.push(emoji);\r\n }\r\n }\r\n //Display the single category emoji list.\r\n renderHTML(singleCategoryEmoji, displayEmoji);\r\n }\r\n}", "title": "" }, { "docid": "a991329dfdd8d6239c37c9b3f6ae2928", "score": "0.55286837", "text": "function show_item()\n {\n var cause_category = $('#cause_category').val(),\n item = $('#item');\n\n item.find('option').remove();\n if(cause_category==0){\n item.append(\"<option selected='selected'>-- select category --</option>\");\n }else{\n $.ajax({\n type: 'GET',\n url: \"get_item\",\n data: {selected_category: cause_category},\n success: function(result){\n item.append(\"<option value=''>Choose from list</option>\" + result)\n }\n });\n }\n }", "title": "" }, { "docid": "dda5d5aeb05bcf5ba712a5a39ae5226c", "score": "0.55259746", "text": "function successCategory(data) {\n\t\tlet all = $('<option>');\n\t\t\tall.attr('value', 'All');\n\t\t\tall.text('All');\n\t\t\t$('#select').append(all);\n\n\t\tfor(let i = 0; i < data.length; i++) {\n\t\t\tlet option = $('<option>');\n\t\t\toption.attr('value', data[i]._id);\n\t\t\toption.text(data[i].title);\n\t\t\t$('#select').append(option);\n\t\t}\n\t}", "title": "" }, { "docid": "23c0d7cb0f7ec299f0bff4efaecf40fa", "score": "0.55225825", "text": "getCat1() {\r\n return this.cat1Select.value;\r\n }", "title": "" }, { "docid": "7a9d7cc25565bc13a27afe9717ad8e97", "score": "0.5519704", "text": "function checkCats() {\t\t\n\t\tselectedCats.forEach(function(cat) {\n\t\t\t$('input[value=\"' +cat+ '\"]').prop('checked', true);\n\t\t});\n\t\t\n\t\tif (selectedCats.length == 2) {\n\t\t\t$('#startFight').show();\n\t\t\t$('input[name=\"chaton1\"]').attr('value', selectedCats[0]);\n\t\t\t$('input[name=\"chaton2\"]').attr('value', selectedCats[1]);\n\t\t}\n\t}", "title": "" } ]
1b8af00b278595130b119631fc13a29c
surfaceAreaCylinder(3,7); 131.94689145077132 Perimeter formulas
[ { "docid": "7edbd0eacdb376845ade7af24368a25b", "score": "0.0", "text": "function perimeterSquare(side){\n let answer = 4*side\n return answer;\n}", "title": "" } ]
[ { "docid": "99eabcc621ca75c5b92aea274164beff", "score": "0.78997546", "text": "function rightCircleCylinderSurfaceArea(r, h){\n\treturn ((2 * Math.PI) * (r * h)) + ((2 * Math.PI) * Math.pow(r, 2)); \n}", "title": "" }, { "docid": "d2399975f375761f10bb2eab54908360", "score": "0.6805864", "text": "function cylinder({ radius = 1, height = 1 }) {\n const surfaceArea = () => 2 * Math.PI * radius * height\n + 2 * Math.PI * radius * radius;\n const volume = () => Math.PI * radius * radius * height;\n const widen = (factor) => { radius *= factor; };\n const stretch = (factor) => { height *= factor; };\n const toString = () => 'Cylinder with radius ${radius} and height ${height}';\n return Object.freeze({\n surfaceArea,\n volume,\n widen,\n stretch,\n toString,\n get radius() { return radius; },\n get height() { return height; },\n });\n}", "title": "" }, { "docid": "52d55bc6b8b8e1b554cb32aa28ee4531", "score": "0.6777811", "text": "function surfaceAreaCube(side){\n let answer = 6 * (side * side)\n return answer;\n}", "title": "" }, { "docid": "6b2a219b35ee3449d4e42c186578df3f", "score": "0.6774025", "text": "function cylinderVolume(outD,insD,height){\n return Math.PI * (diaSquared(outD)-diaSquared(insD))*height;\n}", "title": "" }, { "docid": "13ad98980452ec374ff2789e885ab749", "score": "0.6736879", "text": "function righCircleCylinderVolume(r, h){\n\t// V = PI * (r^2 * h)\n\treturn Math.PI * (Math.pow(r,2) * h);\n}", "title": "" }, { "docid": "55453f0ddf272b01eb87d2fc917a8a7e", "score": "0.67020386", "text": "function drawCylinder(){\n\n\n}", "title": "" }, { "docid": "cbde9c17ae45baabb6badda2c1ed42b6", "score": "0.66911864", "text": "function rightCircularConeSurfaceArea(r,h){\n\treturn (Math.PI * r) * (r + Math.sqrt(Math.pow(r,2) + Math.pow(h,2)));\n}", "title": "" }, { "docid": "7e4940edeae874a86a019ca88cbc43b1", "score": "0.66437095", "text": "function volCyl(radius, height){\n return Math.round(Math.PI * Math.pow(radius, 2) * height);\n}", "title": "" }, { "docid": "4ba823248680315d97b81319344b3996", "score": "0.6509577", "text": "function cylinderBlock(){\n\n\tvar disk = DISK([0.75])([32]);\n\tvar main_cylinder = EXTRUDE([5])(disk);\n\tvar surface = CYL_SURFACE([0.76,4.5])([48,2]);\n\tvar col_surface = COLOR([1,0.6,0.4])(surface);\n\tvar t_col_surface = T([2])([0.25])(col_surface);\n\tvar block = STRUCT([main_cylinder, t_col_surface]);\n\treturn block;\n}", "title": "" }, { "docid": "ec6342f223fd2856a3a8e7308bfffd29", "score": "0.6507558", "text": "get cylinder () {\n\t\treturn this._cylinder;\n\t}", "title": "" }, { "docid": "0c92c94870a593d74995bbc3dff3fc37", "score": "0.6478754", "text": "function Cylinder(radius,height,direction) {\n this.radius = radius\n this.height = height\n if (direction === undefined) {\n this.direction = [0,0,this.height]\n } else {\n this.direction = direction\n }\n this.shape = CSG.cylinder({ //using the CSG primitives\n start: [0, 0, 0],\n end: this.direction,\n radius: radius, // true cylinder\n resolution: 16\n });\n}", "title": "" }, { "docid": "f346aad75f47eb2bad311bc281b111ca", "score": "0.6424812", "text": "function cone(radius,height) {\n //Slant height of a cone\n let s = Math.sqrt(radius * radius + height * height)\n\n // Lateral surface area of a cone\n let l = Math.PI * radius * s\n\n //Base surface area of a cone\n let b = Math.PI*radius*radius\n\n let volume = (1/3)*Math.PI*(radius*radius)*height\n let area = l + b;\n\n console.log(`volume = ${volume} \\n area = ${area}`)\n}", "title": "" }, { "docid": "07feb101cd98aae21022198042c403eb", "score": "0.6392286", "text": "function drawCylinder() {\n setMV() ;\n Cylinder.draw() ;\n}", "title": "" }, { "docid": "07feb101cd98aae21022198042c403eb", "score": "0.6392286", "text": "function drawCylinder() {\n setMV() ;\n Cylinder.draw() ;\n}", "title": "" }, { "docid": "75ec9478750a428f176ae8ec73a479b4", "score": "0.63906354", "text": "function drawCylinder() {\n setMV();\n Cylinder.draw();\n}", "title": "" }, { "docid": "75ec9478750a428f176ae8ec73a479b4", "score": "0.63906354", "text": "function drawCylinder() {\n setMV();\n Cylinder.draw();\n}", "title": "" }, { "docid": "a54869b9943361874b63930853c60c6c", "score": "0.6390418", "text": "function drawCylinder() {\n setMV();\n Cylinder.draw();\n}", "title": "" }, { "docid": "e8b19849a9d4366d66f6bd606e9225e5", "score": "0.63500476", "text": "function main() {\n\treturn union(\n\t\tdifference(\n\t\t\tunion(\n\t\t\t\tcylinder({r:20, h:25}),\n\t\t\t\tcylinder({r:25, h:2})\n\t\t\t),\n\t\t\tcylinder({r:15, h:25})\n\t\t),\n\t\tcylinder({r:30, h:0.3})\n\t);\n}", "title": "" }, { "docid": "86db40e16cef0682101e3a3b8dcea8ac", "score": "0.63026786", "text": "getArea() {\n return 3.14 * this.radius * this.radius\n }", "title": "" }, { "docid": "94b6dbc3b5d7ffafeaab3245d346ff81", "score": "0.6299636", "text": "createControlPoints() {\n\n let xBottom = this.baseRadius;\n let xTop = this.topRadius;\n let z = this.height;\n let yBottom = 2* 2/3 * xBottom;\n let yTop = 2* 2/3 * xTop;\n\n var controlPoints = [];\n\n //control points will be created using 2 rectangles that will create half of the cylinder. the other half will be created with a rotate\n controlPoints.push([xBottom,0,0,1.0]);\n controlPoints.push([xTop,0,z,1.0]);\n controlPoints.push([xBottom,yBottom,0,1.0]);\n controlPoints.push([xTop,yTop,z,1.0]);\n controlPoints.push([-xBottom,yBottom,0,1.0]);\n controlPoints.push([-xTop,yTop,z,1.0]);\n controlPoints.push([-xBottom,0,0,1.0]);\n controlPoints.push([-xTop,0,z,1.0]);\n \n this.controlPointsList = [];\n \n for (var a = 0; a <= this.degreeU; a++) {\n var tmp = [];\n for (var b = 0; b <= this.degreeV; b++)\n tmp.push(controlPoints.shift());\n\n this.controlPointsList.push(tmp);\n }\n }", "title": "" }, { "docid": "d2e9addc4fb9521f4b6467f2059b2f37", "score": "0.6295546", "text": "calcArea() {\r\n return Math.PI * Math.pow(this.r, 2);\r\n }", "title": "" }, { "docid": "11d5a245418883224cf1c4f14ca226bf", "score": "0.6295407", "text": "area () {\n return 4*Math.PI*this.radi**2\n }", "title": "" }, { "docid": "50e7512f8d9ac0b3b538b5ede363ed89", "score": "0.6283039", "text": "getArea() {\n return Math.PI*this.r**2;\n }", "title": "" }, { "docid": "245481f799dfb77c3c915867b3be0c8a", "score": "0.62640244", "text": "function cylinder (vstart,vend,r) {\n var distance = vstart.distanceTo(vend);\n var position = vend.clone().add(vstart).divideScalar(2);\n var cylinder = new THREE.CylinderGeometry(r,r,distance,10,10,true);\n var orientation = new THREE.Matrix4();//a new orientation matrix to offset pivot\n orientation.lookAt(vstart,vend,new THREE.Vector3(0,1,0));//look at destination\n var offsetRotation = new THREE.Matrix4();//a matrix to fix pivot rotation\n offsetRotation.makeRotationX(Math.PI/2);//rotate 90 degs on X\n orientation.multiply(offsetRotation);//combine orientation with rotation transformations\n cylinder.applyMatrix(orientation);\n var offsetPosition = new THREE.Matrix4();//a matrix to fix pivot position\n offsetPosition.makeTranslation (position.x, position.y, position.z);\n cylinder.applyMatrix(offsetPosition);\n return cylinder;\n}", "title": "" }, { "docid": "cff79b29be1f0a9ce33e9a652c1a7e9f", "score": "0.6249554", "text": "function CylinderShape()\n\t{\n\t\tmxShape.call(this);\n\t}", "title": "" }, { "docid": "fbeadb0fe76484dd97a37abd6f1d7d38", "score": "0.6238476", "text": "area() {\n var p = (this.sideA + this.sideB + this.sideC) / 2;\n var area = Math.sqrt(\n p * (p - this.sideA) * (p - this.sideB) * (p - this.sideC)\n );\n return area;\n }", "title": "" }, { "docid": "b002ed070b48f5f7f9f84e143130fc04", "score": "0.62224025", "text": "function circArea(radius) {\n return radius * radius * Math.PI\n}", "title": "" }, { "docid": "df3caaa19872f004e5fa8362ac1f5adc", "score": "0.6217599", "text": "function cylinderVolume() {\n //INPUT: Get height (h) of cylinder and radius (r).\n let r = parseFloat(document.getElementById('r').value);\n let h = parseFloat(document.getElementById('h').value);\n\n //PROCESSING: compute volume of a cylinder V=πr2h\n let volume = Math.PI * Math.pow(r, 2) * h / 61.024;\n //OUTPUT: Display units\n document.getElementById('output').innerHTML = volume.toFixed(5) + \" Liters\";\n}", "title": "" }, { "docid": "aa8b61c9f7952c8e82b7f84ea0826815", "score": "0.6216796", "text": "getReynoldsCylinder(){\n\n\n var vfsd = this.getVelocity();\n var vconv = this.getVconv();\n var radius = this.getRadius();\n var lconv = this.getLconv();\n var rho;\n var viscos;\n\n /**\n * Earth conditions\n */\n if(environmentSelect == 1){\n\n rho = this.getRhoEarth();\n viscos = this.getViscosEarth();\n }\n\n /**\n * Mars conditions\n */\n else if(environmentSelect == 2){\n\n rho = this.getRhoMars();\n viscos = this.getViscosMars();\n }\n\n /**\n * Water conditions\n */\n else if(environmentSelect == 3){\n\n rho = this.getRhoWater();\n viscos = this.getViscosWater();\n\n }\n\n /**\n * Venus Surface conditions \n */\n else if(environmentSelect == 4){\n\n rho = this.getRhoVenus();\n viscos = this.getViscosVenus();\n\n }\n\n var reynolds = vfsd/vconv * 2 * radius/lconv * rho / viscos;\n return reynolds;\n\n }", "title": "" }, { "docid": "c5405b2725090fd1b3391631b7b1b79c", "score": "0.62116385", "text": "function cylinder(numSlices, numStacks, caps) {\n\n var slices = 36;\n if (numSlices) slices = numSlices;\n var stacks = 1;\n if (numStacks) stacks = numStacks;\n var capsFlag = true;\n if (caps == false) capsFlag = caps;\n\n var data = {};\n\n var ss = [1, 1, 1];\n\n var top = 0.5;\n var bottom = -0.5;\n var radius = 0.5;\n var topCenter = [0.0, top, 0.0];\n var bottomCenter = [0.0, bottom, 0.0];\n\n\n var sideColor = [1.0, 0.0, 0.0, 1.0];\n var topColor = [0.0, 1.0, 0.0, 1.0];\n var bottomColor = [0.0, 0.0, 1.0, 1.0];\n\n\n var cylinderVertexCoordinates = [];\n var cylinderNormals = [];\n var cylinderVertexColors = [];\n var cylinderTextureCoordinates = [];\n\n // side\n\n for (var j = 0; j < stacks; j++) {\n var stop = bottom + (j + 1) * (top - bottom) / stacks;\n var sbottom = bottom + j * (top - bottom) / stacks;\n var topPoints = [];\n var bottomPoints = [];\n var topST = [];\n var bottomST = [];\n for (var i = 0; i < slices; i++) {\n var theta = 2.0 * i * Math.PI / slices;\n topPoints.push([radius * Math.sin(theta), stop, radius * Math.cos(theta), 1.0]);\n bottomPoints.push([radius * Math.sin(theta), sbottom, radius * Math.cos(theta), 1.0]);\n };\n\n topPoints.push([0.0, stop, radius, 1.0]);\n bottomPoints.push([0.0, sbottom, radius, 1.0]);\n\n\n for (var i = 0; i < slices; i++) {\n var a = topPoints[i];\n var d = topPoints[i + 1];\n var b = bottomPoints[i];\n var c = bottomPoints[i + 1];\n var u = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];\n var v = [c[0] - b[0], c[1] - b[1], c[2] - b[2]];\n\n var normal = [\n u[1] * v[2] - u[2] * v[1],\n u[2] * v[0] - u[0] * v[2],\n u[0] * v[1] - u[1] * v[0]\n ];\n\n var mag = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2])\n normal = [normal[0] / mag, normal[1] / mag, normal[2] / mag];\n cylinderVertexCoordinates.push([a[0], a[1], a[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([(i + 1) / slices, j * (top - bottom) / stacks]);\n\n cylinderVertexCoordinates.push([b[0], b[1], b[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([i / slices, (j - 1) * (top - bottom) / stacks]);\n\n cylinderVertexCoordinates.push([c[0], c[1], c[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([(i + 1) / slices, (j - 1) * (top - bottom) / stacks]);\n\n cylinderVertexCoordinates.push([a[0], a[1], a[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([(i + 1) / slices, j * (top - bottom) / stacks]);\n\n cylinderVertexCoordinates.push([c[0], c[1], c[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([(i + 1) / slices, (j - 1) * (top - bottom) / stacks]);\n\n cylinderVertexCoordinates.push([d[0], d[1], d[2], 1.0]);\n cylinderVertexColors.push(sideColor);\n cylinderNormals.push([normal[0], normal[1], normal[2]]);\n cylinderTextureCoordinates.push([(i + 1) / slices, j * (top - bottom) / stacks]);\n };\n };\n\n var topPoints = [];\n var bottomPoints = [];\n for (var i = 0; i < slices; i++) {\n var theta = 2.0 * i * Math.PI / slices;\n topPoints.push([radius * Math.sin(theta), top, radius * Math.cos(theta), 1.0]);\n bottomPoints.push([radius * Math.sin(theta), bottom, radius * Math.cos(theta), 1.0]);\n };\n topPoints.push([0.0, top, radius, 1.0]);\n bottomPoints.push([0.0, bottom, radius, 1.0]);\n\n if (capsFlag) {\n\n //top\n\n for (i = 0; i < slices; i++) {\n normal = [0.0, 1.0, 0.0];\n var a = [0.0, top, 0.0, 1.0];\n var b = topPoints[i];\n var c = topPoints[i + 1];\n cylinderVertexCoordinates.push([a[0], a[1], a[2], 1.0]);\n cylinderVertexColors.push(topColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n\n cylinderVertexCoordinates.push([b[0], b[1], b[2], 1.0]);\n cylinderVertexColors.push(topColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n\n cylinderVertexCoordinates.push([c[0], c[1], c[2], 1.0]);\n cylinderVertexColors.push(topColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n };\n\n //bottom\n\n for (i = 0; i < slices; i++) {\n normal = [0.0, -1.0, 0.0];\n var a = [0.0, bottom, 0.0, 1.0];\n var b = bottomPoints[i];\n var c = bottomPoints[i + 1];\n cylinderVertexCoordinates.push([a[0], a[1], a[2], 1.0]);\n cylinderVertexColors.push(bottomColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n\n cylinderVertexCoordinates.push([b[0], b[1], b[2], 1.0]);\n cylinderVertexColors.push(bottomColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n\n cylinderVertexCoordinates.push([c[0], c[1], c[2], 1.0]);\n cylinderVertexColors.push(bottomColor);\n cylinderNormals.push(normal);\n cylinderTextureCoordinates.push([0, 1]);\n };\n\n };\n function translate(x, y, z) {\n for (var i = 0; i < cylinderVertexCoordinates.length; i++) {\n cylinderVertexCoordinates[i][0] += x;\n cylinderVertexCoordinates[i][1] += y;\n cylinderVertexCoordinates[i][2] += z;\n };\n }\n\n function scale(sx, sy, sz) {\n ss = [sx, sy, sz];\n for (var i = 0; i < cylinderVertexCoordinates.length; i++) {\n cylinderVertexCoordinates[i][0] *= sx;\n cylinderVertexCoordinates[i][1] *= sy;\n cylinderVertexCoordinates[i][2] *= sz;\n };\n }\n\n function radians(degrees) {\n return degrees * Math.PI / 180.0;\n }\n\n function rotate(angle, axis) {\n\n var d = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n\n var x = axis[0] / d;\n var y = axis[1] / d;\n var z = axis[2] / d;\n\n var c = Math.cos(radians(angle));\n var omc = 1.0 - c;\n var s = Math.sin(radians(angle));\n\n var mat = [\n [x * x * omc + c, x * y * omc - z * s, x * z * omc + y * s],\n [x * y * omc + z * s, y * y * omc + c, y * z * omc - x * s],\n [x * z * omc - y * s, y * z * omc + x * s, z * z * omc + c]\n ];\n\n for (var i = 0; i < cylinderVertexCoordinates.length; i++) {\n var u = [0, 0, 0];\n var v = [0, 0, 0];\n for (var j = 0; j < 3; j++)\n for (var k = 0; k < 3; k++) {\n u[j] += mat[j][k] * cylinderVertexCoordinates[i][k];\n v[j] += mat[j][k] * cylinderNormals[i][k] / ss[k];\n };\n for (var j = 0; j < 3; j++) {\n cylinderVertexCoordinates[i][j] = u[j];\n cylinderNormals[i][j] = v[j];\n };\n };\n }\n\n data.TriangleVertices = cylinderVertexCoordinates;\n data.TriangleNormals = cylinderNormals;\n data.TriangleVertexColors = cylinderVertexColors;\n data.TextureCoordinates = cylinderTextureCoordinates;\n data.rotate = rotate;\n data.translate = translate;\n data.scale = scale;\n return data;\n\n}", "title": "" }, { "docid": "9afefe044b318009c74708f6ca48279d", "score": "0.617234", "text": "function areaTr(t) {\n var perimeter = (t.sideA + t.sideB + t.sideC) / 2;\n console.log(perimeter);\n var area = Math.sqrt(perimeter * ((perimeter - t.sideA) * (perimeter - t.sideB) * (perimeter - t.sideC)));\n return area;\n}", "title": "" }, { "docid": "9daa33595e5a585c472746738b2ef728", "score": "0.61715114", "text": "function surfaceCercle(rayon){\n return 3.14 * rayon * rayon;\n\n}", "title": "" }, { "docid": "5f0b3ff56c5e0dde4a0082ca39e1402f", "score": "0.61680335", "text": "function volCube(side){\n return Math.pow(side, 3);\n}", "title": "" }, { "docid": "7935ee0287cfe1a1e3a66e8c1e38a67e", "score": "0.6156314", "text": "function createCylinderPass(){\n var geometryWa = new THREE.CylinderGeometry( 30, 30, 70, 64, 64, true, 0, -2.4);\n var textureWa = new THREE.TextureLoader().load('libs/Images/ice-cave-c2.png');\n var normalTextureWa = new THREE.TextureLoader().load('libs/Images/ice-cave-2c.png');\n var bumpTextureWa = new THREE.TextureLoader().load('libs/Images/ice-cave-3-b.png');\n var materialWa = new THREE.MeshPhongMaterial( {\n color: 0xe6f2ff,\n map:textureWa,\n specular: 0xe6f2ff,\n emissive: 0x0d1e26,\n bumpMap: bumpTextureWa,\n //normalMap: normalTextureWa,\n shininess: 100,\n reflectivity: .5,\n side:THREE.DoubleSide\n } );\n var pmaterialWa = new Physijs.createMaterial(materialWa,0.9,0.5);\n passWall = new THREE.Mesh( geometryWa, materialWa );\n passWall.rotation.y = THREE.Math.degToRad( -23 );\n passWall.rotation.x = THREE.Math.degToRad( 90 );\n passWall.position.y = -52;\n passWall.position.x = -5;\n passWall.position.z = -580;\n passWall.receiveShadow = true;\n passWall.castShadow = false;\n scene.add(passWall);\n }", "title": "" }, { "docid": "6a4adb52c1315375fa1efac1c30733cb", "score": "0.61002123", "text": "function generateCylinder(gl) {\r\n var r = 40; \r\n \r\n for(var i = 0; i < points.length; i++){\r\n var pointV = new Vector3([points[i].x, points[i].y, r]); //z vector\r\n var axisV; //vector created by 2 pts\r\n if(i == 0)\r\n axisV = new Vector3([points[i].x - points[i+1].x, points[i].y - points[i+1].y, 0]); \r\n else\r\n axisV = new Vector3([points[i-1].x - points[i].x, points[i-1].y - points[i].y, 0]);\r\n \r\n for(var angle = 0; angle < 360; angle+=30)\r\n matrixTransformations(angle, r, pointV, axisV);\r\n \r\n if (i != 0 && i+1 < points.length){\r\n for(var angle = 0; angle < 360; angle+=30){\r\n axisV = new Vector3([points[i].x - points[i+1].x, points[i].y - points[i+1].y, 0]);\r\n matrixTransformations(angle, r, pointV, axisV);\r\n }\r\n }\r\n }\r\n \r\n if(loading == false) vertices = calcIntersect(vertices);\r\n drawCylinderObjects(gl);\r\n}", "title": "" }, { "docid": "3e147f4955d18b91b9a3bb226f7ec045", "score": "0.6065991", "text": "function makeCylinder(radius,halfLength, slices, slices2){\n var normalData = [];\n var vertexPositionData = [];\n var indexData = [];\n var tri = 0;\n for(var i=0; i<slices; i++){\n var theta = i * Math.PI / slices;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n\n var theta = (i+0.0)*2.0*Math.PI/slices;\n var nextTheta = (i+1.0)*2.0*Math.PI/slices;\n\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n var sinNextTheta = Math.sin(nextTheta);\n var cosNextTheta = Math.cos(nextTheta);\n\n // Top triangle\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(1.0);\n vertexPositionData.push(0.0);\n vertexPositionData.push(0.0);\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(1.0);\n vertexPositionData.push(radius*Math.cos(theta));\n vertexPositionData.push(radius*Math.sin(theta));\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(1.0);\n vertexPositionData.push(radius*Math.cos(nextTheta));\n vertexPositionData.push(radius*Math.sin(nextTheta));\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n // front left upper triangle\n tri++;\n normalData.push(Math.cos(theta));\n normalData.push(Math.sin(theta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(theta));\n vertexPositionData.push(radius*Math.sin(theta));\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(Math.cos(nextTheta));\n normalData.push(Math.sin(nextTheta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(nextTheta));\n vertexPositionData.push(radius*Math.sin(nextTheta));\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(Math.cos(theta));\n normalData.push(Math.sin(theta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(theta));\n vertexPositionData.push(radius*Math.sin(theta));\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n\n // front right bottom triangle\n tri++;\n normalData.push(Math.cos(nextTheta));\n normalData.push(Math.sin(nextTheta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(nextTheta));\n vertexPositionData.push(radius*Math.sin(nextTheta));\n vertexPositionData.push(halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(Math.cos(nextTheta));\n normalData.push(Math.sin(nextTheta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(nextTheta));\n vertexPositionData.push(radius*Math.sin(nextTheta));\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(Math.cos(theta));\n normalData.push(Math.sin(theta));\n normalData.push(0.0);\n vertexPositionData.push(radius*Math.cos(theta));\n vertexPositionData.push(radius*Math.sin(theta));\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n\n // Bottom triangle\n tri++;\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(-1.0);\n vertexPositionData.push(radius*Math.cos(nextTheta));\n vertexPositionData.push(radius*Math.sin(nextTheta));\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(-1.0);\n vertexPositionData.push(radius*Math.cos(theta));\n vertexPositionData.push(radius*Math.sin(theta));\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n tri++;\n normalData.push(0.0);\n normalData.push(0.0);\n normalData.push(-1.0);\n vertexPositionData.push(0.0);\n vertexPositionData.push(0.0);\n vertexPositionData.push(-halfLength);\n indexData.push(tri);\n\n tri++;\n }\n return {positions:vertexPositionData,\n normals:normalData,\n indices:indexData};\n}", "title": "" }, { "docid": "d1c7bcb22e64d6b7551977e93fa25725", "score": "0.6064545", "text": "function CylinderGeometry(id, scene, \n /**\n * Defines the height of the cylinder\n */\n height, \n /**\n * Defines the diameter of the cylinder's top cap\n */\n diameterTop, \n /**\n * Defines the diameter of the cylinder's bottom cap\n */\n diameterBottom, \n /**\n * Defines the tessellation factor to apply to the cylinder\n */\n tessellation, \n /**\n * Defines the number of subdivisions to apply to the cylinder (1 by default)\n */\n subdivisions, canBeRegenerated, mesh, \n /**\n * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)\n */\n side) {\n if (subdivisions === void 0) { subdivisions = 1; }\n if (mesh === void 0) { mesh = null; }\n if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; }\n var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this;\n _this.height = height;\n _this.diameterTop = diameterTop;\n _this.diameterBottom = diameterBottom;\n _this.tessellation = tessellation;\n _this.subdivisions = subdivisions;\n _this.side = side;\n return _this;\n }", "title": "" }, { "docid": "62d8be35ea126827fa67b3a2cf836738", "score": "0.606131", "text": "function generateCylinderGeometry(sample) {\n\tvar cylinderMesh={vertices:[],texCoords:[],normals:[]};\n\tvar i;\n\tfor (i = 0; i < sample; i++) {\n\t\t// TARA: setup the angles (in radians) to be used (I need two of them per sliver \n\t\t// of the cylinder)\n\t\tvar angle_1 = (i*2*Math.PI) / sample;\n\t\tvar angle_2 = ((i+1)*2*Math.PI) / sample;\n\n\t\t// TARA: bottom circle wedge data\n\t\tcylinderMesh.vertices.push(vec3(0,0,0)); // center of bottom circle\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_1), Math.sin(angle_1), 0));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_2), Math.sin(angle_2), 0));\n\t\t// TARA: texture explanation--with radius=1, diameter=2; however the texture coordinates\n\t\t// vary from 0,0 to 1,1. So, first the coordinates of the original x and y of the geometry \n\t\t// are translated +1 to get them to be completely positive, ranging from ~0,0 to ~2,2 instead \n\t\t// of ~-1,-1 to ~1,1. Then, they are divided by 2. E.g. this means that the center (once at 0,0) \n\t\t// goes from 0,0 to 1,1 and then to 0.5,0.5.\n\t\tcylinderMesh.texCoords.push(vec2(0.5,0.5));\n\t\tcylinderMesh.texCoords.push(vec2((Math.cos(angle_1)+1.0)/2.0, (Math.sin(angle_1)+1.0)/2.0));\n\t\tcylinderMesh.texCoords.push(vec2((Math.cos(angle_2)+1.0)/2.0, (Math.sin(angle_2)+1.0)/2.0));\n\t\t// TARA: Now for the normals, which will be straight out in the z direction \n\t\tcylinderMesh.normals.push(vec3(0,0,-1)); // \"down\" direction\n\t\tcylinderMesh.normals.push(vec3(0,0,-1));\n\t\tcylinderMesh.normals.push(vec3(0,0,-1));\n\n\t\t// TARA: top circle wedge data\n\t\tcylinderMesh.vertices.push(vec3(0,0,1)); // center of top circle\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_1), Math.sin(angle_1), 1));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_2), Math.sin(angle_2), 1));\n\t\t// Texture coordinates are the same as bottom circle wedge\n\t\tcylinderMesh.texCoords.push(vec2(0.5,0.5));\n\t\tcylinderMesh.texCoords.push(vec2((Math.cos(angle_1)+1.0)/2.0, (Math.sin(angle_1)+1.0)/2.0));\n\t\tcylinderMesh.texCoords.push(vec2((Math.cos(angle_2)+1.0)/2.0, (Math.sin(angle_2)+1.0)/2.0));\n\t\t// Normals\n\t\tcylinderMesh.normals.push(vec3(0,0,2)); // \"up\" direction\n\t\tcylinderMesh.normals.push(vec3(0,0,2));\n\t\tcylinderMesh.normals.push(vec3(0,0,2));\n\n\t\t// TARA: panel data\n\t\t// Starting with vertices... one triangle\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_1), Math.sin(angle_1), 1));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_1), Math.sin(angle_1), 0));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_2), Math.sin(angle_2), 1));\n\t\t// Second triangle\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_2), Math.sin(angle_2), 1));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_1), Math.sin(angle_1), 0));\n\t\tcylinderMesh.vertices.push(vec3(Math.cos(angle_2), Math.sin(angle_2), 0));\n\t\t// Texture coordinates for panel\n\t\tcylinderMesh.texCoords.push(vec2(i/sample,1));\n\t\tcylinderMesh.texCoords.push(vec2(i/sample,0));\n\t\tcylinderMesh.texCoords.push(vec2((i+1)/sample,1));\n\t\tcylinderMesh.texCoords.push(vec2((i+1)/sample,1));\n\t\tcylinderMesh.texCoords.push(vec2(i/sample,0));\n\t\tcylinderMesh.texCoords.push(vec2((i+1)/sample,0));\n\t\t// Normals\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_1), Math.sin(angle_1), 1), vec3(0,0,1)));\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_1), Math.sin(angle_1), 0), vec3(0,0,0)));\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_2), Math.sin(angle_2), 1), vec3(0,0,1)));\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_2), Math.sin(angle_2), 1), vec3(0,0,1)));\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_1), Math.sin(angle_1), 0), vec3(0,0,0)));\n\t\tcylinderMesh.normals.push(subtract(vec3(Math.cos(angle_2), Math.sin(angle_2), 0), vec3(0,0,0)));\n\t\t\n\t}\n\treturn cylinderMesh;\n}", "title": "" }, { "docid": "8b6f0fde2a4164c58c16d9f05944d1cd", "score": "0.6044806", "text": "function calculateCubeArea() {\n var cubeArea = 6 * Math.pow(width, 2)\n return cubeArea\n}", "title": "" }, { "docid": "d032c80ba14d9b5071f0e4a06ad4c4f3", "score": "0.604425", "text": "function cylinderVol() {\r\n const radius = getElement('#radiusCyl');\r\n const height = getElement('#heightCyl');\r\n const cylVolResult = getElement('#cylVolResult');\r\n cylVolEqualsBtn.addEventListener('click', () => {\r\n if (radius.value && height.value) {\r\n const result = mathLib.cylinderVol(parseFloat(radius.value), parseFloat(height.value));\r\n displayResult_UNITFUL(cylVolResult, 'Volume of cylinder', result, [radius, height], 3);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "56d8b09f2ce50f8dbd1ffde2a101cdba", "score": "0.6035985", "text": "area() {\n return (4 * Math.PI * this.radius ** 2).toFixed(2)\n }", "title": "" }, { "docid": "fba34398d6d3c51b1e547dedf0ec6f8a", "score": "0.59972394", "text": "function IsoCubeShape()\n\t{\n\t\tmxCylinder.call(this);\n\t}", "title": "" }, { "docid": "e00881ab646635e4cb22748d96d6f19f", "score": "0.5996255", "text": "circle_area(){\n return Math.PI * this.radius * this.radius;\n }", "title": "" }, { "docid": "5bac09fab75bb0f4f95a58c7509e3ac9", "score": "0.59666973", "text": "function area(readius) {\n\n var area = readius*readius*3.14\n return area;\n}", "title": "" }, { "docid": "c72dd76bf0ce288a81ff8b391551f296", "score": "0.59620756", "text": "function rectangulareSurfaceArea (l, w, h){\n\treturn (2 * (l * h)) + (2 * (w * h)) + (2 * (w * l));\n}", "title": "" }, { "docid": "b64b7bd8cab1a96f3bdf948a03b96be7", "score": "0.59461045", "text": "function circArea( radius ) {\n\t\t\t\treturn Math.round( Math.pow( radius, 2 ) * Math.PI );\n\t\t\t}", "title": "" }, { "docid": "05989270d1b8a473c5a2492f6c5db90a", "score": "0.59383696", "text": "function calculateConeVolume(r,t) {\n return 0.333 * Math.PI * r**2 *t;\n}", "title": "" }, { "docid": "6fdb40dfc1b80a5cffce849e335155b9", "score": "0.59326553", "text": "function circleArea(r, width) {\n return r * r * Math.acos(1 - width / r) - (r - width) * Math.sqrt(width * (2 * r - width));\n }", "title": "" }, { "docid": "8b21ee54765aef6aa5d0c69cc9997afd", "score": "0.5927091", "text": "function rightCircularConeVolume(r,h){\n\treturn ((1/3) * Math.PI) * (Math.pow(r, 2) * h);\n}", "title": "" }, { "docid": "557726da53f49ccbc3abb8a28683956e", "score": "0.5921336", "text": "function areaOfCircle(r){\n var areaC = Math.PI*r*r;\n return areaC;\n}", "title": "" }, { "docid": "94805e35a455e779d013c1949b2cfc55", "score": "0.5900383", "text": "function getVolume(){\n\t//If the radius or height are missing, then display a message\n\tif (!radius.value || !height.value){\n\t\toutput.innerHTML = \"Please enter both the height and radius of the cylinder.\";\n\t}else{\n\t\t//Volume of cylander is: V=pi*r^2*h\n\t\t//Conversion of inches to liters is approximately 61.024 per google\n\t\toutput.innerHTML = \"Volume<i>(in liters)</i> ≈ \" + (Math.PI * Math.pow(radius.value, 2) * height.value)/61.024;\n\t}\n}", "title": "" }, { "docid": "95d786591ee90b7fdcc1a5095a4cbf23", "score": "0.5890217", "text": "function areaCirc(r) {\n\treturn Math.PI * r * r;\n}", "title": "" }, { "docid": "e3d83e342ac1c36bb8c210cfccccf60c", "score": "0.58887273", "text": "function areaVolum (width, height, depth) {\n let area = width * height;\n let volume = width * height * depth;\n return [area, volume];\n}", "title": "" }, { "docid": "7c925d618ab3503c78c30a2121008ea7", "score": "0.58729607", "text": "function initCylinderBuffer(radius,circle_resolution,norows,pgl){\n //radius = radius of the cylinder\n //circle_resolution = the roundness of the cylinder\n //norows = the vertical resolution of the cylinder\n //pgl = the Web GL object\n var vertexPositionData=[];\n var normalData=[];\n var textureCoordData=[];\n //find the vertices of a circle first\n var prevx=radius,prevy=0;\n var i=0; \n var circle_x=new Array();var circle_z=new Array();\n var circle_index=0;\n for (var i=0;i<90;i+=circle_resolution)\n {//first Quadrant\n var angle=i/180.0*Math.PI;\n var x=radius *Math.cos(angle);\n var y=radius * Math.sin(angle); \n circle_x[circle_index]=x; circle_z[circle_index++]=y; \n }\n for (var i=90;i>=0;i-=circle_resolution)\n {//fourth Quadrant\n var angle=i/180.0*Math.PI;\n var x=radius *Math.cos(angle);\n var y=radius * Math.sin(angle); \n circle_x[circle_index]=-x; circle_z[circle_index++]=y; \n } \n for (var i=0;i<90;i+=circle_resolution)\n {//third Quadrant\n var angle=i/180.0*Math.PI;\n var x=radius *Math.cos(angle);\n var y=radius * Math.sin(angle); \n circle_x[circle_index]=-x; circle_z[circle_index++]=-y; \n } \n for (var i=90;i>=0;i-=circle_resolution)\n {//second Quadrant\n var angle=i/180.0*Math.PI;\n var x=radius *Math.cos(angle);\n var y=radius * Math.sin(angle); \n circle_x[circle_index]=x; circle_z[circle_index++]=-y; \n } \n circle_x[circle_index]=radius; circle_z[circle_index++]=0.0; \n var prevy=-1;\n //then create a cylinder \n var y_resolution=2.0/norows;\n var vertexIndex=0;\n var indexData=[];\n //var u,v;\n for (var y=-1.0;y<=1.0;y+=y_resolution)//only need 2 points\n {\n var prevx=circle_x[0];var prevz=circle_z[0]; \n for (var i=0;i<circle_x.length;i++)\n { //first triangle\n vertexPositionData.push(prevx);\n vertexPositionData.push(prevy);\n vertexPositionData.push(prevz);\n indexData.push(vertexIndex);//0 \n normalData.push(prevx);\n normalData.push(prevy);\n normalData.push(prevz);\n //u=(prevz);\n //v=(y);\n //textureCoordData.push(u);\n //textureCoordData.push(v);\n vertexIndex++; \n\n vertexPositionData.push(circle_x[i]);\n vertexPositionData.push(prevy);\n vertexPositionData.push(circle_z[i]);\n indexData.push(vertexIndex);//1\n normalData.push(circle_x[i]);\n normalData.push(prevy);\n normalData.push(circle_z[i]);\n //u=(circle_z[i]);\n //textureCoordData.push(u);\n //textureCoordData.push(v);\n vertexIndex++;\n\n vertexPositionData.push(prevx);\n vertexPositionData.push(y);\n vertexPositionData.push(prevz);\n indexData.push(vertexIndex);//2\n normalData.push(prevx);\n normalData.push(y);\n normalData.push(prevz);\n //u=prevz;\n //textureCoordData.push(u);\n //textureCoordData.push(v);\n vertexIndex++;\n //second triangle\n /*vertexPositionData.push(circle_x[i]);\n vertexPositionData.push(prevy);\n vertexPositionData.push(circle_z[i]);*/ //no need when using index buffer\n indexData.push(vertexIndex-2);\n //vertexIndex++;//3=1\n\n /*vertexPositionData.push(prevx);\n vertexPositionData.push(y);\n vertexPositionData.push(prevz);*///no need when using index buffer\n indexData.push(vertexIndex-1);\n //vertexIndex++;//4=2\n\n vertexPositionData.push(circle_x[i]);\n vertexPositionData.push(y);\n vertexPositionData.push(circle_z[i]);\n indexData.push(vertexIndex);\n normalData.push(circle_x[i]);\n normalData.push(y);\n normalData.push(circle_z[i]);\n //u=(circle_z[i]);\n //textureCoordData.push(u);\n //textureCoordData.push(v);\n vertexIndex++;//5->3\n prevx=circle_x[i];\n prevz=circle_z[i];\n }\n prevy=y;\n } \n //draw the top and bottom lid\n var cone=-0.2;//the lid with the shape of a cone\n for (var y=-1;y<=1.0;y+=2,cone=-cone)\n {\n //y=-1;\n vertexPositionData.push(circle_x[0]);\n vertexPositionData.push(y);\n vertexPositionData.push(circle_z[0]);\n indexData.push(vertexIndex);//0\n normalData.push(circle_x[0]);\n normalData.push(y);\n normalData.push(circle_z[0]);\n vertexIndex++; \n var i=1;\n \n for (i=1;i<circle_x.length;i++)\n { \n vertexPositionData.push(circle_x[i]);\n vertexPositionData.push(y);\n vertexPositionData.push(circle_z[i]);\n indexData.push(vertexIndex);//1\n normalData.push(circle_x[i]);\n normalData.push(y);\n normalData.push(circle_z[i]);\n vertexIndex++;\n vertexPositionData.push(0);\n vertexPositionData.push(y+cone);\n vertexPositionData.push(0);\n indexData.push(vertexIndex);//2\n normalData.push(0);\n normalData.push(y+cone);\n normalData.push(0);\n vertexIndex++; \n indexData.push(vertexIndex-2);\n }\n vertexPositionData.push(0);\n vertexPositionData.push(y);\n vertexPositionData.push(0);\n indexData.push(vertexIndex);//2\n normalData.push(0);\n normalData.push(y);\n normalData.push(0);\n vertexIndex++; \n vertexPositionData.push(circle_x[0]);\n vertexPositionData.push(y);\n vertexPositionData.push(circle_z[0]);\n indexData.push(vertexIndex);//0\n normalData.push(circle_x[0]);\n normalData.push(y);\n normalData.push(circle_z[0]);\n vertexIndex++; \n }\n //build the normal, vertex and texture buffers\n var pCylinderVertexNormalBuffer=pgl.createBuffer();\n pgl.bindBuffer(pgl.ARRAY_BUFFER,pCylinderVertexNormalBuffer);\n pgl.bufferData(pgl.ARRAY_BUFFER,new Float32Array(normalData),pgl.STATIC_DRAW);\n pCylinderVertexNormalBuffer.itemSize=3;\n pCylinderVertexNormalBuffer.numItems=normalData.length/3; \n var pCylinderVertexPositionBuffer=pgl.createBuffer();\n pgl.bindBuffer(pgl.ARRAY_BUFFER,pCylinderVertexPositionBuffer);\n pgl.bufferData(pgl.ARRAY_BUFFER,new Float32Array(vertexPositionData),pgl.STATIC_DRAW);\n pCylinderVertexPositionBuffer.itemSize=3;\n pCylinderVertexPositionBuffer.numItems=vertexPositionData.length/3;\n var pCylinderVertexIndexBuffer=pgl.createBuffer();\n pgl.bindBuffer(pgl.ELEMENT_ARRAY_BUFFER,pCylinderVertexIndexBuffer);\n pgl.bufferData(pgl.ELEMENT_ARRAY_BUFFER,new Uint16Array(indexData),pgl.STATIC_DRAW);\n pCylinderVertexIndexBuffer.itemSize=1;\n pCylinderVertexIndexBuffer.numItems=indexData.length;\n var result=[];\n result.push(pCylinderVertexPositionBuffer);\n result.push(pCylinderVertexNormalBuffer);\n result.push(pCylinderVertexIndexBuffer);\n return result;\n}", "title": "" }, { "docid": "5df00fc84082104322487110358100ae", "score": "0.5853765", "text": "get area() {\n return this.sides[0] * this.sides[1];\n }", "title": "" }, { "docid": "d1b5bfe264de2d895c4c54c19a71877b", "score": "0.5849845", "text": "function volumeOfCone(coneBase, coneHeight) {\n var coneVol = (pi) * (Math.pow(coneBase, 2)) * (coneHeight/3);\n return coneVol;\n}", "title": "" }, { "docid": "e099683f7799e84f814c0969e0874116", "score": "0.58478963", "text": "draw_closed_cylinder(graphics_state, m, material) {\n let R = Mat4.rotation(Math.PI/2, Vec.of(1, 0, 0));\n this.shapes.cylinder.draw(graphics_state, m.times(R), material);\n\n let T = Mat4.translation(Vec.of(0, 1, 0));\n this.shapes.circle.draw(graphics_state, m.times(T).times(R), material);\n\n T = Mat4.translation(Vec.of(0, -1, 0));\n this.shapes.circle.draw(graphics_state, m.times(T).times(R), material); \n }", "title": "" }, { "docid": "53dc4bb83e22a9fd36e40f114559a6c5", "score": "0.584662", "text": "perimeter() {\n const a = this.dim.a;\n const b = this.dim.b;\n this.parallelogram['perimeter'] = parseFloat((2 * (a + b)).toFixed(this.fixed));\n }", "title": "" }, { "docid": "20713ed2689308ab31284b4a77aa828b", "score": "0.5841516", "text": "getArea(){\n\n const pi = Math.PI;\n var radius = this.getRadius();\n var area = pi * Math.pow(radius,2);\n\n return area;\n }", "title": "" }, { "docid": "7bd060f2ff65a14a2bfea2e6dd6b6a5a", "score": "0.58391666", "text": "function createCylinder(x, y, z, rad, height, color, num_stacks, num_slices, ambient_coef, diffuse_coef, specular_coef, shininess) {\n // Initialize the tranformation matrix\n mat = mat4.create();\n mat4.identity(mat);\n\n var cylinder = {\n matrix: mat,\n vertex_position_buffer: {},\n vertex_index_buffer: {},\n vertex_normal_buffer: {},\n vertex_color_buffer: {},\n ambient_coef: ambient_coef,\n diffuse_coef: diffuse_coef,\n specular_coef: specular_coef,\n shininess: shininess\n };\n\n var vertices = [];\n var indices = [];\n var colors = [];\n var normals = [];\n var num_vertices = num_slices * num_stacks;\n\n var d_angle = 2 * Math.PI / (num_slices - 1);\n\n for (j = 0; j < num_stacks; j++)\n for (i = 0; i < num_slices; i++) {\n var idx = j * num_slices + i;\n var angle = d_angle * i;\n vertices.push(x + rad * Math.cos(angle));\n vertices.push(y + rad * Math.sin(angle));\n vertices.push(z + j * height / (num_stacks - 1));\n\n normals.push(Math.cos(angle));\n normals.push(Math.sin(angle));\n normals.push(0.0);\n\n colors = colors.concat(color);\n }\n // now create the index array\n\n num_indices = (num_stacks - 1) * 6 * (num_slices + 1);\n\n for (j = 0; j < num_stacks - 1; j++)\n for (i = 0; i <= num_slices; i++) {\n var mi = i % num_slices;\n var mi2 = (i + 1) % num_slices;\n indices.push((j + 1) * num_slices + mi);\n indices.push(j * num_slices + mi); // mesh[j][mi]\n indices.push((j) * num_slices + mi2);\n indices.push((j + 1) * num_slices + mi);\n indices.push((j) * num_slices + mi2);\n indices.push((j + 1) * num_slices + mi2);\n }\n\n // Initialize the cylinders vertex and color buffer objects\n cylinder.vertex_position_buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cylinder.vertex_position_buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n cylinder.vertex_position_buffer.itemSize = 3;\n cylinder.vertex_position_buffer.numItems = num_vertices;\n\n cylinder.vertex_index_buffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cylinder.vertex_index_buffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n cylinder.vertex_index_buffer.itemSize = 1;\n cylinder.vertex_index_buffer.numItems = num_indices;\n //\n cylinder.vertex_normal_buffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cylinder.vertex_normal_buffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array(normals), gl.STATIC_DRAW);\n cylinder.vertex_normal_buffer.itemSize = 3;\n cylinder.vertex_normal_buffer.numItems = num_vertices;\n\n cylinder.vertex_color_buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cylinder.vertex_color_buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n cylinder.vertex_color_buffer.itemSize = 4;\n cylinder.vertex_color_buffer.numItems = num_vertices;\n\n return cylinder;\n}", "title": "" }, { "docid": "b1e642c748ad4b113b7e391467ddad45", "score": "0.58355147", "text": "function calcArea() {\n\n var length = document.getElementById(\"length\").value;\n var width = document.getElementById(\"width\").value;\n var depth = document.getElementById(\"depth\").value;\n depth = depth / 12;\n\n var area = length * width * depth;\n\n area = area / 3;\n area = area.toFixed(2);\n\n var result = area + \" cubic yards\"\n\n document.getElementById(\"result\").textContent = result;\n}", "title": "" }, { "docid": "a459a703d1b9ded7c30de446d92517e2", "score": "0.58190364", "text": "function createHomePageCylinder() {\n homePagePlanetMaterial = new THREE.MeshBasicMaterial({\n color: \"#00000F\",\n transparent: true,\n opacity: 0.1,\n depthWrite: false,\n });\n\n const geometry = new THREE.CylinderGeometry(15, 15, 20, 100)\n geometry.name = \"HomePage_TextPlane\";\n\n backgroundPlaneMesh = new THREE.Mesh(geometry, homePagePlanetMaterial)\n backgroundPlaneMesh.scale.x = backgroundPlaneMesh.scale.y = backgroundPlaneMesh.scale.z = 1;\n backgroundPlaneMesh.position.x = 0;\n backgroundPlaneMesh.position.y = 0;\n backgroundPlaneMesh.position.z = 0;\n\n scene.add(backgroundPlaneMesh);\n }", "title": "" }, { "docid": "af1dcd61c6cfdebece88d766f13810de", "score": "0.58064234", "text": "function circleArea(r, width) {\n\t return r * r * Math.acos(1 - width / r) - (r - width) * Math.sqrt(width * (2 * r - width));\n\t }", "title": "" }, { "docid": "931edde7d1715020a78985fc5451a621", "score": "0.58058053", "text": "function lateralSurface(r, h, size){\n // This is the first half of the Lateral Surface Area Formula\n var equation1 = (r * r) + (h * h);\n console.log(equation1);\n // This is finding the square root of equation1\n var squareRoot = Math.sqrt(equation1);\n console.log(squareRoot);\n // This is finding the full Lateral Surface Equation solution\n var equation2 = 3.14 * r * squareRoot;\n console.log(equation2);\n\t// converting the square feet to inches\n\tvar areaInches = equation2 * 144;\n\tconsole.log(areaInches);\n\t// Dividing the tree surface area by the area needed for each ornament\n\tvar amount = areaInches / (size * size);\n\tconsole.log(amount);\n\treturn parseInt(amount); // Returning the amount of ornaments\n}", "title": "" }, { "docid": "f853c1929eb1f532db2f92d1b08a6d1a", "score": "0.58051085", "text": "get perimeter () {\n return this.sides.reduce(\n (accumulator, currentValue) => accumulator + currentValue,\n 0\n )\n }", "title": "" }, { "docid": "a65b935140a6577b480db1bbc145a115", "score": "0.58035517", "text": "get area() {\n return this.sides[0] ** 2;\n }", "title": "" }, { "docid": "5a1bd2b220a6538dc21fd64deef75993", "score": "0.5784937", "text": "function circleArea(r){\n //calc area = PI * r *r\n var area = Math.PI * r *r;\n\n //return the value\n return area;\n }", "title": "" }, { "docid": "8241f9e14f4c2e80838f5515d07c42f1", "score": "0.57802004", "text": "Area()\n {\n return Vector.Cross(Vector.Subtract(this.vertices[0], this.vertices[1]), Vector.Subtract(this.vertices[1], this.vertices[2])) / 2;\n }", "title": "" }, { "docid": "dd2c97a76a27dfa74560d83ee6a3f6c7", "score": "0.5766473", "text": "get perimeter() {\r\n let sum = this.sides.reduce(function(total, element) {\r\n return element + total;\r\n }, 0);\r\n return sum;\r\n }", "title": "" }, { "docid": "806702334594304825fc5d5bf01be33e", "score": "0.5765091", "text": "function areaOfCircle(r){\n const PI = 3.14 \n let area = PI * r * r;\n return area;\n}", "title": "" }, { "docid": "b6fb0643d2b2e5398d959d322ee991b1", "score": "0.5764019", "text": "function createCapsule( material, radius, top, bottom, segmentsWidth, openTop, openBottom )\r\n{\r\n\t// defaults\r\n\tsegmentsWidth = (segmentsWidth === undefined) ? 32 : segmentsWidth;\r\n\topenTop = (openTop === undefined) ? false : openTop;\r\n\topenBottom = (openBottom === undefined) ? false : openBottom;\r\n\r\n\t// get cylinder height\r\n\tvar cylAxis = new THREE.Vector3();\r\n\tcylAxis.subVectors( top, bottom );\r\n\tvar length = cylAxis.length();\r\n\r\n\t// get cylinder center for translation\r\n\tvar center = new THREE.Vector3();\r\n\tcenter.addVectors( top, bottom );\r\n\tcenter.divideScalar( 2.0 );\r\n\r\n\t// always open-ended\r\n\tvar cylGeom = new THREE.CylinderGeometry( radius, radius, length, segmentsWidth, 1, 1 );\r\n\tvar cyl = new THREE.Mesh( cylGeom, material );\r\n\r\n\t// pass in the cylinder itself, its desired axis, and the place to move the center.\r\n\tmakeLengthAngleAxisTransform( cyl, cylAxis, center );\r\n\r\n\tvar capsule = new THREE.Object3D();\r\n\tcapsule.add( cyl );\r\n\tif ( !openTop || !openBottom ) {\r\n\t\t// instance geometry\r\n\t\tvar sphGeom = new THREE.SphereGeometry( radius, segmentsWidth, segmentsWidth/2 );\r\n\t\tif ( !openTop ) {\r\n\t\t\tvar sphTop = new THREE.Mesh( sphGeom, material );\r\n\t\t\tsphTop.position.set( top.x, top.y, top.z );\r\n\t\t\tcapsule.add( sphTop );\r\n\t\t}\r\n\t\tif ( !openBottom ) {\r\n\t\t\tvar sphBottom = new THREE.Mesh( sphGeom, material );\r\n\t\t\tsphBottom.position.set( bottom.x, bottom.y, bottom.z );\r\n\t\t\tcapsule.add( sphBottom );\r\n\t\t}\r\n\t}\r\n\r\n\treturn capsule;\r\n\r\n}", "title": "" }, { "docid": "14b39c8915fbd7e5add1be48df70c7dd", "score": "0.57583356", "text": "function frustumOfRightCircularConeVolume(r, R, h){\n\treturn ((Math.PI * h) / 3) * (Math.pow(R, 2) +(R * r) + Math.pow(r,2));\n}", "title": "" }, { "docid": "789c7856c22265f998597631cc204d2c", "score": "0.57417774", "text": "function perimeter(h,w) {\n return (h + w) * 2;\n}", "title": "" }, { "docid": "7e74ead857c031a1c826b1b75073e644", "score": "0.57384056", "text": "function perimeterCircle (r) {\n const pi = 3.14;\n return pi*(2*r)\n}", "title": "" }, { "docid": "3712e356e7f4b6c343c7ad65eff98391", "score": "0.5737297", "text": "function findPerimeter(height, width) {\r\n return 2 * (height + width);\r\n}", "title": "" }, { "docid": "46ebf08073bdb894635fe0073796a686", "score": "0.57294524", "text": "get area() {\n\n // Calculate the sum of face area\n const value = this.reduce((sum, { area }) => add(sum, Number(area)), 0);\n\n // Return as a unit in meters\n return toMeters(value);\n }", "title": "" }, { "docid": "1276c6faeb954c354e55da68238932bf", "score": "0.57278657", "text": "function calcSurface(length, width) {\n\n let result = length * width;\n return \"The area is \" + result + \" m2\";\n\n}", "title": "" }, { "docid": "1783748abc1c794aa84b61cb161f3c8d", "score": "0.5726068", "text": "function createEdgeCylinders () {\n edgeCylinders = new THREE.Object3D();\n var m = new THREE.MeshLambertMaterial({color:0x0000ff});\n for (var i in paper.edges) {\n var e = paper.edges[i];\n var g = cylinder(e.geometry.vertices[0], e.geometry.vertices[1],5);\n edgeCylinders.add (new THREE.Mesh (g,m));\n }\n}", "title": "" }, { "docid": "415d1593dd18e55c534ce38752b4f48e", "score": "0.5716284", "text": "function areaOfCircle(r) {\r\n console.log(Math.PI * Math.pow(r, 2))\r\n}", "title": "" }, { "docid": "3410c6b97786b18e86a7274f1748d606", "score": "0.57038325", "text": "perimeter(){\n return (2 * this.width) + (2 * this.length);\n }", "title": "" }, { "docid": "5e4a7fcb5e31319c8c6067095a12ff3e", "score": "0.570255", "text": "function circleArea(r){\n //Calc area pi*r*r\n var area = Math.PI*r*r;\n // return the value\n return area;\n}", "title": "" }, { "docid": "b4e2dc148e882d140912582f91001869", "score": "0.5698694", "text": "function CubicPoly() {\r\n\t\r\n\t\t}", "title": "" }, { "docid": "b4e2dc148e882d140912582f91001869", "score": "0.5698694", "text": "function CubicPoly() {\r\n\t\r\n\t\t}", "title": "" }, { "docid": "d4bb98b1ce253a46c51f88e70fbe7f26", "score": "0.5690912", "text": "constructor(c, r){\r\n this.centre = c;\r\n this.radius = r;\r\n }", "title": "" }, { "docid": "f0f5a4af443078a2e0ae7953673412fa", "score": "0.5686608", "text": "calculateAreaTriangle() {\r\n var side1 = 5;\r\n var side2 = 6;\r\n var side3 = 7;\r\n var perimeter = (side1 + side2 + side3) / 2;\r\n var area = Math.sqrt(perimeter * ((perimeter - side1) * (perimeter - side2) * (perimeter - side3)));\r\n console.log(area);\r\n }", "title": "" }, { "docid": "ed50cd1998fc33ad1af7900bafdd577d", "score": "0.56680495", "text": "function createEdgeCylinders() {\n edgeCylinders = new THREE.Object3D();\n var m = new THREE.MeshLambertMaterial({\n color: 0x0000ff\n });\n for (var i in paper.edges) {\n var e = paper.edges[i];\n var g = cylinder(e.geometry.vertices[0], e.geometry.vertices[1], 5);\n edgeCylinders.add(new THREE.Mesh(g, m));\n }\n}", "title": "" }, { "docid": "fdaaf93c2be6a684fa15fd50ab74a23d", "score": "0.5666815", "text": "function CubeShape()\n\t{\n\t\tmxCylinder.call(this);\n\t}", "title": "" }, { "docid": "117540241d3e9684699cde32eaa4ff78", "score": "0.56656164", "text": "function addCylinder(){\n var cylinder = new THREE.Mesh( cylinder_geometry, normal_material );\n //scene.add( cylinder );\n return cylinder; \n}", "title": "" }, { "docid": "6ba865b0820b9d9c6342d1d39d416eea", "score": "0.56636614", "text": "function TriangleArea(a, b, c) {\n\n // using sqrt the method of Returns the square root of a number \n var pre = (a + b + c) / 2;\n var area = Math.sqrt(pre * (pre - a) * (pre - b) * (pre - c));\n return \"area =\" + area;\n\n\n\n}", "title": "" }, { "docid": "bf31612426c78d275548799ce2e43765", "score": "0.56621975", "text": "function periRect(w,h) {\n //perimeter of a rectangle is 2*width + 2*height\n var perimeter = 2 * w + 2 * h;\n //return the perimeter\n return perimeter;\n\n}", "title": "" }, { "docid": "d666485bbf504320d99d3efd25a3dfb8", "score": "0.56581455", "text": "function createBody() {\n var sphereMaterial = new THREE.MeshLambertMaterial({ color: 0xA00000});\n var cylinderMaterial = new THREE.MeshLambertMaterial({ color: 0x0000D0});\n\n var body = new THREE.Mesh(\n new THREE.SphereGeometry(116/2, 32, 16), sphereMaterial);\n body.position.x = 0;\n body.position.y = 160;\n body.position.z = 0;\n scene.add(body);\n\n var connector = new THREE.Mesh(\n new THREE.CylinderGeometry(24/2, 24/2, 390, 32), cylinderMaterial);\n connector.position.x = 0;\n connector.position.y = 160 + 390/2;\n connector.position.z = 0;\n scene.add(connector);\n }", "title": "" }, { "docid": "7f79fd9672ef17f0cdba271f1c2e59a6", "score": "0.56555957", "text": "function frustumOfRightCircularConeSurfaceArea(r,R,s){\n\treturn Math.PI * (s * (R + r));\n}", "title": "" }, { "docid": "5ad8a9019ad822fecca36320090c1e16", "score": "0.56408507", "text": "function volumeOfRectPrism(length, width, height){\n let volume = length * width * height;\n return volume; \n}", "title": "" }, { "docid": "b5f4f135bfcfb2a01486097baa86b086", "score": "0.5636764", "text": "function drawCylinderObjects(gl) {\r\n vNorms = [];\r\n pNorms = [];\r\n drawN = [];\r\n poly = [];\r\n \r\n //Traverse through vertices and connect the indeces.\r\n for(var i = 0; i < vertices.length-24; i+=2){\r\n poly.push(new triangle(i, i+24, i+25));\r\n poly.push(new triangle(i+1, i, i+25));\r\n \r\n calcNormals(vertices, i);\r\n\r\n if((i+2)%24 == 0) i+=24;\r\n }\r\n \r\n calcSmooth();\r\n \r\n //this.colors = [];\r\n /*\r\n mesh.verts = vertices;\r\n mesh.poly = poly;\r\n mesh.drawN = drawN;\r\n mesh.vNorms = vNorms;\r\n mesh.pNorms = pNorms;\r\n */\r\n initVertexBuffers(gl); \r\n}", "title": "" }, { "docid": "610188017e85516d2f86a9213aaa8af6", "score": "0.5631818", "text": "function volumeCube(side){\n let answer = side * side * side\n return answer;\n}", "title": "" }, { "docid": "f558774a2c907747acf1e17193ff9b84", "score": "0.5631299", "text": "area (){}", "title": "" }, { "docid": "326c2fc6c7727c02827ab46235bfddd6", "score": "0.56303394", "text": "function calculateDodecahedronVertices(radius){\n let verts_dic = {\n 'A': [0, 0.618 * radius , 1.618 * radius],\n 'B': [0, 0.618 * radius, -1.618 * radius],\n 'C': [0, -0.618 * radius, 1.618 * radius],\n 'D': [0, -0.618 * radius, -1.618 * radius],\n 'E': [0.618 * radius, 1.618 * radius, 0],\n 'F': [0.618 * radius, -1.618 * radius, 0],\n 'G': [-0.618 * radius, 1.618 * radius, 0],\n 'H': [-0.618 * radius, -1.618 * radius, 0],\n 'I': [1* radius, 1* radius, 1* radius],\n 'J': [1* radius, 1* radius, -1* radius],\n 'K': [1* radius, -1* radius, 1* radius],\n 'L': [1* radius, -1* radius, -1* radius],\n 'M': [-1* radius, 1* radius, 1* radius],\n 'N': [-1* radius, 1* radius, -1* radius],\n 'O': [-1* radius, -1* radius, 1* radius],\n 'P': [-1* radius, -1* radius, -1* radius],\n 'Q': [1.62* radius, 0, 0.62* radius],\n 'R': [1.62* radius, 0, -0.62* radius],\n 'S': [-1.62* radius, 0, 0.62* radius],\n 'T': [-1.62* radius, 0, -0.62* radius],\n };\n\n let verts = []\n\n //face 1\n verts.push(...verts_dic['A']);\n verts.push(...verts_dic['I']);\n verts.push(...verts_dic['E']);\n verts.push(...verts_dic['G']);\n verts.push(...verts_dic['M']);\n //face 2\n verts.push(...verts_dic['C']);\n verts.push(...verts_dic['O']);\n verts.push(...verts_dic['H']);\n verts.push(...verts_dic['F']);\n verts.push(...verts_dic['K']);\n //face 3\n verts.push(...verts_dic['Q']);\n verts.push(...verts_dic['I']);\n verts.push(...verts_dic['A']);\n verts.push(...verts_dic['C']);\n verts.push(...verts_dic['K']);\n //face 4\n verts.push(...verts_dic['S']);\n verts.push(...verts_dic['O']);\n verts.push(...verts_dic['C']);\n verts.push(...verts_dic['A']);\n verts.push(...verts_dic['M']);\n //face 5\n verts.push(...verts_dic['M']);\n verts.push(...verts_dic['G']);\n verts.push(...verts_dic['N']);\n verts.push(...verts_dic['T']);\n verts.push(...verts_dic['S']);\n //face 6\n verts.push(...verts_dic['I']);\n verts.push(...verts_dic['Q']);\n verts.push(...verts_dic['R']);\n verts.push(...verts_dic['J']);\n verts.push(...verts_dic['E']);\n //face 7\n verts.push(...verts_dic['K']);\n verts.push(...verts_dic['F']);\n verts.push(...verts_dic['L']);\n verts.push(...verts_dic['R']);\n verts.push(...verts_dic['Q']);\n //face 8\n verts.push(...verts_dic['O']);\n verts.push(...verts_dic['S']);\n verts.push(...verts_dic['T']);\n verts.push(...verts_dic['P']);\n verts.push(...verts_dic['H']);\n //face 9\n verts.push(...verts_dic['D']);\n verts.push(...verts_dic['L']);\n verts.push(...verts_dic['F']);\n verts.push(...verts_dic['H']);\n verts.push(...verts_dic['P']);\n //face 10\n verts.push(...verts_dic['D']);\n verts.push(...verts_dic['P']);\n verts.push(...verts_dic['T']);\n verts.push(...verts_dic['N']);\n verts.push(...verts_dic['B']);\n //face 11\n verts.push(...verts_dic['B']);\n verts.push(...verts_dic['N']);\n verts.push(...verts_dic['G']);\n verts.push(...verts_dic['E']);\n verts.push(...verts_dic['J']);\n //face 12\n verts.push(...verts_dic['B']);\n verts.push(...verts_dic['J']);\n verts.push(...verts_dic['R']);\n verts.push(...verts_dic['L']);\n verts.push(...verts_dic['D']);\n\n return verts;\n}", "title": "" }, { "docid": "a7cb24db0f36dc8865d1cd4b2052e3e2", "score": "0.5628302", "text": "get perimeter() {\n return this.sides.reduce((side, i) => side + i, 0);\n }", "title": "" }, { "docid": "b0652a567a8a1a9cdc6123e7c8bb20a6", "score": "0.56270814", "text": "get circumference() {\n return Math.PI * (this.radius * 2)\n }", "title": "" }, { "docid": "916dfcc8532a7e4f80bea4d425558067", "score": "0.56264156", "text": "function area(){\n return this.x * this.y;\n}", "title": "" }, { "docid": "42c029baa8459ca6a76c31688a555b49", "score": "0.5622148", "text": "function CubicPoly() {\r\n\r\n\t}", "title": "" } ]
bb87166d4664cb9ca1222df32acb2cfe
make sure everything is okay after delete check if entityManager contains all entities in ids except the ones at indices idxs
[ { "docid": "7887aa8af632fe2c416abaf779a72db2", "score": "0.62716264", "text": "function containsEverythingExcept(ids, idxs) {\n /* jshint shadow: true */\n /* ^ allow for (var i =) and another (for var i =) */\n \n for (var i = 0; i < idxs.length; i++) {\n expect(entityManager).not.toContainEntity(ids[idxs[i]]);\n }\n for (var i = 0; i < ids.length; i++) {\n if (!idxs.includes(i)) {\n expect(entityManager).toContainEntity(ids[i]);\n }\n }\n }", "title": "" } ]
[ { "docid": "c8d662b7604fd86b437cfb46650aaa14", "score": "0.65115356", "text": "deleteAllEntities() {\n // Consider switch to this[entityIds].forEach(id => this.deleteEntity());\n this[entityIds] = []\n this[componentRegistry].clear()\n }", "title": "" }, { "docid": "330ef0a52bfdcd39b0b8f94edf84b7ed", "score": "0.5875495", "text": "BatchDeleteByIds(ids, callback) {\n if ( !isArray(ids) ) {\n // TODO: Error log this\n console.log(\"BatchDeleteByIds parameter='ids' is NOT array.\");\n if ( callback ) {\n callback( false );\n }\n return;\n }\n\n let keys = [];\n // Construct keys to delete\n for(let i = 0; i < ids.length ; ++i) {\n keys.push( this._dataStore.key( [ this._kind, ids[i] ] ) );\n }//for\n\n // If empty, we're not making any call to GoogleDataStore\n if ( keys.length > 0 ) {\n this._dataStore.delete(keys,\n function(err) {\n if ( err ) {\n // TODO: Log error\n console.log(err);\n }\n\n if ( callback ) {\n callback( (err)?false:true );\n }\n\n }\n );\n } else {\n console.log(\"BatchDeleteByIds empty 'ids' array.\");\n if ( callback ) {\n callback( false );\n }\n }\n }", "title": "" }, { "docid": "922abd3584b64ce3bb50cf5389229416", "score": "0.5750688", "text": "async deleteByIds(ids, repoName) {\n return new Promise(resolve => {\n const repo = this.connection.getRepository(repoName);\n\n let idRef = ids;\n\n if (!Array.isArray(ids)) {\n idRef = [ids];\n }\n\n repo.delete(idRef)\n .then(res => {\n return resolve(res);\n })\n .catch(err => {\n console.error(err);\n return resolve(undefined);\n });\n });\n }", "title": "" }, { "docid": "a08cb811291cd68e1628502366be316a", "score": "0.56948537", "text": "rejectCrudStores() {\n this.orderedCrudStores.forEach(store => store.store.clearChanges());\n }", "title": "" }, { "docid": "737d6f57d405acad70e75584a8139793", "score": "0.56223977", "text": "handleDeleteDRCWRRule() {\n //console.log(\"selected index is: \" + this.selIndex);\n let rows = this.drcRequestRules;\n let deckRuleIdsToDelete = [];\n let selIndex = this.selIndex;\n //console.log(\"selected index is: \" + selIndex);\n \n selIndex.forEach(index =>{\n //console.log('index in forEach is: '+ index);\n if (rows[index].Id !== undefined) {\n deckRuleIdsToDelete.push(rows[index].Id);\n }\n rows.splice(index, 1);\n });\n this.drcRequestRules = rows;\n this.selIndex = [];\n \n //console.log(\"this.drcRequestRules after delete is; \" + JSON.stringify(rows));\n\n //delete drc deck rule record \n if (deckRuleIdsToDelete.length > 0) {\n deckRuleIdsToDelete.forEach(fileId =>{\n this.deleteRecords(fileId);\n })\n }\n\n }", "title": "" }, { "docid": "e944f25f1eacc70519ff809da93d230a", "score": "0.5611411", "text": "async checkForeignKeysDeletion(targetDoc, patchDocs, i) {\n const referencingIDs = await this.adapter.findReferencingDocuments(targetDoc._id, {\n includeWeak: false\n })\n\n if (referencingIDs.length === 0) {\n return\n }\n\n const description = `Document \"${\n targetDoc._id\n }\" cannot be deleted as there are references to it from \"${referencingIDs[0]}\"`\n\n throw new TransactionError({\n errors: [\n {\n error: {\n description,\n id: targetDoc._id,\n referencingIDs,\n type: 'documentHasExistingReferencesError'\n },\n index: i\n }\n ],\n statusCode: 409\n })\n }", "title": "" }, { "docid": "1c9c99e9b8bffd245150a94ccc3c03e7", "score": "0.5595497", "text": "if ( entityName === 'User' )\n if ( filter.id == defaultPersister.uuidNullAsString() )\n return Promise.resolve( User_0 )\n\n // For all non-user, non 0 ids, load from data loader per protocol\n const loaderIdentifier = Object.keys( filter )\n .sort()\n .join( ',' )\n const loader = this.getLoader( entityName, loaderIdentifier, false )\n\n return loader.load( filter ).then( result => {\n const changes = this.changes[entityName]\n if ( changes ) {\n // $FlowIssue - by convention all entity objects are expected to have an id\n const change = changes[result.id]\n if ( change != null ) {\n if ( change === deletedRecord )\n result = null // Object is not found, return null // Add or update\n else Object.assign( result, change )\n }\n }\n return result\n })\n }\n\n getObjectList( entityName: string, filter: Object ) {\n // TODO x2000 Provide try catch with logging here!\n const loaderIdentifier = Object.keys( filter )\n .sort()\n .join( ',' )\n const loader = this.getLoader( entityName, loaderIdentifier, true )\n\n return loader.load( filter ).then( arrResults => {\n const changes = this.changes[entityName]\n if ( changes ) {\n for ( let ix = 0; ix < arrResults.length; ix++ ) {\n const change = changes[arrResults[ix].id]\n if ( change != null ) {\n if ( change === deletedRecord )\n arrResults.splice( ix--, 1 ) // Reduce ix in order not to skip over a record // Add or update\n else Object.assign( arrResults[ix], change )\n }\n }\n }\n return arrResults\n })\n }\n\n invalidateLoaderCache( entityName: string, fields: any ) {\n // At this moment there is no obvious way of knowing what to clear from lists, so delete them all\n this.clearLoadersMultiple( entityName )\n\n const loadersSingle = this.getLoadersSingle( entityName )\n for ( let loaderFieldName in loadersSingle ) {\n if ( loaderFieldName === 'id' )\n loadersSingle[loaderFieldName].clear( fields.id )\n else delete loadersSingle[loaderFieldName]\n }\n }\n\n executeTriggers(\n arrTriggers: Array<Function>,\n fields: Object,\n oldFields: ?Object\n ) {\n const arrPromises = []\n for ( let trigger of arrTriggers ) {\n arrPromises.push( trigger( this, fields, oldFields ) )\n }\n\n return Promise.all( arrPromises )\n }", "title": "" }, { "docid": "54041063f726eef826ac10300cb1a88a", "score": "0.55705", "text": "delete(id) {\n // this items now includes all items that dont have that passed in id\n this.items = this.items.filter((item) => item.id !== id);\n this._commit(this.items);\n }", "title": "" }, { "docid": "296e388525421d69f688438fbbcc2ae9", "score": "0.54790825", "text": "deleteExpense() {\n const { deleteId, expenses } = this.state;\n const newState = {\n ...this.cleanState(),\n expenses: expenses.filter(exp => exp._id !== deleteId)\n };\n\n del(`/api/expense/${deleteId}`)\n .then(res => this.setState({ ...newState }))\n .catch(error => {\n const expense = this.state.expenses.find(exp => exp.id === deleteId);\n this.setState(this.cleanState());\n console.log('DELETE ERROR:', { error, expense, deleteId });\n });\n }", "title": "" }, { "docid": "29532c0f1b99aae7cd16d0499609d7a2", "score": "0.5449113", "text": "remove() {\r\n entities.splice(this.entityId, 1);\r\n }", "title": "" }, { "docid": "865ea532da616d942073f1203f7befc0", "score": "0.54083866", "text": "function deleteEntities(entities, deleteEntities) {\n return mapValues(entities, function (value, key) {\n // RA Summary: eslint - security/detect-object-injection\n // RA: Using square bracket notation with user input can lead to exploitation\n // RA: Uses object square bracket notation\n // RA: Valuable for state management cleanup\n // RA: The threat actor (web application user) already controls the execution environment (web browser)\n // RA Developer Status: Mitigated\n // RA Validator Status: Mitigated\n // RA Modified Severity: N/A\n // eslint-disable-next-line security/detect-object-injection\n const idsToDelete = Object.keys(deleteEntities[key] || {});\n return omit(value, idsToDelete);\n });\n}", "title": "" }, { "docid": "1db27c3fc3af6f876a876dbcc49f2562", "score": "0.5392551", "text": "setMissingIds() {\n this.database = this.database.map(note => this.setId(note))\n }", "title": "" }, { "docid": "aacfa7833688dae20db92f92d4c0371c", "score": "0.5387477", "text": "function deleteAll(ids,callback){\n\tDB.transaction(function(tx) {\n\t\tif(!localStorage['diigo']){\n\t\t\ttx.executeSql(\n\t\t\t\t'DELETE FROM items WHERE id IN ('+ids+')',null,function(tx,ds){\n\t\t\t\t\ttx.executeSql('DELETE FROM diigo WHERE local_id IN ('+ids+')',null,\n\t\t\t\t\t\tfunction(tx,ds){\n\t\t\t\t\t\t\tcallback(tx,ds);\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t);\n\t\t}else{\n\t\t\ttx.executeSql(\n\t\t\t\t'UPDATE items SET list=?,created=? WHERE id IN ('+ids+')',['delete',BG.getTime.getUTCString('now')],\n\t\t\t\tfunction(tx,ds){\n tx.executeSql(\n 'UPDATE diigo SET sync_s = 0 WHERE local_id IN ('+ids+')',[],\n function(t,d){\n callback(tx,ds);\n }\n );\n }\n\t\t\t);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "52ef0aa97fac3782f69aef048294a236", "score": "0.5362902", "text": "function deleteAll(_context, payload) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (payload && payload.entity) {\n (new Query(this, payload.entity)).deleteAll();\n return [2 /*return*/];\n }\n Query.deleteAll(this);\n return [2 /*return*/];\n });\n });\n}", "title": "" }, { "docid": "950d1bbc2133c95e335c161d4a82ff4e", "score": "0.5359664", "text": "undoMany(entityOrIdList, collection) {\n if (entityOrIdList == null || entityOrIdList.length === 0) {\n return collection; // nothing to undo\n }\n let didMutate = false;\n const { changeState, remove, upsert } = entityOrIdList.reduce((acc, entityOrId) => {\n let chgState = acc.changeState;\n const id = typeof entityOrId === 'object'\n ? this.selectId(entityOrId)\n : entityOrId;\n const change = chgState[id];\n if (change) {\n if (!didMutate) {\n chgState = { ...chgState };\n didMutate = true;\n }\n delete chgState[id]; // clear tracking of this entity\n acc.changeState = chgState;\n switch (change.changeType) {\n case ChangeType.Added:\n acc.remove.push(id);\n break;\n case ChangeType.Deleted:\n const removed = change.originalValue;\n if (removed) {\n acc.upsert.push(removed);\n }\n break;\n case ChangeType.Updated:\n acc.upsert.push(change.originalValue);\n break;\n }\n }\n return acc;\n }, \n // entitiesToUndo\n {\n remove: [],\n upsert: [],\n changeState: collection.changeState,\n });\n collection = this.adapter.removeMany(remove, collection);\n collection = this.adapter.upsertMany(upsert, collection);\n return didMutate ? { ...collection, changeState } : collection;\n }", "title": "" }, { "docid": "12e7bffb656af62b62f732792be50d99", "score": "0.5352063", "text": "function writeDeleteEntities(bitStream, ids, config) {\n if (ids.length > 0) {\n bitStream[Binary[BinaryType.UInt8].write](Chunk.DeleteEntities) \n bitStream[Binary[BinaryType.UInt16].write](ids.length) \n ids.forEach(id => {\n writeDeleteId(bitStream, config.ID_BINARY_TYPE, id)\n })\n }\n}", "title": "" }, { "docid": "b9a409e6172809d595fd1351fc56f36b", "score": "0.53363025", "text": "trackDeleteMany(keys, collection, mergeStrategy) {\n if (mergeStrategy === MergeStrategy.IgnoreChanges ||\n keys == null ||\n keys.length === 0) {\n return collection; // nothing to track\n }\n let didMutate = false;\n const entityMap = collection.entities;\n const changeState = keys.reduce((chgState, id) => {\n const originalValue = entityMap[id];\n if (originalValue) {\n const trackedChange = chgState[id];\n if (trackedChange) {\n if (trackedChange.changeType === ChangeType.Added) {\n // Special case: stop tracking an added entity that you delete\n // The caller must also detect this, remove it immediately from the collection\n // and skip attempt to delete on the server.\n cloneChgStateOnce();\n delete chgState[id];\n }\n else if (trackedChange.changeType === ChangeType.Updated) {\n // Special case: switch change type from Updated to Deleted.\n cloneChgStateOnce();\n chgState[id] = { ...chgState[id], changeType: ChangeType.Deleted };\n }\n }\n else {\n // Start tracking this entity\n cloneChgStateOnce();\n chgState[id] = { changeType: ChangeType.Deleted, originalValue };\n }\n }\n return chgState;\n function cloneChgStateOnce() {\n if (!didMutate) {\n didMutate = true;\n chgState = { ...chgState };\n }\n }\n }, collection.changeState);\n return didMutate ? { ...collection, changeState } : collection;\n }", "title": "" }, { "docid": "112005251172d62d484b14e8f070c772", "score": "0.5319223", "text": "async delete(args) {\n let id = args.id;\n delete args.id;\n try {\n let [entity] = await this._db(this._entityName).update({\n status: 'deleted',\n hashed_password: 'deletedaccount'\n }, \"*\").where({id});\n return Object.assign({}, entity)\n } catch (error) {\n throw new Error('Error at DB')\n }\n }", "title": "" }, { "docid": "84fb6dc115d5654b0985ef7ae7c545bb", "score": "0.53095675", "text": "function delRows() {\r\n \t\treturn $q(function(resolve, reject) {\r\n \t\t// for each selected row (entity)\r\n \t\tangular.forEach($scope.gridApi.selection.getSelectedRows(), function(row, index) {\r\n \t\t\t// Ask server to delete entity\r\n \t\t\tResource.remove({id: row.id}, row)\r\n \t \t\t\t// On success\r\n \t \t\t\t.$promise.then(function(data) {\r\n \t \t\t\t\t// Remove entity from datagrid\r\n \t \t\t\t\tvm.data.splice(vm.data.lastIndexOf(row), 1);\r\n \t \t\t\t\t// Only resolve if finished\r\n \t \t\t\t\tif (0 == $scope.gridApi.selection.getSelectedRows().length - 1) {\r\n \t \t\t\t\t\tresolve();\r\n \t \t\t\t\t}\r\n \t\t\t\t\t// On error\r\n \t \t\t\t}, function(error){\r\n \t\t\t\t// return appropiated error message\r\n \t\t\t\tvar errorMsg;\r\n \t\t\t\tswitch (error.status) {\r\n \t\t\t\t\t\t\tdefault:\r\n \t\t\t\t\t\t\t\terrorMsg = 'Error al intentar borrar los registros seleccionados. Por favor intente nuevamente.';\r\n \t\t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t// reject\r\n \t\t\t\treject(errorMsg);\r\n \t\t\t\t// stope foreach\r\n \t\t\t\treturn;\r\n \t\t\t});\r\n \t\t});\r\n \t\t});\r\n \t}", "title": "" }, { "docid": "3eac258e19b3162b0818ca0955fee112", "score": "0.5307325", "text": "function checkIntegrity(tx) {\n sync.log.trace(\"Entering healingWoundSteps.updateAll->checkIntegrity\");\n for (var i = 0;\n ((inputArray) != null) && i < inputArray.length; i++) {\n var relationshipMap = {};\n relationshipMap = healingWoundSteps.getRelationshipMap(relationshipMap, inputArray[i].changeSet);\n sync.log.debug(\"Relationship Map for Integrity check created:\", relationshipMap);\n errObject = kony.sync.checkIntegrityinTransaction(tx, relationshipMap, null);\n if (errObject === false) {\n isError = true;\n return;\n }\n if (errObject !== true) {\n isError = true;\n kony.sync.rollbackTransaction(tx);\n return;\n }\n }\n }", "title": "" }, { "docid": "3170610419234f5a153b251d0b056510", "score": "0.5306751", "text": "handleBulkDelete() {\n this.props.deleteRecords(this.props.appId, this.props.tblId, this.props.selection, this.props.nameForRecords);\n this.setState({confirmDeletesDialogOpen: false});\n }", "title": "" }, { "docid": "d5bd2efcdef42dcfffeccd131d0ea292", "score": "0.53005004", "text": "static remove(id) {\n _entities = _entities.filter((iItem) => iItem.id !== id);\n }", "title": "" }, { "docid": "e4d3b1d2d76717380e221d81dbce75bf", "score": "0.5274481", "text": "async function handleUserDelete(id){\n let k = await user.findOne({\"_id\": id});\n await user.update({\n }, {$pull: {savedApartments: {$in: k.currentApartments}}}, {multi: true});\n k.currentApartments.forEach(async aptID => {\n if (aptID != {}){\n await handleApartmentDelete(aptID);\n }\n });\n await apartment.deleteMany({userID: id});\n}", "title": "" }, { "docid": "fd55bc304809c86d4d3b3b32bc3fca70", "score": "0.52721983", "text": "deleteAssets(assetsId){\r\n AssetService.deleteAssets(assetsId).then(res=>{\r\n this.setState({assets:this.state.assets.filter(assets=>assets.assetsId!==assetsId)});\r\n }).catch(error =>{\r\n console.log(error);\r\n });\r\n }", "title": "" }, { "docid": "cdf2be2dd4ae90523798b07396507d3b", "score": "0.5267291", "text": "function ensureDelete(notID, byUser) { id = null; }", "title": "" }, { "docid": "60bb5d29f7ae35db397c6cee205e078e", "score": "0.5266798", "text": "async function handleUserDelete(id){\n let k = await user.findOne({\"_id\": id});\n await user.update({}, {$pull: { SavedApartments: {$in: k.CurrentApartments }}}, {multi: true});\n k.CurrentApartments.forEach(async aptID => {\n if (aptID != {}){\n await handleApartmentDelete(aptID);\n }\n });\n await apartment.deleteMany({ UserID: id});\n}", "title": "" }, { "docid": "f5733985809cb83cf87ec89d86dc4025", "score": "0.5262091", "text": "bulkDelete() {\n\n }", "title": "" }, { "docid": "afcab930a2ecfb8f1a5d086b89cecc94", "score": "0.525104", "text": "deletePost() {\n this.postsService.deletePost(this.post.post_id).subscribe((x) => {\n /* remove the deleted post from posts and myPosts array if it exists there so we do not have to refresh the page or refetch data */\n let indexInMyPosts = this.postsService.myPosts.findIndex((p) => p.post_id == this.post.post_id);\n let indexInAllPosts = this.postsService.posts.findIndex((p) => p.post_id == this.post.post_id);\n this.postsService.myPosts.splice(indexInMyPosts, 1);\n this.postsService.posts.splice(indexInAllPosts, 1);\n }, (e) => {\n console.log(e);\n });\n }", "title": "" }, { "docid": "40d7e46d8c5f6f05e9d6830f1084b46b", "score": "0.52452797", "text": "_doDeleteNonPersisted(entity) {\n\t\treturn this._doDelete(entity);\n\t}", "title": "" }, { "docid": "8001a3d06cd70fd085b5b72f7b8ab173", "score": "0.52335703", "text": "deleteGame(id) {\n let i = this.index.findIndex(index => index === id);\n this.index.splice(i, 1);\n delete this.collection[id];\n }", "title": "" }, { "docid": "aba05ac5132765d69801f967df6ed154", "score": "0.5215112", "text": "function batchDelete(){\n var index;\n var checkedBox = [];\n ctrl.checkBox.forEach(function(project, index){\n if(!ctrl.showError){\n if(project){\n projectDelete(ctrl.data.projects[index].name);\n }\n }\n });\n ctrl.checkBox = []\n }", "title": "" }, { "docid": "c3a2937bf4fa53f3232297cf98019d39", "score": "0.5213883", "text": "async deleteMany(payload) {\n let data = await _repository.deleteMany({\n listId: payload.listId\n });\n if (!data) {\n throw new ApiError(\"Invalid ID\", 400);\n }\n }", "title": "" }, { "docid": "ff37a47ce3c12ce58bf247737aa5e2bd", "score": "0.5187338", "text": "function checkIntegrity(tx) {\n sync.log.trace(\"Entering com.healogics.offline.appListOffline.updateAll->checkIntegrity\");\n for (var i = 0;\n ((inputArray) != null) && i < inputArray.length; i++) {\n var relationshipMap = {};\n relationshipMap = com.healogics.offline.appListOffline.getRelationshipMap(relationshipMap, inputArray[i].changeSet);\n sync.log.debug(\"Relationship Map for Integrity check created:\", relationshipMap);\n errObject = kony.sync.checkIntegrityinTransaction(tx, relationshipMap, null);\n if (errObject === false) {\n isError = true;\n return;\n }\n if (errObject !== true) {\n isError = true;\n kony.sync.rollbackTransaction(tx);\n return;\n }\n }\n }", "title": "" }, { "docid": "4345bedbbeb7c3aaab826982a88ff4ee", "score": "0.51854783", "text": "onClickDeleteAll() {\n this.dialog.delete = true;\n this.idsToDelete = this.pickedItems.map(i => i.id);\n }", "title": "" }, { "docid": "7bbbd51886c236372ddac585dade7cda", "score": "0.5182354", "text": "refresh() {\r\n const ids = __classPrivateFieldGet(this, _data$1).getIds({\r\n filter: __classPrivateFieldGet(this, _options$1).filter,\r\n });\r\n const oldIds = [...__classPrivateFieldGet(this, _ids)];\r\n const newIds = {};\r\n const addedIds = [];\r\n const removedIds = [];\r\n const removedItems = [];\r\n // check for additions\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n newIds[id] = true;\r\n if (!__classPrivateFieldGet(this, _ids).has(id)) {\r\n addedIds.push(id);\r\n __classPrivateFieldGet(this, _ids).add(id);\r\n }\r\n }\r\n // check for removals\r\n for (let i = 0, len = oldIds.length; i < len; i++) {\r\n const id = oldIds[i];\r\n const item = __classPrivateFieldGet(this, _data$1).get(id);\r\n if (item == null) {\r\n // @TODO: Investigate.\r\n // Doesn't happen during tests or examples.\r\n // Is it really impossible or could it eventually happen?\r\n // How to handle it if it does? The types guarantee non-nullable items.\r\n console.error(\"If you see this, report it please.\");\r\n }\r\n else if (!newIds[id]) {\r\n removedIds.push(id);\r\n removedItems.push(item);\r\n __classPrivateFieldGet(this, _ids).delete(id);\r\n }\r\n }\r\n this.length += addedIds.length - removedIds.length;\r\n // trigger events\r\n if (addedIds.length) {\r\n this._trigger(\"add\", { items: addedIds });\r\n }\r\n if (removedIds.length) {\r\n this._trigger(\"remove\", { items: removedIds, oldData: removedItems });\r\n }\r\n }", "title": "" }, { "docid": "ce992c67f32b69a6768f835ddd1292b7", "score": "0.516583", "text": "async deleteAll() {\n return this.repository.deleteAll();\n }", "title": "" }, { "docid": "12f08b4069709efb7bd297d40ed7c372", "score": "0.5162811", "text": "determineIndicesToDelete() {\n let name_str = this.state.expenseName;\n let cost = this.state.cost;\n let category = this.state.category;\n let indices = [];\n\n for (let i = 0; i<exps.length; i++) {\n if (name_str !== '') {\n if (cost !== null) {\n if (category !== '') {\n if ((name_str === exps[i].name) && (cost === exps[i].cost) && (category === exps[i].category)) {\n indices.push(i);\n }\n } else {\n if ((name_str === exps[i].name) && (cost === exps[i].cost)) {\n indices.push(i);\n }\n }\n } else {\n if (name_str === exps[i].name) {\n indices.push(i);\n }\n }\n } else if (cost !== null) {\n if (category !== '') {\n if ((cost === exps[i].cost) && (category === exps[i].category)) {\n indices.push(i);\n }\n } else {\n if (cost === exps[i].cost) {\n indices.push(i);\n }\n }\n\n } else if (category !== '') {\n if (category === exps[i].category) {\n indices.push(i);\n }\n }\n }\n return indices;\n }", "title": "" }, { "docid": "a1a50cdf9c1c82809ee65a83b6c77ee0", "score": "0.5157414", "text": "clear() {\n this[PRIVATE.entities].clear()\n }", "title": "" }, { "docid": "9997f6e6950f2ef9679cb8baa0d806bf", "score": "0.5155874", "text": "deleteUser({ params }, res) {\n User.findOneAndDelete({ _id: params.id })\n .select('-__v')\n .then(async dbData => {\n if (!dbData) {\n res.status(404).json({ message: `No user found with id: ${params.id}` });\n return;\n }\n // The thoughts array has ids of this user's Thought objects\n // delete all those Thought obects along with this user \n if (dbData.thoughts && dbData.thoughts.length) {\n const deleteManyStatus = await Thought.deleteMany({ _id: { $in: dbData.thoughts } });\n }\n res.json(dbData);\n })\n .catch(err => res.json(err));\n}", "title": "" }, { "docid": "62de53f2cf829655f92a71eaffd8ba9b", "score": "0.51553124", "text": "function checkIntegrity(tx){\n\t\tsync.log.trace(\"Entering com.healogic.offline.patientInfo.updateAll->checkIntegrity\");\n\t\tfor (var i=0; ((inputArray) != null) && i < inputArray.length; i++ ){\n\t\t\tvar relationshipMap={}; \n\t\t\trelationshipMap = com.healogic.offline.patientInfo.getRelationshipMap(relationshipMap,inputArray[i].changeSet);\n\t\t\tsync.log.debug(\"Relationship Map for Integrity check created:\", relationshipMap);\n\t\t\terrObject = kony.sync.checkIntegrityinTransaction(tx, relationshipMap, null);\n\t\t\tif(errObject===false){\n\t\t\t\tisError = true;\n\t\t\t\treturn; \n\t\t\t}\n\t\t\tif(errObject!==true){\n\t\t\t\tisError = true;\n\t\t\t\tkony.sync.rollbackTransaction(tx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f99fbeaddaf0d4da51faa1b0a0e628dd", "score": "0.5148244", "text": "deleteRecipe(id){\n //find the Recipe Array index through recipe Id \n let index = this._recipes.findIndex(matchId);\n\n //nested helper function to match Id\n function matchId(recipe){\n return (recipe.id === id)\n }\n //Remove recipe from recipe array through array splice\n this._recipes.splice(index,1);\n }", "title": "" }, { "docid": "60cf4094e959f3d74047c2076e984b85", "score": "0.5148097", "text": "onRemoveEntity(entity) {\n removeFromArray(this.targetEntities, entity);\n }", "title": "" }, { "docid": "99781620c47be1351cc01c623343908e", "score": "0.5136806", "text": "adjust(transactions: Transaction[], id: number, amount: number): void {\n for (let i = 0; i < transactions.length; i++) {\n let currentTransaction = transactions[i];\n if (currentTransaction.id === id) {\n if (currentTransaction.amount <= amount) {\n // console.log(`Deleted transaction (${i}) ${currentTransaction.index}:${currentTransaction.amount} @ ${currentTransaction.direction}`);\n transactions.splice(i, 1);\n } else {\n currentTransaction.amount -= amount;\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "879a2f48004d6df1ec60009a46031e72", "score": "0.51276416", "text": "async deleteExecutions() {\n const executions = await this.scan();\n return await Promise.all(executions.Items.map(\n (execution) => super.delete({ arn: execution.arn })\n ));\n }", "title": "" }, { "docid": "7c706a9ba078a6eb1035f4a2b0f92be1", "score": "0.5120445", "text": "async function _delete(ids) {\n const requestConfig = {\n // headers: authHeader()\n };\n const promises = await ids.map((id) => {\n return axios.delete(`${backendUrl}/api/users/${id}`, requestConfig);\n });\n return Promise.all(promises).then(handleResponse);\n}", "title": "" }, { "docid": "290aca828dd5b495a39033ad6facb01e", "score": "0.51141673", "text": "async deleteExecutions() {\n const executions = await this.scan();\n return Promise.all(executions.Items.map((execution) => super.delete({ arn: execution.arn })));\n }", "title": "" }, { "docid": "66bde8193a45cef8e2cdcb15f3ebfc86", "score": "0.5108796", "text": "async deleteGame (id) {\n let action1, action2;\n [action1, action2] = await Promise.all([\n this.source.removeFromSortedSet(GAMES, id),\n this.source.delete(prefix + id)\n ]);\n if (!action1 || !action2) {\n console.error(\"something went wrong deleting game\");\n return false;\n }\n this.notify( { id: id, status: \"delete\" });\n return true;\n }", "title": "" }, { "docid": "1798c15156bb98487b4a3cd01c93f260", "score": "0.5106198", "text": "_checkDocsAreTrashed() {\n return this.documents.every((document) => this.isTrashed(document));\n }", "title": "" }, { "docid": "bbf6dc66f009b2aac53504dcfb30044d", "score": "0.51036644", "text": "undoAll(collection) {\n const ids = Object.keys(collection.changeState);\n const { remove, upsert } = ids.reduce((acc, id) => {\n const changeState = acc.chgState[id];\n switch (changeState.changeType) {\n case ChangeType.Added:\n acc.remove.push(id);\n break;\n case ChangeType.Deleted:\n const removed = changeState.originalValue;\n if (removed) {\n acc.upsert.push(removed);\n }\n break;\n case ChangeType.Updated:\n acc.upsert.push(changeState.originalValue);\n break;\n }\n return acc;\n }, \n // entitiesToUndo\n {\n remove: [],\n upsert: [],\n chgState: collection.changeState,\n });\n collection = this.adapter.removeMany(remove, collection);\n collection = this.adapter.upsertMany(upsert, collection);\n return { ...collection, changeState: {} };\n }", "title": "" }, { "docid": "5e96f3a0b47f8fae61e452ecfa3daeff", "score": "0.5099378", "text": "async function _delete(ids) {\n const requestConfig = {\n // headers: authHeader()\n };\n\n const promises = await ids.map((id) => {\n return axios.delete(`/api/warehouses/${id}`, requestConfig);\n });\n return Promise.all(promises).then(handleResponse);\n}", "title": "" }, { "docid": "a00ffb54a86ed81449cd28b9081fe25f", "score": "0.5096857", "text": "commitMany(entityOrIdList, collection) {\n if (entityOrIdList == null || entityOrIdList.length === 0) {\n return collection; // nothing to commit\n }\n let didMutate = false;\n const changeState = entityOrIdList.reduce((chgState, entityOrId) => {\n const id = typeof entityOrId === 'object'\n ? this.selectId(entityOrId)\n : entityOrId;\n if (chgState[id]) {\n if (!didMutate) {\n chgState = { ...chgState };\n didMutate = true;\n }\n delete chgState[id];\n }\n return chgState;\n }, collection.changeState);\n return didMutate ? { ...collection, changeState } : collection;\n }", "title": "" }, { "docid": "29d59c02509eea9d42104bd90b84dd91", "score": "0.5087602", "text": "function writeDeleteEntities(chunkType, bitStream, ids, config) {\r\n if (ids.length > 0) {\r\n bitStream[Binary[BinaryType.UInt8].write](chunkType) \r\n bitStream[Binary[BinaryType.UInt16].write](ids.length) \r\n ids.forEach(id => {\r\n writeDeleteId(bitStream, config.ID_BINARY_TYPE, id)\r\n })\r\n }\r\n}", "title": "" }, { "docid": "3b3c496675927400f65fcd5d1e9d53b5", "score": "0.5086227", "text": "onDeleteCheckedOrdersHandler() {\n let changedOrders = this.state.orders.filter((order) => {\n return this.state.checkedOrders.indexOf(order.id) < 0\n });\n if (this.state.checkedOrders.length === this.state.orders.length) {\n this.setState({\n orders: []\n }, () => this.filterOrders())\n } else {\n this.setState({\n orders: [].concat(changedOrders)\n }, () => this.filterOrders())\n }\n }", "title": "" }, { "docid": "1dc271d5e2bb9fbdf7ec8e46826c1280", "score": "0.50846696", "text": "function removeAllAvatarEntities() {\n var avatarEntityCount = 0;\n var lockedCount = 0;\n MyAvatar.getAvatarEntitiesVariant().forEach(function(avatarEntity) {\n avatarEntityCount++;\n\n if (avatarEntity.properties.locked) {\n lockedCount++;\n console.log(\"Locked Avatar Entity Name: \" + avatarEntity.properties.name);\n\n if (Entities.canAdjustLocks()) {\n console.log(\"Attempting to unlock then delete locked avatar entity... \");\n Entities.editEntity(avatarEntity.id, {\"locked\": false});\n Entities.deleteEntity(avatarEntity.id);\n\n Script.setTimeout(function() {\n console.log(\"After timeout, attempting to delete previously-locked avatar entity again... \");\n Entities.deleteEntity(avatarEntity.id);\n }, TRY_DELETE_AGAIN_MS);\n } else {\n console.log(\"You are wearing a locked avatar entity,\" +\n \" but you do not have permissions to unlock it. Domain owner: Put this script on a domain \" +\n \"in which all users have lock/unlock rights.\");\n }\n } else {\n console.log(\"Unlocked Avatar Entity Name: \" + avatarEntity.properties.name);\n Entities.deleteEntity(avatarEntity.id);\n }\n });\n console.log(\"You WERE wearing \" + avatarEntityCount + \" avatar entities, \" + lockedCount + \" of which were locked.\");\n\n if (avatarEntityCount === 0 && cleanUserDomain && neverMoveUsers.indexOf(AccountServices.username) === -1) {\n console.log(\"You are clean now. Sending you to \" + cleanUserDomain + \"...\");\n Window.location = cleanUserDomain;\n }\n }", "title": "" }, { "docid": "d60f2d54509d34521b052a5bba05bac6", "score": "0.50711936", "text": "validateIndex() {\n // if (this.filter && !isEmpty(this.filter)) {\n // throw new Error('cannot validate index when filter is active');\n // }\n const leftData = this.leftIndexRef.val;\n const rightData = this.rightIndexRef.val;\n \n const inconsistencies = [];\n\n // for every right id R added to the left id L,\n // L must also be added to R\n for (let leftId in leftData) {\n const rightIds = leftData[leftId];\n for (let rightId in rightIds) {\n const rightEntry = rightData[rightId];\n if (!rightEntry[leftId]) {\n inconsistencies.push([leftId, rightId]);\n }\n }\n }\n\n // for every L added to R,\n // R must also be added to L\n for (let rightId in rightData) {\n const leftIds = rightData[rightId];\n for (let leftId in leftIds) {\n const leftEntry = leftData[leftId];\n if (!leftEntry[rightId]) {\n inconsistencies.push([leftId, rightId]);\n }\n }\n }\n\n\n // TODO: check if all indexed objects actually exist in leftEntryRef + rightEntryRef\n\n return inconsistencies;\n }", "title": "" }, { "docid": "4ffecb65523f145424e9922b71b484a6", "score": "0.50693405", "text": "del(query) {\n\n let objects = this.get_by_query(query)\n\n for (var obj of objects) {\n\n // Find current index of the field (if not defined)\n let i = obj.i !== undefined ?\n obj.i : obj.p.indexOf(obj.v)\n\n if (i !== -1) {\n this.Vue.$delete(obj.p, i)\n }\n\n }\n\n this.update_ids()\n }", "title": "" }, { "docid": "93fe038d19e11157a41001db21a3c587", "score": "0.50631416", "text": "function checkIntegrity(tx) {\n sync.log.trace(\"Entering healingWoundSteps.createAll->checkIntegrity\");\n arrayLength = valuesArray.length;\n for (var i = 0; valuesArray != null && i < arrayLength; i++) {\n var relationshipMap = {};\n relationshipMap = healingWoundSteps.getRelationshipMap(relationshipMap, valuesArray[i]);\n errObject = kony.sync.checkIntegrityinTransaction(tx, relationshipMap, null);\n if (errObject === false) {\n isError = true;\n return;\n }\n if (errObject !== true) {\n isError = true;\n isReferentialIntegrityFailure = true;\n return;\n }\n }\n }", "title": "" }, { "docid": "de35ab277d1c696fbaefc1d86d78428e", "score": "0.50630796", "text": "delete(id) {\n let index = this.internal.findIndex((test) => test.id === id);\n if (index !== -1) {\n this.internal.splice(index, 1);\n }\n return new Promise((success, error) => {\n if (index === -1) {\n error(new Error(\"[LocalDB] Failed to find item with id \" + id ));\n } else {\n success()\n }\n });\n }", "title": "" }, { "docid": "527b6c7ea09541172b38c353ada8eb69", "score": "0.5057446", "text": "clear() {\n // Call onRemove on all components of all entities\n for (const { data } of this.entities.values()) {\n for (const componentName in data) {\n invoke(data[componentName], 'onRemove')\n }\n }\n\n // Clear entities\n this.entities.clear()\n this.index.clear()\n }", "title": "" }, { "docid": "5c94992b092bddb0e5d130261f2e8c80", "score": "0.5052518", "text": "async delete() {\n log.debug(\"Entity.delete()\");\n\n try {\n let instance = await this.constructor.db_adapter.delete(this);\n this.id = null;\n } catch (e) {\n log.error(e);\n throw e;\n }\n }", "title": "" }, { "docid": "b7dd69c1f4b27ab0dbc7b8b6ebb10b97", "score": "0.5049186", "text": "function checkDatabase() {\nconst budget = indexeddatabase.transaction(['pending'], 'readwrite');\nconst data = budget.objectStore('pending');\nconst read = data.getAll();\n\n//gets transaction objects from the client storage, makes post request, stringifies the object\nread.onsuccess = function () {\n\nif (read.result.length > 0) {\n\nfetch(\"/api/transaction/bulk\", {\nmethod: \"POST\", \nbody: JSON.stringify(getAll.result),\nheaders: {\nAccept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => response.json())\n .then(()=> {\n// accesses the indexeddb objects containing uploaded updates and deletes them\n\n const budget = indexeddatabase.transaction([\"pending\"], \"readwrite\");\n const data = budget.objectStore(\"pending\");\n\n data.clear();\n });\n }\n };\n}", "title": "" }, { "docid": "f2c3776bc77b04bcca106de441bb8473", "score": "0.5048023", "text": "function deleteMultiple() {\n\n var listId = [];\n $.each($scope.selected, function (index, item) {\n listId.push(item.ID);\n });\n\n var config = {\n params: {\n checkedStudents: JSON.stringify(listId)\n }\n };\n apiService.del('/api/students/deletemulti',\n config,\n (result) => {\n notificationService.displaySuccess('Xóa thành công ' + result.data + ' sinh viên');\n search();\n },\n (failure) => {\n notificationService.displayError('Xóa các sinh viên trên thất bại');\n });\n }", "title": "" }, { "docid": "46a90251bc4c5e41cf7cf2d31dfc5db4", "score": "0.5047508", "text": "function RemoveAllEntities(){\n var ents = scene.GetEntitiesWithComponent('EC_DynamicComponent');\n for (i = 0; i<ents.length; i++)\n {\n scene.RemoveEntity(ents[i].Id()); \n }\n \n console.LogInfo(\"Executing the funtion of removing all entities\")\n}", "title": "" }, { "docid": "bb4e85637209f96a82f9b932ded13220", "score": "0.50438774", "text": "mergeSaveDeletes(keys, collection, mergeStrategy) {\n mergeStrategy =\n mergeStrategy == null ? MergeStrategy.OverwriteChanges : mergeStrategy;\n // same logic for all non-ignore merge strategies: always clear (commit) the changes\n const deleteIds = keys; // make TypeScript happy\n collection =\n mergeStrategy === MergeStrategy.IgnoreChanges\n ? collection\n : this.commitMany(deleteIds, collection);\n return this.adapter.removeMany(deleteIds, collection);\n }", "title": "" }, { "docid": "61bc5fa879008d9a7c15be1b780dab3f", "score": "0.5037779", "text": "deleteAvailable () {\n return this.index !== 0\n }", "title": "" }, { "docid": "3c8cd5ed7985fabe6d8086b26d83ef9e", "score": "0.50329787", "text": "function te(t, n, i) {\n var e = t.store(Ne.store), r = t.store(Oe.store), u = [], s = IDBKeyRange.only(i.batchId), o = 0, h = e.Ss({\n range: s\n }, (function(t, n, i) {\n return o++, i.delete();\n }));\n u.push(h.next((function() {\n A(1 === o, \"Dangling document-mutation reference found: Missing batch \" + i.batchId);\n })));\n for (var c = [], a = 0, f = i.mutations; a < f.length; a++) {\n var l = f[a], d = Oe.key(n, l.key.path, i.batchId);\n u.push(r.delete(d)), c.push(l.key);\n }\n return Bi.Wu(u).next((function() {\n return c;\n }));\n}", "title": "" }, { "docid": "9c8dccc9503cc2c24095af2740cfe60c", "score": "0.5032781", "text": "async deletePositions (req, res) {\n const {id} = req.body\n try {\n EmployeePosition.destroy({\n where: {\n id: id\n }\n })\n const item = await EmployeePosition.findAll({\n })\n res.send(item)\n } catch (err) {\n res.status(500).send({\n error: 'An error has occured during deleting'\n })\n }\n }", "title": "" }, { "docid": "0ad408462dbeaa9a3270cbfffccd0910", "score": "0.5028365", "text": "function deletedids(id,el)\n {\n deletedidarray.push(id);\n console.log(id);\n console.log(deletedidarray);\n $(el).closest(\"tr\").remove();\n calculates();\n return false;\n }", "title": "" }, { "docid": "eb1fc1c6d448a452ec99e055dc5beccb", "score": "0.5021758", "text": "static deleteFromAll(id) {\n let goals = Goal.all()\n for (var i = 0; i < goals.length; i++) {\n if (goals[i].id === parseInt(id)) {\n allGoals.splice(i,1)\n }\n }\n }", "title": "" }, { "docid": "1e4b2580cdf4ea9f1dd15b6c2f9bf5a1", "score": "0.5013634", "text": "deleteItem(id) {\n const { items } = this.state\n\n items.forEach((item, index) => {\n if (item.id === id) {\n items.splice(index, 1)\n }\n })\n\n this.setState({items})\n this.storeLocal()\n }", "title": "" }, { "docid": "89724f01eb036fb96fc628cdc818822d", "score": "0.5003705", "text": "remove(i) {\n this.entities.splice(i, 1);\n }", "title": "" }, { "docid": "4b15f82cc9a856734873826d685c4def", "score": "0.49987864", "text": "function common_delete(eid) {\n pim_delete(eid)\n}", "title": "" }, { "docid": "093a003531240da2378085de7eb8f172", "score": "0.499842", "text": "function checkIntegrity(tx) {\n sync.log.trace(\"Entering com.healogics.offline.appListOffline.createAll->checkIntegrity\");\n arrayLength = valuesArray.length;\n for (var i = 0; valuesArray != null && i < arrayLength; i++) {\n var relationshipMap = {};\n relationshipMap = com.healogics.offline.appListOffline.getRelationshipMap(relationshipMap, valuesArray[i]);\n errObject = kony.sync.checkIntegrityinTransaction(tx, relationshipMap, null);\n if (errObject === false) {\n isError = true;\n return;\n }\n if (errObject !== true) {\n isError = true;\n isReferentialIntegrityFailure = true;\n return;\n }\n }\n }", "title": "" }, { "docid": "a535c0c805a2db1148be1c00f965a0ae", "score": "0.49934986", "text": "erase() {\n let sql = 'DELETE FROM ' + this._.table + ' WHERE id = $id'\n let params = { id: this.id }\n let { changes, lastInsertRowid } = DB.run(sql, params)\n // return this.find(this.id)\n }", "title": "" }, { "docid": "cd267c2b3c9ac49ae8924c3a6de60f42", "score": "0.4993403", "text": "delete() {\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 0 }));\n }", "title": "" }, { "docid": "d30aac367e38128946224be7d45b9dff", "score": "0.4986168", "text": "async function verifyFoodItemIds(foodItemIds) {\n await Promise.all(\n foodItemIds.map(_id => {\n if (!mongoose.Types.ObjectId.isValid(_id)) {\n throw new BadRequestError(`${_id} is not a valid foodItem _id`)\n }\n return Food.count({ 'items._id': _id }).then(count => {\n if (!count) throw new BadRequestError(`foodItem ${_id} was not found in the database`)\n })\n })\n )\n}", "title": "" }, { "docid": "9cfbab1d0ac1cb0a2d28f21a78c08cb7", "score": "0.49825096", "text": "@action spliceModels(ids = []) {\n ids.forEach((id) => {\n const model = this.getModel(id);\n if (!model) return;\n\n this.models.splice(this.models.indexOf(model), 1);\n })\n }", "title": "" }, { "docid": "54bb01bab69c34320099fb09639daaf8", "score": "0.49745068", "text": "removeMinitask(id) {\n const fight_minitask_temp = this.state.fight_minitask;\n var i = -1;\n\n fight_minitask_temp.forEach((minitask, index) => {\n if (id.isNew === true) {\n if (minitask.id === id.id) {\n console.log(minitask.id);\n i = index;\n }\n }\n else if (id.isNew === undefined && id.id === minitask.id) {\n // call api here\n axios.delete(`http://localhost:8081/api/v1/curd/delminitask/${this.state.id}/${id.id}`).then(res => {\n fight_minitask_temp.splice(i, 1);\n this.setState({ fight_minitask: fight_minitask_temp });\n this.props.enqueueSnackbar('Xóa thành công', {\n variant: 'success',\n });\n });\n }\n });\n console.log(i);\n if (i !== -1) {\n fight_minitask_temp.splice(i, 1);\n this.setState({ fight_minitask: fight_minitask_temp });\n }\n }", "title": "" }, { "docid": "ef32edd2d17a98716ccfe64df32d8b8f", "score": "0.49721858", "text": "triggerDelete() {\n let selected = this.collection.where({\n markedForDelete: true\n });\n if( !selected.length ){\n return;\n }\n if (window.confirm('You sure you wanna delete? ' + selected.length)) {\n if (typeof this.collection.batchDelete != 'undefined') {\n this.collection.batchDelete(selected);\n this.$('[type=\"checkbox\"]').prop('checked', false);\n }\n }\n }", "title": "" }, { "docid": "a2a08e20fa75ab2f0349e2eb82a864ed", "score": "0.49706516", "text": "handleDelete(id) {\n const newTodos = this.state.todos.filter((todo) => {\n return todo.id !== id;\n });\n this.setState({ todos: newTodos }, this.saveTodos);\n }", "title": "" }, { "docid": "efaa27d2a06a6f39bcaefe4403010877", "score": "0.4962363", "text": "function deleteAllContacts(callback){\n myDB.transaction(function(transaction) {\n myDB.executeSql('DELETE FROM contactsEphemeralKeys', [], function (resultSet) {\n console.log(\"removed all ephemeral keys, table 'contactsEphemeralKeys'.\");\n ephemeralKeysContactsList.splice(0,ephemeralKeysContactsList.length);\n\n myDB.transaction(function(transaction) {\n myDB.executeSql('DELETE FROM contactsData', [], function (resultSet) {\n console.log(\"removed all contacts table 'contactsData'.\");\n contactsList.splice(0,contactsList.length);\n callback();\n }, function(error) {\n console.log(\"Error in DELETE all contacts, table 'contactsData': \" + error.message);\n });\n });\n\n }, function(error) {\n console.log(\"Error in DELETE all contacts, table 'contactsEphemeralKeys': \" + error.message);\n });\n });\n}", "title": "" }, { "docid": "4b9fca674886f62aea99eb1e74b63e6b", "score": "0.49569592", "text": "reset() {\n this.entitiesService.reset();\n }", "title": "" }, { "docid": "46cecbedc35eb2ebe29a44e7ff0dd255", "score": "0.494916", "text": "function fn(t, e, n) {\n var r = t.store(Vn.store), i = t.store(On.store), o = [], s = IDBKeyRange.only(n.batchId), u = 0, a = r.Vo({\n range: s\n }, (function(t, e, n) {\n return u++, n.delete();\n }));\n o.push(a.next((function() {\n _e(1 === u);\n })));\n for (var h = [], c = 0, f = n.mutations; c < f.length; c++) {\n var l = f[c], p = On.key(e, l.key.path, n.batchId);\n o.push(i.delete(p)), h.push(l.key);\n }\n return Ve.Kn(o).next((function() {\n return h;\n }));\n}", "title": "" }, { "docid": "1193d7cc15f5e35f3a7a0f0858130637", "score": "0.4947756", "text": "function verifyQueuedDeletions() {\n\t\t// Loop through all guilds the bot is in.\n\t\tbot.guilds.forEach((guild, guild_id) => {\n\t\t\tclearDeletion(guild_id);\n\t\t});\n\t}", "title": "" }, { "docid": "bf617447ca0a094ef46a79bbb83d8cd3", "score": "0.49453127", "text": "function deleteViolations() {\n return true;\n}", "title": "" }, { "docid": "3e5102353e81b9f3a417ae5e7b24952e", "score": "0.49357003", "text": "async function _delete(ids) {\n const requestConfig = {\n // headers: authHeader()\n };\n const promises = await ids.map((id) => {\n return axios.delete(`/api/payments/${id}`, requestConfig);\n });\n return Promise.all(promises).then(handleResponse);\n}", "title": "" }, { "docid": "ce00beb03ae26f3a2239a1d810a5bb0e", "score": "0.49322832", "text": "remove() {\n\t\tqueued_entities_for_removal.push(this.id);\n\t}", "title": "" }, { "docid": "e0c11b05e33fd16a4d9dad397a5e6be3", "score": "0.49319494", "text": "function clearIndexedDB() {\n $log.debug('clearing indexxeddb');\n var defer = $q.defer();\n /////////////////////////////////\n $indexedDB.openStore('student', function (studentStore) {\n studentStore.clear().then(function () {\n $indexedDB.openStore('class', function (studentStore) {\n studentStore.clear().then(function () {\n $indexedDB.openStore('route', function (studentStore) {\n studentStore.clear().then(function () {\n defer.resolve();\n });\n });\n });\n });\n });\n });\n return defer.promise;\n\n }", "title": "" }, { "docid": "5573fa4c01fa358af9152d628397cada", "score": "0.4927854", "text": "deleteCourse(i, j) {\n this.x = this.x.filter(e => e !== i);\n this.exist = this.exist.filter(e => e !== j);\n }", "title": "" }, { "docid": "07ac81a1d2c2a165f58ec59a0e27fd34", "score": "0.49257943", "text": "stateDeleted() {\n let rightSel = this.rightSelected;\n rightSel.forEach(right => {\n this.rightSelections = util.removeElementFromArray(this.rightSelections, right);\n }); \n }", "title": "" }, { "docid": "36e89ee0e94fb6473354a95a36326d81", "score": "0.491999", "text": "static clear() {\n _entities = [];\n }", "title": "" }, { "docid": "5de6c61949379a0ce4eda6a5f65d5ff1", "score": "0.49173602", "text": "async function deleteChronicHealthIssue(ids) {\r\n const [ results ] = await mysqlPool.query(\r\n 'DELETE FROM chronichealth WHERE chronicId=? AND userId=?',\r\n [ids.chronicId, ids.userId]\r\n );\r\n\r\n if(results.affectedRows == 0) {\r\n throw new Error(\"No chronic health issue was deleted\");\r\n }\r\n\r\n return results.affectedRows;\r\n}", "title": "" }, { "docid": "712ec019621b2794cb6352608a90834c", "score": "0.49153763", "text": "filterEntities(entities) {\n const cleanEntities = entities.slice(0);\n entities.forEach((entity) => {\n if ('children' in entity) {\n entity['children'].forEach((child) => {\n const spanStart = child.span.start;\n const spanEnd = child.span.end;\n let removeIndex = -1;\n cleanEntities.forEach((cleanEntity, index) => {\n if ((cleanEntity.span.start === spanStart) && (cleanEntity.span.end === spanEnd)) {\n removeIndex = index;\n }\n });\n cleanEntities.splice(removeIndex, 1);\n });\n }\n });\n\n return cleanEntities;\n }", "title": "" }, { "docid": "34ac6b95cb7f4e081c58c714caf5a51c", "score": "0.49144807", "text": "deleteAll() {\n let sqlRequest = \"DELETE FROM trade\";\n return this.commonService.runWithoutParams(sqlRequest);\n }", "title": "" }, { "docid": "7434976b81a419ebcf4d04c0cbf3077f", "score": "0.49143875", "text": "async deleteAll() {\n await this.selectAll();\n await this.deleteSelection();\n }", "title": "" }, { "docid": "dd939bcafe736fb7fdaf63ef07d7326a", "score": "0.49079522", "text": "function deleteEntity(id) {\n console.log('delete ' + id);\n return oasis.deleteEndpoint(id, true);\n }", "title": "" }, { "docid": "131754f21f29e2e3954b90dd35f8479f", "score": "0.49030656", "text": "unindexModel(model, opts = {}) {\n const searchTableName = `${model.constructor.name}Search`;\n const sql = (\n `DELETE FROM \\`${searchTableName}\\` WHERE \\`${searchTableName}\\`.\\`rowid\\` = ?`\n );\n const query = this._query(sql, [model.searchIndexId]);\n if (opts.isBeingUnpersisted) {\n return query;\n }\n return query.then(() => {\n model.isSearchIndexed = false;\n model.searchIndexId = 0;\n return this.inTransaction((t) => t.persistModel(model, {silent: true, affectsJoins: false}))\n });\n }", "title": "" }, { "docid": "9cb9a680e8c8ba9de14afe3d9f2a2d5a", "score": "0.49006096", "text": "async checkTagsForRemoval() {\n await this.knex.raw(\n `DELETE FROM tags WHERE ID in (select tags.id from tags\n left join level_tags on tags.id=tag_id\n left join levels on level_tags.level_id=levels.id\n where (admin_id is null or type is null or type='')\n and tags.guild_id=:guild_id\n group by tags.id\n having count(level_id)=0);`,\n { guild_id: this.team.id },\n );\n }", "title": "" }, { "docid": "e8498ed8e372912f1955c0c117a02908", "score": "0.48994058", "text": "async function syncToServer() {\n if (db) {\n return new Promise((resolve, reject) => {\n console.log('in db sync');\n\n var objectStore = db.transaction(\"transactions\", \"readonly\").objectStore(\"transactions\");\n var getObject = objectStore.getAll();\n getObject.onsuccess = (e) => {\n var data = e.target.result;\n console.log('data length', data.length);\n if (data.length) {\n // sync it to server\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\"\n }\n }).then(response => {\n return response.json();\n })\n .then(async (response) => {\n var os = db.transaction(\"transactions\", \"readwrite\").objectStore(\"transactions\");\n for (let ids of data) {\n\n await os.delete(ids.id);\n\n }\n resolve();\n });\n\n }\n };\n\n });\n\n }\n}", "title": "" }, { "docid": "b5a2dc8ec5ee4dbd3c130636824dc81f", "score": "0.48988742", "text": "deleteArticle(id) {\n axios({\n method:'get',\n baseURL: `/api/delete/${id}`,\n }).then(response => {\n // update state accordingly\n this.setState({\n savedData: this.state.savedData.filter(article => {\n return article._id !== response.data._id\n })\n })\n })\n }", "title": "" } ]
54a48a31c1243bc6f0ae0eb03f7398da
For the private fuctions below.
[ { "docid": "045b97cea47e8b8d1372bdbc6aa76a83", "score": "0.0", "text": "function findValidLink(links) {\r\n if (typeof that.isValidLink == \"undefined\") { return links.iterateNext(); }\r\n while (link = links.iterateNext()) {\r\n if (that.isValidLink(link)) { return link; }\r\n }\r\n return null;\r\n }", "title": "" } ]
[ { "docid": "4f1b399154edaf560218b25a2834fdc3", "score": "0.71358085", "text": "function __b_aPxD_aAgzT_aoP7hbI6qzoA(){}", "title": "" }, { "docid": "a91589e45fdcfec6caa9f5350e11949b", "score": "0.63920593", "text": "function internalPrivateThing() {}", "title": "" }, { "docid": "a91589e45fdcfec6caa9f5350e11949b", "score": "0.63920593", "text": "function internalPrivateThing() {}", "title": "" }, { "docid": "cc93fda6e9ad8cc897427b9884256c08", "score": "0.6365189", "text": "function Tq_aQrwWh_bD_aBOiNIUcEaAg(){}", "title": "" }, { "docid": "b7084992218bc4aa6aadb80055d427e6", "score": "0.63525844", "text": "function _4Xmw8hHFnzuUOt7IaRLq5g() {}", "title": "" }, { "docid": "55e69873cf40db9669a84067c1cae1ec", "score": "0.63349885", "text": "privateMethod() {\n\t}", "title": "" }, { "docid": "72148348f3c9fc01fea10d1f8cbd4c7b", "score": "0.622713", "text": "function _3RhvcSQcujmOU5OTLoz_bAw(){}", "title": "" }, { "docid": "f7137ffc8b0bae68104fc80452a6776c", "score": "0.62209916", "text": "function _5wzrP2I6Vj2DJL7jzmH7UA(){}", "title": "" }, { "docid": "02fa778cd91a8f24b9d2e74c73b817f2", "score": "0.60778433", "text": "function exPublicFunction() {\n\n }", "title": "" }, { "docid": "453590f416f6ca0b8b269e834a16236c", "score": "0.60508496", "text": "function _72a4Z_bbNkT6_bTngQiji06g() {}", "title": "" }, { "docid": "0f0a4acb856b60b4d8ba740e21538373", "score": "0.59928876", "text": "function somePrivateFunction() {\n return 0;\n }", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.59604824", "text": "function miFuncion(){}", "title": "" }, { "docid": "7bc549bf91aa349cd177ae89ecffa165", "score": "0.5900176", "text": "function __aA8B_bDuuKzS7s5Os_bGMgRg(){}", "title": "" }, { "docid": "87ba02b8aaf08d9aa81a0f67132bcd25", "score": "0.5872248", "text": "function _2WIz9js3_aTyRRmQlZHHvZA() {}", "title": "" }, { "docid": "c9ff6235cea21e159b922cc4ed21c9e9", "score": "0.58585846", "text": "function modulePrivateMethod () {\n return;\n }", "title": "" }, { "docid": "124d57cfa1bf618a4334cf035f93eff8", "score": "0.5793922", "text": "function _myPrivateMethod1(){\n\t\t\t\t//use private variables here\n\t\t\t\t//use other private methods here\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "a92e7a566c0693bfee0f0aa764c85102", "score": "0.57894653", "text": "function accessesingData2() {\n\n}", "title": "" }, { "docid": "fb631b0bc2a50b52753afa5b26a0e266", "score": "0.5723308", "text": "function _13hooBu1eDGj1gno_aSkb0Q(){}", "title": "" }, { "docid": "aa822b17c74d59661da6d83fde5803e4", "score": "0.5706724", "text": "function G_bjM0hfvuj_amn1p32jmFYA(){}", "title": "" }, { "docid": "4d99c88c1fb22bbe7f77757417b4292b", "score": "0.56852454", "text": "function DrunkBug() {}", "title": "" }, { "docid": "5d5a5f1710d259d9ffacba41ea29fd3b", "score": "0.5683334", "text": "function d6GxjiFzuj6fvDIOQUJw3g(){}", "title": "" }, { "docid": "1c074b3374528445a62f7e78c2ed1344", "score": "0.5678102", "text": "adoptedCallback() {\n // This is difficult to call, so just cut out and explain\n }", "title": "" }, { "docid": "754d9ba96f328f849728df6789482bd0", "score": "0.5642375", "text": "function HApm8NWjVjKNbQVa1DQvlA(){}", "title": "" }, { "docid": "25ac8d9faa59873fe67c135beaa7a59c", "score": "0.5636388", "text": "publicMethod() {\n privateMethod();\n }", "title": "" }, { "docid": "1216ec01813738d4ee4cd8f1168d7d5d", "score": "0.5631911", "text": "function si_aJsJefrT69C_af6ilPj8w(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.56287134", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.56287134", "text": "function dummy(){}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.5593386", "text": "function StupidBug() {}", "title": "" }, { "docid": "f1680a05103b2e7f42a693c6b987dab2", "score": "0.55909014", "text": "adoptedCallback() { }", "title": "" }, { "docid": "548f46587d6c081b69fd414afd18c3a5", "score": "0.5585551", "text": "function CuiBJb0tGju_bjvSOrtaPxw(){}", "title": "" }, { "docid": "5330c402aafba5eec6be477f4407e8fd", "score": "0.55683124", "text": "compilable() {}", "title": "" }, { "docid": "3926c21f8aef5209978106c9da6755d2", "score": "0.5565689", "text": "function O_bNDlbJ2ujuPrR_aM4Me_b7Q() {}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.554611", "text": "_map_data() { }", "title": "" }, { "docid": "89bd62737a039f89bd61af6984d7ce56", "score": "0.5541917", "text": "function zyUuCZDtHja_aHv7uHGvtZg(){}", "title": "" }, { "docid": "eb377607ebb19e4a5c680b18f7ac0458", "score": "0.55406463", "text": "apply () {}", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.5540638", "text": "initalizing() {}", "title": "" }, { "docid": "8bf132bc310b72746ac4afb7aa87f26c", "score": "0.5534169", "text": "function lVjjMls5mTqNefK7rKv6qA(){}", "title": "" }, { "docid": "443a4e8241f3ecb23c648894b4261ed7", "score": "0.5515962", "text": "function Di3A8FBIvzOP0yiHovphNQ(){}", "title": "" }, { "docid": "99887cfa05a00086b07d845eca9d2007", "score": "0.54954", "text": "_validate() {}", "title": "" }, { "docid": "3e7e9e9646f88550fefad4316e69e379", "score": "0.54530275", "text": "function kbGTuVSCBjenekexrWe7fA() {}", "title": "" }, { "docid": "bdedde63a1be9eb502d9e699e12dab47", "score": "0.5449874", "text": "function _8m8ZRZANjTuLQkDC_aWckyw(){}", "title": "" }, { "docid": "5da2ac73938a608dad38243d254bb9ff", "score": "0.5449246", "text": "function _PrivateHelper(){\n // This has access to all functions and variables defined in the app.\n }", "title": "" }, { "docid": "1be679293f35b4319a2549ddf30d54a0", "score": "0.5442077", "text": "function __f_0() {\n}", "title": "" }, { "docid": "74c95495bc802c660f5d96993c1ca78c", "score": "0.5440646", "text": "function QJjz4emwkTGj_buhVyJ1fzg(){}", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.5435293", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "cb099bee189b07ea48232749eddccb3d", "score": "0.5425091", "text": "function somePublicFunction() {\n return somePrivateFunction();\n }", "title": "" }, { "docid": "230a1a85fbb44f3ae2141174d67aee94", "score": "0.542493", "text": "function _6kOHfpBS4TyQ1xYz4_b0B_aQ(){}", "title": "" }, { "docid": "429375ce5fe932cb0bee084580279168", "score": "0.5403773", "text": "function LYPmBuEI4DO8eD3uAJTIog() {}", "title": "" }, { "docid": "5b756884f32ffa07b5f630af6ebc7bef", "score": "0.5402298", "text": "function dummy() { }", "title": "" }, { "docid": "5b756884f32ffa07b5f630af6ebc7bef", "score": "0.5402298", "text": "function dummy() { }", "title": "" }, { "docid": "a03f27cea0cf0d7d27c9b5d480b6f189", "score": "0.540047", "text": "function vxNj6H8VFjKwXIdd_aik3Tg() {}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5399805", "text": "apply() {}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5399805", "text": "apply() {}", "title": "" }, { "docid": "23a387904edf2ce203edf092bafcc8d9", "score": "0.5392947", "text": "function grNiReJK1jaWHkGfTZVH_aw() {}", "title": "" }, { "docid": "24cdb3283cf3d715dd0ace3a5a17b572", "score": "0.53816473", "text": "function JFipocK4njiaqk0rCNLIuQ(){}", "title": "" }, { "docid": "c80c4e0573b6cd209ecd7e948dba188d", "score": "0.53780013", "text": "function privateMethod() {\n console.log('im private')\n }", "title": "" }, { "docid": "ec0b97f6406951af6b99eabede603cc1", "score": "0.53768027", "text": "function wi(){}", "title": "" }, { "docid": "1129d02f87a82ee394e5d0903181169c", "score": "0.53761244", "text": "function missing(){}", "title": "" }, { "docid": "f4bb834c5e1b55c51ea7eda44e309b8b", "score": "0.53729695", "text": "function InnerloLite() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5367397", "text": "function Interfaz() {}", "title": "" }, { "docid": "1aa44846a035b10a6476a411403abae7", "score": "0.53544205", "text": "function TTEaihOoHTCT8R6eM8B9OA(){}", "title": "" }, { "docid": "abd1da2716d25449a34551b9e1f0e338", "score": "0.5352131", "text": "function oq_bX7lmqRzCnqwl2dS1RuA() {}", "title": "" }, { "docid": "cea499dc3aaedb0a9367dcfbe002cc75", "score": "0.53509665", "text": "function PuOVUxoA0DGnMJJYXJ28Ww(){}", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.53502965", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "a86694908751f208d75fe53d74acd36f", "score": "0.5344453", "text": "function dothis(){}", "title": "" }, { "docid": "7006832e646e4b2214ae75621a32624e", "score": "0.53368926", "text": "\n (){}", "title": "" }, { "docid": "31a6aa850776e5d4306ff16e7e094f33", "score": "0.5329257", "text": "doSomething() {\n doSomethingPrivate();\n }", "title": "" }, { "docid": "66fe60e0a1f675f24eb100b2156801c2", "score": "0.532453", "text": "function accessesingData1() {\n\n}", "title": "" }, { "docid": "368167e370df6b0836bc47c4a1cf7a9c", "score": "0.5323431", "text": "beforeApply() {}", "title": "" }, { "docid": "bce951297c5b319f0d534706bec70de7", "score": "0.5320413", "text": "function inner() {\n\n }", "title": "" }, { "docid": "b74e36c1f41bce9bec27ad61a01c8853", "score": "0.5318988", "text": "function Ad3CJ05Oejy4H774J7A_bGw(){}", "title": "" }, { "docid": "62a1192cad355ea810d8407179e99d96", "score": "0.5317229", "text": "function Fc(){}", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.53093684", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "763d400babd390a21eed82d6bcc48566", "score": "0.5301889", "text": "function OLwjhGKG5DiKtx5Fu3WzmQ() {}", "title": "" }, { "docid": "46d5b421a3f263f051d4f224a73e9936", "score": "0.5300707", "text": "function yFUu8VEDUzGdSSSuDXxzRw(){}", "title": "" }, { "docid": "e8c1c847b4491ff007d133fbaa7e7482", "score": "0.5286466", "text": "function iFt4NhK0gzebfKqSkNHliw() {}", "title": "" }, { "docid": "f1dee0844c297518222694a85f068875", "score": "0.52760476", "text": "function chorus_obj() {\n\t\n}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5263482", "text": "prepare() {}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.52608335", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.52608335", "text": "function ba(){}", "title": "" }, { "docid": "b9e58e809d551b7296508526348507bc", "score": "0.52537906", "text": "function mQjg8rO4UDiFI8E7Q7Xi4Q(){}", "title": "" }, { "docid": "70b787cabe9bf540d79c8d9dd6977ba6", "score": "0.52522075", "text": "function privateFunction ( ) { \n alert ( \" : [privateFunction] \" ) ; \n alert ( \" The private method has accessed the private field: [privateField1 = '\" +privateField1 + \"']\" ) ; \n alert ( \"The private method has accessed the public field: [publicField1 = '\" + this . publicField1 + \"']\" ) ; \n return true ; \n }", "title": "" }, { "docid": "f2a0c15987e7d312313e817baec492bc", "score": "0.5245883", "text": "function _G() {}", "title": "" }, { "docid": "f2a0c15987e7d312313e817baec492bc", "score": "0.5245883", "text": "function _G() {}", "title": "" }, { "docid": "d057b392ca48690551c61f2b21fd1ad2", "score": "0.52429867", "text": "function wi() {}", "title": "" }, { "docid": "b424ac1819653d498557ad9aba593bd2", "score": "0.52416784", "text": "_reset() {\n return;\n }", "title": "" }, { "docid": "61739e9a2a2b90cb2ac4c2b987937f47", "score": "0.5222644", "text": "getCreepNeeded() {\r\n \r\n }", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5220871", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5220871", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "360e1617933b4dc8613331d30274d701", "score": "0.5218672", "text": "adoptedCallback() {\n\n }", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.52182364", "text": "function dummy() {}", "title": "" }, { "docid": "f00367f0a1027d490e31e8e35afa9693", "score": "0.52151227", "text": "function Squarer() {\n }", "title": "" }, { "docid": "57a87bbd19e8c5148e4a201f575243f1", "score": "0.52065", "text": "static aye(){\n return 0;\n }", "title": "" }, { "docid": "9bb6a43e5fd274bc5538bc88f1367a97", "score": "0.52057076", "text": "function ZMFJKLS_btTGGHQ9aWbqvTA() {}", "title": "" }, { "docid": "41276a12c06bcbe70588ec2c67251573", "score": "0.5202028", "text": "function OsLA0qVUTjWcyNy4GqFnTQ(){}", "title": "" } ]
88a7c2fd0f617433ae51bbe91bc9e05d
Sets a value in memory in a dynamic way at runtime. Uses the type data. This is the same as makeSetValue, except that makeSetValue is done at compiletime and generates the needed code then, whereas this function picks the right code at runtime. Note that setValue and getValue only do aligned writes and reads! Note that ccall uses JS types as for defining types, while setValue and getValue need LLVM types ('i8', 'i32') this is a lowerlevel operation
[ { "docid": "0f73a1dd9d2c2a9af7b342f4697a7d8a", "score": "0.687866", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" } ]
[ { "docid": "51ad9887ca1a985cdfbd36c871f25508", "score": "0.6991242", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "51ad9887ca1a985cdfbd36c871f25508", "score": "0.6991242", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "51ad9887ca1a985cdfbd36c871f25508", "score": "0.6991242", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "51ad9887ca1a985cdfbd36c871f25508", "score": "0.6991242", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "51ad9887ca1a985cdfbd36c871f25508", "score": "0.6991242", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "42ade45925c95ffa46bc5cfb41834501", "score": "0.6976284", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=((HEAP32[((tempDoublePtr)>>2)])|0),HEAP32[(((ptr)+(4))>>2)]=((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "5f3df2aac1e1e587995444b3c441ac0d", "score": "0.6959169", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "5f3df2aac1e1e587995444b3c441ac0d", "score": "0.6959169", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "5f3df2aac1e1e587995444b3c441ac0d", "score": "0.6959169", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "5f3df2aac1e1e587995444b3c441ac0d", "score": "0.6959169", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "8bd1d15475605c529e00bb1adeb57fc4", "score": "0.6955618", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,((Math.min((+(Math.floor((value)/(+(4294967296))))), (+(4294967295))))|0)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "fd67ba0a7d14ad6587b40ec778f1cfee", "score": "0.69502383", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "fd67ba0a7d14ad6587b40ec778f1cfee", "score": "0.69502383", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "a36e921ef6cd54da1e68600ac7cd16e6", "score": "0.69496226", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[(((ptr)+(4))>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "a36e921ef6cd54da1e68600ac7cd16e6", "score": "0.69496226", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[(((ptr)+(4))>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "51e0c3e4b95f8e001a1c44b5a3d1c306", "score": "0.69418496", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF32[((ptr)>>2)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "84135d80ef83ea005f164a8dba579db1", "score": "0.6924729", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[((ptr+4)>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "84135d80ef83ea005f164a8dba579db1", "score": "0.6924729", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[((ptr+4)>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "e386978eb33363dd8bc2ee0ac7119468", "score": "0.6913483", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "e386978eb33363dd8bc2ee0ac7119468", "score": "0.6913483", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "e386978eb33363dd8bc2ee0ac7119468", "score": "0.6913483", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "b1506634fa02b6e87ca54a3f8a07bebe", "score": "0.68983096", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "b1506634fa02b6e87ca54a3f8a07bebe", "score": "0.68983096", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "dc2cccb5e45b9e823fd2453f1ee7d29e", "score": "0.68702734", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[((ptr)>>0)]=value; break;\n case 'i8': HEAP8[((ptr)>>0)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "ac4807b34178292950962974b0ec30a4", "score": "0.6868596", "text": "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= (+(1)) ? (tempDouble > (+(0)) ? ((Math.min((+(Math.floor((tempDouble)/(+(4294967296))))), (+(4294967295))))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+(4294967296)))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "dbe49e69768bb78b9c6a1da4d59b7e8b", "score": "0.6734642", "text": "function setValue(ptr, value, type) {\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP[ptr]=value;; break;\n case 'i8': HEAP[ptr]=value;; break;\n case 'i16': HEAP[ptr]=value;; break;\n case 'i32': HEAP[ptr]=value;; break;\n case 'i64': HEAP[ptr]=value;; break;\n case 'float': HEAP[ptr]=value;; break;\n case 'double': HEAP[ptr]=value;; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "title": "" }, { "docid": "18b7329879a6f3ae3c1674e2b1f5ef79", "score": "0.55260944", "text": "setFieldValue(field,value){\n\t\tvar valuetype = typeof(value);\n\t\t\n\t\tswitch (valuetype)\n\t\t{\n\t\t\tcase \"number\": eval(\"this.\"+field+\" = \"+value );break;\n\t\t\tcase \"boolean\": eval(\"this.\"+field+\" = \"+value);break;\n\t\t\t// Warning: the string value cannot contains \"'\" at some time, or it\n\t\t\t// will fail.There are some problem in this method\n\t\t\t// so this function only can be used in limit condition.\n\t\t\t// NEVER USE IT in large scale.\n\t\t\tcase \"string\": eval(\"this.\"+field+\" = '\"+value+\"'\" );break;\n\t\t\tcase \"object\": break;\n\t\t\tcase \"function\": break;\n\t\t\tcase \"undefined\": break;\n\t\t}\n\t}", "title": "" }, { "docid": "53956eb85a26501f45f9d4b19941822e", "score": "0.5511235", "text": "setValue(int, string) {\n\n }", "title": "" }, { "docid": "b1a3213a747484bfffcf37ab40e1ea50", "score": "0.5456924", "text": "function Value(type,value) {\n\tthis.type=t[type];\n\tthis.value=value;\n}", "title": "" }, { "docid": "1b121cd13108eee6f115fdc150746f2a", "score": "0.54229546", "text": "function SetValue (id, value) {\r\n Id (id).value = value;\r\n}", "title": "" }, { "docid": "b8a9a80c66871b74a608df38671cd449", "score": "0.53521895", "text": "setValue() {}", "title": "" }, { "docid": "93b13474e2dcf6de1b017a25ce17514e", "score": "0.53267026", "text": "function getPureArraySetter( type ) {\n\n \tswitch ( type ) {\n\n \t\tcase 0x1406: return setValue1fv; // FLOAT\n \t\tcase 0x8b50: return setValueV2a; // _VEC2\n \t\tcase 0x8b51: return setValueV3a; // _VEC3\n \t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n \t\tcase 0x8b5a: return setValueM2a; // _MAT2\n \t\tcase 0x8b5b: return setValueM3a; // _MAT3\n \t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n \t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n \t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n \t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n \t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n \t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n \t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n \t}\n\n }", "title": "" }, { "docid": "ad4bfae4f5dc4f50f29b10e1d7373b4e", "score": "0.53226644", "text": "function setter (index, value) {\n\t debug('setting array[%d]', index)\n\t var size = this.constructor.BYTES_PER_ELEMENT\n\t var baseType = this.constructor.type\n\t var offset = size * index\n\t var end = offset + size\n\t var buffer = this.buffer\n\t if (buffer.length < end) {\n\t debug('reinterpreting buffer from %d to %d', buffer.length, end)\n\t buffer = _ref.reinterpret(buffer, end)\n\t }\n\t // TODO: DRY with getter()\n\n\t _ref.set(buffer, offset, value, baseType)\n\t return value\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "799ff9e3d15ef6e74f3f377761d45e7e", "score": "0.5322387", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "71cef1a55543081d0426080531916df6", "score": "0.53209937", "text": "function getPureArraySetter(type) {\n switch(type){\n case 5126:\n return setValueV1fArray; // FLOAT\n case 35664:\n return setValueV2fArray; // _VEC2\n case 35665:\n return setValueV3fArray; // _VEC3\n case 35666:\n return setValueV4fArray; // _VEC4\n case 35674:\n return setValueM2Array; // _MAT2\n case 35675:\n return setValueM3Array; // _MAT3\n case 35676:\n return setValueM4Array; // _MAT4\n case 5124:\n case 35670:\n return setValueV1iArray; // INT, BOOL\n case 35667:\n case 35671:\n return setValueV2iArray; // _VEC2\n case 35668:\n case 35672:\n return setValueV3iArray; // _VEC3\n case 35669:\n case 35673:\n return setValueV4iArray; // _VEC4\n case 5125:\n return setValueV1uiArray; // UINT\n case 36294:\n return setValueV2uiArray; // _VEC2\n case 36295:\n return setValueV3uiArray; // _VEC3\n case 36296:\n return setValueV4uiArray; // _VEC4\n case 35678:\n case 36198:\n case 36298:\n case 36306:\n case 35682:\n return setValueT1Array;\n case 35680:\n case 36300:\n case 36308:\n case 36293:\n return setValueT6Array;\n }\n}", "title": "" }, { "docid": "5b3227c8a76384c1539b47b388613070", "score": "0.53172684", "text": "function getPureArraySetter( type ) {\r\n\r\n \tswitch ( type ) {\r\n\r\n \t\tcase 0x1406: return setValue1fv; // FLOAT\r\n \t\tcase 0x8b50: return setValueV2a; // _VEC2\r\n \t\tcase 0x8b51: return setValueV3a; // _VEC3\r\n \t\tcase 0x8b52: return setValueV4a; // _VEC4\r\n\r\n \t\tcase 0x8b5a: return setValueM2a; // _MAT2\r\n \t\tcase 0x8b5b: return setValueM3a; // _MAT3\r\n \t\tcase 0x8b5c: return setValueM4a; // _MAT4\r\n\r\n \t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\r\n \t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\r\n\r\n \t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\r\n \t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\r\n \t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\r\n \t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\r\n\r\n \t}\r\n\r\n }", "title": "" }, { "docid": "b5093428f18de91a9ed1a6483aa41944", "score": "0.5313402", "text": "function getPureArraySetter( type ) {\r\n\r\n\t\tswitch ( type ) {\r\n\r\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\r\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\r\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\r\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\r\n\r\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\r\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\r\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\r\n\r\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\r\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\r\n\r\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\r\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\r\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\r\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.5274559", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "2452c5794ea6b7e86d6e993e3699c5cf", "score": "0.52257746", "text": "modifyMemory(memAddr, memValue, memType = \"i32\") {\n const memory = this.memory(memType);\n\n const memIndex = realAddressToIndex(memAddr, memType);\n\n if (memIndex < 0 || memIndex >= memory.length) {\n throw new RangeError(\"Address out of range in Cetus.modifyMemory()\");\n }\n\n memory[memIndex] = memValue;\n }", "title": "" }, { "docid": "04c6dddf3f7313de23b020917d9ca96d", "score": "0.5204381", "text": "function three_module_getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return three_module_setValueV1f; // FLOAT\n\t\tcase 0x8b50: return three_module_setValueV2f; // _VEC2\n\t\tcase 0x8b51: return three_module_setValueV3f; // _VEC3\n\t\tcase 0x8b52: return three_module_setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return three_module_setValueM2; // _MAT2\n\t\tcase 0x8b5b: return three_module_setValueM3; // _MAT3\n\t\tcase 0x8b5c: return three_module_setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return three_module_setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return three_module_setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return three_module_setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return three_module_setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return three_module_setValueV1ui; // UINT\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn three_module_setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn three_module_setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn three_module_setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn three_module_setValueT2DArray1;\n\n\t}\n\n}", "title": "" }, { "docid": "868be03e49c617c45b9b9e986000aed3", "score": "0.51951534", "text": "function memory_set(memory, address, value_array){\n console.log(\"memory_set params: \" + address + \" \" + value_array);\n var memory_array = memory_get_block_bytes(memory, address, value_array.length);\n var offset = address % 4;\n console.log(\"memory_set memory_array: \" + memory_array);\n var j = 0;\n for (var i = offset; i < offset+value_array.length; i++){\n memory_array[i] = value_array[j];\n j += 1;\n }\n var start = Math.floor(address/4);\n var index = start;\n for (var i = 0; i < memory_array.length; i+=4){\n var byte_array = memory_array.slice(i, i+4);\n var value = byte_array_to_integer(byte_array);\n memory[index] = value;\n index += 1;\n }\n}", "title": "" }, { "docid": "6d038f73fcb839804b59b39cb6083469", "score": "0.51772916", "text": "function getSingularSetter(type) {\n switch(type){\n case 5126:\n return setValueV1f; // FLOAT\n case 35664:\n return setValueV2f; // _VEC2\n case 35665:\n return setValueV3f; // _VEC3\n case 35666:\n return setValueV4f; // _VEC4\n case 35674:\n return setValueM2; // _MAT2\n case 35675:\n return setValueM3; // _MAT3\n case 35676:\n return setValueM4; // _MAT4\n case 5124:\n case 35670:\n return setValueV1i; // INT, BOOL\n case 35667:\n case 35671:\n return setValueV2i; // _VEC2\n case 35668:\n case 35672:\n return setValueV3i; // _VEC3\n case 35669:\n case 35673:\n return setValueV4i; // _VEC4\n case 5125:\n return setValueV1ui; // UINT\n case 36294:\n return setValueV2ui; // _VEC2\n case 36295:\n return setValueV3ui; // _VEC3\n case 36296:\n return setValueV4ui; // _VEC4\n case 35678:\n case 36198:\n case 36298:\n case 36306:\n case 35682:\n return setValueT1;\n case 35679:\n case 36299:\n case 36307:\n return setValueT3D1;\n case 35680:\n case 36300:\n case 36308:\n case 36293:\n return setValueT6;\n case 36289:\n case 36303:\n case 36311:\n case 36292:\n return setValueT2DArray1;\n }\n}", "title": "" }, { "docid": "5eb0dbd0dff1577464248a2440cf216d", "score": "0.51747936", "text": "setValue (value) {\n this.value = this.ensureValidValue(value)\n return this.value\n }", "title": "" }, { "docid": "a3b3f287d6d5b6d7c9f9dd20341ae9b8", "score": "0.51516235", "text": "set(value) {\n\t\t\t/*\n\t\t\t\tShow an error if this request is attempting to assign to a value which isn't\n\t\t\t\tstored in the variables or temp. variables.\n\t\t\t\te.g. (set: (a:)'s 1st to 1).\n\t\t\t\tThe identifiers store has a different, better error message produced by canSet().\n\t\t\t*/\n\t\t\tif (this.object && !this.object.TwineScript_VariableStore && !this.object.TwineScript_Identifiers) {\n\t\t\t\treturn TwineError.create(\"macrocall\", \"I can't (set:) \"\n\t\t\t\t\t+ objectName(this)\n\t\t\t\t\t+ \", if the \"\n\t\t\t\t\t+ (objectName(this.object).match(/ (.+$)/) || ['',\"value\"])[1]\n\t\t\t\t\t+ \" isn't stored in a variable.\",\n\t\t\t\t\t\"Modifying data structures that aren't in variables won't change the game state at all.\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tFor each *object*:\n\t\t\t\t- Set the *property* inside the *object* to the *preceding value*\n\t\t\t\t- Make the *object* be the *preceding value*\n\t\t\t*/\n\t\t\treturn mutateRight.call(this, (value, [object, property], i) => {\n\t\t\t\t/*\n\t\t\t\t\tFirst, propagate errors from the preceding iteration, or from\n\t\t\t\t\tcompilePropertyChain() itself.\n\t\t\t\t*/\n\t\t\t\tlet error;\n\t\t\t\tif ((error = TwineError.containsError(value, object, property) || TwineError.containsError(\n\t\t\t\t\t\tcanSet(object, property)\n\t\t\t\t\t))) {\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t\tProduce an error if the value is \"unstorable\".\n\t\t\t\t*/\n\t\t\t\tif (value && value.TwineScript_Unstorable) {\n\t\t\t\t\treturn TwineError.create(\"operation\", typeName(value) + \" can't be stored.\");\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tOnly attempt to clone the object if it's not the final iteration.\n\t\t\t\t*/\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tobject = clone(object);\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tCertain types of objects require special means of assigning\n\t\t\t\t\ttheir values than just objectOrMapSet().\n\n\t\t\t\t\tStrings are immutable, so modifications to them must be done\n\t\t\t\t\tby splicing them.\n\t\t\t\t*/\n\t\t\t\tif (typeof object === \"string\") {\n\t\t\t\t\tif (typeof value !== \"string\" || value.length !== (Array.isArray(property) ? property.length : 1)) {\n\t\t\t\t\t\treturn TwineError.create(\"datatype\", \"I can't put this non-string value, \" + objectName(value) + \", in a string.\");\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t\tConvert strings to an array of code points, to ensure that the indexes are correct.\n\t\t\t\t\t*/\n\t\t\t\t\tobject = [...object];\n\t\t\t\t\t/*\n\t\t\t\t\t\tInsert each character into the string, one by one,\n\t\t\t\t\t\tusing this loop.\n\t\t\t\t\t*/\n\t\t\t\t\tconst valArray = [...value];\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf property is a single index, convert it into an array\n\t\t\t\t\t\tnow through the usual method.\n\t\t\t\t\t*/\n\t\t\t\t\t[].concat(property).forEach(index => {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tBecause .slice treats negative indices differently than we'd\n\t\t\t\t\t\t\tlike right now, negatives must be normalised.\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif (0+index < 0) {\n\t\t\t\t\t\t\tindex = object.length + (0+index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tNote that the string's length is preserved during each iteration, so\n\t\t\t\t\t\t\tthe index doesn't need to be adjusted to account for a shift.\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tobject = [...object.slice(0, index), valArray.shift(), ...object.slice(index+1)];\n\t\t\t\t\t});\n\t\t\t\t\tobject = object.join('');\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t\tOther types of objects simply call objectOrMapSet, once or multiple times\n\t\t\t\t\tdepending on if the property is a slice.\n\t\t\t\t*/\n\t\t\t\telse if (isObject(object)) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf the property is an array of properties, and the value is an array also,\n\t\t\t\t\t\tset each value to its matching property.\n\t\t\t\t\t\te.g. (set: $a's (a:2,1) to (a:2,3)) will set position 1 to 3, and position 2 to 1.\n\t\t\t\t\t*/\n\t\t\t\t\tif (Array.isArray(property) && isSequential(value)) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tDue to Javascript's regrettable use of UCS-2 for string access,\n\t\t\t\t\t\t\tastral plane glyphs won't be correctly regarded as single characters,\n\t\t\t\t\t\t\tunless the following kludge is employed.\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\t\t\tvalue = [...value];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tIterate over each property, and zip it with the value\n\t\t\t\t\t\t\tto set at that property position. For example:\n\t\t\t\t\t\t\t(a: 1) to (a: \"wow\")\n\t\t\t\t\t\t\twould set \"wow\" to the position \"1\"\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tproperty.map((prop,i) => [prop, value[i]])\n\t\t\t\t\t\t\t.forEach(([e, value]) => objectOrMapSet(object, e, value));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tobjectOrMapSet(object, property, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn object;\n\t\t\t}, value);\n\t\t}", "title": "" }, { "docid": "70dddd763cbd9f79c370de49ab742bd7", "score": "0.5145122", "text": "function setTMXValue(value) {\n //console.log(value);\n if (!value || value.isBoolean()) {\n // if value not defined or boolean\n value = value ? (value === \"true\") : true;\n }\n else if (value.isNumeric()) {\n // check if numeric\n value = Number(value);\n }\n else if (value.match(/^json:/i)) {\n // try to parse it\n var match = value.split(/^json:/i)[1];\n try {\n value = JSON.parse(match);\n }\n catch (e) {\n throw \"Unable to parse JSON: \" + match;\n }\n }\n // return the interpreted value\n return value;\n }", "title": "" }, { "docid": "716630415849cc2b2016e2518990f0e8", "score": "0.51076454", "text": "set asymptoteValue(value) {}", "title": "" }, { "docid": "8c2e9eb182cc60d6ef8d39af08a5635e", "score": "0.5062728", "text": "setValue(data) {\n if (data instanceof Object) {\n const dataAsObj = data;\n for (const key in dataAsObj) {\n if (Object.prototype.hasOwnProperty.call(dataAsObj, key)) {\n const value = dataAsObj[key];\n if ((typeof value != \"function\") &&\n (key != \"__proto__\")) {\n const reflection = this.findSubReflectionByName(key);\n if (reflection.initialField.isSection) {\n reflection.setValue(value);\n }\n else if (reflection.initialField.isInput) {\n reflection.setValueExternal(value);\n }\n }\n }\n }\n }\n else {\n }\n }", "title": "" }, { "docid": "ab16670273f1dff594d3f960f115171f", "score": "0.5057902", "text": "set(type, strVal1, strVal2, strVal3) {\r\n this.type = type;\r\n this.strVal1 = strVal1 !== null && strVal1 !== void 0 ? strVal1 : \"\";\r\n this.strVal2 = strVal2 !== null && strVal2 !== void 0 ? strVal2 : \"\";\r\n this.strVal3 = strVal3 !== null && strVal3 !== void 0 ? strVal3 : \"\";\r\n switch (type) {\r\n case ClassWriter.CLASS:\r\n this.intVal = 0; // intVal of a class must be zero, see visitInnerClass\r\n case ClassWriter.UTF8:\r\n case ClassWriter.STR:\r\n case ClassWriter.MTYPE:\r\n case ClassWriter.TYPE_NORMAL:\r\n this.__hashCode = 0x7FFFFFFF & (type + str_hash(this.strVal1));\r\n return;\r\n case ClassWriter.NAME_TYPE: {\r\n this.__hashCode = 0x7FFFFFFF & (type + str_hash(this.strVal1)\r\n * str_hash(this.strVal2));\r\n return;\r\n }\r\n // ClassWriter.FIELD:\r\n // ClassWriter.METH:\r\n // ClassWriter.IMETH:\r\n // ClassWriter.HANDLE_BASE + 1..9\r\n default:\r\n this.__hashCode = 0x7FFFFFFF & (type + str_hash(this.strVal1)\r\n * str_hash(this.strVal2) * str_hash(this.strVal3));\r\n }\r\n }", "title": "" }, { "docid": "679016e4fefaf452ec7ddf1404598a6f", "score": "0.50533307", "text": "SetProperty(int, Variant, Variant) {\n\n }", "title": "" }, { "docid": "c8cfdd19cd15aa0e2599f12873085b5f", "score": "0.5045644", "text": "function TypedNumber(a, type) {\n this.type = (type != undefined) ? type : 'float64';\n var $this = this;\n var checkAndSet = function(t, a) {\n switch (t) {\n case \"int8\":\n if (a < -128 || a > 127) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 1;\n case \"uint8\":\n if (a < 0 || a > 255) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 1;;\n case \"int16\":\n if (a < -32768 || a > 32767) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 2;\n case \"uint16\":\n if (a < 0 || a > 65535) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 2;\n case \"int32\":\n if (a < -2147483648 || a > 2147483647) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 4;\n case \"uint32\":\n if (a < 0 || a > 4294967295) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 4;\n case \"int64\":\n if (typeInstance(a) == 'number') a = new Int64(a);\n else if (!(a instanceof Int64)) throw 'invalid type object';\n $this.value = a;\n return 8;\n case \"uint64\":\n if (typeInstance(a) == 'number') a = new UInt64(a);\n else if (!(a instanceof UInt64)) throw 'invalid type object';\n $this.value = a;\n return 8;\n case \"float32\":\n if (a < -1.40129846432481707e-45 || a > 3.40282346638528860e+38) throw 'invalid numeric range';\n $this.value = new Number(a);\n return 4;\n case \"float64\":\n $this.value = new Number(a);\n return 8;\n default:\n throw 'invalid numeric type \\'' + t + '\\'';\n }\n };\n this.size = checkAndSet(this.type, a);\n\n}", "title": "" }, { "docid": "589f402d6dd7465c45ca0992da583b4f", "score": "0.5042596", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1Array; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6Array; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "8a90972b65e1705f403bbd17c0945f46", "score": "0.500883", "text": "function three_module_getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return three_module_setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return three_module_setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return three_module_setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return three_module_setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return three_module_setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return three_module_setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return three_module_setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return three_module_setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return three_module_setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return three_module_setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return three_module_setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn three_module_setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn three_module_setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "16d5dd1f883768baf5784326a4a49b3a", "score": "0.49872532", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "415f82b8e9c90e1662a1714255aa1f8f", "score": "0.49632555", "text": "function getPureArraySetter(type) {\n\n switch (type) {\n\n case 0x1406:\n return setValueV1fArray; // FLOAT\n case 0x8b50:\n return setValueV2fArray; // _VEC2\n case 0x8b51:\n return setValueV3fArray; // _VEC3\n case 0x8b52:\n return setValueV4fArray; // _VEC4\n\n case 0x8b5a:\n return setValueM2Array; // _MAT2\n case 0x8b5b:\n return setValueM3Array; // _MAT3\n case 0x8b5c:\n return setValueM4Array; // _MAT4\n\n case 0x1404:\n case 0x8b56:\n return setValueV1iArray; // INT, BOOL\n case 0x8b53:\n case 0x8b57:\n return setValueV2iArray; // _VEC2\n case 0x8b54:\n case 0x8b58:\n return setValueV3iArray; // _VEC3\n case 0x8b55:\n case 0x8b59:\n return setValueV4iArray; // _VEC4\n\n case 0x8b5e: // SAMPLER_2D\n case 0x8d66: // SAMPLER_EXTERNAL_OES\n case 0x8dca: // INT_SAMPLER_2D\n case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n case 0x8b62: // SAMPLER_2D_SHADOW\n return setValueT1Array;\n\n case 0x8b60: // SAMPLER_CUBE\n case 0x8dcc: // INT_SAMPLER_CUBE\n case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n case 0x8dc5: // SAMPLER_CUBE_SHADOW\n return setValueT6Array;\n\n }\n\n }", "title": "" }, { "docid": "13eb229b4169a432d79af7c5d5952e94", "score": "0.4932145", "text": "function getSingularSetter(type) {\n\n switch (type) {\n\n case 0x1406:\n return setValueV1f; // FLOAT\n case 0x8b50:\n return setValueV2f; // _VEC2\n case 0x8b51:\n return setValueV3f; // _VEC3\n case 0x8b52:\n return setValueV4f; // _VEC4\n\n case 0x8b5a:\n return setValueM2; // _MAT2\n case 0x8b5b:\n return setValueM3; // _MAT3\n case 0x8b5c:\n return setValueM4; // _MAT4\n\n case 0x1404:\n case 0x8b56:\n return setValueV1i; // INT, BOOL\n case 0x8b53:\n case 0x8b57:\n return setValueV2i; // _VEC2\n case 0x8b54:\n case 0x8b58:\n return setValueV3i; // _VEC3\n case 0x8b55:\n case 0x8b59:\n return setValueV4i; // _VEC4\n\n case 0x1405:\n return setValueV1ui; // UINT\n\n case 0x8b5e: // SAMPLER_2D\n case 0x8d66: // SAMPLER_EXTERNAL_OES\n case 0x8dca: // INT_SAMPLER_2D\n case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n case 0x8b62: // SAMPLER_2D_SHADOW\n return setValueT1;\n\n case 0x8b5f: // SAMPLER_3D\n case 0x8dcb: // INT_SAMPLER_3D\n case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n return setValueT3D1;\n\n case 0x8b60: // SAMPLER_CUBE\n case 0x8dcc: // INT_SAMPLER_CUBE\n case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n case 0x8dc5: // SAMPLER_CUBE_SHADOW\n return setValueT6;\n\n case 0x8dc1: // SAMPLER_2D_ARRAY\n case 0x8dcf: // INT_SAMPLER_2D_ARRAY\n case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n return setValueT2DArray1;\n\n }\n\n }", "title": "" }, { "docid": "7267b63b4ea525b0b70e5b0a6255a896", "score": "0.49077776", "text": "function wrapValue (val, type) {\n var basetype = type.type ? type.type : type;\n if(basetype == '@' || basetype == '#') return createObject(val, basetype);\n else if (basetype == '@?') return createObject(createBlock(val, '@'));\n else if (basetype == '^?') return createUnwrapperFunction(val, type);\n else if (basetype == ':') return objc.sel_getName(val);\n else if (basetype == 'B') return val ? true : false;\n else if (basetype == 'c' && val === 1) return true;\n else if (basetype == 'c' && val === 0) return false;\n else return val;\n }", "title": "" }, { "docid": "160b214660f1e8ad1f0d22f6423442e3", "score": "0.49015293", "text": "function store_operand(desttype, destaddr, val) {\n switch (desttype) {\n case 0:\n return;\n case 1:\n MemW4(destaddr, val);\n return;\n case 2:\n self.frame.locals[destaddr] = val;\n return;\n case 3:\n self.frame.valstack.push(val);\n return;\n default:\n fatal_error(\"Unrecognized desttype in callstub.\", desttype);\n }\n}", "title": "" }, { "docid": "7654bd9cf6defec627f6d7f118b6adf8", "score": "0.48752823", "text": "function setx(path, value, type) { // M.set\n\n\t\t\tif (path instanceof Array) {\n\t\t\t\tfor (var i = 0; i < path.length; i++) \n\t\t\t\t\tsetx(path[i], value, type);\n\t\t\t\treturn this; // M\n\t\t\t}\n\n\t\t\tpath = pathmaker(path);\n\n\t\t\tif (!path) {\n\t\t\t\treturn this; // M\n\t\t\t}\n\n\t\t\tvar is = path.charCodeAt(0) === 33; // !\n\t\t\tif (is) {\n\t\t\t\tpath = path.substring(1);\n\t\t\t}\n\n\t\t\tif (path.charCodeAt(0) === 43) { // +\n\t\t\t\tpath = path.substring(1);\n\t\t\t\treturn push(path, value, type);\n\t\t\t}\n\n\t\t\tif (!path) {\n\t\t\t\treturn this; // M\n\t\t\t}\n\n\t\t\tvar isUpdate = (typeof(value) === 'object' && !(value instanceof Array) && value != null);\n\t\t\tvar reset = type === true;\n\t\t\tif (reset) {\n\t\t\t\ttype = 1;\n\t\t\t}\n\n\t\t\tskipproxy = path;\n\t\t\tset(path, value);\n\n\t\t\tif (isUpdate) {\n\t\t\t\treturn update(path, reset, type, true);\n\t\t\t}\n\n\t\t\tvar result = get(path);\n\t\t\tvar state = [];\n\n\t\t\tif (type === undefined) {\n\t\t\t\ttype = 1;\n\t\t\t}\n\n\t\t\tvar all = view.componenter.components;//M.components;\n\n\t\t\tfor (var i = 0, length = all.length; i < length; i++) {\n\t\t\t\tvar com = all[i];\n\n\t\t\t\tif (!com || com.disabled || com.$removed || !com.$loaded || !com.path || !com.$compare(path))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (com.setter) {\n\t\t\t\t\tif (com.path === path) {\n\t\t\t\t\t\tif (com.setter) {\n\t\t\t\t\t\t\tcom.setterX(result, path, type);\n\t\t\t\t\t\t\tcom.$interaction(type);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (com.setter) {\n\t\t\t\t\t\t\tcom.setterX(get(com.path), path, type);\n\t\t\t\t\t\t\tcom.$interaction(type);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!com.$ready) {\n\t\t\t\t\tcom.$ready = true;\n\t\t\t\t}\n\n\t\t\t\ttype !== 3 && com.state && state.push(com);\n\n\t\t\t\tif (reset) {\n\t\t\t\t\tif (!com.$dirty_disabled)\n\t\t\t\t\t\tcom.$dirty = true;\n\t\t\t\t\tif (!com.$valid_disabled) {\n\t\t\t\t\t\tcom.$valid = true;\n\t\t\t\t\t\tcom.$validate = false;\n\t\t\t\t\t\tif (com.validate) {\n\t\t\t\t\t\t\tcom.$valid = com.validate(result);\n\t\t\t\t\t\t\tcom.$interaction(102);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\thelper.findControl2(com);\n\n\t\t\t\t} else if (com.validate && !com.$valid_disabled) {\n\t\t\t\t\tcom.valid(com.validate(result), true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (reset) {\n\t\t\t\tcache.clear('dirty', 'valid');\n\t\t\t}\n\n\t\t\tfor (var i = 0, length = state.length; i < length; i++) {\n\t\t\t\tstate[i].stateX(type, 5);\n\t\t\t}\n\n\t\t\teventer.emitwatch(path, result, type);\n\t\t\treturn this; // M;\n\t\t}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.48722944", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.48722944", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.48722944", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.48722944", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "f7b15355d96ee069ed1b7a619e5e58f0", "score": "0.4859792", "text": "function set (buffer, offset, value) {\n\t debug('Struct \"type\" setter for buffer at offset', buffer, offset, value)\n\t var isStruct = value instanceof this\n\t if (isStruct) {\n\t // optimization: copy the buffer contents directly rather\n\t // than going through the ref-struct constructor\n\t value['ref.buffer'].copy(buffer, offset, 0, this.size)\n\t } else {\n\t if (offset > 0) {\n\t buffer = buffer.slice(offset)\n\t }\n\t new this(buffer, value)\n\t }\n\t}", "title": "" }, { "docid": "1c050fac36c508ea952dc7130c703fd1", "score": "0.48506957", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "1c050fac36c508ea952dc7130c703fd1", "score": "0.48506957", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "f5d19d75d7411dae65079212ddeb866a", "score": "0.48354295", "text": "function workletValueSetterJS(value) {\n const previousAnimation = this._animation;\n if (previousAnimation) {\n previousAnimation.cancelled = true;\n this._animation = null;\n }\n if (typeof value === 'function' ||\n (value !== null && typeof value === 'object' && value.onFrame)) {\n // animated set\n const animation = typeof value === 'function' ? value() : value;\n let initializeAnimation = (timestamp) => {\n animation.onStart(animation, this.value, timestamp, previousAnimation);\n };\n const step = (timestamp) => {\n if (animation.cancelled) {\n animation.callback && animation.callback(false /* finished */);\n return;\n }\n if (initializeAnimation) {\n initializeAnimation(timestamp);\n initializeAnimation = null; // prevent closure from keeping ref to previous animation\n }\n const finished = animation.onFrame(animation, timestamp);\n animation.timestamp = timestamp;\n this._setValue(animation.current);\n if (finished) {\n animation.callback && animation.callback(true /* finished */);\n }\n else {\n requestFrame(step);\n }\n };\n this._animation = animation;\n requestFrame(step);\n }\n else {\n this._setValue(value);\n }\n}", "title": "" }, { "docid": "95e1eecf16a3a069204cb7923e72ceb2", "score": "0.4829778", "text": "function setNodeOptimizedVal(node, val) {\n node.type = typeof val;\n node.value = val;\n node.wasOptimized = true;\n delete node.left;\n delete node.right;\n}", "title": "" }, { "docid": "9cf201e638501720a551cd13b83ce3c2", "score": "0.48067436", "text": "store (mi, addr, v) { return memstore(0x38, mi, addr, v) }", "title": "" }, { "docid": "c52293a9efcf0167e11a2fa08a6e0b8c", "score": "0.4797249", "text": "set value(value) {\n this.set(value);\n }", "title": "" }, { "docid": "45a26d94066447e47b7014f66cf083a5", "score": "0.47908112", "text": "constructor(type, value) {\n this.type = type;\n this.value = value;\n }", "title": "" }, { "docid": "49724ff9bb383b9189198b1b0c1a59c1", "score": "0.47828355", "text": "function setTimeSlicesFormValue(form, formValues, formValueSelector, newValueDataName, valueType) {\n // Retrieve the objects\n var currentValue = $(form).children(\"#\" + formValueSelector);\n // Format the string if necessary (it will work fine even if it's an empty string\n if (newValueDataName === \"\") {\n newValueDataName = formValueSelector;\n }\n newValueDataName = newValueDataName.replace(\"timeSlicesForm\", \"\").toLowerCase();\n var newValue = $(formValues).data(newValueDataName);\n // Help handle 0. The form does not handle it well...\n // Instead, just take a small value to indicate that there is nothing more.\n if (newValue === 0 && valueType === \"max\") {\n console.log(\"Reassign a 0 to 0.5 for a max value!\");\n newValue = 0.5;\n }\n /*console.log(\"currentValue: \" + $(currentValue).prop(valueType));\n console.log(\"newValue: \" + newValue);*/\n // Set the values\n // Need to check explicitly, because otherwise this fails on 0...\n if (currentValue !== undefined && currentValue !== null && newValue !== undefined && newValue !== null) {\n //console.log(\"Assigning!\");\n $(currentValue).prop(valueType, newValue);\n }\n}", "title": "" }, { "docid": "d7df3f6d818e4fc3aefae56aa0d876b5", "score": "0.47822443", "text": "setValue(value) {\n this.value = value;\n this.outputCells.forEach((cell) => {\n cell.getNewValue();\n });\n \n // push new value set into the global store array for later referencing\n allStoredCells.forEach((storedCell) => {\n storedCell.calculateNewValues();\n });\n }", "title": "" }, { "docid": "541477d0fe015f6ca2d0889f42587284", "score": "0.4769337", "text": "store (mi, addr, v) { return memstore(0x37, mi, addr, v) }", "title": "" }, { "docid": "cc73e0ec14321a42e919771be8192b54", "score": "0.47597587", "text": "function set (buffer, offset, value) {\n debug('Struct \"type\" setter for buffer at offset', buffer, offset, value)\n var isStruct = value instanceof this\n if (isStruct) {\n // optimization: copy the buffer contents directly rather\n // than going through the ref-struct constructor\n value['ref.buffer'].copy(buffer, offset, 0, this.size);\n } else {\n if (offset > 0) {\n buffer = buffer.slice(offset)\n }\n new this(buffer, value)\n }\n}", "title": "" }, { "docid": "0a1b56893021273510bc9174180266e7", "score": "0.47570586", "text": "function set (buffer, offset, value) {\n debug('Struct \"type\" setter for buffer at offset', buffer, offset, value)\n var isStruct = value instanceof this\n if (isStruct) {\n // optimization: copy the buffer contents directly rather\n // than going through the ref-struct constructor\n value['ref.buffer'].copy(buffer, offset, 0, this.size)\n } else {\n if (offset > 0) {\n buffer = buffer.slice(offset)\n }\n new this(buffer, value)\n }\n}", "title": "" }, { "docid": "0a1b56893021273510bc9174180266e7", "score": "0.47570586", "text": "function set (buffer, offset, value) {\n debug('Struct \"type\" setter for buffer at offset', buffer, offset, value)\n var isStruct = value instanceof this\n if (isStruct) {\n // optimization: copy the buffer contents directly rather\n // than going through the ref-struct constructor\n value['ref.buffer'].copy(buffer, offset, 0, this.size)\n } else {\n if (offset > 0) {\n buffer = buffer.slice(offset)\n }\n new this(buffer, value)\n }\n}", "title": "" }, { "docid": "e99bfd1ebf67e484f8d8d24b1e61e931", "score": "0.4755138", "text": "setValueAtAddress(pObject,pAddress,pValue){return this.objectAddressSetValue.setValueAtAddress(pObject,pAddress,pValue);}", "title": "" }, { "docid": "2009a76e31c7f8ca797c001d3b2034a6", "score": "0.47549936", "text": "setVal(newVal) {}", "title": "" } ]
1eef3983bd2bd55d5a8a5267f5459b78
This method is just like `format` except that the `justifyWidth` is inferred from the `stave`.
[ { "docid": "2fb8b106f0742bd9c81f01ba76f5791a", "score": "0.63912976", "text": "formatToStave(voices, stave, options) {\n options = {\n padding: 10,\n ...options\n };\n\n const justifyWidth = stave.getNoteEndX() - stave.getNoteStartX() - options.padding;\n L('Formatting voices to width: ', justifyWidth);\n return this.format(voices, justifyWidth, { context: stave.getContext(), ...options });\n }", "title": "" } ]
[ { "docid": "6a5d270e812ff408035e6dd7429b4625", "score": "0.63362086", "text": "formatWithPadding(n, width, z){\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }", "title": "" }, { "docid": "cc9b5821c8782c31780061a4d0f5a414", "score": "0.6260703", "text": "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "title": "" }, { "docid": "cc9b5821c8782c31780061a4d0f5a414", "score": "0.6260703", "text": "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "title": "" }, { "docid": "cc9b5821c8782c31780061a4d0f5a414", "score": "0.6260703", "text": "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "title": "" }, { "docid": "cc9b5821c8782c31780061a4d0f5a414", "score": "0.6260703", "text": "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "title": "" }, { "docid": "cc9b5821c8782c31780061a4d0f5a414", "score": "0.6260703", "text": "function createPadding (width) {\n var result = ''\n var string = ' '\n var n = width\n do {\n if (n % 2) {\n result += string;\n }\n n = Math.floor(n / 2);\n string += string;\n } while (n);\n\n return result;\n}", "title": "" }, { "docid": "94e1eb49505dfe5bbb454d84d5b75d02", "score": "0.62441033", "text": "function padTo(x, width) {\n\t if (!width || width <= 0) {\n\t return x;\n\t }\n\t var s = x.toString();\n\t var paddingNeeded = width - s.length;\n\t if (paddingNeeded > 0) {\n\t return s + \" \".substr(0, paddingNeeded);\n\t }\n\t else {\n\t return s.substr(0, width);\n\t }\n\t}", "title": "" }, { "docid": "d8635bd436bfd2a22f85b0c270a5e759", "score": "0.6114023", "text": "function padded(n,width) {\n var s = n.toString();\n while (s.length < width) s = ' ' + s;\n return s;\n}", "title": "" }, { "docid": "456033af6fa0b6a63177f8aa7f273e24", "score": "0.6019436", "text": "function formatString(string, width, padding) {\n\treturn (width <= string.length) ? string : formatString(string + padding, width, padding);\n}", "title": "" }, { "docid": "1e9d1d90ef4add0b912575be5eb61e3a", "score": "0.59903586", "text": "function rjust( string, width, padding ) {\n padding = padding || \" \";\n padding = padding.substr( 0, 1 );\n if ( string.length < width ){\n return padding.repeat( width - string.length ) + string;\n } else {\n return string;\n }\n}", "title": "" }, { "docid": "bccbe8523e29f421c3ff3177f9a7a851", "score": "0.5930363", "text": "function format(text, width) {\n\n // Establish new text\n var new_text = '';\n var arr = text.split(' ');\n var temp = '';\n\n // loop through characters\n for (var i = 0; i< arr.length; i++){\n\n // Add words as long as length isn't reached\n if(temp.length + arr[i].length <= width){\n temp += arr[i] + ' ';\n }else{\n\n // Start a new line when width is reached\n neep = temp.substr(0,temp.length-1) + '\\n';\n new_text += neep;\n temp = '';\n --i;\n };\n }\n // remove last \\n\n neep = temp.substr(0,temp.length-1);\n\n // append last piece of text to the new_text before returning it\n new_text += neep;\n temp = '';\n return new_text;\n }", "title": "" }, { "docid": "37e953d1a4f1a398c28e938dd1cd8c55", "score": "0.5839219", "text": "function fillWidth(text, width, paddingStart) {\n return \" \".repeat(paddingStart) + text + \" \".repeat(Math.max(1, width - text.length - paddingStart));\n}", "title": "" }, { "docid": "e66440210d9a8a9ee30c7483758e8151", "score": "0.57725173", "text": "function pad (n, width) {\n n = n + ''; \n return (n.length >= width) ? n : new Array(width-n.length + 1).join('0') + n; \n}", "title": "" }, { "docid": "d69d54f8ff30e383cf38cbaa8b645548", "score": "0.57321054", "text": "format(voices, justifyWidth, options) {\n const opts = {\n align_rests: false,\n context: null,\n stave: null,\n ...options,\n };\n\n this.voices = voices;\n if (this.options.softmaxFactor) {\n this.voices.forEach(v => v.setSoftmaxFactor(this.options.softmaxFactor));\n }\n\n this.alignRests(voices, opts.align_rests);\n this.createTickContexts(voices);\n this.preFormat(justifyWidth, opts.context, voices, opts.stave);\n\n // Only postFormat if a stave was supplied for y value formatting\n if (opts.stave) this.postFormat();\n\n return this;\n }", "title": "" }, { "docid": "0e8641c591d94cf3a9ec44a05ff645c0", "score": "0.5708739", "text": "function align(right, str, width) {\n str = String(str);\n const n = Math.max(0, width - str.length);\n for (let i = 0; i < n; i++) {\n str = right ? (' ' + str) : (str + ' ');\n }\n return str;\n}", "title": "" }, { "docid": "a9d7b1540608fe0bc496a4fb25f416eb", "score": "0.57033545", "text": "function fmt(value, defaultWidth) {\n if (flag == '-') // No padding.\n return value;\n\n if (flag == '^') // Convert to uppercase.\n value = String(value).toUpperCase();\n\n if (typeof width == 'undefined')\n width = defaultWidth;\n\n // If there is no width specifier, there's nothing to pad.\n if (!width)\n return value;\n\n if (flag == '_') // Pad with spaces.\n return lpad(value, ' ');\n\n // Autodetect padding character.\n if (typeof value == 'number')\n return lpad(value, '0');\n\n return lpad(value, ' ');\n }", "title": "" }, { "docid": "5de4d299d5d96b564a5c96410a8b31a9", "score": "0.56145406", "text": "preFormat(justifyWidth = 0, renderingContext, voices, stave) {\n // Initialize context maps.\n const contexts = this.tickContexts;\n const { list: contextList, map: contextMap } = contexts;\n\n // Reset loss history for evaluator.\n this.lossHistory = [];\n\n // If voices and a stave were provided, set the Stave for each voice\n // and preFormat to apply Y values to the notes;\n if (voices && stave) {\n voices.forEach(voice => voice.setStave(stave).preFormat());\n }\n\n // Now distribute the ticks to each tick context, and assign them their\n // own X positions.\n let x = 0;\n let shift = 0;\n this.minTotalWidth = 0;\n\n // Pass 1: Give each note maximum width requested by context.\n contextList.forEach((tick) => {\n const context = contextMap[tick];\n if (renderingContext) context.setContext(renderingContext);\n\n // Make sure that all tickables in this context have calculated their\n // space requirements.\n context.preFormat();\n\n const width = context.getWidth();\n this.minTotalWidth += width;\n\n const metrics = context.getMetrics();\n x = x + shift + metrics.totalLeftPx;\n context.setX(x);\n\n // Calculate shift for the next tick.\n shift = width - metrics.totalLeftPx;\n });\n\n this.minTotalWidth = x + shift;\n this.hasMinTotalWidth = true;\n\n // No justification needed. End formatting.\n if (justifyWidth <= 0) return this.evaluate();\n\n\n // Start justification. Subtract the right extra pixels of the final context because the formatter\n // justifies based on the context's X position, which is the left-most part of the note head.\n const firstContext = contextMap[contextList[0]];\n const lastContext = contextMap[contextList[contextList.length - 1]];\n\n // Calculate the \"distance error\" between the tick contexts. The expected distance is the spacing proportional to\n // the softmax of the ticks.\n function calculateIdealDistances(adjustedJustifyWidth) {\n return contextList.map((tick, i) => {\n const context = contextMap[tick];\n const voices = context.getTickablesByVoice();\n let backTickable = null;\n if (i > 0) {\n const prevContext = contextMap[contextList[i - 1]];\n // Go through each tickable and search backwards for another tickable\n // in the same voice. If found, use that duration (ticks) to calculate\n // the expected distance.\n for (let j = i - 1; j >= 0; j--) {\n const backTick = contextMap[contextList[j]];\n const backVoices = backTick.getTickablesByVoice();\n\n // Look for matching voices between tick contexts.\n const matchingVoices = [];\n Object.keys(voices).forEach(v => {\n if (backVoices[v]) {\n matchingVoices.push(v);\n }\n });\n\n if (matchingVoices.length > 0) {\n // Found matching voices, get largest duration\n let maxTicks = 0;\n let maxNegativeShiftPx = Infinity;\n let expectedDistance = 0;\n\n // eslint-disable-next-line\n matchingVoices.forEach(v => {\n const ticks = backVoices[v].getTicks().value();\n if (ticks > maxTicks) {\n backTickable = backVoices[v];\n maxTicks = ticks;\n }\n\n // Calculate the limits of the shift based on modifiers, etc.\n const thisTickable = voices[v];\n const insideLeftEdge = thisTickable.getX() - (thisTickable.getMetrics().modLeftPx + thisTickable.getMetrics().leftDisplacedHeadPx);\n\n const backMetrics = backVoices[v].getMetrics();\n const insideRightEdge = backVoices[v].getX() + backMetrics.notePx + backMetrics.modRightPx + backMetrics.rightDisplacedHeadPx;\n\n // Don't allow shifting if notes in the same voice can collide\n maxNegativeShiftPx = Math.min(maxNegativeShiftPx, insideLeftEdge - insideRightEdge);\n });\n\n // Don't shift further left than the notehead of the last context\n maxNegativeShiftPx = Math.min(maxNegativeShiftPx, context.getX() - prevContext.getX());\n\n // Calculate the expected distance of the current context from the last matching tickable. The\n // distance is scaled down by the softmax for the voice.\n expectedDistance = backTickable.getVoice().softmax(maxTicks) * adjustedJustifyWidth;\n\n return {\n expectedDistance,\n maxNegativeShiftPx,\n fromTickable: backTickable,\n };\n }\n }\n }\n\n return { errorPx: 0, fromTickablePx: 0, maxNegativeShiftPx: 0 };\n });\n }\n\n\n function shiftToIdealDistances(idealDistances) {\n // Distribute ticks to the contexts based on the calculated distance error.\n const centerX = adjustedJustifyWidth / 2;\n let spaceAccum = 0;\n let negativeSpaceAccum = 0;\n\n contextList.forEach((tick, index) => {\n const context = contextMap[tick];\n if (index > 0) {\n const x = context.getX();\n const ideal = idealDistances[index];\n const errorPx = (ideal.fromTickable.getX() + ideal.expectedDistance) - (x + spaceAccum);\n\n let negativeShiftPx = 0;\n if (errorPx > 0) {\n spaceAccum += errorPx;\n } else if (errorPx < 0) {\n negativeShiftPx = Math.min(ideal.maxNegativeShiftPx + negativeSpaceAccum, Math.abs(errorPx));\n }\n\n context.setX(x + spaceAccum - negativeShiftPx);\n negativeSpaceAccum += negativeShiftPx;\n }\n\n // Move center aligned tickables to middle\n context.getCenterAlignedTickables().forEach(tickable => { // eslint-disable-line\n tickable.center_x_shift = centerX - context.getX();\n });\n });\n\n return lastContext.getX() - firstContext.getX();\n }\n\n\n const adjustedJustifyWidth = justifyWidth -\n lastContext.getMetrics().notePx -\n lastContext.getMetrics().totalRightPx -\n firstContext.getMetrics().totalLeftPx;\n const actualWidth = shiftToIdealDistances(calculateIdealDistances(adjustedJustifyWidth));\n\n if (actualWidth > adjustedJustifyWidth) {\n // If we couldn't fit all the notes into the jusification width, it's because the softmax-scaled\n // widths between different durations differ across stave (e.g., 1 quarter note is not the same pixel-width\n // as 4 16th-notes). Run a second pass, now that we know how much to justify.\n shiftToIdealDistances(calculateIdealDistances(adjustedJustifyWidth - (actualWidth - adjustedJustifyWidth)));\n }\n\n // Just one context. Done formatting.\n if (contextList.length === 1) return null;\n\n this.justifyWidth = justifyWidth;\n return this.evaluate();\n }", "title": "" }, { "docid": "9b2e0eaac5073d3e911a7a45ae7218a1", "score": "0.55934995", "text": "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }", "title": "" }, { "docid": "c99a6337ffefb559f6f111d51600bf7d", "score": "0.5569838", "text": "function pad(n, width, z)\n {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }", "title": "" }, { "docid": "a53b5044cfec9517218974db49ca16a9", "score": "0.55601436", "text": "function pad(n, width, z) {\n z = z || '0'\n n = n + ''\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n\n}", "title": "" }, { "docid": "4208a2dc3febb1325193f464ff7b23e0", "score": "0.55267155", "text": "function pad(n, width, z) {\n z = z || \"0\";\n n = n + \"\";\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "title": "" }, { "docid": "bfdcb26acba38add6d7125f90c896cda", "score": "0.5488459", "text": "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "title": "" }, { "docid": "bfdcb26acba38add6d7125f90c896cda", "score": "0.5488459", "text": "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "title": "" }, { "docid": "811f9a9b2f0b58430a17323d7573291f", "score": "0.5471723", "text": "function padLeft(str, width) {\n\treturn str.length >= width ? str : new Array(width - str.length + 1).join('0') + str;\n}", "title": "" }, { "docid": "a0c4c824acdbd7631fbdd94eec770a05", "score": "0.54689074", "text": "function pad(n, width, z) {\r\n\t\t\t\t\tz = z || '0';\r\n\t\t\t\t\tn = n + '';\r\n\t\t\t\t\treturn n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\r\n\t\t\t\t}", "title": "" }, { "docid": "6cf377f5a1703e5ede16baa74277122a", "score": "0.544884", "text": "function pad(n, width, z) {\r\n z = z || '0';\r\n n = n + '';\r\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\r\n}", "title": "" }, { "docid": "6cf377f5a1703e5ede16baa74277122a", "score": "0.544884", "text": "function pad(n, width, z) {\r\n z = z || '0';\r\n n = n + '';\r\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\r\n}", "title": "" }, { "docid": "10af919198412eb0e467166b809ba4aa", "score": "0.54146296", "text": "function centeredString(s, width) {\n\tvar centeringSpaceLeft = (Math.ceil((width - s.length - 2)/2));\n\tvar centeringSpaceRight = (Math.floor((width - s.length - 2)/2));\n\n\treturn _str.sprintf(\"%s %s %s\", new Array(centeringSpaceLeft+1).join('-'), s, new Array(centeringSpaceRight+1).join('-'));\n}", "title": "" }, { "docid": "1065574027387989b9366994ba80e33c", "score": "0.53969306", "text": "function pad_text (text, margin)\n{\n // trim trailing spaces and leading and trailing lines\n text = text.replace(/\\t/g, \" \"); // just in case\n text = text.replace(/ *\\r*$/mg, \"\");\n text = text.replace(/^\\n*/, \"\\n\");\n text = text.replace(/\\n*$/, \"\\n\");\n \n // trim indentation if not empty\n while (text.search(/(^|\\n).?\\S|^\\s*$/) == -1) {\n text = text.replace(/^ /mg, \"\");\n }\n var rows = text.split(\"\\n\");\n var width = 0;\n var align = 0;\n var alignpat = /[^\\w\\s=~&\\/\\[\\].-]|[A-Z0-9]+([\\/&._]?[A-Z0-9])+/ig;\n var res;\n \n for (var i=0; i < rows.length; i++) {\n width = Math.max(width, rows[i].length);\n \n // Are majority of alignment indicators on odd or even?\n //\n while ((res = alignpat.exec(rows[i])) != null) {\n var len = res[0].length;\n if (len % 2) // even boxes are ambiguous\n ((res.index + len/2) & 1) ? align-- : align++;\n }\n }\n \n // If formatting for display, center diagram on column 40, but\n // at least a 4-cell left margin unless close to max width.\n // The margin gives room to draw another box on the left, and\n // you can then toggle view twice to indent another 4 cells.\n //\n if (margin == null) {\n margin = Center - width / 2;\n margin = Math.max(margin & ~1, 8);\n if (width/2 + margin > Maxwidth)\n margin = 0;\n }\n else if (align < 0)\n margin++;\n \n margin = pad(\"\", margin);\n text = \"\";\n \n for (var i=0; i < rows.length; i++) {\n text += margin + pad(rows[i], width) + margin + \"\\n\";\n }\n return text;\n}", "title": "" }, { "docid": "133f776e77316cce2f99bc182cc87351", "score": "0.5396687", "text": "function pad(n, width, z) {\n\tz = z || '0';\n\tn = n + '';\n\treturn n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "title": "" }, { "docid": "aa6ee170470ef12e0265c41661ebb7e1", "score": "0.5385521", "text": "getJustification() { return this.justification; }", "title": "" }, { "docid": "1f9e39d7418c9c9c4cca7d6224d38c62", "score": "0.53731334", "text": "function pad(n, width, z){\n\tz = z || '0';\n\tn = n + '';\n\treturn n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; //if statement & to be string\n}", "title": "" }, { "docid": "33810ce7ce6a6bce7e55e7011d69f13d", "score": "0.5350065", "text": "function pad(number, count) {\n\t\tvar str = number + \" \";\n\t\tfor(var i = 0; i < count - str.length + 1; i++)\n\t\t\tstr = \" \" + str;\n\t\treturn str;\n\t}", "title": "" }, { "docid": "18eb1877a548b3a4104861be84b905b8", "score": "0.5331862", "text": "static format(nums, state) {\n const { left_shift, right_shift } = state;\n const num_spacing = 1;\n\n if (!nums || nums.length === 0) return false;\n\n const nums_list = [];\n let prev_note = null;\n let shiftLeft = 0;\n let shiftRight = 0;\n\n for (let i = 0; i < nums.length; ++i) {\n const num = nums[i];\n const note = num.getNote();\n const pos = num.getPosition();\n const props = note.getKeyProps()[num.getIndex()];\n if (note !== prev_note) {\n for (let n = 0; n < note.keys.length; ++n) {\n if (left_shift === 0) {\n shiftLeft = Math.max(note.getLeftDisplacedHeadPx(), shiftLeft);\n }\n if (right_shift === 0) {\n shiftRight = Math.max(note.getRightDisplacedHeadPx(), shiftRight);\n }\n }\n prev_note = note;\n }\n\n nums_list.push({\n note,\n num,\n pos,\n line: props.line,\n shiftL: shiftLeft,\n shiftR: shiftRight,\n });\n }\n\n // Sort fingernumbers by line number.\n nums_list.sort((a, b) => b.line - a.line);\n\n let numShiftL = 0;\n let numShiftR = 0;\n let xWidthL = 0;\n let xWidthR = 0;\n let lastLine = null;\n let lastNote = null;\n\n for (let i = 0; i < nums_list.length; ++i) {\n let num_shift = 0;\n const { note, pos, num, line, shiftL, shiftR } = nums_list[i];\n\n // Reset the position of the string number every line.\n if (line !== lastLine || note !== lastNote) {\n numShiftL = left_shift + shiftL;\n numShiftR = right_shift + shiftR;\n }\n\n const numWidth = num.getWidth() + num_spacing;\n if (pos === _modifier__WEBPACK_IMPORTED_MODULE_1__[\"Modifier\"].Position.LEFT) {\n num.setXShift(left_shift + numShiftL);\n num_shift = left_shift + numWidth; // spacing\n xWidthL = num_shift > xWidthL ? num_shift : xWidthL;\n } else if (pos === _modifier__WEBPACK_IMPORTED_MODULE_1__[\"Modifier\"].Position.RIGHT) {\n num.setXShift(numShiftR);\n num_shift = shiftRight + numWidth; // spacing\n xWidthR = num_shift > xWidthR ? num_shift : xWidthR;\n }\n lastLine = line;\n lastNote = note;\n }\n\n state.left_shift += xWidthL;\n state.right_shift += xWidthR;\n\n return true;\n }", "title": "" }, { "docid": "4e7da638b9a91d8a33f3fd5d088c4881", "score": "0.5316069", "text": "static format(strokes, state) {\n const left_shift = state.left_shift;\n const stroke_spacing = 0;\n\n if (!strokes || strokes.length === 0) return this;\n\n const strokeList = strokes.map((stroke) => {\n const note = stroke.getNote();\n if (note instanceof _stavenote__WEBPACK_IMPORTED_MODULE_2__[\"StaveNote\"]) {\n const { line } = note.getKeyProps()[stroke.getIndex()];\n const shift = note.getLeftDisplacedHeadPx();\n return { line, shift, stroke };\n } else {\n const { str: string } = note.getPositions()[stroke.getIndex()];\n return { line: string, shift: 0, stroke };\n }\n });\n\n const strokeShift = left_shift;\n\n // There can only be one stroke .. if more than one, they overlay each other\n const xShift = strokeList.reduce((xShift, { stroke, shift }) => {\n stroke.setXShift(strokeShift + shift);\n return Math.max(stroke.getWidth() + stroke_spacing, xShift);\n }, 0);\n\n state.left_shift += xShift;\n return true;\n }", "title": "" }, { "docid": "9b51b6174c931a7a62d80a5689d0c0aa", "score": "0.5311389", "text": "pad(str, len) {\n const strLen = str.length;\n const space = ' ';\n if (strLen > len) {\n return str;\n } else if ((len - strLen) % 2 === 0) {\n str = space.repeat((len - strLen) / 2) + str + space.repeat((len - strLen) / 2);\n } else {\n str = space.repeat((len - 1 - strLen) / 2) + str + space.repeat((len + 1 - strLen) / 2);\n }\n return str;\n }", "title": "" }, { "docid": "6b763577fe5639c3715b41e6b2fcc7fe", "score": "0.5291713", "text": "function padLeft(value, length) {\n let paddedValue = (\" \" + value.toString()).slice(-length);\n return paddedValue;\n}", "title": "" }, { "docid": "fd2f2779bbeddc1147c09a2caac90a6d", "score": "0.52856225", "text": "function toWidth(){return function(value){if(isNaN(value)){value=0;}else{value=Math.max(0,Math.min(1,value));}return{width:Math.round(value*100)+'%'};};}", "title": "" }, { "docid": "1f1b9e1ec576eb4507c80e5221679840", "score": "0.5273084", "text": "function aligningRight(arr){\n var max=\"\";\n max+=arr[0];\n max=max.length;\n var result=\"\";\n for(var i=0; i<arr.length; i++){\n arr[i]=\"\" + arr[i];\n if(arr[i].length>max){\n max=arr[i].length;\n }\n }\n var emptySpace=\"\";\n for(var i=0; i<arr.length; i++){\n for(var j=0; j<max-arr[i].length; j++){\n emptySpace+=\" \";\n }\n result+=emptySpace + arr[i] + \"\\n\";\n emptySpace=\"\";\n }\n return result;\n}", "title": "" }, { "docid": "1c6c12587eb60fe1a26f58d08b55ad3d", "score": "0.52727175", "text": "function leftPad(width, string, padding) {\n return (width <= string.length) ? string : leftPad(width, padding + string, padding)\n }", "title": "" }, { "docid": "3b9129f05cb5eaaa37aaeb56434a732b", "score": "0.5266888", "text": "indentToString(count) {\n return _.join(_.times(count * 2, () => ' '), '');\n }", "title": "" }, { "docid": "e9b1715dac888a72e7a41657f0a569bd", "score": "0.52661335", "text": "function blank(width) {\n var ret = \"\";\n while (ret.length < width) { ret += \" \"; }\n return ret;\n}", "title": "" }, { "docid": "7a89d98d28360ef5961079bdca9cfa81", "score": "0.52661204", "text": "function fixed(widths) {\n\t var args = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t args[_i - 1] = arguments[_i];\n\t }\n\t if (debugging()) {\n\t var paddedArgs = args.map(function (x, i) { return padTo(expandUN(x), widths[i]); });\n\t console.log.apply(console, [typeTemplate(paddedArgs)].concat(paddedArgs));\n\t }\n\t}", "title": "" }, { "docid": "e32e60110174045ad454d728ebf61374", "score": "0.51817894", "text": "_alignTo( size, count ) {\n switch ( count ) {\n case 1: return size; // Pad upwards to even multiple of 2\n case 2: return size + size % 2; // Pad upwards to even multiple of 2\n default: return size + ( 4 - size % 4 ) % 4; // Pad upwards to even multiple of 4\n }\n }", "title": "" }, { "docid": "4216d5334b1d81e81ddf46d06b606d54", "score": "0.51789564", "text": "static get Justify() {\n return {\n LEFT: 1,\n CENTER: 2,\n RIGHT: 3,\n CENTER_STEM: 4,\n };\n }", "title": "" }, { "docid": "9833d6c68494e0b71731c6d03012e4ef", "score": "0.51741993", "text": "function pad (str, len, filler = \"&nbsp;\", left = false) {\n if (str.length <= len) {\n var padding = new Array(1 + len - str.length).join(filler);\n return (left)? padding + str : str + padding;\n }\n else {\n return str.slice(0,len);\n }\n}", "title": "" }, { "docid": "13b96de3ceb826ffa9cd9e7aff4789c3", "score": "0.51719904", "text": "function wrapIndent(indent) {\n var str = ''\n for (var i = 0; i < indent.length - 1; i++) {\n str += (indent[i] === '0' ? '| ' : ' ')\n }\n return colorful.gray(str + '|-')\n}", "title": "" }, { "docid": "4263b4749de9432ac40d61a12bf1c143", "score": "0.51590997", "text": "function pad (str, len)\n{\n if (str.length < len)\n str += Array(len - str.length + 1).join(\" \");\n return str;\n}", "title": "" }, { "docid": "1b72159aaff67132b94030c08d4f1dba", "score": "0.51534843", "text": "function lpad(n, width, z) \n{\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "title": "" }, { "docid": "c61907938eeb89c323c610e094fc13e5", "score": "0.51448137", "text": "_pad(number, width, z) {\n\t\tz = z || '0';\n\t\tnumber = number + '';\n\t\treturn number.length >= width ? number : new Array(width - number.length + 1).join(z) + number;\n\t}", "title": "" }, { "docid": "49401ff1eb251c230ce46fad1561cd98", "score": "0.5144721", "text": "function NumberToString(number, width, pad)\n{\n var formattedNumber= \"\" + number;\n \n while (formattedNumber.length < width)\n {\n formattedNumber= pad + formattedNumber;\n }\n \n return formattedNumber;\n}", "title": "" }, { "docid": "28d014b5a9fa45ca1f4fafc3105c3855", "score": "0.51438105", "text": "function pad_left(value, pad_char, width) {\n var result = value + '';\n if (result.length >= width)\n return result.substr(0,width); // Return string truncated to width.\n for (var i = result.length; result.length < width; i++) {\n result = pad_char + result;\n }\n return result;\n}", "title": "" }, { "docid": "2a862bfdfe0262c1c490c413c97776c3", "score": "0.5128014", "text": "function padString(s, length, padWith, bSuffix) {\n\t\tif (null === s || (typeof(s) == \"undefined\")) {\n\t\t\ts = \"\";\n\t\t}\n\t\telse {\n\t\t\ts = String(s);\n\t\t}\n\t\tpadWith = String(padWith);\n\t\tvar padLength = padWith.length;\n\t\tfor (var i = s.length; i < length; i += padLength) {\n\t\t\tif (bSuffix) {\n\t\t\t\ts += padWidth;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ts = padWith + s;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "title": "" }, { "docid": "164cfc8ca8851ef0637b187ceae32e70", "score": "0.5117091", "text": "static format(nums, state) {\n const left_shift = state.left_shift;\n const right_shift = state.right_shift;\n const num_spacing = 1;\n\n if (!nums || nums.length === 0) return this;\n\n const nums_list = [];\n let prev_note = null;\n let shift_left = 0;\n let shift_right = 0;\n\n let i;\n let num;\n let note;\n let pos;\n for (i = 0; i < nums.length; ++i) {\n num = nums[i];\n note = num.getNote();\n\n for (i = 0; i < nums.length; ++i) {\n num = nums[i];\n note = num.getNote();\n pos = num.getPosition();\n const props = note.getKeyProps()[num.getIndex()];\n\n if (note !== prev_note) {\n for (let n = 0; n < note.keys.length; ++n) {\n if (left_shift === 0) {\n shift_left = Math.max(note.getLeftDisplacedHeadPx(), shift_left);\n }\n if (right_shift === 0) {\n shift_right = Math.max(note.getRightDisplacedHeadPx(), shift_right);\n }\n }\n prev_note = note;\n }\n\n nums_list.push({\n pos,\n note,\n num,\n line: props.line,\n shiftL: shift_left,\n shiftR: shift_right,\n });\n }\n }\n\n // Sort string numbers by line number.\n nums_list.sort((a, b) => b.line - a.line);\n\n // TODO: This variable never gets assigned to anything. Is that a bug or can this be removed?\n let num_shiftL = 0; // eslint-disable-line\n let num_shiftR = 0;\n let x_widthL = 0;\n let x_widthR = 0;\n let last_line = null;\n let last_note = null;\n for (i = 0; i < nums_list.length; ++i) {\n let num_shift = 0;\n note = nums_list[i].note;\n pos = nums_list[i].pos;\n num = nums_list[i].num;\n const line = nums_list[i].line;\n const shiftL = nums_list[i].shiftL;\n const shiftR = nums_list[i].shiftR;\n\n // Reset the position of the string number every line.\n if (line !== last_line || note !== last_note) {\n num_shiftL = left_shift + shiftL;\n num_shiftR = right_shift + shiftR;\n }\n\n const num_width = num.getWidth() + num_spacing;\n if (pos === _modifier__WEBPACK_IMPORTED_MODULE_1__[\"Modifier\"].Position.LEFT) {\n num.setXShift(left_shift);\n num_shift = shift_left + num_width; // spacing\n x_widthL = (num_shift > x_widthL) ? num_shift : x_widthL;\n } else if (pos === _modifier__WEBPACK_IMPORTED_MODULE_1__[\"Modifier\"].Position.RIGHT) {\n num.setXShift(num_shiftR);\n num_shift += num_width; // spacing\n x_widthR = (num_shift > x_widthR) ? num_shift : x_widthR;\n }\n last_line = line;\n last_note = note;\n }\n\n state.left_shift += x_widthL;\n state.right_shift += x_widthR;\n return true;\n }", "title": "" }, { "docid": "261dff12ad53304d7d52179119149f6d", "score": "0.51157105", "text": "function padStr(str, len, pad, dir) {\n if (typeof(len) == 'undefined') { var len = 0; };\n if (typeof(pad) == 'undefined') { var pad = ' '; };\n if (typeof(dir) == 'undefined') { var dir = STR_PAD_RIGHT; };\n if (len + 1 >= str.length) {\n switch (dir){\n case STR_PAD_LEFT:\n str = Array(len + 1 - str.length).join(pad) + str;\n break;\n case STR_PAD_BOTH:\n var right = Math.ceil((padlen = len - str.length) / 2);\n var left = padlen - right;\n str = Array(left+1).join(pad) + str + Array(right+1).join(pad);\n break;\n default:\n str = str + Array(len + 1 - str.length).join(pad);\n break;\n } // switch\n }\n return str;\n}", "title": "" }, { "docid": "261dff12ad53304d7d52179119149f6d", "score": "0.51157105", "text": "function padStr(str, len, pad, dir) {\n if (typeof(len) == 'undefined') { var len = 0; };\n if (typeof(pad) == 'undefined') { var pad = ' '; };\n if (typeof(dir) == 'undefined') { var dir = STR_PAD_RIGHT; };\n if (len + 1 >= str.length) {\n switch (dir){\n case STR_PAD_LEFT:\n str = Array(len + 1 - str.length).join(pad) + str;\n break;\n case STR_PAD_BOTH:\n var right = Math.ceil((padlen = len - str.length) / 2);\n var left = padlen - right;\n str = Array(left+1).join(pad) + str + Array(right+1).join(pad);\n break;\n default:\n str = str + Array(len + 1 - str.length).join(pad);\n break;\n } // switch\n }\n return str;\n}", "title": "" }, { "docid": "1ac798d057ad9efe651738e2083329bf", "score": "0.51051646", "text": "function roundingPad(P, width) {\n\n\tP = \"\" + eval(P)\n\tQ = parseInt(P)\n\tstrQ = \"\" + Math.abs(Q)\n\n\tif (Math.abs(Q)>=1000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000))\n\t\tT = strQ.substring(lenQ - 3, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tif (Math.abs(Q)>=1000000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000000))\n\t\tT = strQ.substring(lenQ - 7, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tif (Math.abs(Q)>=1000000000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000000000))\n\t\tT = strQ.substring(lenQ - 12, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tnWholeNumber = parseInt(P);\n\trNumber = (P - nWholeNumber) * 100.00;\n\t\t\t\n\t\tif (rNumber < 99.5) {\n\t\t\tdNumber = Math.round(rNumber);\n\t\t} else {\n\t\t\tdNumber = rNumber;\n\t\t}\n\tnNumber = Math.abs(parseInt(dNumber));\n\n\tif (nNumber == 0) {\n\t\tif (Q < 0) {\n\t\t\tX = \"(\" + strQ + \".00\" + \")\";\n\t\t} else { \n\t\tX = \"\" + strQ + \".00\";\n\t\t}\n\t}\n\n\tif (nNumber > 0 && nNumber < 10) {\n\t\tif (Q < 0) {\n\t\t\tX = \"(\" + strQ + \".0\" + nNumber + \")\";\n\t\t} else {\n\t\tX = \"\" + strQ + \".0\" + nNumber;\n\t\t}\n\t}\n\n\tif (nNumber >= 10 && nNumber < 100) {\n\t\tif (Q < 0) {\n\t\t\tX = \"(\" + strQ + \".\" + nNumber + \")\";\n\t\t} else {\n\t\tX = \"\" + strQ + \".\" + nNumber;\n\t\t}\n\t}\n\t\n\tif (nNumber == 100) {\n\t\tif (Q < 0) {\n\t\t\tX = \"(\" + strQ + \".\" + (nNumber - 1) + \")\";\n\t\t} else {\n\t\tX = \"\" + strQ + \".\" + (nNumber - 1);\n\t\t}\n\t}\n\t\n\treturn X\n}", "title": "" }, { "docid": "d60cce23b661d3b284dbe07118534dfc", "score": "0.5082039", "text": "function rjust (s, targetLen, padding) {\n while (s.length < targetLen) {\n s = padding + s\n }\n return s\n}", "title": "" }, { "docid": "9700efd01b805c94c6b89650647cea61", "score": "0.5067358", "text": "function fixedWidth( number ) {\n\n\tvar numberString = number.toFixed( 2 );\n\tvar nSpaces = 7 - numberString.length;\n\tif ( nSpaces > 0 ) {\n\n\t\tvar spaces = '&nbsp'.repeat( nSpaces );\n\t\treturn spaces.concat( numberString );\n\n\t} else {\n\n\t\treturn numberString;\n\n\t}\n\n}", "title": "" }, { "docid": "d5f1c6a4541ba1813458584cf4c8513f", "score": "0.5043744", "text": "function pad_string(string,maxlen)\r\n{\r\n\twhile ( string.length < maxlen ) {\r\n\t\tstring += \" \";\r\n\t}\r\n\treturn string;\r\n} // end of display_full_date", "title": "" }, { "docid": "3e9a11dca165bd20785bb707c8cca3c4", "score": "0.50351524", "text": "function pad(value, level) {\n var index;\n var padding;\n\n value = value.split('\\n');\n\n index = value.length;\n padding = repeat(' ', level * INDENT);\n\n while (index--) {\n if (value[index].length !== 0) {\n value[index] = padding + value[index];\n }\n }\n\n return value.join('\\n');\n}", "title": "" }, { "docid": "3e9a11dca165bd20785bb707c8cca3c4", "score": "0.50351524", "text": "function pad(value, level) {\n var index;\n var padding;\n\n value = value.split('\\n');\n\n index = value.length;\n padding = repeat(' ', level * INDENT);\n\n while (index--) {\n if (value[index].length !== 0) {\n value[index] = padding + value[index];\n }\n }\n\n return value.join('\\n');\n}", "title": "" }, { "docid": "541c3a2e88ad19ae2dc566b6f979d77b", "score": "0.50313765", "text": "function formatTable (table, padding) {\n var output = [];\n\n // size of left-hand-column.\n var llen = longest(Object.keys(table));\n\n // don't allow the left-column to take up\n // more than half of the screen.\n if (wrap) {\n llen = Math.min(llen, parseInt(wrap / 2));\n }\n\n // size of right-column.\n var desclen = longest(Object.keys(table).map(function (k) {\n return table[k].desc;\n }));\n\n Object.keys(table).forEach(function(left) {\n var desc = table[left].desc,\n extra = table[left].extra,\n leftLines = null;\n\n if (wrap) {\n desc = wordwrap(llen + padding + 1, wrap)(desc)\n .slice(llen + padding + 1);\n }\n\n // if we need to wrap the left-hand-column,\n // split it on to multiple lines.\n if (wrap && left.length > llen) {\n leftLines = wordwrap(2, llen)(left.trim()).split('\\n');\n left = '';\n }\n\n var lpadding = new Array(\n Math.max(llen - left.length + padding, 0)\n ).join(' ');\n\n var dpadding = new Array(\n Math.max(desclen - desc.length + 1, 0)\n ).join(' ');\n\n if (!wrap && dpadding.length > 0) {\n desc += dpadding;\n }\n\n var prelude = ' ' + left + lpadding;\n\n var body = [ desc, extra ].filter(Boolean).join(' ');\n\n if (wrap) {\n var dlines = desc.split('\\n');\n var dlen = dlines.slice(-1)[0].length\n + (dlines.length === 1 ? prelude.length : 0)\n\n if (extra.length > wrap) {\n body = desc + '\\n' + wordwrap(llen + 4, wrap)(extra)\n } else {\n body = desc + (dlen + extra.length > wrap - 2\n ? '\\n'\n + new Array(wrap - extra.length + 1).join(' ')\n + extra\n : new Array(wrap - extra.length - dlen + 1).join(' ')\n + extra\n );\n }\n }\n\n if (leftLines) { // handle word-wrapping the left-hand-column.\n var rightLines = body.split('\\n'),\n firstLine = prelude + rightLines[0],\n lineCount = Math.max(leftLines.length, rightLines.length);\n\n for (var i = 0; i < lineCount; i++) {\n var left = leftLines[i],\n right = i ? rightLines[i] : firstLine;\n\n output.push(strcpy(left, right, firstLine.length));\n }\n } else {\n output.push(prelude + body);\n }\n });\n\n return output;\n }", "title": "" }, { "docid": "816d364cd382c0772288eb5100eff177", "score": "0.5024456", "text": "function createWhiteSpace(item, sectionSize){\n if(typeof item === \"number\"){\n var numString = item.toString();\n var spaceLength = sectionSize - numString.length;\n } else {\n var spaceLength = sectionSize - item.length;\n }\n \n var display = \" \" + item + new Array(spaceLength).join(\" \") + \" \";\n return display;\n}", "title": "" }, { "docid": "0242d43040040941bed0c55d9b8eac85", "score": "0.50238013", "text": "function padString(length, str) {\n\t while (str.length < length)\n\t str += \" \";\n\t return str;\n\t}", "title": "" }, { "docid": "bb972c0d861b9163a8ff377da041fb9d", "score": "0.50150865", "text": "function JustifyText(numLine : int){\n\n\tvar nmbSpace : float = GetNumberOfSpaces(numLine);\n\tvar lengthToRight : float = CalculateSpace(numLine);\n\tvar spaceToAdd : float = lengthToRight/nmbSpace;\n\tvar currentSpace : int = 0;\n\t\n\t/* Avoiding cast errors........ */\n\tvar moveToNext0Int: int = moveToNext[0];\n\tvar moveToNextInt: int = moveToNext[numLine];\n\t\n\tif(numLine == 0){\n\t\tfor(var i : int = 0; i < moveToNext0Int; i++){\n\t\t\tif(textToDisplay[i] == \" \")\n\t\t\t\tcurrentSpace++;\n\t\t\telse // move all letters\n\t\t\t\tletterSpots[i].x += spaceToAdd*currentSpace;\n\t\t}\n\t}\n\telse{\n\t\t/* Avoiding cast errors........ */\n\t\tvar moveToNextIntMinus1: int = moveToNext[numLine - 1];\n\t\t\n\t\tfor(i = moveToNextIntMinus1; i < moveToNextInt; i++){\n\t\t\tif(textToDisplay[i] == \" \" && i != moveToNext[numLine-1])\n\t\t\t\tcurrentSpace++;\n\t\t\telse // move all letters\n\t\t\t\tletterSpots[i].x += spaceToAdd*currentSpace;\n\t\t}\n\t\n\t}\n}", "title": "" }, { "docid": "fca4ecc02d3611fafff71aef0e0cb350", "score": "0.49970636", "text": "function zeroPad(number, width) {\n var num = Math.abs(number);\n var zeros = Math.max(0, width - Math.floor(num).toString().length );\n zeros = Math.pow(10,zeros).toString().substr(1);\n return (number<0 ? '-' : '') + zeros + num;\n }", "title": "" }, { "docid": "56120e13206103fb24fb65bbc34415b8", "score": "0.49909112", "text": "function formatText(width, height) {\n return JSON.stringify({ width, height }, null, 4);\n}", "title": "" }, { "docid": "eb97a2f15f0528fc33d17ceeb3e87146", "score": "0.4971502", "text": "function fixedWidthStr(inp, size, fill) {\n fill = typeof fill == 'undefined' ? ' ' : fill;\n var out = \"\" + inp;\n var diff = size - out.length;\n var extra = '';\n for(var i = 0; i < diff; i++)\n extra += fill;\n out = extra + out;\n return out.slice(0, size);\n}", "title": "" }, { "docid": "6f5c400ab9e37a3807038db2d35090ac", "score": "0.4959467", "text": "space(spacing) { return this.options.stave.space * spacing; }", "title": "" }, { "docid": "778bed1f1ddf40d6145076885253b3a3", "score": "0.49483666", "text": "function _applySequenceNumberPadding(seqNum, width, replaceZeroWith = '0') {\n seqNum = seqNum + '';\n return seqNum.length >= width ? seqNum : new Array(width - seqNum.length + 1).join(replaceZeroWith) + seqNum;\n}", "title": "" }, { "docid": "5a28418ea1a02a75fd971616cec9942b", "score": "0.4948152", "text": "function pad(depth) {\n if(depth === undefined) {\n depth = this.depth; \n }\n return repeat(' ', this.indent * depth);\n}", "title": "" }, { "docid": "6968ef990f4484045a49bdefccea5a6c", "score": "0.49294558", "text": "function getWidthString(span) {\n if (!span) return;\n\n let width = (span / 12) * 100;\n return `width: ${width}%`;\n}", "title": "" }, { "docid": "541b4ae20ece222627ac2069697dd7ba", "score": "0.4915842", "text": "function _format($elt) {\n\t\n\t\t// Get text from element\n\t\tvar text = $elt.html();\n\t\t\n\t\t// Create Reader; skip initial whitespace, then mark column as base indent\n\t\tvar reader = SourceReader.create(text);\n\t\treader.skipWhitespace();\n\t\tvar base_indent = reader.col;\n\n\t\t// Convert the text\n\t\tvar html = '';\n\t\tvar ch;\n\t\twhile (true) {\n\t\t\t// Handle whitespace\n\t\t\tvar s = '';\n\t\t\twhile (CharClasses.isWhitespace((ch = reader.peekNextChar()))) {\n\t\t\t\ts += ch;\n\t\t\t\treader.consumeNextChar();\n\t\t\t}\n\t\t\tif (s > '') html += Util.whitespaceToHtml(s, reader.tab_width, base_indent);\n\t\t\t// Stop here if out of characters\n\t\t\tch = reader.peekNextChar();\n\t\t\tif (ch == null) break;\n\t\t\t// Pack all non-whitespace into a span\n\t\t\thtml += '<span>';\n\t\t\twhile (ch != null && !CharClasses.isWhitespace(ch)) {\n\t\t\t\thtml += ch;\n\t\t\t\treader.consumeNextChar();\n\t\t\t\tch = reader.peekNextChar();\n\t\t\t}\n\t\t\thtml += '</span>';\n\t\t}\n\n\t\t// Replace original code with converted code\n\t\t$elt.html(html);\n\t}", "title": "" }, { "docid": "e1582fef6326a4fb18be830a6b13940c", "score": "0.4904682", "text": "function justifyText(text) {\n // remove multiple spaces and get all paragraphs of text\n let paragraphs = text.split(/\\s\\s+/g);\n\n textGeneral = \"\";\n\n paragraphs.forEach((paragraph) => {\n let begin = 0;\n let end = 80;\n let newParagraph = \"\";\n while (begin < paragraph.length) {\n\n newParagraph = newParagraph + paragraph.slice(begin, end) + \"\\n\";\n begin = begin + 80;\n end = end + 80;\n }\n textGeneral = textGeneral + newParagraph + \".\" + \"\\n\";\n });\n return textGeneral;\n}", "title": "" }, { "docid": "c009a4d778e33278447c518c87101b34", "score": "0.48937333", "text": "getExtraWidthPadding(group) {\n let extraWidthPadding = 0;\n const lastColMonth = this.timestampsTmp[group - 1][0].date.getMonth();\n const secondLastColMonth = this.timestampsTmp[group - 2][0].date.getMonth();\n\n if (lastColMonth !== secondLastColMonth) {\n extraWidthPadding = 6;\n }\n\n return extraWidthPadding;\n }", "title": "" }, { "docid": "5514636b05fd5115ff4c52e6698d1d44", "score": "0.48828518", "text": "function padString(length, str) {\r\n\t\t while (str.length < length)\r\n\t\t str += \" \";\r\n\t\t return str;\r\n\t\t}", "title": "" }, { "docid": "3389051c785828dd3ef2d7a6b47dde8c", "score": "0.48818812", "text": "function padding(s, len) {\n var len = len - (s + '').length;\n for (var i = 0; i < len; i++) { s = '0' + s; }\n return s;\n}", "title": "" }, { "docid": "eb0293186ebadb8a7a3185166310a644", "score": "0.48778352", "text": "function addPad(p, ret) { var r = ''; for (var i = 0; i < p; i++) { r += ' '; } return r; }", "title": "" }, { "docid": "eb0293186ebadb8a7a3185166310a644", "score": "0.48778352", "text": "function addPad(p, ret) { var r = ''; for (var i = 0; i < p; i++) { r += ' '; } return r; }", "title": "" }, { "docid": "7ee8f7dac63e46e8020ba4ad7f99d76b", "score": "0.48659948", "text": "function Indent(indent_w = 0.0) { bind.Indent(indent_w); }", "title": "" }, { "docid": "5c009d0d92741cc5aade781f7025f83e", "score": "0.4863673", "text": "static SimpleFormat(notes, x = 0, { paddingBetween = 10 } = {}) {\n notes.reduce((x, note) => {\n note.addToModifierContext(new _modifiercontext__WEBPACK_IMPORTED_MODULE_7__[\"ModifierContext\"]());\n const tick = new _tickcontext__WEBPACK_IMPORTED_MODULE_8__[\"TickContext\"]().addTickable(note).preFormat();\n const metrics = tick.getMetrics();\n tick.setX(x + metrics.totalLeftPx);\n\n return x + tick.getWidth() + metrics.totalRightPx + paddingBetween;\n }, x);\n }", "title": "" }, { "docid": "c4c98a83b0a44c94ac14c07912fbe88a", "score": "0.48616248", "text": "function StringAlign(strString, intLength, strPadding) {\r\n\tvar blnNegative = false;\r\n\tvar strAssemble = \"\";\r\n\tvar intCharCnts = 0;\r\n\r\n\tif (intLength > 0) {\r\n\t\tblnNegative = false;\r\n\t} else {\r\n\t\tblnNegative = true;\r\n\t}\r\n\r\n\tintLength = Math.abs(intLength);\r\n\r\n\tif (intLength <= strString.length) {\r\n\t\treturn strString;\r\n\t}\r\n\r\n\twhile (strAssemble.length < intLength) {\r\n\t\tstrAssemble += strPadding;\r\n\t}\r\n\r\n\tintCharCnts = GetCharCount(strString);\r\n\r\n\tstrAssemble = strAssemble.substring(0, intLength - intCharCnts);\r\n\r\n\tif (blnNegative == false) {\r\n\t\treturn strString + strAssemble;\r\n\t} else {\r\n\t\treturn strAssemble + strString;\r\n\t}\r\n}", "title": "" }, { "docid": "1ec39a4eec8c9755c446922ed2661ff0", "score": "0.48523015", "text": "function padLeft(str, length, pad) {\n pad = pad || ' ';\n while (str.length < length)\n str = pad + str;\n return str;\n}", "title": "" }, { "docid": "7cac58a1d371b85b2c067174c164775e", "score": "0.48512504", "text": "function columnSpacer(str, isFirstCol) {\n var width = isFirstCol ? 6 : 12;\n return str + ' '.repeat(width - str.length);\n}", "title": "" }, { "docid": "21e3f5177574a3bda15408123841a7fe", "score": "0.48438162", "text": "function pad(s,n){\n s = s.toString() + \" \"; \n return ( s.substring(0,n));\n}", "title": "" }, { "docid": "f4375c6f1b223c1843e2283364493f92", "score": "0.48169523", "text": "function align (d) {\n switch (d.type) {\n case 'number':\n return 'right'\n case 'string':\n case 'date':\n default:\n return 'left'\n }\n }", "title": "" }, { "docid": "b4012f9d28a75a10a7b101b730b6f64d", "score": "0.48088032", "text": "function integerPad(P, width) {\n\n\tP = \"\" + eval(P)\n\tQ = parseInt(P)\n\tstrQ = \"\" + Math.abs(Q)\n\n\tif (Math.abs(Q)>=1000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000))\n\t\tT = strQ.substring(lenQ - 3, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tif (Math.abs(Q)>=1000000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000000))\n\t\tT = strQ.substring(lenQ - 7, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tif (Math.abs(Q)>=1000000000) {\n\t\tlenQ = strQ.length\n\t\tS = parseInt(\"\" + (Q/1000000000))\n\t\tT = strQ.substring(lenQ - 12, lenQ)\n\t\tstrQ = Math.abs(S)+\",\"+T\n\t}\n\n\tnWholeNumber = parseInt(P);\n\trNumber = (P - nWholeNumber) * 100.00;\n\t\t\t\n\t\tif (rNumber < 99.5) {\n\t\t\tdNumber = Math.round(rNumber);\n\t\t} else {\n\t\t\tdNumber = rNumber;\n\t\t}\n\tnNumber = Math.abs(parseInt(dNumber));\n\n\tif (Q < 0) {\n\t\t\tX = \"(\" + strQ + \")\";\n\t\t} else { \n\t\tX = \"\" + strQ;\n\t\t}\n\n\treturn X\n}", "title": "" }, { "docid": "d8224fa044f05999bb00859ebdf59e36", "score": "0.48014203", "text": "function zeroLeftPad(stw,noz)\r\n\t{\r\n\tif (stw == null) { stw = \"\" }\r\n\tvar workstr = \"000000000000000000000000000000000000000000000000000\" + stw;\r\n\treturn String(workstr).substring(workstr.length,workstr.length - noz);\r\n\t}", "title": "" }, { "docid": "4838ba5e2a9f6f3caa1580dfed3c4074", "score": "0.4800037", "text": "setWidth(newWidth){\n this.width = Math.trunc(newWidth);\n }", "title": "" }, { "docid": "ba70d2c6303a112f9c17804d98fc2eab", "score": "0.4797653", "text": "function IpadicFormatter() {\n}", "title": "" }, { "docid": "6e4685fe68b0982fd032f336f037301a", "score": "0.47945723", "text": "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "title": "" }, { "docid": "6e4685fe68b0982fd032f336f037301a", "score": "0.47945723", "text": "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "title": "" }, { "docid": "b1165d737ce0acb0214ac3cee8fcecd2", "score": "0.47755504", "text": "function padRight(value, length) {\n if (value.length > length) {\n return value.substring(0, length);\n } else {\n for (let i = value.length; i <= length; i++) {\n value += ' ';\n }\n return value;\n }\n}", "title": "" }, { "docid": "57c2213002b8a606478cccf94dd13596", "score": "0.47618794", "text": "function pad(t) {\n let st = \"\" + t;\n \n while (st.length < 2)\n st = \"0\" + st;\n \n return st; \n }", "title": "" }, { "docid": "d8226f8b2e852a5f4afacf96b4d5d12f", "score": "0.47534138", "text": "pad(string, length) {\n //here we use only 2 arguments and space as a pad\n //if string is already longer than targeted length\n //it will return the string\n if (length <= string.length) {\n return string\n }\n //value of start padding\n let padStart = Math.floor((length - string.length) / 2)\n //value of end padding\n let padEnd = (length - (string.length + padStart))\n //creating a string with added padding\n let paddedString = ' '.repeat(padStart) + string +' '.repeat(padEnd)\n return paddedString\n }", "title": "" }, { "docid": "a3bd14e9321827483f400bd9814bdfe2", "score": "0.47476593", "text": "function format(vField, iLength, bCutFromFront) {\n\t\t\t\tif (!vField) {\n\t\t\t\t\tvField = vField === 0 ? \"0\" : \"\";\n\t\t\t\t} else if (typeof vField === \"number\") {\n\t\t\t\t\tvar iField = vField;\n\t\t\t\t\tvField = Math.round(vField).toString();\n\t\t\t\t\t// Calculation of figures may be erroneous because incomplete performance entries lead to negative\n\t\t\t\t\t// numbers. In that case we set a -1, so the \"dirty\" record can be identified as such.\n\t\t\t\t\tif (vField.length > iLength || iField < 0) {\n\t\t\t\t\t\tvField = \"-1\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvField = bCutFromFront ? vField.substr(-iLength, iLength) : vField.substr(0, iLength);\n\t\t\t\t}\n\t\t\t\treturn vField;\n\t\t\t}", "title": "" }, { "docid": "d1f3fbca6aa1b5377afd4dfaf2e06e60", "score": "0.47428092", "text": "function align4(size) {\r\n if (size % 4 === 0) return size;\r\n return size + 4 - (size % 4);\r\n}", "title": "" }, { "docid": "62ec0abc5129388bb5c027793b2d1425", "score": "0.47419924", "text": "function PadString( Str, Len, bLeading )\n{\n // Force to string\n Str += \"\";\n\n var PadString = \"\";\n for (var c = Str.length; c < Len; c++)\n {\n PadString += \" \";\n }\n\n if (bLeading == true)\n {\n Str = PadString + Str;\n }\n else\n {\n Str = Str + PadString;\n }\n\n return Str;\n}", "title": "" }, { "docid": "a6ddf2ac62a54511ee4f8b6020a5ba25", "score": "0.4740714", "text": "padString(item) {\n const value = (item.value != null ? item.value.toString().trim() : undefined) || '';\n return value.toString().trim() + new Array(item.length).fill(' ').join('').substring(value.length);\n }", "title": "" } ]
675122c6be970ed5b2a770b021f5b2c4
checks if a bolt reaches the circuit
[ { "docid": "51f2593dd9072ea7983ad0bf791b7499", "score": "0.0", "text": "function circuitCollisionHandler(circuit, bolt){\n\t\t\tthis.game.time.events.remove(this.timer);\n\t\t\tgame.state.start('menu');\n\t\t}", "title": "" } ]
[ { "docid": "aec60b097aef1f219b738b55f105a51b", "score": "0.59870034", "text": "pass(bird) {\n if (bird.x > this.x && !this.passed) {\n this.passed = true;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "ab4d392d6b7d38b7ff6ed28a2629adf9", "score": "0.58502126", "text": "isBuried() {\n var currentPlayerID;\n this.props.G.isNavigating ? currentPlayerID = this.props.G.navigatingID : currentPlayerID = this.props.ctx.currentPlayer;\n if (this.state.duneBlasting) {\n currentPlayerID = this.state.duneBlastingPlayerID\n }\n\n //check if current tile has a climber on it;\n //iterate through all players, and check if a climber's position is current position\n const currPos = this.props.G.players[currentPlayerID].position;\n for (var i = 0; i < this.props.G.players.length; i++) {\n if (this.props.G.players[i].role === \"Climber\" && this.props.G.players[i].position === currPos) {\n return false;\n }\n }\n return this.props.G.tiles[currPos].sandCount > 1;\n }", "title": "" }, { "docid": "3c32e59e70265284b5092163c93f34bb", "score": "0.5804173", "text": "isBalanced() {}", "title": "" }, { "docid": "4ebbf9ac574fb7062e389bdf516e7fb5", "score": "0.5746086", "text": "function isCrushed(){}", "title": "" }, { "docid": "4ebbf9ac574fb7062e389bdf516e7fb5", "score": "0.5746086", "text": "function isCrushed(){}", "title": "" }, { "docid": "df06043e6ef4ecb8af5c098abcd0e5d1", "score": "0.5731087", "text": "checkHitPoints()\r\n {\r\n this.hasCondition(\"name\",\"Unconcious\", true); // Remove the Unconcious condition temporarily\r\n\r\n\r\n if(this.hitPoints.current > this.hitPoints.maximum)\r\n {\r\n this.hitPoints.current = this.hitPoints.maximum;\r\n }\r\n if(this.hitPoints.current <= 0)\r\n {\r\n this.hitPoints.current = 0;\r\n this.conditions.unshift({name: \"Unconcious\"}) // Put the Unconcious condition back\r\n }\r\n }", "title": "" }, { "docid": "8b5a602f29ffa4dc9e80a3469b376213", "score": "0.56940746", "text": "bustChecker(points){\n if (points > 21) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "86494bed75bc764734a89463c3d151e1", "score": "0.56358474", "text": "isBalanced() {\n\n }", "title": "" }, { "docid": "1f7a5286921b867126a7160288899857", "score": "0.5628433", "text": "ballOverCatcher() {\n return this.x > this.catcherX && this.x < this.catcherX + this.catcherW;\n }", "title": "" }, { "docid": "4e4e3fd35c59f8085c17cb308e85907c", "score": "0.5576965", "text": "function checkCompHit() {\n if (playerWinner) return\n if (cellsPlayer[(shotsTaken[(shotsTaken.length - 1)])] === undefined) {\n compHit = false\n return\n } else if (cellsPlayer[(shotsTaken[(shotsTaken.length - 1)])].classList.contains('ship-hit')) {\n compHit = true\n return\n } else {\n compHit = false\n return\n }\n }", "title": "" }, { "docid": "3f4cc83941b21c252f1a81506f8a9011", "score": "0.55655926", "text": "function earlyBus(busA, busB) {\r\n if (busA.ETA < busB.ETA) {return -1;}\r\n if (busB.ETA < busA.ETA) {return 1;}\r\n return 0;\r\n}", "title": "" }, { "docid": "7315274e47f7363ad0a03ace8eb01684", "score": "0.5562701", "text": "function isSettlement(vertex) {\n let vertexUnit = DATA.getMatch().map.getVertexInfo(vertex);\n if (!_.isObject(vertexUnit) || isKnight(vertexUnit)) return false;\n return (vertexUnit.level == 1);\n}", "title": "" }, { "docid": "409dbfc9efb0dffff4c9a669dc1fcfa4", "score": "0.555547", "text": "function checkCanyon(t_canyon)\n{\n if(gameChar_world_x > t_canyon.x_pos && gameChar_world_x < t_canyon.x_pos + t_canyon.width && gameChar_y >= floorPos_y)\n {\n console.log('fall');\n isPlummeting = true;\n }\n}", "title": "" }, { "docid": "b666b3658b595f10a941e0e2c267e7b0", "score": "0.5554676", "text": "function isRawCondition(packet, event) {\n if (dataType === 'data') {\n return true\n } else {\n return packet.timestamp > event.startTime && packet.timestamp < event.endTime\n }\n }", "title": "" }, { "docid": "f9815b7a7ee4defe0ac03e61d8f36797", "score": "0.5546001", "text": "function thorny_bush_check(io,socket, is_first ,battle_inf){\r\n\treturn true;\r\n}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" }, { "docid": "8928af84f97c1aee22f5305bcab3296d", "score": "0.5536804", "text": "function isCrushed() {}", "title": "" } ]
c95f2a5a31432c0012b84576e304f3b3
show retrieve agency information with table
[ { "docid": "66cbab5e3f69dc5d1c1f1c55a712fcdf", "score": "0.5789893", "text": "function retrieveAgency() {\n if (!lessOneNotNullInRetrievePage())\n return;\n var object = $('#agency-property')[0];\n var retrieveAgencyForm = new FormData(object);\n $.ajax({\n type: 'post',\n url: '/retrieve/agency',\n data: retrieveAgencyForm,\n processData: false,\n contentType: false,\n beforeSend: function () {\n $('#ajaxErrorInfo').remove()\n\t $('tbody').children().each(function(index){\n\t\t\tif(index!=0)\n\t\t\t\t$(this).remove();\n\t\t});\n },\n success: function (data) {\n console.log(data);\n var outPutDiv = $('#retrieve-result-table');\n var innerHTML = \"\";\n for (var i = 0; i < data.length; i++) {\n var aId = '\"' + data[i].ano + '\"';\n innerHTML += \"<tr>\" +\n \"<td>\" + data[i].ano + \"</td>\" +\n \"<td>\" + data[i].phone + \"</td>\" +\n \"<td>\" + data[i].name + \"</td>\" +\n \"<td>\" + data[i].sex + \"</td>\" +\n \"<td><a href='/modify/agency/page/\"+data[i].ano+ \"'>\" + \"详情/管理\" + \"</a></td>\" +\n \"</tr>\";//agency base information\n innerHTML += \"<tr><td colspan='5' height='80px' style='display: none' id='\" + data[i].ano + \"'>\" + \"入职时间:\" + data[i].created_at + \"<br/>备注:\" + data[i].remark + \"</td></tr>\"//hide agency efficacy\n }\n\t if(innerHTML==='')\n\t\tinnerHTML = '<tr><td colspan=\"5\" style=\"font-size:1.5em\">无结果</td></tr>';\n outPutDiv.append(innerHTML);\n },\n error: function (data) {\n showWarningAfterNav(data);\n console.log(data);\n }\n });\n}", "title": "" } ]
[ { "docid": "127500039ca712be8b009e63d4a1c401", "score": "0.6377421", "text": "function viewAgency(agency_id) {\n console.log('view details clicked ', agency_id);\n $http.get('/agencies/' + agency_id).then(function(response) {\n agency.selected = response.data;\n console.log('Agency record back from db: ', agency.selected);\n });\n }", "title": "" }, { "docid": "38b6a03bf43763cd6f76e14c8450786e", "score": "0.57659656", "text": "function viewDepartments() {\n\n\n // var query = \"SELECT top_albums.year, top_albums.album, top_albums.position, top5000.song, top5000.artist \";\n // query += \"FROM top_albums INNER JOIN top5000 ON (top_albums.artist = top5000.artist AND top_albums.year \";\n // query += \"= top5000.year) WHERE (top_albums.artist = ? AND top5000.artist = ?) ORDER BY top_albums.year \";\n\n\n connection.query(\"SELECT DepartmentID, Department, Overhead_Cost FROM departments\", function (err, res) {\n if (err) throw err;\n\n //Prints Table\n console.log(\"\\n\");\n console.table(res);\n console.log(\"\\n\");\n\n userSearch();\n });\n\n}", "title": "" }, { "docid": "cbe2f8c19914126bc506566300da85ae", "score": "0.5721626", "text": "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "title": "" }, { "docid": "6bdadbbb8aa58918db3686a6fc2d8dde", "score": "0.56835735", "text": "function viewEmpByDept() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY d.name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ----------------------------------- \\n ALL COMPANY EMPLOYEES BY DEPARTMENT \\n -----------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "d4742674adfdd1658fe19a4b9ce8e682", "score": "0.5659082", "text": "function viewBudget() {\n connection.query(\n \"SELECT d.name AS 'Department', SUM(r.salary) AS 'Budget' FROM employee e INNER JOIN role r ON r.id = e.role_id INNER JOIN department d ON d.id = r.department_id GROUP BY Department;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (let i = 0; i < res.length; i++) {\n let empObj = [res[i].Department, res[i].Budget];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS & BUDGET UTILIZED \\n ------------------------------------\"\n );\n console.table([\"Department\", \"Budget\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "d6a35b4905f2c73063bff3ab40f631c4", "score": "0.56487644", "text": "function displayAlldept() {\n // let query = \"SELECT * FROM department\";\n connection.query(\"SELECT * FROM department\", (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Department list ** \\n\");\n printTable(res);\n });\n}", "title": "" }, { "docid": "3c5bbde3ee2a81ce22de20ca05ff128c", "score": "0.5627036", "text": "function buildTable(taObj) {\n let table = $('#applicants-table');\n let parent = table.children();\n for (let j = 0; j < taObj.length; j++) {\n var td = $('td');\n var data = [taObj[j].givenname, taObj[j].familyname, taObj[j].status, taObj[j].year];\n\n parent.append($('<tr>'));\n for (let i = 0; i < data.length; i++) {\n var html = $('<td>').text(data[i]);\n parent.append(html);\n }\n }\n table.show();\n}", "title": "" }, { "docid": "978d54ab72bcbaa99b2b238ffc25bbb2", "score": "0.55890363", "text": "function viewEmpByMgr() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY m.last_name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" -------------------------------- \\n ALL COMPANY EMPLOYEES BY MANAGER \\n --------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "301329f5c17af9a55462f6ad7e3921d9", "score": "0.55391335", "text": "function display() {\n // var table = new Table({style:{border:[],header:[]}});\n\n \n var query = \"SELECT item_id 'Item ID', product_name 'Product Name', price 'Price' from products GROUP BY item_id\";\n connection.query(query, function(err, res) {\n console.log(\"\\n\");\n console.table(res);\n });\n}", "title": "" }, { "docid": "0def66982ac6edd8f89b1174d8922e92", "score": "0.5520978", "text": "function viewAllEmp() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY e.last_name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ---------------------------------- \\n ALL COMPANY EMPLOYEES AT THIS TIME \\n ----------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "2ca099a6539bc630f76ea60a5381030f", "score": "0.546854", "text": "function display() {\n var sql = `SELECT *, p.department_name, d.department_name,\n SUM(product_sales) AS p_sales\n FROM products AS p\n INNER JOIN departments AS d\n ON p.department_name=d.department_name\n GROUP BY d.department_name`;\n var query = connection.query(sql, function(err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\n \"department_id\",\n \"department_name\",\n \"over_head_costs\",\n \"product_sales\",\n \"total_profit\"\n ]\n });\n\n res.forEach(function(e) {\n var overhead = e.over_head_costs;\n var sales = e.p_sales;\n var profit = sales - overhead;\n table.push([e.department_id, e.department_name, overhead, sales, profit]);\n });\n // display the table\n console.log(table.toString());\n displayMenu();\n });\n}", "title": "" }, { "docid": "28907100775f594acea3ccb5c52f2740", "score": "0.5463547", "text": "function displayAllDepartments() {\n let query = \"SELECT * FROM department \";\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Department list ** \\n\");\n console.table(res);\n });\n}", "title": "" }, { "docid": "4b58a153fc479dbc02191f64afd42744", "score": "0.5456789", "text": "function tableDisplay() {\n connection.query(\n \"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString() + \"\\n\");\n managerChoices();\n }\n )\n}", "title": "" }, { "docid": "ebe83c3afa346f404fadd199f1d3bc07", "score": "0.5449084", "text": "function viewEmp(){\n connection.query(`\n SELECT e.first_name FirstName, e.last_name LastName, d.name Department, r.title JobTitle, r.salary Salary, e.id EmpID, e.manager_id Manager\n FROM employee e\n LEFT JOIN role r on (e.role_id = r.id)\n LEFT JOIN department d on (r.department_id = d.id)\n LEFT JOIN employee m on (e.manager_id = m.id)\n ORDER BY e.first_name,e.last_name,d.name,r.title;`,(err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "title": "" }, { "docid": "2b810d05e16afcdfea69447412a91def", "score": "0.54283476", "text": "function viewEmp() {\n connection.query(\"SELECT employee.first_name, employee.last_name, emp_role.title, emp_role.salary, department.dept_name, manager.first_name AS 'manager_firstname', manager.last_name AS 'manager_lastname' FROM employee LEFT JOIN emp_role ON employee.role_id = emp_role.id LEFT JOIN department ON emp_role.department_id = department.id LEFT JOIN employee manager ON employee.manager_id = manager.id;\", function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n });\n}", "title": "" }, { "docid": "e4f56de35f859c543147c372febe4513", "score": "0.5428255", "text": "function viewDepartment() {\n connection.query(\"SELECT * FROM employee_db.department\", function (error, data) {\n console.table(data)\n init()\n })\n}", "title": "" }, { "docid": "1e63e754c8245a2aec5a6fff54f5d2a2", "score": "0.54241264", "text": "function view() {\n const query = `SELECT a.id, a.first_name, a.last_name, role.title, department.name AS department, role.salary, CONCAT(b.first_name, \" \", b.last_name) AS manager\n FROM employee a\n LEFT JOIN role ON role.id = a.role_id\n LEFT JOIN department ON department.id = role.department_id\n LEFT JOIN employee b ON a.manager_id = b.id;`\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n return init();\n });\n}", "title": "" }, { "docid": "399ee2945e68d5e140e1bfd0a8a7ef1a", "score": "0.5421373", "text": "function departmentTable() { }", "title": "" }, { "docid": "25f2bd03650084233638e8a7d51b5d1f", "score": "0.54168", "text": "function _showAggregateAnalitycs(client){\r\n\r\n\t\t\twindow.location.hash = '';\r\n\r\n\t\t\tif(Page.mediaspots.length == 0){\r\n\t\t\t\t$div.hide();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t_mediaspot = null;\r\n\r\n \t\t$('[href=\"#tab-analytics\"]').tab('show')\r\n\t\t\t$div.find('.mediaspot-tabs').hide();\r\n\r\n\t\t\tvar title = '';\r\n\t\t\tif($('#select_content_provider option').length > 1){\r\n\t\t\t\ttitle = 'Aggregated analytics for <b>' + Page.contentProvider.displayName + '</b>';\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ttitle = 'Aggregated analytics';\r\n\t\t\t}\r\n\t\t\t$div.find('h4').html(title);\r\n\t\t\t$div.show();\r\n\r\n\r\n\t\t\tDownloadsOverTime.show(client);\r\n\t\t\tTableTopFiles.show(client);\r\n\t\t}", "title": "" }, { "docid": "e8fd53ee7800e6119ebec683372f6947", "score": "0.5412103", "text": "viewJobSalarytable(adr) {\n\t\tconst query = `\n\t\tSELECT \t\n\t\tstaffrole.title,sum(staffrole.salary)\n\t\tFROM employee As S1\n\t\tRight JOIN employee as S2 on (S1.id = S2.manager_id)\n\t\tLEFT JOIN staffrole on (S2.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tWHERE department.id = ?\n group by staffrole.title\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "title": "" }, { "docid": "c54b85fcdd9ffedd6914f894ba348b4a", "score": "0.5391076", "text": "function viewEmployee() {\n console.log(\"Viewing all employees\\n\");\n\n var results=connection.query\n (\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department_id AS department, role.salary, employee.manager_id FROM employee, role where employee.role_id = role.id ;\",\n function(error,results)\n {\n\n if(error) throw error;\n\n \n console.table(results)\n console.log(\" All Employees \\n\");\n mainMenu();\n \n })\n\n }", "title": "" }, { "docid": "7dff122b453054dc6c4b4a82beb32c41", "score": "0.53862375", "text": "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "title": "" }, { "docid": "6c1ada079d76e3c31faf144d51661dda", "score": "0.5374204", "text": "function viewAllEmployees() {\n const query = \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.department_name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id\";\n db.query(query, function (err, res) {\n console.table(res);\n startTracker();\n });\n}", "title": "" }, { "docid": "9ec150656f184efb364eec1f741db5b6", "score": "0.53673494", "text": "show() {\r\n console.table(this.data);\r\n }", "title": "" }, { "docid": "e24b12d018e5e0306454fec7275cc757", "score": "0.5349992", "text": "function viewEmp() {\n connection.query(\n \"SELECT employee.id,first_name,last_name,manager,title,salary,department FROM employee JOIN role ON employee.role_id = role.id JOIN department ON role.department_id = department.id\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n}", "title": "" }, { "docid": "11d42b1696a015b5b4fed579461eaf20", "score": "0.53447694", "text": "function showItems(displaytable){\n let table=new Table({\n head:[\"id\",\"product\",\"department\",\"price\",\"quantity\"]\n });\n connection.query(\"SELECT * FROM Products\",function(err,res){\n if(err) throw err;\n for (let i=0;i<res.length; i++){\n table.push([res[i].id,res[i].product,res[i].department,res[i].price,res[i].quantity]);\n }\n console.log(table.toString());\n displaytable();\n });\n}", "title": "" }, { "docid": "cc6d60b9fe7402887ce20fd560abe958", "score": "0.53434014", "text": "function show(data) {\r\n let tab = \r\n `<tr>\r\n <th>ID</th>\r\n <th>NAME</th>\r\n </tr>`;\r\n \r\n // Loop to access all rows \r\n for (let r of data) {\r\n tab += `<tr> \r\n <td>${r.id} </td>\r\n <td>${r.name}</td>\r\n \r\n</tr>`;\r\n }\r\n // Setting innerHTML as tab variable\r\n document.getElementById(\"employees\").innerHTML = tab;\r\n}", "title": "" }, { "docid": "1049a26204bcaddd5823e7e0f36ae0bc", "score": "0.5332752", "text": "viewInvidualSalarytable(adr) {\n\t\tconst query = `\n\t\tSELECT \t\n\t\t(CONCAT(s2.first_name, ' ', s2.last_name)) AS staff_name,\n\t\tstaffrole.title,staffrole.salary\n\t\tFROM employee As S1\n\t\tRight JOIN employee as S2 on (S1.id = S2.manager_id)\n\t\tLEFT JOIN staffrole on (S2.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tWHERE department.id = ?\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "title": "" }, { "docid": "a34cf4ffa5fb40fab440e873f2b40755", "score": "0.53251445", "text": "function showTable() {\n\tmyDB.transaction(function(transaction) {\n\ttransaction.executeSql('SELECT * FROM patients_local', [], function (tx, results) {\n\t\tvar len = results.rows.length, i;\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tpatients[i] = {\"id\":results.rows.item(i).id, \"name\":results.rows.item(i).name, \"date\":results.rows.item(i).date, \"image\":results.rows.item(i).image};\n\t\t}\n\t\tdisplayList(patients);\n\t}, null);\n\t});\n}", "title": "" }, { "docid": "533fdb25ab8d748b10565dd06faaf111", "score": "0.53126407", "text": "function getAllCases(){\n // console.log(\"https://kea-alt-del.dk/customersupport/\"\");\n fetch(\"https://kea-alt-del.dk/customersupport/\")\n .then(res=>res.json())\n .then(show)\n \n }", "title": "" }, { "docid": "61084f5e0a71cb077cee3665a4e627fb", "score": "0.5306395", "text": "function viewAllEmployees() {\n connection.query(\n `SELECT * from employees`,\n function (err, res) {\n if (err) throw err;\n console.log(\"Employees:\");\n console.table(res);\n\n })\n}", "title": "" }, { "docid": "08976a123f68d8d872723d7c6d6d2b9a", "score": "0.52917403", "text": "function viewProductByDept(){\n //prints the items for sale and their details\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n // cli-table build\n var table = new Table({\n head: [\"Id\", \"Department\", \"Over-Head\" , \"Sales\", \"Profit\"]\n , colWidths: [5, 20, 10, 10, 10]\n });\n \n //push data to table\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].total_sales).toFixed(2), (res[i].total_sales - res[i].over_head_costs).toFixed(2)]\n )\n }\n // displays table\n console.log(table.toString());\n isThatAll();\n })\n}", "title": "" }, { "docid": "f8da6fbda4acead570d941d3b548b33a", "score": "0.5289198", "text": "function viewAllDepartments() {\n const query = 'SELECT * FROM department';\n connection.query(query, function (err, res) {\n if (err) {\n console.log(err)\n }\n else {\n // do stuff with the results \n console.log(res)\n console.table(res);\n options();\n }\n })\n}", "title": "" }, { "docid": "70763e36a245aa34f8fb61a712e3a16f", "score": "0.52734715", "text": "function viewEmpls() {\n connection.query(\"SELECT * FROM employee\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "title": "" }, { "docid": "7ab4ec214db8df4c944224f6a6c5537c", "score": "0.5272575", "text": "function viewDepartmentList() {\n let query = \"SELECT * FROM department\";\n\n connection.query(query, (error, data) => {\n if (error) throw error;\n console.table(data);\n return employee_App();\n });\n}", "title": "" }, { "docid": "dd8f98fae7a2266e44fe77ac896a66cc", "score": "0.5272329", "text": "function viewEmpByRole() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY r.title;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\" ----------------------------- \\n ALL COMPANY EMPLOYEES BY ROLE \\n -----------------------------\");\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "2ba5e85492b8c77da39c0b482da8c2b0", "score": "0.5270735", "text": "function showTable(results) {\n var table = new Table();\n table.push([\n 'ID'.bgRed,\n 'Item Name'.bgRed,\n 'Department Name'.bgRed,\n 'Price'.bgRed,\n 'Stock Quantity'.bgRed]);\n results.forEach(function (row) {\n table.push([\n row.itemId,\n row.productName,\n row.departmentName,\n accounting.formatMoney(row.price),\n accounting.formatNumber(row.stockQuantity)\n ]);\n });\n console.log('' + table);\n}", "title": "" }, { "docid": "db1937dbf2e2d60373f572920f2822f1", "score": "0.52704126", "text": "function showDepartments() {\n connection.query(\"SELECT d.department_id, d.department_name, d.over_head_costs, SUM(p.product_sales) AS product_sales, SUM(p.product_sales) - d.over_head_costs AS total_profit FROM bamazon.departments AS d LEFT JOIN bamazon.products AS p ON d.department_name = p.department_name GROUP BY d.department_name ORDER BY d.department_id;\", function (err, res) {\n if (err) throw err;\n console.log(\"\\nProduct Sales by Department:\\n\")\n var table = new Table({\n head: ['ID'.cyan, 'Department'.cyan, 'Over Head Costs'.cyan, 'Product Sales'.cyan, 'Total Profit'.cyan]\n , colWidths: [5, 15, 20, 20, 20]\n });\n res.forEach(row => {\n table.push(\n [row.department_id, row.department_name, \"$\" + row.over_head_costs, \"$\" + row.product_sales, \"$\" + row.total_profit],\n );\n });\n console.log(table.toString());\n console.log(\"\\n~~~~~~~~~~~~~~~~~\\n\\n\");\n start();\n });\n}", "title": "" }, { "docid": "184d8d417829f35eae539092611843c1", "score": "0.5268096", "text": "function displayAll() {\n connection.query(\"SELECT id, product_name, price FROM products\", function(err, res){\n if (err) throw err;\n console.log(\"\");\n console.log(' WELCOME TO BAMAZON ');\n var table = new Table({\n head: ['Id', 'Product Description', 'Price'],\n colWidths: [5, 50, 7],\n colAligns: ['center', 'left', 'right'],\n style: {\n head: ['cyan'],\n compact: true\n }\n });\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].price]);\n }\n console.log(table.toString());\n // productId();\n }); //end connection to products\n}", "title": "" }, { "docid": "3be5ef0d38326530ff7f811e8c568a80", "score": "0.52649695", "text": "function displayExpensesOverview(e) {\n\n var expansesTable = \"\";\n\n db.transaction([\"Expenses\"], \"readonly\").objectStore(\"Expenses\").openCursor().onsuccess = function(e) {\n var cursor = e.target.result;\n if(cursor) {\n expansesTable += \"<tr>\";\n expansesTable += \"<td>\"+cursor.key+\"</td>\";\n for(var key in cursor.value) {\n expansesTable += \"<td>\" + cursor.value[key] + \"</td>\";\n }\n expansesTable += \"</tr>\";\n cursor.continue();\n }\n document.querySelector(\"tbody\").innerHTML = expansesTable;\n }\n}", "title": "" }, { "docid": "6426404d5101e1968f452b5afd6c2561", "score": "0.5259605", "text": "function showTable() {\n const data=[];\n\n // preparing table data\n props.colleges.map(college=>{\n data.push({\n info:college,\n name:college.name,\n location:college.city+\", \"+college.state+\", \"+college.country,\n year_founded:college.year_founded,\n details:college,\n })\n }) \n\n // if no colleges found, show 404 message else show table\n return props.colleges.length===0? <Result status=\"404\" title=\"404\" subTitle=\"No colleges found\" />: <CustomTable data={data} \n header=\"List of all colleges\" \n footer={\"Above are the list of all colleges\"}\n columns= {[\n {\n title:\"College Detail\",\n dataIndex: 'info',\n align: 'center',\n render: text =><a onClick={() => collegeInfo(text)} key=\"list-loadmore-edit\">{text.name}</a>,\n responsive: ['xs']\n },\n {\n title: 'College Name',\n dataIndex: 'name',\n align: 'center',\n responsive: ['sm']\n },\n {\n title: 'Location',\n dataIndex: 'location',\n align: 'center',\n responsive: ['md']\n },\n {\n title: 'Year Of Foundation',\n dataIndex: 'year_founded',\n align: 'center',\n responsive: ['md']\n },\n {\n title: 'Show Details',\n dataIndex: 'details',\n render: text =><a onClick={() => collegeInfo(text)} key=\"list-loadmore-edit\">Show Details</a>,\n align: 'center',\n responsive: ['sm']\n },\n ]}\n />\n }", "title": "" }, { "docid": "0eb64db3b053d2a42ef5f8a3bf6288a1", "score": "0.5258259", "text": "function viewDept(){\n connection.query(`SELECT name, id FROM department;`, (err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "title": "" }, { "docid": "30aee5415e50d82b9427546df222ce65", "score": "0.52544624", "text": "function displayAllEmployees() {\n // let query = \"SELECT * FROM employee\";\n connection.query(\"SELECT * FROM employee\", (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Employee list ** \\n\");\n printTable(res);\n });\n}", "title": "" }, { "docid": "ea4d6f27ddeded2b2ad7d248b3dad2b9", "score": "0.52517945", "text": "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "title": "" }, { "docid": "e243638da6da40d6a7a2d3548555b836", "score": "0.52456766", "text": "displayTable (data) {\n const table = new Table({\n head: ['Name', 'Network', 'Balance (AVAX)'],\n colWidths: [25, 15, 20]\n })\n\n for (let i = 0; i < data.length; i++) table.push(data[i])\n\n const tableStr = table.toString()\n\n // Show the table on the console\n this.log(tableStr)\n\n return tableStr\n }", "title": "" }, { "docid": "bee032342b37a09cf5adc25165090d64", "score": "0.5241445", "text": "function displayAllEmployees() {\n let query = \"SELECT * FROM employee \";\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Employee list ** \\n\");\n console.table(res);\n });\n}", "title": "" }, { "docid": "4033a26a42c603dd137eed4d0b8b90c2", "score": "0.52401406", "text": "async index(request, response){\n const ong_id = request.headers.authorization;\n\n const incidents = await connection('incidents') //seleciona todos os registros da tabela incidents\n .where('ong_id', ong_id) //onde ong_id da tabela seja igual ao ong_id coletado do\n .select('*'); // headers.authorization pego acima.\n\n return response.json(incidents); //retorna os incidents cadastrados\n }", "title": "" }, { "docid": "51c9d6cac6c993b239e9fec8ba596a5b", "score": "0.5234026", "text": "function getAgencies() {\n console.log('client sent request to server for all agencies');\n $http.get('/agencies').then(function(response) {\n agencies.array = response.data;\n console.log(agencies.array);\n });\n }", "title": "" }, { "docid": "bd5fad9b3461bb9e155ce1e956f3fdd2", "score": "0.52290636", "text": "function createAppealsTable(data){\n // Initialize html tables\n var html = \"\";\n\n // Run through data and prep for tables\n data.forEach(function(d,i){\n\n\t\thtml += '<tr><td>'+d['name']+'</td><td>' + d['dtype']['name'];\n\t\thtml += '</td><td>'+getAppealType(d['atype']);\n\t\thtml += '</td><td>'+d['start_date'].substr(0,10)+'</td><td>'+d['end_date'].substr(0,10);\n\t\thtml += '</td><td>'+niceFormatNumber(d['num_beneficiaries'],true)+'</td><td>'+niceFormatNumber(d['amount_requested'],true);\n\t\thtml += '</td><td>'+d['code']+'</td></tr>';\n\n });\n // Send data to appeals or DREFs html tables\n $('#appealstable').append(html);\n\n}", "title": "" }, { "docid": "3cdd558fa93f3ea819cee0d465f324ce", "score": "0.52242744", "text": "function viewEmpByDept() {\n const sql = `\n SELECT \n employee.id AS EmployeeID, \n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName, \n department.name AS Department \n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id \n LEFT JOIN department \n ON role.department_id = department.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Department `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "title": "" }, { "docid": "94dde46bd533d3bd577fc77237da2799", "score": "0.52235", "text": "function display(heading,data){\n\tvar str=\"\";\n\tstr+='<table width=\"200\" border=\"1\">';\n\tstr+=\"<tr>\";\n\tfor(var col=0;col<heading.length;col++){\n\t\tstr+=\"<th>\"+heading[col]+\"</th>\";\n\t}\n\tstr+=\"</tr>\";\n\tfor(var year=1;year<data.length;year++){\n\t\tstr+=\"<tr>\";\n\t\tstr+=(\"<td>\"+year+\"</td>\");\n\t\tstr+=(\"<td>\"+retirement[year]+\"</td>\");\n\t\tstr+=\"</tr>\";\n\t}\n\tstr+=\"</table>\";\n\treturn str;\n}", "title": "" }, { "docid": "99af05e13b5fd67c73a2704c72e3bb91", "score": "0.52171445", "text": "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(\"\\n\" + table.toString() + \"\\n\");\n });\n}", "title": "" }, { "docid": "c58687457b50d90f466ecc1d52e3c55b", "score": "0.5213255", "text": "function viewAll() {\n connection.query(\n \"SELECT e.empid as ID, CONCAT(e.first_name, ' ', e.last_name) as Employee, name as Department, title as Title, salary as Salary, CONCAT(m.first_name, ' ', m.last_name) as Manager FROM employee e LEFT JOIN roles ON roles.roleid = e.role_id LEFT JOIN department ON department.deptid = roles.department_id LEFT JOIN employee m ON m.empid = e.manager_id ORDER BY e.empid\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "title": "" }, { "docid": "01bf235270aa84009308614f836cee09", "score": "0.52130646", "text": "function tableDisplay() {\n console.log(\"\\n\")\n connection.query(\n \"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString());\n }\n )\n}", "title": "" }, { "docid": "c8e674f5c7eab8ac4d46e81f99edbbc4", "score": "0.52083755", "text": "getAllOrganizations(){\n var url = MainData.ballerinaDatabaseURL + \"organization/selectAll\";\n \n \n return axios.get(\n url\n )\n .then(function (response) {\n \n return(response.data) ;\n \n })\n .catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "56c27c134a5d5c678dff8dca26fd9583", "score": "0.52075905", "text": "function viewDept() {\n connection.query(\n `\n SELECT \n department.name AS 'Department'\n FROM department\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "title": "" }, { "docid": "dd79f68dc2741b3434af456fa8fefc0b", "score": "0.5203926", "text": "function viewDeps() {\n connection.query(\"SELECT * FROM department\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "title": "" }, { "docid": "97f02616efd538ac3cad4a2ce267a019", "score": "0.52033544", "text": "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "title": "" }, { "docid": "80a157e998b9f84d96ad775c15346fc0", "score": "0.5197182", "text": "function displayAlgerianLCs(){\n $.ajax({\n url: jsonPath,\n dataType: 'json',\n type: 'GET',\n success: function(data){\n mainData = data.analytics.total_applications.children.buckets;\n for (let i=0; i<mainData.length; i++){\n $('#table tbody').append(\"\" +\n \"<tr>\" +\n \"<td>\"+mainData[i].key +\"</td>\" +\n \"</tr>\"+\n \"\");\n }\n\n }\n })\n}", "title": "" }, { "docid": "786d5e8de46ae229664c97eda438585f", "score": "0.5196492", "text": "function showChartOfAcctsLOV(notIn, obj, acctName) {\n\tLOV.show({\n\t\tcontroller: \"AccountingLOVController\",\n\t\turlParameters: {\n\t\t\taction: \"getChartOfAcctsLOV\",\n\t\t\tnotIn: notIn,\n\t\t\tglObj: obj,\n\t\t\tacctName: acctName,\n\t\t\tpage: 1\n\t\t},\n\t\ttitle: \"Search GL Account Code\", //\"GIAC Chart of Accounts\",\n\t\thideColumnChildTitle: true,\n\t\twidth: 800,\n\t\theight: 403,\n\t\tcolumnModel: [\n\t\t {\n\t \t id : 'glAcctCategory glControlAcct glSubAcct1 glSubAcct2 glSubAcct3 glSubAcct4 glSubAcct5 glSubAcct6 glSubAcct7',\n\t \t title: 'Acct Code',\n\t \t width: 270,\n\t \t children: [\n\t \t {\n\t\t\t\t\t\t\t\t id : 'glAcctCategory',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right'/*,\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }*/\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glControlAcct',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct1',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct2',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct3',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct4',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct5',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct6',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t id : 'glSubAcct7',\n\t\t\t\t\t\t\t\t width: 30,\n\t\t\t\t\t\t\t\t align: 'right',\n\t\t\t\t\t\t\t\t renderer: function(value){\n\t\t\t\t \t\t return lpad(value, 2, 0);\n\t\t\t\t \t }\n\t\t\t\t\t\t\t }\n\t\t\t ]\n\t },\n\t\t\t{\n\t\t\t\t id: \"glAcctName\",\n\t\t\t\t title: \"GL Account Name\",\n\t\t\t\t width: '360px',\n\t\t\t\t titleAlign: 'left',\n\t\t\t\t align: 'left'\n\t\t\t},\n\t\t\t{\n\t\t\t\t id: \"glAcctId\",\n\t\t\t\t title: \"GL Acct Id\",\n\t\t\t\t width: '67px',\n\t\t\t\t align: 'right'\n\t\t\t},\n\t\t\t{\n\t\t\t\t id: \"gsltSlTypeCd\",\n\t\t\t\t title: \"SL Type Cd\",\n\t\t\t\t width: '67px',\n\t\t\t\t align: 'right'\n\t\t\t}\n\t\t],\n\t\tdraggable: true,\n\t\tonSelect: function(row) {\n\t\t\t$(\"inputGlAcctCtgy\").value \t= parseInt(row.glAcctCategory);\n\t\t\t$(\"inputGlCtrlAcct\").value \t= parseInt(row.glControlAcct).toPaddedString(2);\n\t\t\t$(\"inputSubAcct1\").value \t= parseInt(row.glSubAcct1).toPaddedString(2);\n\t\t\t$(\"inputSubAcct2\").value \t= parseInt(row.glSubAcct2).toPaddedString(2);\n\t\t\t$(\"inputSubAcct3\").value \t= parseInt(row.glSubAcct3).toPaddedString(2);\n\t\t\t$(\"inputSubAcct4\").value \t= parseInt(row.glSubAcct4).toPaddedString(2);\n\t\t\t$(\"inputSubAcct5\").value \t= parseInt(row.glSubAcct5).toPaddedString(2);\n\t\t\t$(\"inputSubAcct6\").value \t= parseInt(row.glSubAcct6).toPaddedString(2);\n\t\t\t$(\"inputSubAcct7\").value \t= parseInt(row.glSubAcct7).toPaddedString(2);\n\t\t\t$(\"inputGlAcctName\").value \t= unescapeHTML2(row.glAcctName); //added unescapeHTML2 by robert 10.19.2013\n\t\t\t$(\"hiddenGlAcctId\").value \t= row.glAcctId;\n\t\t\t$(\"hiddenSlTypeCd\").value \t= row.gsltSlTypeCd;\n\t\t\tvalidateGlAcctId(row.glAcctId, row.gsltSlTypeCd);\t//Gzelle 11062015 KB#132\n\t\t\thideOverlay();\n\t\t\tif(row.gsltSlTypeCd == null || row.gsltSlTypeCd == \"\") {\n\t\t\t\t$(\"inputSlName\").removeClassName(\"required\");\n\t\t\t\t$(\"selectSlDiv\").removeClassName(\"required\");\n\t\t\t\t$(\"inputSlName\").style.backgroundColor = \"#FFFFFF\";\n\t\t\t\tdisableSearch(\"searchSlCd\");\n\t\t\t} else {\n\t\t\t\tif ($(\"hiddenSlTypeCd\").getAttribute(\"isSlExisting\") == \"Y\") {\n\t\t\t\t\t$(\"inputSlName\").addClassName(\"required\");\n\t\t\t\t\t$(\"selectSlDiv\").addClassName(\"required\");\n\t\t\t\t\t$(\"inputSlName\").style.backgroundColor = \"#FFFACD\";\n\t\t\t\t}else {\n\t\t\t\t\t$(\"inputSlName\").removeClassName(\"required\");\n\t\t\t\t\t$(\"selectSlDiv\").removeClassName(\"required\");\n\t\t\t\t\t$(\"inputSlName\").style.backgroundColor = \"#FFFFFF\";\n\t\t\t\t}\n\t\t\t\tenableSearch(\"searchSlCd\");\n\t\t\t}\n\t\t},\n\t\tprePager: function(){\n\t\t\ttbgLOV.request.notIn = notIn;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "842c7866f23bb0d55f91be21f471845d", "score": "0.5191201", "text": "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "title": "" }, { "docid": "ab45eb9b28fda93807b805735794923f", "score": "0.5190238", "text": "function displayTable() {\n var query = connection.query(\"SELECT * FROM products\", function(err, res) {\n \n var table = new Table([\n\n head=['id','product_name','department_name','price','stock_quantity']\n ,\n\n colWidths=[6,21,25,17]\n \n ]);\n table.push(['id','product name','department name','price','stock quantity']);\n for (var i = 0; i < res.length; i++) {\n table.push(\n \n [res[i].id ,res[i].product_name,res[i].department_name,res[i].price ,res[i].stock_quantity]\n \n );\n }\n console.log(colors.bgWhite(colors.red((table.toString())))); \n });\n}", "title": "" }, { "docid": "d47c76716e0c928ce45827ecf5594ea7", "score": "0.5177556", "text": "function viewByDept() {\n connection.query(\"SELECT first_name, last_name, department.name FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database by department. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "title": "" }, { "docid": "c7fd273ce44ace36691e5d33f64ed430", "score": "0.5175743", "text": "function viewJoined() {\n connection.query(\"SELECT role.title, role.salary, employee.first_name, employee.last_name, manager_id, department.name FROM ((employee_tracker_db.role INNER JOIN employee_tracker_db.employee ON role.id = employee.role_id) INNER JOIN employee_tracker_db.department ON role.department_id = department.id)\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "title": "" }, { "docid": "be2f496d7ae68033efae9a04608cb5f8", "score": "0.5173918", "text": "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "title": "" }, { "docid": "a440474e1f244eeb0c439ff4ee33368f", "score": "0.5170349", "text": "function callOverview(data, campus = campusDefault, cohort = cohortDefault) {\n showEnrollment(data, campus, cohort);\n showAchievement(data, campus, cohort);\n showNetPrometerScore(data, campus, cohort);\n showTechSkills(data, campus, cohort);\n showStudentSatisfaction(data, campus, cohort);\n showTeacherRating(data, campus, cohort);\n showLastJediMasterRating(data, campus, cohort);\n}", "title": "" }, { "docid": "b8bb46e55475e02635aad58ceacea46d", "score": "0.51672083", "text": "* overviewPrint (request, response) {\n const categories = yield Category.all(),\n result = yield Result.get(request.param('id')),\n user = yield request.auth.getUser(),\n type = request.input('type'),\n date = moment().format('YYYY-mm-DD hh:mm:ss')\n\n result.sortCandidates((a, b) => {\n return result.getJudgesAverage(b.id) - result.getJudgesAverage(a.id)\n })\n\n if (type == 'winner') {\n result.sliceTop(1)\n }\n\n if (type == 'top-5') {\n result.sliceTop(5)\n }\n\n yield response.sendView('dashboard/score/overview_print', {\n categories, result, user, date\n })\n }", "title": "" }, { "docid": "eac75a7ce90f8982bdda001897268108", "score": "0.51657367", "text": "function show(data) {\r\n let tab =\r\n `<tr> \r\n\t\t\r\n\t\t</tr>`;\r\n\r\n // Loop to access all rows \r\n for (let r of data.articles) {\r\n tab += `<tr> <br><br>\r\n <tr><img src=\"${r.image_url}\" width=50% height=60% class=\"mx-auto w-50\"><br></tr> \r\n\t <tr>${r.title} <br></tr> \r\n\t <tr><a href=\"${r.article_url}\" target=\"_blank\">Read More</a><br></tr> \r\n\t <tr><strong>Source: </strong> ${r.source_name}<br></tr>\t\r\n \t<hr>\r\n </tr>`;\r\n }\r\n // Setting innerHTML as tab variable \r\n document.getElementById(\"employees\").innerHTML = tab;\r\n}", "title": "" }, { "docid": "4f24f5b42ea044d652e9a28aba4308af", "score": "0.5164538", "text": "async function viewTeachers(db) {\n let sql;\n let res;\n let str;\n\n sql = `\n SELECT\n acronym,\n fname,\n sirname,\n section,\n competence,\n salary,\n birth\n FROM teacher\n ORDER BY acronym;\n `;\n\n\n res = await db.query(sql); //will return a dict with all.\n str = utils.createTable(res); //send the res to get a table\n\n return str;\n}", "title": "" }, { "docid": "e434b5abbc80e2124f594cfad82cfb3f", "score": "0.51644725", "text": "function alienData(tableData) {\n\n // Clear text from tbody\n tbody.text(\"\")\n\n // Loop through table data and log each alien sighting\n data.forEach((alienSighting) => {\n\n // append a row for each alien sighting\n var row = tbody.append(\"tr\");\n\n // use object entries to console log each alien sighting\n Object.entries(alienSighting).forEach(([key, value]) => {\n // console.log(key, value);\n\n // Append cells per alien sighting (Date, City, State, Country, Shape, Duration, Comments)\n var cell = tbody.append(\"td\");\n\n // Update each cells text with alien sighting info\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "a8d34cd9bb3137551600ce238e0e343e", "score": "0.51626897", "text": "function showApplicants(applicants){\n\tfor(var i = 0;i < applicants.length;i++){\n\t\tconsole.log((i+1) + \": name: \" + applicants[i].name)\n\t\tconsole.log(' team: ' + applicants[i].teamName)\n\t}\n}", "title": "" }, { "docid": "b4a239bc98f888f5a3e50c1bbe5ec55c", "score": "0.5159665", "text": "function populateTable() {\n let tableContent = '';\n $.getJSON('/index', (data) => {\n data.forEach(d => {\n tableContent +=\n `<tr>\n <td>${d.organism_id}</td>\n <td>${d.organism_desc}</td>\n <td>${d.sequence_location}</td>\n </tr>`;\n });\n $('#results tbody').html(tableContent);\n });\n}", "title": "" }, { "docid": "fc6aeed6cea87591303f21f14259de4d", "score": "0.5156896", "text": "function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "title": "" }, { "docid": "c731c0ff8d4b53cb245cad5991e1f4ab", "score": "0.51543075", "text": "function showDenominations() {\n //query the helper table for a list of all denominations\n var queryText = encodeURIComponent(\"SELECT 'Denomination' FROM 420855 {ORDER BY 'Denomination' {ASC}} \");\n var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);\n \n //send the resulting list to getData()\n query.send(getData);\n}", "title": "" }, { "docid": "f4da660aab551a98a08f073ac0c3075f", "score": "0.51520383", "text": "function viewDepartments() {\n connection.query(\"SELECT * FROM department\", function (err, res){\n if (err) throw err; \n console.table(res); \n });\n // init.init()\n}", "title": "" }, { "docid": "411daf3ee696bd3a21dd5e2de137982e", "score": "0.51462156", "text": "function governmentAction(countryCode) {\n var govAction =\n \"https://covidtrackerapi.bsg.ox.ac.uk/api/v2/stringency/date-range/2020-04-29/2020-05-06\";\n sIndexEle.text(\"Stringency Index: \");\n $.ajax({\n url: govAction,\n method: \"GET\",\n }).then(function (response) {\n // use 3 letter code to get country specific data\n var stringency = response.data[\"2020-05-06\"][countryCode].stringency;\n sIndexEle.append(stringency);\n });\n}", "title": "" }, { "docid": "f0658671de244976ac82dd99c30785eb", "score": "0.51447016", "text": "function displayInventoryTable(res) {\r\n\r\n const table = new Table({\r\n head: ['Product #', 'Department', 'Product', 'Price', 'Qty In Stock'],\r\n colWidths: [15, 20, 30, 15, 15]\r\n });\r\n\r\n for (let i = 0;\r\n (i < res.length); i++) {\r\n var row = [];\r\n row.push(res[i].item_id);\r\n row.push(res[i].department_name);\r\n row.push(res[i].product_name);\r\n row.push(res[i].price);\r\n row.push(res[i].stock_quantity);\r\n table.push(row);\r\n }\r\n\r\n console.log(table.toString());\r\n}", "title": "" }, { "docid": "bb30ac30b48c7c6320489779d48e6c26", "score": "0.514291", "text": "async index(req, res){\n const {page=1} = req.query;\n const ong_id = req.headers.authorization;\n const incidents = await connection('incidents')\n .where('ong_id', ong_id)\n .limit(5)\n .offset((page-1)*5)\n .select('*')\n return res.json(incidents)\n }", "title": "" }, { "docid": "339f289853be352efa8d6d5889088527", "score": "0.5138564", "text": "function viewDepartments() {\n connection.query(\"SELECT name FROM department\", (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n });\n // RETURN TO MAIN LIST\n runTracker();\n}", "title": "" }, { "docid": "a6d10f8150bac806573e5e8dc81ac292", "score": "0.51363564", "text": "function viewSomething(obj) {\n console.log(\"Viewing requested table!\");\n connection.query(`SELECT * FROM ${obj.table}`, function(err, res) {\n if (err) throw err;\n const newTable = table.getTable(res);\n console.log(newTable);\n });\n console.clear();\n initiation();\n}", "title": "" }, { "docid": "e1fd211132980539435800f47d43bf8a", "score": "0.51336664", "text": "function data2table(data) {\r\n let keys = Object.keys(data[0]);\r\n let html = '<p>Age breakdown for the population of output area ' + data[0]['GEOGRAPHY_CODE'] + ' in ' + data[0]['DATE_NAME'] + '.</p>';\r\n html += '<table class=\"table table-sm\">';\r\n html += '<thead><tr><th scope=\"col\">Age group</th><th scope=\"col\">%</th></tr></thead><tbody>'\r\n for (object in data) {\r\n html += '<tr>';\r\n html += '<td>' + data[object][keys[2]] + '</td>';\r\n html += '<td><img src=\"./img/pixel.png\" style=\"height: 18px; width: ' + (data[object][keys[3]] * 4) + 'px;\"> ' + data[object][keys[3]] + '%</td>';\r\n html += '</tr>';\r\n }\r\n html += '</tbody></table>';\r\n results.innerHTML = html;\r\n}", "title": "" }, { "docid": "d5d992dcb786c79f17787186d71a3cdb", "score": "0.5129555", "text": "function buildTableApp(taObj) {\n for (let j = 0; j < taObj.length; j++) {\n let data = [taObj[j].givenname, taObj[j].familyname, taObj[j].stunum, taObj[j].year, taObj[j].status,\n taObj[j].courses];\n\n $('#gName').after($('<td>').text(data[0]));\n $('#fName').after($('<td>').text(data[1]));\n $('#stuNum').after($('<td>').text(data[2]));\n $('#year').after($('<td>').text(data[3]));\n $('#status').after($('<td>').text(data[4]));\n\n var courses = $('#courses');\n courses.after($('<td>'));\n\n for (let i = 0; i < data[5].length; i++) {\n var course = data[5][i].code;\n var rank = data[5][i].rank;\n var experience = data[5][i].experience;\n\n courses.next().append(\n $('<ul>').append(\n $('<li>').text(course)\n .append($('<li>').text(\"experience: \" + experience))\n .append($('<li>').text(\"rank: \" + rank))));\n }\n }\n $('#applicant-table').show();\n}", "title": "" }, { "docid": "6758a0e709cefd780cb0b83e86d8e036", "score": "0.51271164", "text": "async show(req, res) {\n const { page = 1 } = req.query;\n const response = await DeliveryProblem.findAndCountAll({\n // Config search\n where: {},\n order: [['id', 'DESC']],\n limit: 7,\n offset: (page - 1) * 7\n });\n return res.json({\n deliveriesProbList: response.rows,\n deliveriesProbCount: response.count\n });\n }", "title": "" }, { "docid": "e47c5943ad61f0268888cce2837a4dd6", "score": "0.51270556", "text": "static async viewAll() {\n return Database.select(new Party().table);\n }", "title": "" }, { "docid": "74527c71f111bc085b51e9c5ae64c363", "score": "0.5122127", "text": "function viewDepartment() {\n const queryDepartment = \"SELECT * FROM department\";\n connection.query(queryDepartment, (err, res) => {\n if (err) throw err;\n console.table(res);\n whatToDo();\n });\n}", "title": "" }, { "docid": "96dfb0c36187692ce5f0802630ec7740", "score": "0.51165485", "text": "function loadAwardData() {\n ///// Construct table from data\n var awardResultArray = [];\n ///// config and load live data from Airtable\n var airKeyContent = parseJson(airtableConfigPath);\n if (JSON.stringify(airKeyContent) !== \"{}\") {\n var airKeyInput = airKeyContent[\"api-key\"];\n var airKeyName = airKeyContent[\"key-name\"];\n if (airKeyInput !== \"\" && airKeyName !== \"\") {\n Airtable.configure({\n endpointUrl: \"https://\" + airtableHostname,\n apiKey: airKeyInput,\n });\n var base = Airtable.base(\"appiYd1Tz9Sv857GZ\");\n base(\"sparc_members\")\n .select({\n view: \"All members (ungrouped)\",\n })\n .eachPage(\n function page(records, fetchNextPage) {\n records.forEach(function (record) {\n if (record.get(\"Project_title\") !== undefined) {\n var awardNumber = (item = record.get(\"SPARC_Award_#\"));\n item = record\n .get(\"SPARC_Award_#\")\n .concat(\" (\", record.get(\"Project_title\"), \")\");\n awardResultArray.push(item);\n awardObj[awardNumber] = item;\n }\n }),\n fetchNextPage();\n },\n function done(err) {\n if (err) {\n log.error(err);\n console.log(err);\n return;\n } else {\n // create set to remove duplicates\n var awardSet = new Set(awardResultArray);\n var resultArray = [...awardSet];\n }\n }\n );\n }\n }\n}", "title": "" }, { "docid": "5d761b71657d4abe711e7658221aae55", "score": "0.5116382", "text": "function showTable(res) {\n // empty array to house the each product property\n var productArray = [];\n // for loop to display all the products\n for (var i = 0; i <res.length; i++) {\n // push the object with product properties to the array for each res\n productArray.push({\n // display item.id\n \"Product ID\": res[i].item_id,\n // display product_name\n \"Product Name\": res[i].product_name,\n // display department_name\n \"Department\": res[i].department_name,\n // display price\n \"Price\": \"$\" + res[i].price,\n // display stock_quantity\n \"Quantity\": + res[i].stock_quantity\n }); // end of .push\n } // end of for loop\n // display the table\n console.table(productArray);\n} // end of showTable function", "title": "" }, { "docid": "003e0ff91878a8577c69782e550d7137", "score": "0.51155674", "text": "function viewProducts() {\n connectionDB.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n //console.log(res);\n var tableFormat = new AsciiTable('PRODUCT LIST');\n tableFormat.setHeading('ITEM ID', 'PRODUCT NAME', 'PRICE', 'QUANTITES');\n for (var index in res) {\n\n tableFormat.addRow(res[index].item_id, res[index].product_name, res[index].price, res[index].stock_quantity);\n }\n console.log(tableFormat.toString());\n\n\n });\n}", "title": "" }, { "docid": "a161d9b35bf68353496bbc95c27b7684", "score": "0.51154655", "text": "function displayTable(results) {\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Department', 'Price', 'Stock']\n , colWidths: [10, 30, 15, 10, 10]\n });\n for (i = 0; i < results.length; i++) {\n table.push(\n [results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n );\n }\n console.log(table.toString());\n}", "title": "" }, { "docid": "5770e9d82b7ae97180d6ea4eecf2eb4f", "score": "0.5114879", "text": "function displayProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n tableFormat(res);\n })\n\n}", "title": "" }, { "docid": "77c5263ad97d90806c385c6a3623dc6d", "score": "0.5110197", "text": "function viewAllDepts() {\n connection.query(\n 'SELECT * FROM Department', (err, res) => {\n if (err) {\n console.log(err);\n }\n console.table(res)\n startProgram();\n })\n}", "title": "" }, { "docid": "5bf410bbc8d99e94b31595a7833117a2", "score": "0.5107203", "text": "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "title": "" }, { "docid": "a7a700f30eccc35186d6b5cd9d7e1a42", "score": "0.51057774", "text": "function viewEmployeeDepartment() {\n\n var query =\n `SELECT d.id AS department_id, d.name AS department, e.first_name, e.last_name, r.salary\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id\n ORDER BY d.id`\n\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n console.table(res); \n init(); \n \n });\n}", "title": "" }, { "docid": "e75ce659d57e210edc99dd05a354a493", "score": "0.5101061", "text": "function viewEmploys() {\n // function that show all employees mySQL\n var query = `SELECT * FROM ((employee INNER JOIN role ON role.id = employee.role_id) INNER JOIN department ON department.id = role.department_id)`;\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log(res);\n start();\n });\n}", "title": "" }, { "docid": "5b40ccb91da385c5d5c404d5d1946316", "score": "0.51002544", "text": "function viewDepartments() {\n // var querycolumns = \"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='employeeTracker_db' AND TABLE_NAME='edepartment'\";\n // connection.query(querycolumns, function(err, res) {\n // for (let i = 0; i < res.length; i++) {\n // console.log(\"Column \" + i + \" \" + JSON.stringify(res[i]));\n // }\n // });\n var query = \"Select id, name from edepartment\";\n connection.query(query, function(err, res) {\n\n departmentarray = [];\n\n for (let i = 0; i < res.length; i++) {\n console.log(\"department name = \" + res[i].name);\n departmentobj = { ID: res[i].id, department: res[i].name }\n departmentarray.push(departmentobj);\n }\n\n console.log(\"departmentarray = \", departmentarray);\n\n for (let i = 0; i < departmentarray.length; i++) {\n console.log(\"departmentarray[i] = \", departmentarray[i].department)\n }\n\n console.log(\"\");\n console.table(departmentarray);\n console.log(\"\");\n\n mainMenu();\n });\n}", "title": "" }, { "docid": "9d31cf59f75d922a6c5696ef71253984", "score": "0.5097232", "text": "function viewAllDepartments() {\n connection.query(\n 'SELECT d_id AS id, name AS department_name FROM department ORDER BY d_id ASC;',\n function (err, results) {\n if (err) throw err;\n console.table(results);\n backMenu();\n }\n );\n}", "title": "" }, { "docid": "dfe4baf974e9459357da95eca49bc94c", "score": "0.50953853", "text": "function render_table_million() {\n let columnDefs = [\n {\n headerName: \"Country\",\n field: \"name\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Cases per million\",\n field: \"cases_per_million\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Deaths per million\",\n field: \"deaths_per_million\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Tests per million\",\n field: \"tests_per_million\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n ];\n\n // let the grid know which columns and what data to use\n let gridOptionsContinents = {\n columnDefs: columnDefs,\n onFirstDataRendered: onFirstDataRendered_f,\n animateRows: true,\n pagination: true,\n\n };\n\n\n let gridDiv = document.querySelector('#table_per_million');\n new agGrid.Grid(gridDiv, gridOptionsContinents);\n\n // get data from server\n let full_url = \"/mysql/million\"\n agGrid.simpleHttpRequest({url: full_url})\n .then(function (data) {\n gridOptionsContinents.api.setRowData(data);\n });\n\n}", "title": "" }, { "docid": "4b82607e3c38e6f13b617c3ba24c2914", "score": "0.50919706", "text": "function viewAllDepts() {\n console.log(\"Showing all departments...\\n\");\n connection.query(\"SELECT * FROM department \", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "title": "" }, { "docid": "36714bb5f051834d570ca7b35cd06540", "score": "0.5091099", "text": "function viewDepartmnt() {\n \n connection.query(\" SELECT * FROM department \", function (error, result) \n {\n if (error) throw error;\n console.table(result);\n mainMenu()\n\n });\n\n }", "title": "" }, { "docid": "5f17a3b0e597b09d4f3c9cf7ad0e064d", "score": "0.5089271", "text": "function getIndustries(req, res) {\n const q = `\n SELECT *\n FROM Industry\n WHERE INDUSTRY_ID > 0\n `;\n execQuery(q, res);\n}", "title": "" } ]
ef78b8eb4295bdcea7a669067bd95235
handle when there is database error. Try to reconnect
[ { "docid": "a5a79d9d3974ee8aa71489d79a292145", "score": "0.7263679", "text": "function handleDbError(mongoError) {\n // If there is error in database connection, try re-connect\n console.error(`Mongoose connection has occured ${mongoError} error`);\n console.log('Trying to re-connect to mongo, after 5 seconds.');\n setTimeout(connectToMongo, 5000);\n}", "title": "" } ]
[ { "docid": "a2232a92039d212ec6a8226a1e3426cc", "score": "0.6994297", "text": "handleConnectionError() {\n this.heartbeat.stop();\n this.reconnector.triggerReconnection();\n }", "title": "" }, { "docid": "a2232a92039d212ec6a8226a1e3426cc", "score": "0.6994297", "text": "handleConnectionError() {\n this.heartbeat.stop();\n this.reconnector.triggerReconnection();\n }", "title": "" }, { "docid": "c11376af3583eca76431b5123015ec9c", "score": "0.6947404", "text": "function handleDisconnect() {\n connection = mysql.createConnection(db_config); \n\n connection.connect(function(err) { \n if(err) { \n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000); \n } \n else \n \tconsole.log('connected as id ' + connection.threadId);\n }); \n \n connection.on('error', function(err) {\n console.log('db error', err);\n if(err.code === 'PROTOCOL_CONNECTION_LOST') { \n handleDisconnect(); \n } \n else { \n throw err;\n }\n });\n}", "title": "" }, { "docid": "e0ee5be7372773ebee1f426668112f56", "score": "0.69373614", "text": "function tryToConnectToDatabase () {\n tryConnectOptions.currentRetryCount += 1\n console.log('Database connection try number: ' + tryConnectOptions.currentRetryCount)\n connect(function () {\n \n tryConnectOptions.resolve()\n }, function () {\n if (tryConnectOptions.currentRetryCount < tryConnectOptions.maxRetries) {\n setTimeout(tryToConnectToDatabase, tryConnectOptions.retryInterval)\n } else {\n tryConnectOptions.reject()\n }\n })\n}", "title": "" }, { "docid": "f3b83c65b99f971cd0fc580f3102fc5e", "score": "0.6927804", "text": "function handleDisconnect() {\n _connection = _mysql.createConnection(_dbConfig);\n\n _connection.connect(function (err) {\n if (err) {\n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000);\n }\n });\n\n _connection.on('error', function (err) {\n console.log('db error', err);\n if (err.code === 'PROTOCOL_CONNECTION_LOST') {\n handleDisconnect();\n } else {\n throw err;\n }\n });\n}", "title": "" }, { "docid": "efb48d8a9895b827257a55d9bd261018", "score": "0.6922076", "text": "function handleDisconnect(){\n dbConnection = mysql.createConnection(db_config);\n console.log(\"Successfully connected to Database.\");\n dbConnection.connect(function(err){\n if(err){\n console.log('Error when connecting to DB: ', err);\n setTimeout(handleDisconnect, 5000);\n }\n });\n dbConnection.on('error', function(err){\n console.log('DB ERROR ', err);\n if(err.code === 'PROTOCOL_CONNECTION_LOST'){\n console.log('Lost connection. Reconnecting...');\n handleDisconnect();\n }\n else{\n throw err;\n }\n });\n}", "title": "" }, { "docid": "b2cffac45a1480c8942e384a84339138", "score": "0.68194526", "text": "function maintainConnection() {\n\tc = mysql.createConnection(db);\n\t\n\tc.connect(function(err){\n\t\tif(err){\n\t\t\tnodeLog('Error connecting to Db: ' + err.message);\n\t\t\tsetTimeout(maintainConnection(), 1000) // Retry soon\n\t\t\treturn;\n\t\t}\n\t\tnodeLog('Database connection established');\n\t});\n\t\n\tc.on('error', function (err) {\n\t\tnodeLog(\"Database error: \" + err);\n\t\tif(err.code === 'PROTOCOL_CONNECTION_LOST') {\n\t\t\tmaintainConnection(); // Reconnect\n\t\t} \n\t\telse { \n\t\t\tthrow err;\n\t\t}\n\t})\n\t\n}", "title": "" }, { "docid": "ae7efa234c2871ac7ebf749411ac9c20", "score": "0.68003917", "text": "handleError(err) {\n debug('an error occurred.', err);\n\n if (!this.reconnect) {\n this.emit('error', err);\n this.close();\n return;\n }\n\n this.emit('disconnected', { reason: 'error', err });\n debug('attempting to reconnect');\n\n this.connect(err => {\n if (err) {\n this.emit('error', err);\n this.close();\n return;\n }\n\n this.emit('reconnected');\n });\n }", "title": "" }, { "docid": "da5c86ee7a624ae59b51e6cf33e50e15", "score": "0.6772484", "text": "static syncPendingReviews() {\r\n let dbPromise = DBHelper.getRestaurantDB();\r\n //Obtaining Result\r\n let res = dbPromise.then(function(db) {\r\n let transaction = db.transaction('pending_review_transactions', 'readwrite');\r\n let reviewStore = transaction.objectStore('pending_review_transactions');\r\n let reviews = reviewStore.getAll();\r\n //Clear from local store\r\n reviewStore.clear();\r\n return reviews;\r\n })\r\n .then((pendingReviews) => {\r\n\r\n console.log(\"Uploading pending Reviews \");\r\n pendingReviews.forEach(review => {\r\n DBHelper.saveReview(review.restaurant_id, review.name,\r\n review.rating, review.comments,\r\n review.date, (error, response) => {\r\n // Is it possible that error occur even after getting connection ??\r\n if (error) {\r\n DBHelper.enableBackgroundSync();\r\n }\r\n });//End-saveReview\r\n });//End-forEach\r\n\r\n })\r\n .catch((err) => {\r\n console.log('Problem in Review Sync: '+err);\r\n });\r\nreturn res;\r\n}", "title": "" }, { "docid": "6ddd496ae1c80b972b969d5d1ff18949", "score": "0.6730441", "text": "function handleDisconnect() {\n connection = mysql.createConnection(dbconfig.connection); // Recreate the connection, since\n // the old one cannot be reused.\n\n connection.connect(function(err) { // The server is either down\n if (err) { // or restarting (takes a while sometimes).\n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect,\n } // to avoid a hot loop, and to allow our node script to\n }); // process asynchronous requests in the meantime.\n // If you're also serving http, display a 503 error.\n connection.on('error', function(err) {\n console.log('db error', err);\n if (err.code === 'PROTOCOL_CONNECTION_LOST') { // Connection to the MySQL server is usually\n handleDisconnect(); // lost due to either server restart, or a\n } else { // connnection idle timeout (the wait_timeout\n throw err; // server variable configures this)\n }\n });\n}", "title": "" }, { "docid": "11e925c30f77c3fd415a1a996f2b88f0", "score": "0.65856385", "text": "function handleError (err) {\n if (err) {\n // 如果是连接断开,自动重新连接\n if (err.code === 'PROTOCOL_CONNECTION_LOST') {\n connect();\n } else {\n console.error(err.stack || err);\n }\n }\n}", "title": "" }, { "docid": "a26b36b6fc9cd51d4498db07dd48fa4d", "score": "0.6498313", "text": "function dbConnection() {\n // If there is already a connection to the database it will return from the function\n if (gDBconnect) return;\n try {\n mongoose.connect(config.dbURL, dbOptions);\n\n gDBconnect = mongoose.connection;\n\n // DB errors handles\n gDBconnect.on('error', (err) => {\n logger.error('db.service: Database connection crashed\\n\\t' + err);\n gDBconnect = null;\n throw err;\n });\n // When DB connection was successful\n gDBconnect.once('open', () => {\n logger.info('Database is connection');\n });\n } catch (err) {\n logger.error('db.service: Database connection failed\\n\\t' + err);\n throw err;\n }\n}", "title": "" }, { "docid": "f477a661615c86b07540bc47e480857e", "score": "0.6459048", "text": "function connectToDb(res){\n const db = mongoose.connect( DB_CONNECTION_STRING,\n {\n useNewUrlParser: true,\n useUnifiedTopology: true,\n serverSelectionTimeoutMS: 5000 // Timeout after 5s instead of 30s\n }\n );\n\n db\n .then( (data)=>{\n if(mongoose.connection.readyState === 1){\n console.log(`Connected to database`);\n }\n })\n .catch((err) => {\n console.log(\"Db Connection Error, trying to reconnect... \" + mongoose.connection.readyState );\n if(expFactor<3600){\n expFactor = expFactor*2\n }else {\n expFactor = 1;\n }\n \n if(res){\n expFactor === 1 ? setTimeout( connectToDb, expFactor * 1000 ) : expFactor = 1;\n return res.status(500).json(err);\n }else{\n setTimeout( connectToDb, expFactor * 1000 );\n // console.error(err);\n }\n \n });;\n}", "title": "" }, { "docid": "09ed12062cdf8f2b9b87dbe9de1b019a", "score": "0.6413694", "text": "reconnect(){\n if (!this.max_reconnect_attempts || \n this.reconnect_attempts < this.max_reconnect_attempts)\n {\n this.reconnect_attempts++;\n this.connect();\n }\n else {\n this.stopAutoReconnect();\n }\n }", "title": "" }, { "docid": "c15a166bc8064a399a3319d586927abd", "score": "0.6390616", "text": "async _maintainConnection() {\r\n try {\r\n await this._connect();\r\n }\r\n catch (err) {\r\n await new Promise(r => setTimeout(r, this._reconnectionDelay));\r\n this._maintainConnection();\r\n }\r\n }", "title": "" }, { "docid": "ee1503265d890fc7dd81394ae7c6f44c", "score": "0.6379082", "text": "_fail(error) {\n this.connecting = false;\n this.db = null;\n this.client = null;\n this.error = error;\n this._updateConnectionStatus();\n // Fail event is only emitted after either a then promise handler or an I/O phase so is guaranteed to be asynchronous\n this.emit('connectionFailed', error);\n }", "title": "" }, { "docid": "1537ba5b610d9bcd824c97894346c5f1", "score": "0.6307523", "text": "function OnDbErr (err) {\n\tconsole.log(err);\n\tjsonRes[\"result\"] = 1;\n\tjsonRes[\"message\"] = \"Fail to connect to database\";\n}", "title": "" }, { "docid": "dfd771e7e0308f7f02038c0629e8e512", "score": "0.63019955", "text": "function handleDisconnect() {\n connection = mysql.createConnection('mysql://beff28cd12f519:e3a36fc4@us-cdbr-east-02.cleardb.com/heroku_7ee16bba47948d7?reconnect=true'); // Recreate the connection, since\n // the old one cannot be reused.\n\n connection.connect(function (err) { // The server is either down\n if (err) { // or restarting (takes a while sometimes).\n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect,\n } // to avoid a hot loop, and to allow our node script to\n }); // process asynchronous requests in the meantime.\n // If you're also serving http, display a 503 error.\n connection.on('error', function (err) {\n console.log('db error', err);\n if (err.code === 'PROTOCOL_CONNECTION_LOST') { // Connection to the MySQL server is usually\n handleDisconnect(); // lost due to either server restart, or a\n } else { // connnection idle timeout (the wait_timeout\n throw err; // server variable configures this)\n }\n });\n}", "title": "" }, { "docid": "1456190cedb64f627c9f3ec0f7d32d28", "score": "0.6216592", "text": "function _connectionFailureHandler(self, event) {\n return function() {\n // console.log(\"========== _connectionFailureHandler :: \" + event)\n if (this._connectionFailHandled) return;\n this._connectionFailHandled = true;\n // Destroy the connection\n this.destroy();\n // Count down the number of reconnects\n self.retriesLeft = self.retriesLeft - 1;\n // How many retries are left\n if(self.retriesLeft == 0) {\n // Destroy the instance\n self.destroy();\n // Emit close event\n self.emit('reconnectFailed'\n , new MongoError(f('failed to reconnect after %s attempts with interval %s ms', self.options.reconnectTries, self.options.reconnectInterval)));\n } else {\n self.reconnectId = setTimeout(attemptReconnect(self), self.options.reconnectInterval);\n }\n }\n }", "title": "" }, { "docid": "496d035d84d941a9dfe9a925f344fd02", "score": "0.62111783", "text": "_handleErrorWhileConnecting(err) {\n if (this._connectionError) {\n // TODO(bmc): this is swallowing errors - we shouldn't do this\n return\n }\n this._connectionError = true\n clearTimeout(this.connectionTimeoutHandle)\n if (this._connectionCallback) {\n return this._connectionCallback(err)\n }\n this.emit('error', err)\n }", "title": "" }, { "docid": "496d035d84d941a9dfe9a925f344fd02", "score": "0.62111783", "text": "_handleErrorWhileConnecting(err) {\n if (this._connectionError) {\n // TODO(bmc): this is swallowing errors - we shouldn't do this\n return\n }\n this._connectionError = true\n clearTimeout(this.connectionTimeoutHandle)\n if (this._connectionCallback) {\n return this._connectionCallback(err)\n }\n this.emit('error', err)\n }", "title": "" }, { "docid": "fd91c24f6fa110811d859a67e8babbf1", "score": "0.61400086", "text": "handleSyncError(db, err) {\n //destroy local database if permission has been revoked or remote database has been deleted\n if (err.status === 403 || err.status === 404) {\n this.removeDB(db);\n } else if (err.status === 401) {\n //unauthorized, user has been revoked or password changed. Remove local storage\n this.session.invalidate();\n } else if (err.result !== undefined && err.result.status === 'cancelled') {\n //seems to happen when removing the databases while they are syncing\n log.error(err); \n } else {\n //Not sure what error this is but we need to report it\n this.ea.publish('dberr', {dbName: db.name, err: err});\n }\n }", "title": "" }, { "docid": "cc72b52a382f56a7c27b5d9eacb9d5de", "score": "0.61003816", "text": "_handleErrorEvent(err) {\n if (this._connecting) {\n return this._handleErrorWhileConnecting(err)\n }\n this._queryable = false\n this._errorAllQueries(err)\n this.emit('error', err)\n }", "title": "" }, { "docid": "cc72b52a382f56a7c27b5d9eacb9d5de", "score": "0.61003816", "text": "_handleErrorEvent(err) {\n if (this._connecting) {\n return this._handleErrorWhileConnecting(err)\n }\n this._queryable = false\n this._errorAllQueries(err)\n this.emit('error', err)\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.60734457", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.60734457", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.60734457", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.60734457", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "770477772557af6ee34187b9da6d8103", "score": "0.6058418", "text": "function sqlConnError(conn, errMsg, res) {\n\tAPP.dbpool.releaseConnection(conn);\n\treturn res.status(200).json({\n\t\tsuccess: false,\n\t\tmsg: errMsg,\n\t\tcode: '0001'\n\t});\n}", "title": "" }, { "docid": "ce08aacc382979ee0f2e9d52375c223e", "score": "0.6053563", "text": "function maintainConnection() {\n\tconnection.query('SELECT 1');\n }", "title": "" }, { "docid": "85f2b8e2ffdf2f1a9a6595caad817643", "score": "0.60338986", "text": "reconnect() {\n console.log('Reconnecting...');\n this.disconnect();\n this.connect();\n }", "title": "" }, { "docid": "78a64f54207ebc2c8d92543c2c9a0733", "score": "0.6013142", "text": "function _connectionFailureHandler(self) {\n return function () {\n if (this._connectionFailHandled) return;\n this._connectionFailHandled = true;\n // Destroy the connection\n this.destroy();\n // Count down the number of reconnects\n self.retriesLeft = self.retriesLeft - 1;\n // How many retries are left\n if (self.retriesLeft <= 0) {\n // Destroy the instance\n self.destroy();\n // Emit close event\n self.emit('reconnectFailed', new MongoNetworkError(f('failed to reconnect after %s attempts with interval %s ms', self.options.reconnectTries, self.options.reconnectInterval)));\n } else {\n self.reconnectId = setTimeout(attemptReconnect(self), self.options.reconnectInterval);\n }\n };\n }", "title": "" }, { "docid": "a5fc2b7826d84d9b5694e2310018c30d", "score": "0.6003962", "text": "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "title": "" }, { "docid": "a5fc2b7826d84d9b5694e2310018c30d", "score": "0.6003962", "text": "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "title": "" }, { "docid": "a5fc2b7826d84d9b5694e2310018c30d", "score": "0.6003962", "text": "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "title": "" }, { "docid": "a5fc2b7826d84d9b5694e2310018c30d", "score": "0.6003962", "text": "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "title": "" }, { "docid": "52610e2196ae1afff919f22a6a95bc19", "score": "0.6000593", "text": "function handleError(event) {\n reject(`Database error: ${event.target.errorCode}`);\n }", "title": "" }, { "docid": "959ed8f47bb6151abf5722ab06845b16", "score": "0.59998065", "text": "_handleConnectionError(\n error\n ) {\n this._handleError(error);\n this._connection.close();\n }", "title": "" }, { "docid": "959ed8f47bb6151abf5722ab06845b16", "score": "0.59998065", "text": "_handleConnectionError(\n error\n ) {\n this._handleError(error);\n this._connection.close();\n }", "title": "" }, { "docid": "41fdf277d3aaaf2194330e1cc453b863", "score": "0.5996031", "text": "async dbConnection() {\n\n try {\n \n await db.authenticate();\n console.log('Database online');\n\n } catch (error) {\n throw new Error( error );\n }\n\n }", "title": "" }, { "docid": "fc85b9feb57caf9ea27c11a510794f51", "score": "0.5995666", "text": "function reconnect() {\n\tif (!_conn) {\n\t\t_conn = net.connect({port: config.connect.port, host: config.connect.host})\n\t\t_conn.once(\"error\", function () {\n\t\t\t_conn = null\n\t\t})\n\t\t_conn.once(\"connect\", function () {\n\t\t\t_conn.removeAllListeners()\n\t\t\t_conn = cntxt.wrapSocket(_conn)\n\t\t\t_conn.once(\"close\", function () {\n\t\t\t\t_conn = null\n\t\t\t})\n\t\t\tstepProcess()\n\t\t})\n\t}\n}", "title": "" }, { "docid": "9a7eb98ec6debe0b40890882994b2e96", "score": "0.5983473", "text": "function connectDBError(error) {\n return {\n message: \"Cant connect to DB, Please try again\"\n };\n}", "title": "" }, { "docid": "c430cf07772fa539dd937fc9377dacf4", "score": "0.5971161", "text": "function close() {\n if (!db) {\n throw new Error(\"Database connection has not been established\")\n }\n\n db.close();\n}", "title": "" }, { "docid": "a259aee8910a036bc050bdcc7fa00c8a", "score": "0.5951002", "text": "async connectDatabase () {\n if (this.plugin) {\n this.cherry.hookConfigurator.trigger(HOOK_BEFORE_START_ORM, {\n cherry: this.cherry,\n orm: this.plugin\n })\n try {\n await this.plugin.connectDatabase()\n } catch (error) {\n throw new ORMException(error, ORM_CONNECTION_ERROR, this.options)\n }\n\n try {\n this.plugin.postConnectionProcess()\n } catch (error) {\n throw new ORMException(error, ORM_POST_CONNECTION_ERROR, this.options)\n }\n this.cherry.hookConfigurator.trigger(HOOK_AFTER_START_ORM, {\n cherry: this.cherry,\n orm: this.plugin\n })\n }\n }", "title": "" }, { "docid": "9708111dccf026f186c330fb86685d33", "score": "0.5936809", "text": "function _(e){return function(){const t=arguments.length>0?arguments[arguments.length-1]:null,n=\"function\"==typeof t?Array.prototype.slice.call(arguments,0,arguments.length-1):Array.prototype.slice.call(arguments),r=new c(\"Connection \"+this.id+\" was disconnected when calling `\"+e.name+\"`\");return f(t,t=>{d(()=>{this.readyState===a.connecting?this.once(\"open\",(function(){e.apply(this,n.concat([t]))})):this.readyState===a.disconnected&&null==this.db?t(r):e.apply(this,n.concat([t]))})})}}", "title": "" }, { "docid": "7f1c2458b8b738d5373ffc0d36ba2327", "score": "0.5908954", "text": "function onConnectionFailed() {\n console.log('------------------------------');\n console.log('onConnectionFailed(). Reconnect');\n setTimeout(function () {\n voxAPI.connect();\n }, 1000);\n}", "title": "" }, { "docid": "2b8f1821e7073bb88a151cade57423d9", "score": "0.58551604", "text": "function disconnectToDb() {\n connection.end(function(err) {\n if (err) {\n console.error('error connecting: ' + err.stack);\n return;\n }\n console.log('ended database connection as id ' + connection.threadId);\n });\n}", "title": "" }, { "docid": "286047cf30fb56a5b63759a19658a32e", "score": "0.58508617", "text": "async function testConnection() {\n try {\n let info = await cdb.info();\n console.log(info);\n if (info.couchdb!='Welcome')\n throw info;\n else\n main(info);\n } catch (error) {\n console.log(error);\n setTimeout(testConnection, 5000);\n }\n}", "title": "" }, { "docid": "2e01ae27fedcdd2f554acfcbab8449db", "score": "0.58283", "text": "checkError(error, client) {\n if (error && error.code !== DATABASE_IS_STARTING_UP && error.code !== CONNECTION_REFUSED) {\n this.logger.info(types_1.EVENT.ERROR, error.name);\n }\n }", "title": "" }, { "docid": "40a5f7f81f761fb1ccfa32878d06d017", "score": "0.5827653", "text": "function handleDbError(res) {\n return (err) => {\n console.warn('hit a snag');\n console.error(err);\n \n if (err.code == 'ECONNRESET') {\n return res.status(500).send({ message: 'something died again' });\n }\n if (err.code == '22P02') {\n res.status(422).send({ message: 'The request had incorrect or missing properties: ' + err.message });\n }\n res.status(500).send({ message: 'Internal Server Error' })\n };\n}", "title": "" }, { "docid": "ffe49d1a8a8ce12cec18b6d6f1694cc7", "score": "0.5815542", "text": "async close() {\n try {\n this._delegate = null;\n await this._client.close();\n } catch (e) {\n return {\n errors: [\n new AppError(`DB: cannot close connection`,\n {\n code: 'BAD_VAL', widget: e\n }\n )\n ]\n }\n }\n }", "title": "" }, { "docid": "0036907bcf73df8e8f49403510c40ce4", "score": "0.5810631", "text": "function disConnectFromMongoDB(callback) {\n // body...\n mongoose.connection.close(function (error) {\n // body...\n if (error) {\n console.log(error);\n return callback(null, false)\n }\n callback(null, true)\n })\n}", "title": "" }, { "docid": "faf4054d45c3effd0c99d8c0f99c3f86", "score": "0.58058196", "text": "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\"+responseObject.errorMessage);\n \n //Try to reconnect after lost connection\n client.connect({onSuccess:onConnect});\n }\n}", "title": "" }, { "docid": "3c94f4b4c14d35d23c16dbfa32b73019", "score": "0.57905656", "text": "function errHandler(err){\n\tif (err){\n\t\tif (err.code === 'ECONNREFUSED'){\n\t\t\tconsole.log(`DB ERROR[${err.code}]: MySQL service is not turned on!`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(`DB ERROR [${err.code}]: ${err.sqlMessage}!`)\n\t\t}\n\t\tprocess.exit();\n\t}\n\telse{\n\t\tconsole.log('DB connected successfully\\n');\n\t}\n}", "title": "" }, { "docid": "ebf8c7df585f561e42cc09e60d6ac527", "score": "0.579013", "text": "function onConnectionLost(responseObject) {\n paho_debug(`Connection lost ${responseObject.errorMessage}`)\n if (responseObject.errorCode !== 0) {\n paho_debug(`Reconnecting`)\n setTimeout(connect, 1000)\n }\n }", "title": "" }, { "docid": "c76f6318f77fccf3a0d7b00314d510af", "score": "0.5788698", "text": "function dbError(msg) {\n if (calledDBError) {\n return;\n }\n req.readyState = \"done\";\n req.error = \"DOMError\";\n var e = idbModules.util.createEvent(\"error\");\n e.message = msg;\n e.debug = arguments;\n idbModules.util.callback(\"onerror\", req, e);\n calledDBError = true;\n }", "title": "" }, { "docid": "0656fc48ef2eeabec25d599c20545421", "score": "0.5784555", "text": "function handleDisconnect(client) {\n client.on('error', function (error) {\n if (!error.fatal) return;\n if (error.code !== 'PROTOCOL_CONNECTION_LOST') throw err;\n\n console.error('> Re-connecting lost MySQL connection: ' + error.stack);\n\n mysqlClient = mysql.createConnection(client.config);\n handleDisconnect(mysqlClient);\n mysqlClient.connect();\n });\n}", "title": "" }, { "docid": "345e5f74ed51ef2b6dd4a48641319503", "score": "0.57585174", "text": "function checkMongooseConnection(db){\n // mongoose.connection.on('open', function (ref) {\n // console.log(\"Connected to Mongo db\");\n // return db\n // });\n mongoose.connection.on('error', function (err) {\n console.log(\"Error occur in connection to Mongo db\");\n if(err) throw err;\n });\n mongoose.createConnection('mongodb://localhost/nodeseed', {\n useMongoClient: true,\n /* other options */\n }\n ); \n return db; \n}", "title": "" }, { "docid": "3fc92cedfe7501c2ef5527ad97299260", "score": "0.57537663", "text": "function handlePullError(xhr, error) {\n if (!remote.isConnected()) {\n return;\n }\n\n switch (xhr.status) {\n // Session is invalid. User is still login, but needs to reauthenticate\n // before sync can be continued\n case 401:\n remote.trigger('error:unauthenticated', error);\n return remote.disconnect();\n\n // the 404 comes, when the requested DB has been removed\n // or does not exist yet.\n //\n // BUT: it might also happen that the background workers did\n // not create a pending database yet. Therefore,\n // we try it again in 3 seconds\n //\n // TODO: review / rethink that.\n //\n case 404:\n return global.setTimeout(remote.pull, 3000);\n\n case 500:\n //\n // Please server, don't give us these. At least not persistently\n //\n remote.trigger('error:server', error);\n global.setTimeout(remote.pull, 3000);\n return hoodie.checkConnection();\n default:\n // usually a 0, which stands for timeout or server not reachable.\n if (xhr.statusText === 'abort') {\n // manual abort after 25sec. restart pulling changes directly when connected\n return remote.pull();\n } else {\n\n // oops. This might be caused by an unreachable server.\n // Or the server cancelled it for what ever reason, e.g.\n // heroku kills the request after ~30s.\n // we'll try again after a 3s timeout\n //\n global.setTimeout(remote.pull, 3000);\n return hoodie.checkConnection();\n }\n }\n }", "title": "" }, { "docid": "a825865267117c2bc8537a5df06bf3f0", "score": "0.5752991", "text": "_connect() {\n const { db, client = null } = this.configuration;\n if (db && !is_promise_1.default(db) && !is_promise_1.default(client)) {\n this._setDb(db, client);\n return;\n }\n this._resolveConnection()\n /* eslint-disable-next-line promise/prefer-await-to-then */\n .then(({ db, client }) => {\n this._setDb(db, client);\n })\n .catch((error) => {\n this._fail(error);\n });\n }", "title": "" }, { "docid": "d2288ce6cc7990fc69f764251f743e0e", "score": "0.5747931", "text": "function onConnectError() {\n // Once a connection has been made, make a subscription and send a message.\n showMessageContent(\"onConnectError:\", \"Error\");\n }", "title": "" }, { "docid": "7de6b82277f4c5c7b1272f0a6c65e8dd", "score": "0.5741391", "text": "function onPreConnectionError (err){\n redisConnectionError = err;\n adapterConfig.pubClient.removeListener('error', onPreConnectionError);\n adapterConfig.subClient.removeListener('error', onPreConnectionError);\n }", "title": "" }, { "docid": "f164da5b8c70d8ff12a4b19b501d7735", "score": "0.5734691", "text": "function closeConnection() {\n if (db !== \"undefined\")\n db.end();\n}", "title": "" }, { "docid": "8afe1ffb538e28dc7a28b8c6397ce852", "score": "0.571046", "text": "handleDisconnectError() {\n // log.error(`BT error: ${JSON.stringify(e)}`);\n if (!this._connected) return;\n this.disconnect();\n\n if (this._resetCallback) {\n this._resetCallback();\n }\n\n this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR, {\n message: \"Scratch lost connection to\",\n extensionId: this._extensionId\n });\n }", "title": "" }, { "docid": "8b250e539f02592085535c59726c135c", "score": "0.570849", "text": "async function connect() {\n let opts = {};\n if (config.forceSync) {\n console.log(\"DB_FORCE_SYNC is set to 'true'. Forcing table updates\");\n opts.force = true;\n }\n let tries = 0;\n while (tries < MAX_TRIES) {\n try {\n tries++;\n console.log('Connecting to database...');\n let connection = await db.sync(opts);\n console.log('Connected to database ' + connection.config.database + ' on ' + connection.config.host + ' as user ' + connection.config.username);\n return;\n } catch (ex) {\n console.error('Error connecting to database: ' + JSON.stringify(ex));\n console.log(`Re-try database connection in ${DB_RETRY_INTERVAL}ms`);\n await sleep(DB_RETRY_INTERVAL);\n }\n }\n console.error(`Unable to connect to database after ${MAX_TRIES} attemps`);\n}", "title": "" }, { "docid": "9a796a44ab4a218443d6a51d639c35a0", "score": "0.5692338", "text": "function connectCallback( err)\r\n{\r\n // if an error occured in mysql.connection.connect \r\n if(err)\r\n {\r\n console.log(\"Failed connecting to db \" + err);\r\n return;\r\n }\r\n\r\n // Connection to db succeed\r\n console.log('Connected to db succesfuly');\r\n}", "title": "" }, { "docid": "1b7564caff6d8cbdd96559777d702f93", "score": "0.5683172", "text": "function handleHDBConnection (err) {\n\n if (err) {\n log.write(log.LEVEL_ERROR,MODULE,'hdbClient.connect' + err);\n hdbReconnect();\n }\n \n log.write(log.LEVEL_INFO,MODULE,'hdbClient.connect','HDB Connected - ' + global.hdbClient.readyState);\n\n setInterval(function() {\n global.hdbClient.exec('CALL \"XSA_DEV\".\"RFID.demo.model::manual_event_retriever\"(?)',handleRetrieverResponse);\n },POLLING_TICK * 1000);\n\n}", "title": "" }, { "docid": "7c21948150930dc2cfa190931022f152", "score": "0.56779957", "text": "function checkConnAndReConn(){\n\t\t\t\n\t\t\t//try to reconnect\n\t\t\tif(mWebSocket.readyState == 3 || mWebSocket.readyState == 2 ){\n\t\t\t\tconsole.log(\"Trying to reconnect\");\n\t\t\t\t//reconnect\n\t\t\t\t mWebSocket = connectToMessenger();\n\t\t\t\t//TODO:add code to see if re-connection succeeded \n\t\t\t}//if ends \n\n\t\t //upon recovery request for message status from the main thread\n\t\t //this requested status will be sent to the server \n\t\t //postMessage(\"MESSAGE\");\n\t\t}", "title": "" }, { "docid": "4b317f9dc1d60f2df506b499c8a8e3d4", "score": "0.5661174", "text": "function onFail() {\n console.log('Unable to connect');\n }", "title": "" }, { "docid": "3fd43828ebe63d1afd1aae345d68b57d", "score": "0.5641833", "text": "function errHandler(err){\n\tif (err){\n\t\tconsole.log(`DB ERROR [${err.code}]: ${err.sqlMessage}`)\n\t\tprocess.exit();\n\t}\n\telse{\n\t\tconsole.log('DB connected successfully\\n');\n\t}\n}", "title": "" }, { "docid": "9c9d30d0c09eac16b4f29e9f109b553a", "score": "0.5639993", "text": "function onIntercomm(dbname) {\n // When storage event trigger us to check\n if (dbname === db.name) {\n consumeIntercommMessages().catch('DatabaseClosedError', ()=> {});\n }\n }", "title": "" }, { "docid": "2d4c24ea868b48ae066f5721c855c680", "score": "0.5631599", "text": "function closeDatabase() {\n\tif (db == null)\n\t\treturn console.error(\"Error: Database is not open.\")\n\tdb.close((err) => {\n\t\tif (err) {\n\t\t\treturn console.error(err.message);\n\t\t}\n\t\tconsole.log(\"Database connection has been closed.\");\n\t});\n\tdb = null;\n}", "title": "" }, { "docid": "cd6de4a716eb44a091426093e8666cf2", "score": "0.5624412", "text": "function disconnectDatabase() {\n mongoose.connection.close( (err)=> {\n if (err) console.error(err);\n else console.log(\"DISCONNECTED from \" + connectionString);\n })\n}", "title": "" }, { "docid": "cd6de4a716eb44a091426093e8666cf2", "score": "0.5624412", "text": "function disconnectDatabase() {\n mongoose.connection.close( (err)=> {\n if (err) console.error(err);\n else console.log(\"DISCONNECTED from \" + connectionString);\n })\n}", "title": "" }, { "docid": "cd6de4a716eb44a091426093e8666cf2", "score": "0.5624412", "text": "function disconnectDatabase() {\n mongoose.connection.close( (err)=> {\n if (err) console.error(err);\n else console.log(\"DISCONNECTED from \" + connectionString);\n })\n}", "title": "" }, { "docid": "f1d86c7eed6199fac3942fb02e2148e9", "score": "0.5615483", "text": "_reconnect (forced = true) {\n if (forced && this.isConnected) {\n this.close()\n }\n\n if (this._reconnectionInterval) {\n return\n }\n\n this._clearPingInterval()\n this._reconnectionInterval = setInterval(\n () => this._connect(),\n this._options.reconnectionDelay\n )\n }", "title": "" }, { "docid": "5939a2ba66c75f7566d50612b9c8d48a", "score": "0.5608537", "text": "onReconnect() {\n log('reconnect');\n this.sendOffers();\n }", "title": "" }, { "docid": "c22157793d76183e9368ad33ba0b9749", "score": "0.5607139", "text": "_resetForNewReconnection() {\n this[STATE].shouldReconnect = true;\n this[STATE].reconnectDelay = Constants.RECONNECT_DELAY_MS;\n this[STATE].reconnectAttempts = 0;\n }", "title": "" }, { "docid": "0d94ff776be26348a1702892124a6bcf", "score": "0.56007177", "text": "startAutoReconnect() {\n this.reconnect_attempts = 0;\n this.reconnect_interval = setInterval(\n this.reconnect.bind(this), \n this.reconnect_interval_timer\n );\n }", "title": "" }, { "docid": "23f9b4c49925d71aaea631c0d65c63b8", "score": "0.55992866", "text": "async connect(waitForConnect) {\r\n let connected_once = false;\r\n return new Promise((resolve,reject) => {\r\n this.dbPool = new PgPool(Object.assign({ }, this.options));\r\n // this.dbPool.on('connect', (client) => {\r\n // // if(!this.postgres.stopped)\r\n // //this.log(err);\r\n // if(!connected_once && waitForConnect) {\r\n // this.log(`FlowPgSQL connected`);\r\n // resolve();\r\n // }\r\n // connected_once = true;\r\n // this.log('FlowPgSQL connected');\r\n // })\r\n \r\n this.dbPool.on('error', (err) => {\r\n // if(!this.postgres.stopped)\r\n this.log(err);\r\n })\r\n\r\n const connect = () => {\r\n this.log(`connecting to ${this.options.host}:${this.options.port}`);\r\n\r\n this.dbPool.connect().then((client) => {\r\n client.release();\r\n this.log(`connected`);\r\n resolve();\r\n }).catch((err) => {\r\n this.log(`PgSQL error:`, err.toString());\r\n dpc(1000, connect);\r\n })\r\n }\r\n\r\n dpc(connect);\r\n \r\n this.db = {\r\n query : async (sql, args) => {\r\n if(this.postgres?.stopped)\r\n return Promise.reject(\"pgSQL daemon stopped - the platform is going down!\");\r\n // this.log(\"sql:\", sql, args)\r\n return new Promise((resolve,reject) => {\r\n this.dbPool.connect().then((client) => {\r\n\r\n client.query(sql, args, (err, result) => {\r\n client.release();\r\n // this.log(\"FlowPgSQL:\",result);\r\n\r\n if(err) {\r\n this.log(\"pgSQL Error:\".brightRed,err);\r\n return reject(err);\r\n }\r\n // this.log(\"pgSQL GOT ROWS:\",rows);\r\n resolve(result?.rows);\r\n });\r\n }, (err) => {\r\n this.log(`Error processing pgSQL query:`);\r\n this.log(sql);\r\n this.log(args);\r\n this.log(`SQL Error is: ${err.toString()}`)\r\n return reject(err);\r\n });\r\n });\r\n } \r\n }\r\n\r\n // resolve();\r\n });\r\n }", "title": "" }, { "docid": "1f724933df95abe761f1247aa8d16b6c", "score": "0.5593772", "text": "reconnect() {\n return window.safeApp.reconnect();\n }", "title": "" }, { "docid": "b737a3086b0f91da5edfa7dab53d996c", "score": "0.5588033", "text": "catchIDBBroken(operationCallback) {\n return catchError((error) => {\n /* Check if `indexedDB` is broken based on error message (the specific error class seems to be lost in the process) */\n if ((error !== undefined) && (error !== null) && (error.message === IDB_BROKEN_ERROR)) {\n /* When storage is fully disabled in browser (via the \"Block all cookies\" option),\n * just trying to check `localStorage` variable causes a security exception.\n * Prevents https://github.com/cyrilletuzi/angular-async-local-storage/issues/118\n */\n try {\n if ('getItem' in localStorage) {\n /* Fallback to `localStorage` if available */\n this.database = new LocalStorageDatabase(this.LSPrefix);\n }\n else {\n /* Fallback to memory storage otherwise */\n this.database = new MemoryDatabase();\n }\n }\n catch (_a) {\n /* Fallback to memory storage otherwise */\n this.database = new MemoryDatabase();\n }\n /* Redo the operation */\n return operationCallback();\n }\n else {\n /* Otherwise, rethrow the error */\n return throwError(error);\n }\n });\n }", "title": "" }, { "docid": "7a869cfcc4f678ba96305d2d96770e63", "score": "0.55866075", "text": "function connect() {\n // Connect\n MongoClient.connect(config.db.connection, function(err, db) {\n if(err) {\n throw new Error(\"Database connection failed\");\n }\n _db = db;\n });\n }", "title": "" }, { "docid": "0620c0f87adf113ea723e9e4ffde77eb", "score": "0.55834615", "text": "function _init_db_connections(onComplete){\r\n connectionService.testConnection(\r\n function (error){\r\n if(error){\r\n logger.error(MODULE_NAME + ': error testing the connection to database ' + JSON.stringify(error));\r\n }else{\r\n logger.info(MODULE_NAME + ': ping connection to database success');\r\n errorService.startup({},MODULE_NAME);\r\n }\r\n onComplete();\r\n });\r\n}", "title": "" }, { "docid": "e62ba38b475a6814fe1e81f8a6f83c1f", "score": "0.55817276", "text": "connect() {\r\n\t\tvar $this = this;\r\n\t\tthis.conn = openDatabase(this.dataBase, this.version , this.description, this.size, function() {\r\n\t\t\tconsole.info(\"Database \"+$this.dataBase+\" created correctly\");\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "4ead8cf007e9388ea468f5745afefecf", "score": "0.5572228", "text": "function handleQueryError(err) {\r\n\tconsole.log(err);\r\n\tsetQueryNotRunning();\r\n\tsetStatus(\"ERROR: \" + err, STATUS_ERROR);\r\n}", "title": "" }, { "docid": "28e7857834180d211e316edf5c316f06", "score": "0.55722195", "text": "reconnect (force) {\n if (!force && this.reconnecting) return\n this.reconnecting = true\n if (this.socket) {\n this.socket.disconnect()\n this.connected = false\n }\n this.log.info('Reconnecting to server...')\n setTimeout(() => {\n if (this.connected) return\n this.connect()\n }, RECONNECT_INTERVAL)\n }", "title": "" }, { "docid": "ddedc554e01e718b22fc1841bebee9f8", "score": "0.55612075", "text": "async function initDb() {\n let result = false;\n try {\n const conn = await mongoose.connect(process.env.DB_URL, { useNewUrlParser: true , useUnifiedTopology: true });\n conn.once('open', () => console.log('MongoDB Running')).on('error', e => {\n console.log('DB connection error:', e.message);\n });\n result = true;\n } catch (err) {\n console.log('url = ' + process.env.DB_URL);\n mongoose.createConnection(process.env.DB_URL)\n }\n db.once('open', () => console.log('MongoDB Running')).on('error', e => {\n console.log('DB connection error:', e.message);\n });\n process.on('SIGINT', function(){\n mongoose.connection.close(function(){\n console.log(\"Mongoose default connection is disconnected due to application termination\");\n process.exit(0);\n });\n });\n return result;\n}", "title": "" }, { "docid": "3ffcb604af563546b3bbf3045b7a0b1d", "score": "0.5560599", "text": "connectToDB() {\n // TODO: need to pass in URI later\n\n //If MongoDB Connection is disconnected\n if (mongoose.connection.readyState == 0) {\n\n //Creates Connection\n const mongo = mongoose.connect('mongodb://adamgarcia4:Grimmick15@ds049476.mlab.com:49476/graphql-backend', (err) => {\n if (err) {\n console.error('Could not connect to MongoDB.');\n } else {\n console.log('Connection Succeeded.');\n }\n });\n }\n }", "title": "" }, { "docid": "8d8250bdf9adc54760b1bf41b7eb9b80", "score": "0.5560241", "text": "function initMongoDatabaseConnection() {\n MongoClient.connect(dbConnectionString, function(err, database) {\n assert.equal(null, err);\n console.log(\"Connected correctly to the database.\");\n db = database;\n }); \n}", "title": "" }, { "docid": "ef4b6f4980da54ae85319c8c3eb6e775", "score": "0.5538462", "text": "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "title": "" }, { "docid": "ef4b6f4980da54ae85319c8c3eb6e775", "score": "0.5538462", "text": "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "title": "" }, { "docid": "ef4b6f4980da54ae85319c8c3eb6e775", "score": "0.5538462", "text": "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "title": "" }, { "docid": "ef4b6f4980da54ae85319c8c3eb6e775", "score": "0.5538462", "text": "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "title": "" }, { "docid": "ef4b6f4980da54ae85319c8c3eb6e775", "score": "0.5538462", "text": "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "title": "" }, { "docid": "54bab48327fc21c492ff38b8db61b4ba", "score": "0.55331814", "text": "static async injectDB(conn) {\n if (restaurants) {\n // if restaurants is already filled\n return\n }\n try {\n // otherwise try to connect to restaurants\n restaurants = await conn.db(process.env.RESTREVIEWS_NS).collection(\"restaurants\")\n } catch (e) {\n // if cannot connect then this error message is displayed\n console.error(\n `Unable to establish a collection handle in restaurantsDAO: ${e}`,\n )\n }\n }", "title": "" }, { "docid": "1e77efebc63cbfc3a54d7508fcbdcf1b", "score": "0.55321705", "text": "function connectionCheck() {\n return new Promise((resolve, reject) => {\n db.getConnection(function (err, connection) {\n if (err) {\n if (connection) {\n return connection.release();\n }\n reject(err);\n } else {\n resolve(\"mysql succesfully connected\");\n }\n });\n });\n}", "title": "" }, { "docid": "648cc1672c5f8aa8e9d3499c74a70134", "score": "0.5530435", "text": "handleDisconnectError() {\n // log.error(`BLE error: ${JSON.stringify(e)}`);\n if (!this._connected) return;\n this.disconnect();\n\n if (this._resetCallback) {\n this._resetCallback();\n }\n\n this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR, {\n message: \"Scratch lost connection to\",\n extensionId: this._extensionId\n });\n }", "title": "" }, { "docid": "c735ba4671658d7884adb6182749ccc8", "score": "0.5530134", "text": "SOCKET_RECONNECT(state, count) {\n console.info(\"Reconnecting....\", state, count);\n }", "title": "" }, { "docid": "544711cc98991c057af175ba602b6f16", "score": "0.5524309", "text": "reconnect() {\n\t\tsetTimeout(() => {\n\t\t\tif (this.ws.readyState <= WebSocket.OPEN) return;\n\n\t\t\tconsole.log(\"Trying to reconnect\", this.ws.readyState); // debug\n\n\t\t\t// Connect to the WebSocket server.\n\t\t\tthis.connect();\n\n\t\t\t// Ensure that the connection has been made.\n\t\t\tthis.reconnect();\n\t\t}, 3000);\n\t}", "title": "" } ]
71286dd18b2bf4b3549ba9e430012424
unlike navButtons icons, action icons in rows seem to be hardcoded you can change them like this in here if you want
[ { "docid": "fdbf5291bc6bb86496b4135330d10755", "score": "0.6689606", "text": "function updateActionIcons(table) {\n\n /*\tvar replacement =\n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })*/\n\n }", "title": "" } ]
[ { "docid": "f56ca9a5f17764c0fa72d45f97e3e74b", "score": "0.6911716", "text": "function updateActionIcons(table) {\n\n }", "title": "" }, { "docid": "23db6d6a1f607527e2be98128316f158", "score": "0.6840789", "text": "function updateActionIcons(table) {\r\n\r\n\t}", "title": "" }, { "docid": "23db6d6a1f607527e2be98128316f158", "score": "0.6840789", "text": "function updateActionIcons(table) {\r\n\r\n\t}", "title": "" }, { "docid": "0e13493b6ad1385ebde2d4ca23819cbb", "score": "0.67930585", "text": "function updateActionIcons(table) {\r\n\t\t/**\r\n\t\t * var replacement = { 'ui-icon-pencil' : 'icon-pencil blue',\r\n\t\t * 'ui-icon-trash' : 'icon-trash red', 'ui-icon-disk' : 'icon-ok green',\r\n\t\t * 'ui-icon-cancel' : 'icon-remove red' }; $(table).find('.ui-pg-div\r\n\t\t * span.ui-icon').each(function(){ var icon = $(this); var $class =\r\n\t\t * $.trim(icon.attr('class').replace('ui-icon', '')); if($class in\r\n\t\t * replacement) icon.attr('class', 'ui-icon '+replacement[$class]); })\r\n\t\t */\r\n\t}", "title": "" }, { "docid": "ba3f57a7a39fcbe2b62ebf151244a973", "score": "0.67702556", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\t * var replacement = { 'ui-icon-pencil' : 'icon-pencil blue',\n\t\t * 'ui-icon-trash' : 'icon-trash red', 'ui-icon-disk' : 'icon-ok green',\n\t\t * 'ui-icon-cancel' : 'icon-remove red' }; $(table).find('.ui-pg-div\n\t\t * span.ui-icon').each(function(){ var icon = $(this); var $class =\n\t\t * $.trim(icon.attr('class').replace('ui-icon', '')); if($class in\n\t\t * replacement) icon.attr('class', 'ui-icon '+replacement[$class]); })\n\t\t */\n\t}", "title": "" }, { "docid": "ba3f57a7a39fcbe2b62ebf151244a973", "score": "0.67702556", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\t * var replacement = { 'ui-icon-pencil' : 'icon-pencil blue',\n\t\t * 'ui-icon-trash' : 'icon-trash red', 'ui-icon-disk' : 'icon-ok green',\n\t\t * 'ui-icon-cancel' : 'icon-remove red' }; $(table).find('.ui-pg-div\n\t\t * span.ui-icon').each(function(){ var icon = $(this); var $class =\n\t\t * $.trim(icon.attr('class').replace('ui-icon', '')); if($class in\n\t\t * replacement) icon.attr('class', 'ui-icon '+replacement[$class]); })\n\t\t */\n\t}", "title": "" }, { "docid": "ba3f57a7a39fcbe2b62ebf151244a973", "score": "0.67702556", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\t * var replacement = { 'ui-icon-pencil' : 'icon-pencil blue',\n\t\t * 'ui-icon-trash' : 'icon-trash red', 'ui-icon-disk' : 'icon-ok green',\n\t\t * 'ui-icon-cancel' : 'icon-remove red' }; $(table).find('.ui-pg-div\n\t\t * span.ui-icon').each(function(){ var icon = $(this); var $class =\n\t\t * $.trim(icon.attr('class').replace('ui-icon', '')); if($class in\n\t\t * replacement) icon.attr('class', 'ui-icon '+replacement[$class]); })\n\t\t */\n\t}", "title": "" }, { "docid": "b641cdb05de04c4be594c0f8b12fd65a", "score": "0.67648005", "text": "function updateActionIcons(table) {\n\t\t\t/**\n\t\t\t * var replacement = { 'ui-ace-icon fa fa-pencil' :\n\t\t\t * 'ace-icon fa fa-pencil blue', 'ui-ace-icon fa fa-trash-o' :\n\t\t\t * 'ace-icon fa fa-trash-o red', 'ui-icon-disk' : 'ace-icon\n\t\t\t * fa fa-check green', 'ui-icon-cancel' : 'ace-icon fa\n\t\t\t * fa-times red' }; $(table).find('.ui-pg-div\n\t\t\t * span.ui-icon').each(function(){ var icon = $(this); var\n\t\t\t * $class = $.trim(icon.attr('class').replace('ui-icon',\n\t\t\t * '')); if($class in replacement) icon.attr('class',\n\t\t\t * 'ui-icon '+replacement[$class]); })\n\t\t\t */\n\t\t}", "title": "" }, { "docid": "d4b8c1e030b1ee14e61f19e20388190c", "score": "0.67467237", "text": "function updateActionIcons(table) {\n /**\n var replacement = \n {\n 'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\n 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\n 'ui-icon-disk' : 'ace-icon fa fa-check green',\n 'ui-icon-cancel' : 'ace-icon fa fa-times red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n */\n }", "title": "" }, { "docid": "9f6150ef4cfc2cf82d12b88d1702875d", "score": "0.6745595", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\t * var replacement = { 'ui-ace-icon fa fa-pencil' : 'ace-icon fa\n\t\t * fa-pencil blue', 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa\n\t\t * fa-trash-o red', 'ui-icon-disk' : 'ace-icon fa fa-check green',\n\t\t * 'ui-icon-cancel' : 'ace-icon fa fa-times red' };\n\t\t * $(table).find('.ui-pg-div span.ui-icon').each(function(){ var icon =\n\t\t * $(this); var $class = $.trim(icon.attr('class').replace('ui-icon',\n\t\t * '')); if($class in replacement) icon.attr('class', 'ui-icon\n\t\t * '+replacement[$class]); })\n\t\t */\n\t}", "title": "" }, { "docid": "9e343e071b1584fd8c41a9a36b4b4ef6", "score": "0.6745524", "text": "function updateActionIcons(table) {\n\t\t\t\t\t/**\n\t\t\t\t\tvar replacement = \n\t\t\t\t\t{\n\t\t\t\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t\t\t\t};\n\t\t\t\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\t\t\t\tvar icon = $(this);\n\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t\t\t\t})\n\t\t\t\t\t*/\n\t\t\t\t}", "title": "" }, { "docid": "e8a523e2b2d188f0186296cad88af73d", "score": "0.66965073", "text": "function updateActionIcons(table) {\n /**\n var replacement =\n {\n 'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\n 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\n 'ui-icon-disk' : 'ace-icon fa fa-check green',\n 'ui-icon-cancel' : 'ace-icon fa fa-times red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\t\tvar icon = $(this);\n\t\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t\t})\n */\n }", "title": "" }, { "docid": "98ac63b0f3b65ac122467aac3dfb4f16", "score": "0.6694231", "text": "function updateActionIcons(table) {\r\n /**\r\n var replacement = \r\n {\r\n 'ui-icon-pencil' : 'icon-pencil blue',\r\n 'ui-icon-trash' : 'icon-trash red',\r\n 'ui-icon-disk' : 'icon-ok green',\r\n 'ui-icon-cancel' : 'icon-remove red'\r\n };\r\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n var icon = $(this);\r\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n })\r\n */\r\n }", "title": "" }, { "docid": "723663e8e671b186a1904951f9e1ea65", "score": "0.66703534", "text": "function updateActionIcons(table) {\n /**\n var replacement =\n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n */\n }", "title": "" }, { "docid": "bbc77e1527e5287020902bb642d543d9", "score": "0.6657608", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "title": "" }, { "docid": "bbc77e1527e5287020902bb642d543d9", "score": "0.6657608", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "title": "" }, { "docid": "c79e1e657c2dab72556c89aba41fed38", "score": "0.6635902", "text": "function updateActionIcons(table) {\n var replacement =\n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "7a57d1a1c0a614e56d4642bfa0a302bc", "score": "0.6630986", "text": "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement =\n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "title": "" }, { "docid": "c35e9604b5e06f3b86b8980a31e75d47", "score": "0.6607716", "text": "function updateActionIcons(table) {\r\n\t\t/**\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\r\n\t\t\t'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\r\n\t\t\t'ui-icon-disk' : 'ace-icon fa fa-check green',\r\n\t\t\t'ui-icon-cancel' : 'ace-icon fa fa-times red'\r\n\t\t};\r\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t\t*/\r\n\t}", "title": "" }, { "docid": "983cf7261c37fc15f4e8f19476a597d3", "score": "0.65715617", "text": "function updateActionIcons(table) {\n\tvar replacement = {\n\t\t'ui-icon-plus': 'icon-edit blue',\n\t\t'ui-icon-trash': 'icon-trash red',\n\t\t'ui-icon-disk': 'icon-ok green',\n\t\t'ui-icon-cancel': 'icon-remove red'\n\t};\n\t$(table).find('.ui-pg-div span.ui-icon').each(function () {\n\t\tvar icon = $(this);\n\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\tif ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n\t})\n}", "title": "" }, { "docid": "aef3c81faf0a28ac406de796548edadb", "score": "0.65322477", "text": "function updateActionIcons(table) {\r\n\t\t\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\r\n\t\t\t'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\r\n\t\t\t'ui-icon-disk' : 'ace-icon fa fa-check green',\r\n\t\t\t'ui-icon-cancel' : 'ace-icon fa fa-times red'\r\n\t\t};\r\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t\t\r\n\t}", "title": "" }, { "docid": "7ce641a6a4c8b489e503ecb006eaed41", "score": "0.6174797", "text": "function updatePagerIcons(table) {\n var replacement = \n {\n 'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n 'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n 'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n 'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n \n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "6d3e15e52d8494ffac89c2b5ce413a90", "score": "0.610785", "text": "function updatePagerIcons(table) {\n var replacement = \n {\n 'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n 'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n 'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n 'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n \n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "1279e4820d53fa5b59a455d4d0d08305", "score": "0.6078194", "text": "function updatePagerIcons(table) {\n\t\t\t\t\tvar replacement = \n\t\t\t\t\t{\n\t\t\t\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t\t\t\t};\n\t\t\t\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\t\t\t\tvar icon = $(this);\n\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t\t\t\t})\n\t\t\t\t}", "title": "" }, { "docid": "10c8a45844844a5a3bd4252bee777468", "score": "0.6051307", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n 'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n 'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n 'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "722196c1cac81e866a3fe5121fa727e3", "score": "0.60471314", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n 'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n 'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n 'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "3169995b47b928a9af9b97ffe7180691", "score": "0.60289574", "text": "function updatePagerIcons(table) {\n\t\t\tvar replacement = \n\t\t\t{\n\t\t\t\t'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n\t\t\t\t'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n\t\t\t\t'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n\t\t\t\t'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n\t\t\t};\n\t\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\t\tvar icon = $(this);\n\t\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\t\n\t\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f34efa661c7c47e64ad958f1ec3acc8d", "score": "0.60201246", "text": "renderCardActions() {\n const { classes } = this.props;\n\n return (\n <CardActions className={classes.actions} disableActionSpacing>\n <IconButton aria-label=\"Share\">\n <Icon name=\"telegram\" />\n </IconButton>\n <IconButton aria-label=\"Add to favorites\">\n <FavoriteIcon />\n </IconButton>\n </CardActions>\n );\n }", "title": "" }, { "docid": "4dcf490353ce5ceb88a3db8223d00ec5", "score": "0.5984706", "text": "function buttonTemplate(icon) {\n return '<div class=\"vjs-topbar-button__icon\"><i class=\"fa ' + icon + '\" aria-hidden=\"true\"></i></div>';\n }", "title": "" }, { "docid": "24ef6c6be3ef313aa979ea1c803dc9c9", "score": "0.5980613", "text": "getIcon() {\n if (!this.state.toggler) {\n return <FontAwesomeIcon icon={solid} color=\"#D5E84C\" />;\n } else {\n return <FontAwesomeIcon icon={lineStar} />;\n }\n }", "title": "" }, { "docid": "3d3970ff8a512e1daffc71ff292608c9", "score": "0.59803736", "text": "renderIcon(){\n if(!this.state.expanded){\n return (\n <Icon name=\"arrow-down\" size={20} color=\"#343434\" backgroundColor=\"transparent\"/>\n );\n }\n else {\n return (\n <Icon name=\"arrow-up\" size={20} color=\"#343434\" backgroundColor=\"transparent\"/>\n );\n }\n }", "title": "" }, { "docid": "de6a8d13456457be56eeee45ae6e72e4", "score": "0.5964505", "text": "function updatePagerIcons(table) {\r\n var replacement =\r\n {\r\n 'ui-icon-seek-first': 'icon-double-angle-left bigger-140',\r\n 'ui-icon-seek-prev': 'icon-angle-left bigger-140',\r\n 'ui-icon-seek-next': 'icon-angle-right bigger-140',\r\n 'ui-icon-seek-end': 'icon-double-angle-right bigger-140'\r\n };\r\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {\r\n var icon = $(this);\r\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\r\n if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\r\n })\r\n }", "title": "" }, { "docid": "c66f66ba87f03ee593475204d475a7c4", "score": "0.5963676", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n 'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n 'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n 'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "c66f66ba87f03ee593475204d475a7c4", "score": "0.5963676", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n 'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n 'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n 'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "c66f66ba87f03ee593475204d475a7c4", "score": "0.5963676", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n 'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n 'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n 'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "50f73868fd87d85f35c1041031326a75", "score": "0.59535986", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\t\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "50f73868fd87d85f35c1041031326a75", "score": "0.59535986", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\t\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "f48e9160b267308bdcd372e8d6227fbc", "score": "0.5949837", "text": "get buttonIcon() {\n return this.done ? \"utility:close\" : \"utility:check\";\n }", "title": "" }, { "docid": "45ab2d3e7fee891fcbca6d82463452f2", "score": "0.5941592", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n 'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n 'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n 'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n }", "title": "" }, { "docid": "bc6fbfcc31889d3359cd2998f81dd988", "score": "0.5936613", "text": "_conceptActionsCell({rowIndex, data}) {\n const {readOnly, showLoadingButtonRemove} = this.props;\n const actions = [];\n const value = data[rowIndex];\n const notModificated = !(value._added || value._removed || value._changed);\n const manualRole = !value.automaticRole && !value.directRole;\n //\n actions.push(\n <Basic.Button\n level={'danger'}\n onClick={this._deleteConcept.bind(this, data[rowIndex])}\n className=\"btn-xs\"\n disabled={readOnly || !manualRole}\n showLoading={showLoadingButtonRemove}\n role=\"group\"\n title={this.i18n('button.delete')}\n titlePlacement=\"bottom\">\n <Basic.Icon icon={notModificated ? 'trash' : 'remove'}/>\n </Basic.Button>\n );\n if (!value._removed) {\n actions.push(\n <Basic.Button\n level={'warning'}\n onClick={this._showDetail.bind(this, data[rowIndex], true, false)}\n className=\"btn-xs\"\n disabled={readOnly || !manualRole}\n role=\"group\"\n title={this.i18n('button.edit')}\n titlePlacement=\"bottom\">\n <Basic.Icon icon={'edit'}/>\n </Basic.Button>\n );\n }\n return (\n <div className=\"btn-group\" role=\"group\">\n {actions}\n </div>\n );\n }", "title": "" }, { "docid": "90ed4a74d9509b18cc74c92218e0743f", "score": "0.59286886", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\t\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "42601f16fd00af88472e4bdc80d834bb", "score": "0.59263945", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\t\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "42601f16fd00af88472e4bdc80d834bb", "score": "0.59263945", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\t\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "907dc87c2358af0d47707f9a8b98bec2", "score": "0.5917969", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = {\n\t\t\t'ui-icon-seek-first': 'ace-icon fa fa-angle-double-left green bigger-140',\n\t\t\t'ui-icon-seek-prev': 'ace-icon fa fa-angle-left red bigger-140',\n\t\t\t'ui-icon-seek-next': 'ace-icon fa fa-angle-right red bigger-140',\n\t\t\t'ui-icon-seek-end': 'ace-icon fa fa-angle-double-right green bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function() {\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "e8d37dfdbe4ed125ba17ac11baab0862", "score": "0.5916688", "text": "updateIcons_() {\n var item = /** @type {SlickTreeNode} */ (this.scope_['item']);\n var icons = item.getToggleIcons();\n if (icons) {\n this.scope_['collapsedIcon'] = icons['collapsed'] || Controller.DEFAULT_COLLAPSED;\n this.scope_['expandedIcon'] = icons['expanded'] || Controller.DEFAULT_EXPANDED;\n }\n\n apply(this.scope_);\n }", "title": "" }, { "docid": "f195a35f32079bb6b001d1d6e7a17ecd", "score": "0.59059626", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "f195a35f32079bb6b001d1d6e7a17ecd", "score": "0.59059626", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "f195a35f32079bb6b001d1d6e7a17ecd", "score": "0.59059626", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "f195a35f32079bb6b001d1d6e7a17ecd", "score": "0.59059626", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "f195a35f32079bb6b001d1d6e7a17ecd", "score": "0.59059626", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "10c37277cd1b52b3b37bb2096a82e4a9", "score": "0.5905232", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = {\n\t\t\t'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon')\n\t\t\t\t.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tvar icon = $(this);\n\t\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace(\n\t\t\t\t\t\t\t\t\t'ui-icon', ''));\n\n\t\t\t\t\t\t\tif ($class in replacement)\n\t\t\t\t\t\t\t\ticon.attr('class', 'ui-icon '\n\t\t\t\t\t\t\t\t\t\t+ replacement[$class]);\n\t\t\t\t\t\t})\n\t}", "title": "" }, { "docid": "10c37277cd1b52b3b37bb2096a82e4a9", "score": "0.5905232", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = {\n\t\t\t'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',\n\t\t\t'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon')\n\t\t\t\t.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tvar icon = $(this);\n\t\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace(\n\t\t\t\t\t\t\t\t\t'ui-icon', ''));\n\n\t\t\t\t\t\t\tif ($class in replacement)\n\t\t\t\t\t\t\t\ticon.attr('class', 'ui-icon '\n\t\t\t\t\t\t\t\t\t\t+ replacement[$class]);\n\t\t\t\t\t\t})\n\t}", "title": "" }, { "docid": "1b7c4c246fdb4182dff78995776d6b4d", "score": "0.59043187", "text": "function changeDeleteToTrashIcon() {\n var table = document.getElementById('myTable');\n var rows = table.getElementsByTagName(\"tr\");\n\n table.getElementsByTagName('th')[20].innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\n table.getElementsByTagName('th')[19].innerHTML = '<i class=\"fas fa-edit\"></i>';\n\n for(i = 1; i < rows.length; i++) {\n var link = table.rows[i].cells[18].innerHTML;\n\n if (link == 'file:None' || link == '') {\n table.rows[i].getElementsByTagName('a')[0].innerHTML = '<i class=\"fas fa-edit\"></i>';\n table.rows[i].getElementsByTagName('a')[1].innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\n }\n else {\n table.rows[i].getElementsByTagName('a')[1].innerHTML = '<i class=\"fas fa-edit\"></i>';\n table.rows[i].getElementsByTagName('a')[2].innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\n }\n\n }\n}", "title": "" }, { "docid": "3505fda8bca7635829de9c6090771309", "score": "0.59017456", "text": "function changeIcone() {\n if (menuBtn.classList.contains('fa-bars')){\n menuBtn.className = 'fas fa-times';\n } else {\n menuBtn.className = 'fas fa-bars';\n }\n }", "title": "" }, { "docid": "4ef1e129d5ae0753d9cecb2ac7837b60", "score": "0.58942914", "text": "function updatePagerIcons(table) {\n var replacement =\n\t{\n\t 'ui-icon-seek-first': 'ace-icon fa fa-angle-double-left bigger-140',\n\t 'ui-icon-seek-prev': 'ace-icon fa fa-angle-left bigger-140',\n\t 'ui-icon-seek-next': 'ace-icon fa fa-angle-right bigger-140',\n\t 'ui-icon-seek-end': 'ace-icon fa fa-angle-double-right bigger-140'\n\t};\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n });\n}", "title": "" }, { "docid": "aaa9bf29d99821733b03656e6fbd55a1", "score": "0.5879466", "text": "function updatePagerIcons(table) {\r\n\t\tvar replacement = {\r\n\t\t\t'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-prev' : 'icon-angle-left bigger-140',\r\n\t\t\t'ui-icon-seek-next' : 'icon-angle-right bigger-140',\r\n\t\t\t'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'\r\n\t\t};\r\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon')\r\n\t\t\t\t.each(\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\tvar icon = $(this);\r\n\t\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace(\r\n\t\t\t\t\t\t\t\t\t'ui-icon', ''));\r\n\r\n\t\t\t\t\t\t\tif ($class in replacement)\r\n\t\t\t\t\t\t\t\ticon.attr('class', 'ui-icon '\r\n\t\t\t\t\t\t\t\t\t\t+ replacement[$class]);\r\n\t\t\t\t\t\t})\r\n\t}", "title": "" }, { "docid": "c9b919310e02f954cfd79f8673ce33b5", "score": "0.5877551", "text": "function menuHumBurgerIcon() {\n\t\t$('.navbar-toggler').on('click', function () {\n\t\t\t$('i').toggleClass('d-inline d-none');\n\t\t});\n\t}", "title": "" }, { "docid": "7b0bf0c1e4aa9989b0d31721f3ddaac9", "score": "0.58722883", "text": "function removeIcons(btn) {\n btn.removeClass(function(index, css) {\n return (css.match(/(^|\\s)fa-\\S+/g) || []).join(' ');\n });\n }", "title": "" }, { "docid": "0651ad89a72ad466763210e9f078644e", "score": "0.58696157", "text": "function iconsOn(clickedItem, hoverItem) {\n\n if (o.icons === true) {\n $accordion.append('<span></span>');\n }\n\n if (o.icons === true && o.hover === 'on') {\n \n hoverItem.hover(function () {\n if ($(this).hasClass('active')) {\n return;\n } else {\n $(this).addClass('active').siblings().removeClass('active');\n }\n \n });\n\n } else {\n\n clickedItem.click(function () {\n if ($(this).hasClass('active')) {\n return;\n } else {\n $(this).addClass('active').siblings().removeClass('active');\n }\n });\n\n }\n\n }", "title": "" }, { "docid": "749cf4ee607cb61ce44851894b899789", "score": "0.5862575", "text": "function updatePagerIcons(table) {\n var replacement =\n {\n 'ui-icon-seek-first': 'ace-icon fa fa-angle-double-left bigger-140',\n 'ui-icon-seek-prev': 'ace-icon fa fa-angle-left bigger-140',\n 'ui-icon-seek-next': 'ace-icon fa fa-angle-right bigger-140',\n 'ui-icon-seek-end': 'ace-icon fa fa-angle-double-right bigger-140'\n };\n $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n })\n}", "title": "" }, { "docid": "a88193f45b07365d535c77460d124184", "score": "0.5848334", "text": "function create_action_buttons(action,label,icon,btn_type,id){\n return '<button id=\"'+id+'\" class=\"btn '+btn_type+' '+action+'-btn status-btn xs-pr-10 xs-pl-10\" data-status=\"'+action+'\">'+label+' <i class=\"fa fa-'+icon+'\" aria-hidden=\"true\"></i></button>';\n }", "title": "" }, { "docid": "12cf501d62c3aced806359ac6ff5b4b1", "score": "0.5844776", "text": "function setContatcsIcons() {\n\tif(jQuery('#contacts_send_message_button'))\n\tjQuery('#contacts_send_message_button').button({\n\t\ticons: {\n primary: \"ui-icon-mail-closed\"\n }\n\t});\n}", "title": "" }, { "docid": "1c03c8838d807b02cd1edffaa29e743a", "score": "0.5844472", "text": "function updatePagerIcons(table) {\n\t\tvar replacement = {\n\t\t\t'ui-icon-seek-first': 'icon-double-angle-left bigger-140',\n\t\t\t'ui-icon-seek-prev': 'icon-angle-left bigger-140',\n\t\t\t'ui-icon-seek-next': 'icon-angle-right bigger-140',\n\t\t\t'ui-icon-seek-end': 'icon-double-angle-right bigger-140'\n\t\t};\n\t\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function() {\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n\t\t\tif ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n\t\t})\n\t}", "title": "" }, { "docid": "cf6b0aa108c7cdcbb62d0525957883c7", "score": "0.58219075", "text": "function setProductIcons() {\n\tjQuery('.edit_button').button({\n\t\ticons: {\n primary: \"ui-icon-wrench\"\n\t\t}\n\t});\n\tjQuery('.save_button').button({\n\t\ticons: {\n primary: \"ui-icon-check\"\n\t\t}\n\t}).click(function() {\n\t\tjQuery.cookie('redirect','');\n\t\treturn true;\n\t});\n\tjQuery('.remove_button').button({\n\t\t\ticons: {\n\t primary: \"ui-icon-closethick\"\n\t }\n\t});\n\tjQuery('.add_button').button({\n\t\t\ticons: {\n\t primary: \"ui-icon-plusthick\"\n\t }\n\t});\n\tjQuery('.back').button({\n\t\t\ticons: {\n\t primary: \"ui-icon-arrowreturnthick-1-s\"\n\t }\n\t});\n}", "title": "" }, { "docid": "caa9543faa2b0593c629eceb6746c585", "score": "0.5820855", "text": "getIcons(content) {\n switch (content) {\n case \"Logout\":\n return (\n <>\n <FiLogOut size=\"0.9rem\" />\n </>\n ); // will be redirected to '/' upon successful logout\n case \"Login\":\n return (\n <>\n <FiLogIn size=\"0.9rem\" />\n </>\n );\n case \"Signup\":\n return (\n <>\n <FiUserPlus size=\"0.9rem\" />\n </>\n );\n case \"Manage Pantry\":\n return (\n <>\n <FiEdit size=\"0.9rem\" />\n </>\n );\n case \"Search Foods\":\n return (\n <>\n <FiSearch size=\"0.9rem\" />\n </>\n );\n case \"Cart\":\n return (\n <>\n <FiShoppingCart size=\"0.9rem\" />\n </>\n );\n case \"Profile\":\n return (\n <>\n <FiUser size=\"0.9rem\" />\n </>\n );\n case \"Reservations\":\n return (\n <>\n <FiClipboard size=\"0.9rem\" />\n </>\n );\n case \"Wishlist\":\n return (\n <>\n <BsGift size=\"0.9rem\" />\n </>\n );\n case \"Help\":\n return (\n <>\n <FiHelpCircle size=\"0.9rem\" />\n </>\n );\n default:\n return \"/\";\n }\n }", "title": "" }, { "docid": "92894dafa05a7366bbe98abf54812679", "score": "0.5805511", "text": "_invokerIconTemplate() {\n return html`📅`;\n }", "title": "" }, { "docid": "dd4ccda0b644f951ad1ba21d3caf7f41", "score": "0.57994235", "text": "get actions() {\n const links = [\n {label: 'Home', href:'/'},\n {label: 'About', href:'/about'}\n ]\n return links.map( (listItem,i) => (\n <li key={i}>\n {/* 8. Use Link object to add href for smooth nav */}\n <Link href={listItem.href} >\n <a>{listItem.label}</a>\n </Link>\n </li>\n ))\n }", "title": "" }, { "docid": "1f57c144ea2c1e1b7065fc4e33ccf5d3", "score": "0.5793196", "text": "function updatePagerIcons(table) {\n\tvar replacement = {\n\t\t'ui-icon-seek-first': 'icon-double-angle-left bigger-140',\n\t\t'ui-icon-seek-prev': 'icon-angle-left bigger-140',\n\t\t'ui-icon-seek-next': 'icon-angle-right bigger-140',\n\t\t'ui-icon-seek-end': 'icon-double-angle-right bigger-140'\n\t};\n\t$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {\n\t\tvar icon = $(this);\n\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\n\t\tif ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);\n\t})\n}", "title": "" }, { "docid": "08e3ceaffa04c0868b8344e774b34717", "score": "0.57705796", "text": "renderIconForType(type) {\n //console.log('type: ', this.props);\n if (type === 'items') {\n return (\n <Icon\n onPress={this.props.onEditPress}\n name='create'\n color='#65c3d8'\n iconStyle={{\n justifyContent: 'space-between',\n marginLeft: 10,\n marginRight: 20 }}\n />\n );\n }\n }", "title": "" }, { "docid": "e9d52e94876a9c16c31c2b8ab7a48534", "score": "0.5764706", "text": "deleteIconAdd(cell, row){\n\treturn (<actionDiv><deleteDiv> <a href = 'javaScript:void(0)' onClick= {(e) => {currentObj.deleteTableRow(cell, row, this)}} ><img src=\"http://localhost/img/deleteIcon.png\" /></a></deleteDiv></actionDiv>)\n}", "title": "" }, { "docid": "77e524daeb55b5e4e13877fdf546f1ac", "score": "0.5763653", "text": "function _iconAddToToolbar() {\n\n\t\tvar $icon = $(\"<a>\")\n\t\t\t.attr({\n\t\t\t\tid: \"phpviewlog-preview-icon\",\n\t\t\t\thref: \"#\"\n\t\t\t})\n\t\t\t.css({\n\t\t\t\tdisplay: \"block\"\n\t\t\t})\n\t\t\t.click(_iconClickEvent)\n\t\t\t.appendTo($(\"#main-toolbar .buttons\"));\n\t}", "title": "" }, { "docid": "4b9f78c1646941ddad41686b297aff17", "score": "0.5702244", "text": "function colorizeIcon() {\n chrome.browserAction.setIcon({path:\"go-to-Backend48x48.png\"});\n}", "title": "" }, { "docid": "5b927f3f9f502c6ac221a868bd25fe64", "score": "0.56844604", "text": "function hoverActions () {\n row = arguments[0];\n icon = [];\n for (var i=1; i<arguments.length; i++)\n this.icon.push(arguments[i]);\n $(\".\" + row).mouseenter( function() {\n var id = $(this).attr(\"id\").toString().replace(/row_/i, \"\");\n if ( $('#edit-modal').length ) {\n $(\"#edit_\"+id).click(function(){\n getData(id, function(data) {\n for(key in data) {\n if ($('#edit-modal input[name='+key+']').length )\n $('#edit-modal input[name='+key+']').val(data[key]);\n else\n $('#edit-modal textarea[name='+key+']').val(data[key]);\n }\n $('input[name=\"id\"]').val(id);\n });\n });\n $(\"#delete_\"+id).click( function(){\n var sum = $(this).parent().parent().parent().find('h4').text();\n $(\"#confirmDelete\").data(\"id\", id );\n $(\"#confirmDelete .btn-danger\").text(\"Delete \" + sum);\n });\n }\n }).mouseleave( function() {\n // Nothing to do.\n });\n}", "title": "" }, { "docid": "e5b90f28c0d4f1551e4d6197cac24031", "score": "0.5666035", "text": "toggleButton(e, selectedIcon) {\n if (this.props.choreView === 'list') {\n document.querySelector('.column-button-list-selected').classList.remove('column-button-list-selected');\n e.currentTarget.classList.add('column-button-list-selected');\n }\n this.props.selectIcon(selectedIcon);\n }", "title": "" }, { "docid": "30733df44d333eea76b9d43d9a44fa6f", "score": "0.5665987", "text": "toggleIcon(e) {\n var icon = e.currentTarget.className.split(\"-\")[1];\n this.props.setIcon(icon, this.props.type);\n }", "title": "" }, { "docid": "dbb583601171f1061725cc3cb7a3b72f", "score": "0.56304264", "text": "function FormatterAccionesCheq(values, row) {\n return [\n '<a class=\"btn btn-warning btn-xs btn-edita-cheq\" style=\"margin-right:10%;\"><i class=\"fa fa-pencil\"></i></a>',\n '<a class=\"btn btn-danger btn-xs btn-edo-cheq\"><i class=\"fa fa-exclamation-circle\"></i></a>',\n ].join('');\n }", "title": "" }, { "docid": "5ec11b0b2eea259626b71f522fe2309a", "score": "0.56149566", "text": "function addicons(){\n //Create object with list of icons\n var icons = {\n \"sc-tangentsnowball\": \"&#xf021;\",\t\n \"sc-profile-blacklist\": \"&#xf022;\",\n \"sc-tag\": \"&#xf023;\",\n \"sc-star\": \t \"&#xf024;\",\n \"sc-refresh\": \"&#xf025;\",\n \"sc-upload\": \"&#xf026;\",\n \"sc-download\": \"&#xf027;\",\n \"sc-bookmark\": \"&#xf028;\",\n \"sc-flaga\": \"&#xf029;\",\n \"sc-doc-default\": \"&#xf02a;\",\n \"sc-info\": \"&#xf02b;\",\n \"sc-calendar\": \"&#xf02c;\",\n \"sc-print\": \"&#xf02d;\",\n \"sc-home\": \"&#xf02e;\",\n \"sc-view\": \"&#xf02f;\",\n \"sc-synca\": \"&#xf030;\",\n \"sc-hcard\": \"&#xf031;\",\n \"sc-shop-bag\": \"&#xf032;\",\n \"sc-pants\": \"&#xf033;\",\n \"sc-pants-granny\": \"&#xf034;\",\n \"sc-pants-bikini\": \"&#xf035;\",\n \"sc-pants-speedo\": \"&#xf036;\",\n \"sc-target\": \"&#xf037;\",\n \"sc-trash\": \"&#xf038;\",\n \"sc-notes\": \"&#xf039;\",\n \"sc-library\": \"&#xf03a;\",\n \"sc-paperclipa\": \"&#xf03b;\",\n \"sc-paperclipb\": \"&#xf03c;\",\n \"sc-syncb\": \"&#xf03d;\",\n \"sc-key\": \"&#xf03e;\",\n \"sc-suitcase\": \"&#xf040;\",\n \"sc-smallx\": \"&#xf041;\",\n \"sc-delete-right\": \"&#xf042;\",\n \"sc-delete-left\": \"&#xf043;\",\n \"sc-folder\": \"&#xf044;\",\n \"sc-slider\": \"&#xf045;\",\n \"sc-dot\": \"&#xf046;\",\n \"sc-sort\": \"&#xf047;\",\n \"sc-arrowup\": \"&#xf048;\",\n \"sc-arrowdown\": \"&#xf049;\",\n \"sc-filter\": \"&#xf04a;\",\n \"sc-info-circle\": \"&#xf04b;\",\n \"sc-delivery\": \"&#xf04c;\",\n \"sc-payment\": \"&#xf04d;\",\n \"sc-help-circle\": \"&#xf04e;\",\n \"sc-flagb\": \t \"&#xf050;\",\n \"sc-book\": \"&#xf051;\",\n \"sc-logout-mac\": \"&#xf052;\",\n \"sc-alert\": \"&#xf053;\",\n \"sc-cross\": \"&#xf054;\",\n \"sc-plus\":\t \"&#xf055;\",\n \"sc-tick\": \"&#xf056;\",\n \"sc-minus\": \t \"&#xf057;\",\n \"sc-outline-down\": \"&#xf058;\",\n \"sc-outline-up\": \"&#xf059;\",\n \"sc-outline-right\": \"&#xf05a;\",\n \"sc-outline-left\": \"&#xf05b;\",\n \"sc-fill-down\": \"&#xf05c;\",\n \"sc-fill-top\": \"&#xf05d;\",\n \"sc-fill-right\": \"&#xf05e;\",\n \"sc-fill-left\": \"&#xf060;\",\n \"sc-profile\": \"&#xf061;\",\n \"sc-search\": \"&#xf062;\",\n \"sc-comment\": \"&#xf063;\",\n \"sc-settings\": \"&#xf064;\",\n \"sc-edit\": \"&#xf065;\",\n \"sc-email-closed\": \"&#xf066;\",\n \"sc-email-open\": \"&#xf067;\",\n \"sc-logout\": \"&#xf068;\",\n \"sc-heart\": \"&#xf069;\",\n \"sc-phone\": \"&#xf06a;\",\n \"sc-rss\": \"&#xf06b;\",\n \"sc-link\": \"&#xf06c;\",\n \"sc-stop\": \"&#xf06d;\",\n \"sc-mapmarker\": \"&#xf06e;\",\n\t\"sc-gplus-fill\": \"&#xf070;\", \n \"sc-fb-fill\": \"&#xf071;\",\n \"sc-twitter-fill\": \"&#xf072;\",\n\t\"sc-cart\": \t\t \"&#xf073;\",\n\t\"sc-twitter-nofill\":\t \"&#xf074;\",\n\t\"sc-zoomin\":\t \t\t \"&#xf075;\",\n\t\"sc-zoomout\":\t \t\t \"&#xf076;\",\n\t\"sc-listviewa\":\t \t\t \"&#xf077;\",\n\t\"sc-gridviewa\":\t \t\t \"&#xf078;\",\n\t\"sc-stopwatch\":\t \t\t \"&#xf079;\",\n\t\"sc-clock\":\t \t\t \"&#xf07a;\",\n\t\"sc-timer\":\t \t\t \t \"&#xf07b;\",\n\t\"sc-shop\":\t \t\t\t \"&#xf07c;\",\n\t\"sc-outline-btmright\":\t \"&#xf07d;\",\n\t\"sc-outline-btmleft\":\t \"&#xf07e;\",\n\t\"sc-outline-topright\":\t \"&#xf080;\",\n\t\"sc-outline-topleft\":\t \"&#xf081;\",\n\t\"sc-fill-btmright\":\t \t \"&#xf082;\",\n\t\"sc-fill-btmleft\":\t \t \"&#xf083;\",\n\t\"sc-fill-topright\":\t\t \"&#xf084;\",\n\t\"sc-fill-topleft\":\t \t \"&#xf085;\",\n\t\"sc-outline-minimise\": \"&#xf086;\",\n\t\"sc-outline-maximise\": \"&#xf087;\",\n\t\"sc-fill-minimise\": \t \"&#xf088;\",\n\t\"sc-fill-maximise\": \t \"&#xf089;\",\n\t\"sc-minimise\": \t\t \"&#xf08a;\",\n\t\"sc-maximise\": \t\t \"&#xf08b;\",\n\t\"sc-listviewb\": \t\t \"&#xf08c;\",\n\t\"sc-gridviewb\": \t\t \"&#xf08d;\",\n\t\"sc-downarrowb\": \t\t \"&#xf08e;\",\n\t\"sc-rightarrow\":\t \"&#xf090;\",\n\t\"sc-leftarrow\":\t\t \"&#xf091;\",\n\t\"sc-uparrowb\": \t \"&#xf092;\",\n\t\"sc-addressbook\": \t \"&#xf093;\",\n\t\"sc-paperclipc\": \t\t \"&#xf094;\",\n\t\"sc-thumbup\":\t \t\t \"&#xf095;\",\n\t\"sc-thumbdown\": \t\t \"&#xf096;\",\n\t\"sc-bell\": \t\t\t \"&#xf097;\",\n\t\"sc-flame\":\t\t \t\t \"&#xf098;\",\n\t\"sc-keyline-up\":\t\t \"&#xf099;\",\n\t\"sc-keyline-down\":\t\t \"&#xf09a;\",\n\t\"sc-keyline-right\":\t\t \"&#xf09b;\",\n\t\"sc-keyline-left\":\t\t \"&#xf09c;\",\n\t\"sc-menutoggle\":\t \"&#xf09d;\",\n\t\"sc-image\": \t\t \"&#xf09e;\",\n\t\"sc-hairline-up\":\t\t \"&#xf0a0;\",\n\t\"sc-hairline-down\":\t\t \"&#xf0a1;\",\n\t\"sc-hairline-right\":\t \"&#xf0a2;\",\n\t\"sc-hairline-left\":\t\t \"&#xf0a3;\",\n\t\"sc-invarrow-up\":\t \t \"&#xf0a4;\",\n\t\"sc-invarrow-down\":\t\t \"&#xf0a5;\",\n\t\"sc-invarrow-right\":\t \"&#xf0a6;\",\n\t\"sc-invarrow-left\":\t\t \"&#xf0a7;\",\n\t\"sc-fb-nofill\":\t\t\t \"&#xf0a8;\",\n\t\"sc-4sq-fill\":\t\t \t \"&#xf0a9;\",\n\t\"sc-yt-fill\":\t\t\t \"&#xf0aa;\",\n\t\"sc-4sq-ifill\":\t \t\t \"&#xf0ab;\",\n\t\"sc-linkedin-fill\":\t\t \"&#xf0ac;\",\n\t\"sc-linkedin-nofill\":\t \"&#xf0ad;\",\n\t\"sc-padlock-open\":\t\t \"&#xf0ae;\",\n\t\"sc-padlock-closed\":\t \"&#xf100;\",\n\t\"sc-email-fill\":\t\t \"&#xf111;\"\n };\n\n //Detect IE version\n var browserver = parseInt($.browser.version, 10);\n\n //Run icon insertion\n if ($.browser.msie && browserver == 6 || browserver == 7) {\n $(\".snowcone\").each(function() {\n var $this = $(this);\n var icon = $this.attr(\"class\").split(/\\s/);\n for (key in icons) {\n if ([key]==icon[1]) {\n $this.prepend(\"<span class='snowcone-legacy'>\" + icons[key] + \"</span>\");\n }\n }\n });\n }\n}", "title": "" }, { "docid": "d9c194e7ef94934f93878acf77a59425", "score": "0.5612961", "text": "icon_classes() {\n return this.item.span_class;\n }", "title": "" }, { "docid": "f90e98737b26896fde6f598b1d7734ed", "score": "0.56064755", "text": "function hoverDeleteicon(item) {\n item.toggleClass('white-text primary-textcolor');\n item.toggleClass('delete-hover');\n}", "title": "" }, { "docid": "575839a186345ad0481dbd29ed0779a8", "score": "0.56008434", "text": "defaultNavStyles() {\n const btnElements = document.getElementsByClassName(\"actionNavs\");\n Array.prototype.forEach.call(btnElements, function (element) {\n element.style.backgroundColor = \"slategray\";\n element.style.color = \"white\";\n });\n const actionElements = document.getElementsByClassName(\"methods\");\n Array.prototype.forEach.call(actionElements, function (action) {\n action.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "d33289c22d321b8a98616bf51cc75fd9", "score": "0.55981314", "text": "function iconsStyle(icn) {\n icn.setAttribute('style', '\\\n margin-left: 36px;\\\n margin-right: 15.5px');\n\n return icn;\n}", "title": "" }, { "docid": "cc30cc7eca07f23923aa89a8eaeee36e", "score": "0.55962884", "text": "renderActionButtons() {\n super.renderActionButtons();\n this.actionButtons.push(\n <Button className=\"btn btn-warning list-nav\"\n onPress={() => this.props.sync()}\n iconClass=\"glyphicon glyphicon-plus\" text={t(\"Sync\")} key=\"b1\"/>\n )\n return (\n <div style={{paddingBottom:'7px'}}>\n {this.actionButtons}\n </div>\n )\n }", "title": "" }, { "docid": "fcd5f8eda50a078bd0978b8e6ed94bfe", "score": "0.55938786", "text": "defaultNavStyles() {\n const btnElements = document.getElementsByClassName(\"TactionNavs\");\n Array.prototype.forEach.call(btnElements, function (element) {\n element.style.backgroundColor = \"slategray\";\n element.style.color = \"white\";\n });\n const actionElements = document.getElementsByClassName(\"Tmethods\");\n Array.prototype.forEach.call(actionElements, function (action) {\n action.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "ffab8c4400c298bb3b6012746c259246", "score": "0.5590853", "text": "getShortcutButtons(item, entityType) {\n const allBtns = this.getShortcutButtonsData(\n item,\n entityType,\n shortcutBtnTypes\n );\n return [\n ...allBtns\n // select buttons to be shown\n .filter((btn) => btn.isShown)\n // return rendered link buttons\n .map((btnType, index) => (\n <IconButton\n as={LinkWithRef}\n to={btnType.link}\n tooltip={btnType.tooltip}\n key={item.get(\"id\") + index}\n className=\"main-settings-btn min-btn\"\n data-qa={btnType.type}\n >\n {btnType.label}\n </IconButton>\n )),\n this.getSettingsBtnByType(\n <DatasetMenu\n entity={item}\n entityType={entityType}\n openWikiDrawer={this.openWikiDrawer}\n />,\n item\n ),\n ];\n }", "title": "" }, { "docid": "2515b80156f802bfed9fab5c3a2e8362", "score": "0.5586102", "text": "static get icon() {\n\n }", "title": "" }, { "docid": "2002c51d924550f609fdba37c64c9a1d", "score": "0.5579794", "text": "btnClick() {\n if (this.btnObj.element.classList.contains(\"e-active\")) {\n this.btnObj.iconCss = \"e-icons burg-icon\";\n this.sidebarObj.show();\n } else {\n this.btnObj.iconCss = \"e-icons burg-icon\";\n this.sidebarObj.hide();\n }\n }", "title": "" }, { "docid": "dccd953db1a5bd41f8f662d8f9676b60", "score": "0.55640215", "text": "function mobileMenuIconToggle() {\r\n mobileMenuOpened = !mobileMenuOpened;\r\n if (mobileMenuOpened) {\r\n $('.mobile-menu-toggle').find('span').removeClass('fa-bars').addClass('fa-times');\r\n } else {\r\n $('.mobile-menu-toggle').find('span').addClass('fa-bars').removeClass('fa-times');\r\n }\r\n }", "title": "" }, { "docid": "ba26b9035f86a7eda1d18aeb64274911", "score": "0.5563111", "text": "function FormatterAccionesFirm(values, row) {\n return [\n '<a class=\"btn btn-danger btn-xs btn-edo\"><i class=\"fa fa-exclamation-circle\"></i></a>',\n ].join('');\n }", "title": "" }, { "docid": "a4e45a07d0f4a64b70964459b2d8bfa5", "score": "0.5560992", "text": "function onRowBound(e) {\n $(\".k-grid-Update, .Update_Icon\").find(\"span\").addClass(\"glyph-icon icon-pencil\");\n $(\".k-grid-Delete, .Delete_Icon\").find(\"span\").addClass(\"glyph-icon icon-trash\");\n $(\".Attache_Icon\").find(\"span\").addClass(\"glyph-icon icon-paperclip\");\n }", "title": "" }, { "docid": "8fefbe4618a56920d9c220505c0a46b6", "score": "0.55524945", "text": "function enableIcon() {\n\tif (indexSupportedSite) {\n\t\tchrome.browserAction.setIcon({\n\t\t\tpath: \"images/icons/enable38x38.png\"\n\t\t});\n\t}\n}", "title": "" }, { "docid": "9695c922b86dad39236936ba735db37a", "score": "0.55482656", "text": "function MatIconLocation() { }", "title": "" }, { "docid": "5302ce93758cc48ab27760d98cdf0612", "score": "0.5546964", "text": "function jvizToolNavbarBtnIcon(obj)\n{\n\t//Check for undefined object\n\tif(typeof obj === 'undefined'){ var obj = {}; }\n\n\t//Button ID\n\tthis.id = (typeof obj.id !== 'undefined')? obj.id : '';\n\n\t//Button class\n\tthis.class = (typeof obj.class !== 'undefined')? obj.class : 'jvizFormBtnIconLight';\n\n\t//Button title\n\tthis.title = (typeof obj.title === 'undefined') ? 'Button' : obj.title;\n\n\t//Show button\n\tthis.show = true;\n\n\t//Element type\n\tthis.type = 'button-icon';\n\n\t//Return the button\n\treturn this;\n}", "title": "" }, { "docid": "6a5d97ae655c193cfd042c5c4aafba68", "score": "0.5543977", "text": "getIconClass(type) {\n switch (type) {\n case 'blog':\n return 'icon-pencil';\n break;\n case 'website':\n return 'fa fa-wpforms';\n break;\n case 'email':\n return 'fa fa-envelope';\n break;\n default:\n return `icon-${type}`;\n }\n }", "title": "" }, { "docid": "b038dc94062f49a92e9237a98ecfe117", "score": "0.5535643", "text": "function toggleButtonIcon() {\n let twoPaneButton = document.getElementById(\"twoPaneButton\");\n if (twoPaneButton.dataset.openCloseState === \"InvToOpen\") {\n twoPaneButton.dataset.openCloseState = \"InvToClose\";\n twoPaneButton.innerHTML = `<span><i class=\"material-icons\" id=\"two-window-icon\">indeterminate_check_box</i><span style=\"font-family:${defaultFontName}\" class=\"icon-text\">${appInvToClose}</span>`;\n } else if (twoPaneButton.dataset.openCloseState === \"InvToClose\") {\n twoPaneButton.dataset.openCloseState = \"InvToOpen\";\n twoPaneButton.innerHTML = `<span><i class=\"material-icons\" id=\"two-window-icon\">library_add</i><span style=\"font-family:${defaultFontName}\" class=\"icon-text\">${appInvToOpen}</span>`;\n }\n}", "title": "" }, { "docid": "d3e952bb5f0af8c8ab3ffd0b81a910d6", "score": "0.5535458", "text": "function add_users_browtab_ui_buttons(){\n $( \"#button-activate-all\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-set-member-all\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-recognize-account\" ).button({\n icons: {\n primary: \"ui-icon-check\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-activate-account\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deactivate-account\" ).button({\n icons: {\n primary: \"ui-icon-locked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-set-member-account\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-member-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-delete-account\" ).button({\n icons: {\n primary: \"ui-icon-trash\",\n secondary: \"ui-icon-tag\"\n }\n });\n}", "title": "" }, { "docid": "aa9d211cc84e400651a339fb22f362f8", "score": "0.5531668", "text": "render() {\n return (\n <NavCol>\n <NavCol.Link to=\"/endring/bestillinger\">\n {' '}\n <ion-icon name=\"create\" />\n Endre bestilling\n </NavCol.Link>\n\n <NavCol.Link to=\"/endring/kunde\">\n <ion-icon name=\"people\" />\n Endre kundeinformasjon\n </NavCol.Link>\n\n <NavCol.Link to=\"/endring/sykkel\">\n {' '}\n <ion-icon name=\"bicycle\" />\n Endre sykkel\n </NavCol.Link>\n\n <NavCol.Link to=\"/endring/utstyr\">\n <ion-icon name=\"cube\" />\n Endre utstyr\n </NavCol.Link>\n <NavCol.Link to=\"/endring/ansatt\">\n <ion-icon name=\"contact\" />\n Endre ansatt\n </NavCol.Link>\n </NavCol>\n );\n }", "title": "" }, { "docid": "217f2afc124ee65ca53b00c7310996c5", "score": "0.5530343", "text": "function ELEMENT_ARROW_BUTTON$static_(){FavoritesToolbar.ELEMENT_ARROW_BUTTON=( FavoritesToolbar.BLOCK.createElement(\"arrow-button\"));}", "title": "" }, { "docid": "deaaea2e83a1034ff3008de67c056976", "score": "0.5529963", "text": "function showIconRightOrWrongOpen() {\r\n showIconRightOrWrongQ6();\r\n}", "title": "" }, { "docid": "893ad4d4cb5761f2af52545cdeb86233", "score": "0.55282015", "text": "function getActions(type) {\n const actions = '<td>' +\n '<a class=\"add add-' + type + '\" title=\"Add\" data-toggle=\"tooltip\"><i class=\"material-icons\">&#xE03B;</i></a>' +\n '<a class=\"edit edit-' + type + '\" title=\"Edit\" data-toggle=\"tooltip\"><i class=\"material-icons\">&#xE254;</i></a>' +\n '<a class=\"delete delete-' + type + '\" title=\"Delete\" data-toggle=\"tooltip\"><i class=\"material-icons\">&#xE872;</i></a>' +\n '</td>';\n return $(actions).html();\n}", "title": "" }, { "docid": "7bb820f94386de785c2d536b6fbb7ab9", "score": "0.5520984", "text": "function megaMenuIcon() {\r\n\r\n var icons = document.querySelectorAll('.top-menu i');\r\n icons.forEach(element => {\r\n element.addEventListener('click', function (e) {\r\n if (e.target.classList.contains('fa-angle-down')) {\r\n e.target.classList.remove('fa-angle-down');\r\n e.target.classList.add('fa-angle-up');\r\n } else {\r\n e.target.classList.remove('fa-angle-up');\r\n e.target.classList.add('fa-angle-down');\r\n\r\n }\r\n });\r\n });\r\n}", "title": "" } ]
b57f3a8ad58adf2f9f6c7d9835ff8bcc
All handle___Press() functions are tested and working Allergens are stored/removed in this.state.Allergens upon user selection
[ { "docid": "161455a079331c6530249d0405ae39f5", "score": "0.69134665", "text": "handleCornPress() {\n this.setState({cornChecked: (this.state.cornChecked == true) ? false : true});\n this.state.Allergens.includes('Corn') ? this.remove(this.state.Allergens, 'Corn') : this.state.Allergens.push('Corn');\n }", "title": "" } ]
[ { "docid": "d7b069b58ff02d2fba1dc636077eb1d0", "score": "0.6319207", "text": "async onpressDosing() {\n console.log('onpressDosing()');\n store.setState({\n desired_info: {\n ...store.getState().desired_info,\n label: 'Dosing',\n linkkey: 'dosing'\n }\n });\n this.checkMeds()\n }", "title": "" }, { "docid": "7975cb52cade643ede13599ff7b7d5c0", "score": "0.6122605", "text": "creator(e) {\n if (this.state.clicked === '') {\n console.log('clicked is empty')\n return;\n } else {\n let deal = this.state.clicked;\n for (let foo in deal) {\n let newKey = foo;\n e.currentTarget.textContent = this.state.clicked[foo][0];\n this.setState({clicked: ''})\n this.setState({Word: this.state.clicked[foo]})\n // delete this.state.clicked[foo]\n delete this.state.Cards[foo]\n }\n\n }\n console.log(this.state)\n console.log('word', this.state.Word)\n }", "title": "" }, { "docid": "648b94a3d644f7acd59ac751e860a969", "score": "0.598809", "text": "clickAction(e) {\n e.preventDefault()\n var target = e.currentTarget;\n var selectedHolder = this.state.selected.slice();\n // diet was found, so remove it\n var index = selectedHolder.indexOf(target.textContent);\n if (index > -1) {\n selectedHolder.splice(index, 1);\n target.style.backgroundColor = '#FFF';\n //it was not found so unselect it\n }else {\n target.style.backgroundColor = '#E0E0E0';\n selectedHolder.push(target.textContent)\n }\n this.setState({\n selected: selectedHolder\n })\n }", "title": "" }, { "docid": "91605e314e8aafda22f61624c8769e5f", "score": "0.5808565", "text": "function selectAllergy() {\n\n props.onClick(!selected);\n setSelected(!selected);\n }", "title": "" }, { "docid": "97a2f236a184aa63a74a9d5cd2888fe7", "score": "0.57781756", "text": "handleButtonPress()\r\n\t{\r\n\r\n\t}", "title": "" }, { "docid": "0b73d2bce2e3cbcae0b809644ac05153", "score": "0.5752038", "text": "handleClick(e) {\n\t\tthis.props.changeShelf(e.target.getAttribute('value'), this);\n\t\tthis.setState({showMenu: false})\n\t}", "title": "" }, { "docid": "65216f3cd47fde6357946ca6b6feaa6e", "score": "0.5716811", "text": "handleUnclick() {\r\n this.setState({\r\n clicked: [\"\"],\r\n clickedAnno: \"\",\r\n casePressed: [\r\n \"c1p11s12\",\r\n \"c2p11s12\",\r\n \"c3p11s12\",\r\n \"c4p11s12\",\r\n \"c5p11s12\",\r\n \"c6p11s12\",\r\n \"c7p11s12\",\r\n \"c8p11s12\"\r\n ]\r\n });\r\n }", "title": "" }, { "docid": "f5c5b367f6c415f172185cb4d6441def", "score": "0.5715874", "text": "handleSelection() {\n\n\t\tconst selection = this.effectB.selection;\n\t\tconst selectedObject = this.selectedObject;\n\n\t\tif(selectedObject !== null) {\n\n\t\t\tif(selection.has(selectedObject)) {\n\n\t\t\t\tselection.delete(selectedObject);\n\n\t\t\t} else {\n\n\t\t\t\tselection.add(selectedObject);\n\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "77c285e70c113a1e91538b96ebdd240d", "score": "0.5709792", "text": "handleClick(i) {\n const { randomBomb, randomTreasure } = this.state \n const spaces = this.state.spaces\n const count = this.state.count\n\n if(i === randomBomb){\n spaces[i] = 'Bomb';\n this.setState({spaces: spaces});\n alert ('You lose!')\n window.location.reload()\n } else if(i === randomTreasure) {\n spaces[i] = 'Treasure';\n this.setState({spaces: spaces}); \n alert ('Winner!')\n window.location.reload()\n }else{\n spaces[i] = \"Tree\";\n this.setState({spaces: spaces});\n }\n \n count: this.setState({ count: count + 1 })\n }", "title": "" }, { "docid": "9ed601a9c0d6c91f8b637086198255fb", "score": "0.5697179", "text": "onPressHandler() {\n this.setState({\n first: \"Bye\",\n });\n }", "title": "" }, { "docid": "38a4b725e9eedda1b579ac534883e411", "score": "0.56886715", "text": "_handlePress() {\n\t\t\t\n if( this.state.name !== '' && this.state.address != '' && this.state.productName != '' && this.state.description != '' ){\n this.props.request.name = this.state.name;\n this.props.request.address = this.state.address;\n this.props.request.productName = this.state.productName;\n this.props.request.description = this.state.description;\n Alert.alert(\"Done\",\"Saved\");\n this.props.navigator.pop();\t\n }else{\n Alert.alert(\"Warning\",\"Some input is empty\");\n }\n\t\t\n }", "title": "" }, { "docid": "a7ff4de466aca140531bbd5e263b795e", "score": "0.5684166", "text": "handleInteraction(button) {\n\t\t\tlet isChecked = phrase.checkLetter(button);\n\t\t\tif (isChecked !== undefined && !isChecked) {\n\t\t\t\tthis.removeLife();\n\t\t\t\tfor (let i = 0; i < qwertyKeys.length; i++) {\n\t\t\t\t\tif (button === qwertyKeys[i].textContent) {\n\t\t\t\t\t\tqwertyKeys[i].className = 'wrong animate__animated animate__headShake';\n\t\t\t\t\t\tqwertyKeys[i].disabled = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tphrase.showMatchedLetter(button);\n\n\t\t\t\tfor (let i = 0; i < qwertyKeys.length; i++) {\n\t\t\t\t\tif (button === qwertyKeys[i].textContent) {\n\t\t\t\t\t\tqwertyKeys[i].className = 'chosen animate__animated animate__headShake';\n\t\t\t\t\t\tqwertyKeys[i].disabled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.checkForWin()) {\n\t\t\t\t\tthis.gameOver(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cb763981ec596167147715bb3c3a6489", "score": "0.56668735", "text": "static handleDeleteAllClick() {\n\t\tif (!Display.handlingEvent) {\n\t\t\tDisplay.handlingEvent = true;\n\t\t\t\n\t\t\tInterstruct.deleteAll();\n\t\t\t\n\t\t\tDisplay.handlingEvent = false;\n\t\t}\n\t}", "title": "" }, { "docid": "1672f663376c9ef22ec448f57a438aee", "score": "0.56257683", "text": "recipeSelectHandler(event) {\n if (this.state.results && !this.state.made) {\n this.setState({ navWarn: true });\n }\n else {\n this.setState({ made: false, navWarn: false });\n }\n\n let selectedRecipe;\n for (let r in this.props.userRecipes) {\n if (this.props.userRecipes[r].dbKey === event.target.value) {\n selectedRecipe = this.props.userRecipes[r];\n }\n }\n this.props.onSelectUserRecipe(selectedRecipe.dbKey, selectedRecipe);\n }", "title": "" }, { "docid": "e72270b7be7feb6c56583422f39ba033", "score": "0.5610233", "text": "onClick() {\n this.service.selectedStateChanged(this.selectedState);\n }", "title": "" }, { "docid": "8607509fa485cafaccc5e7f3c4e46a7d", "score": "0.5599107", "text": "onEnvelopeSelected( envelope ) {\n if ( envelope.id === this.state.envelope.id ) {\n this.setState( {envelope: NULL_ENVELOPE } );\n return;\n }\n this.setState( { envelope } );\n }", "title": "" }, { "docid": "5221f2f7492448eba67fc2c8492c5244", "score": "0.55990815", "text": "onChangeAction(newAction) {\n\n console.log('Game : START : -------------------------------------------->');\n console.log('Game : START : onChangeAction ----> '+newAction+' --------->');\n console.log('Game : START : -------------------------------------------->');\n\n let existingNames = this.state.existingNames;\n\n if (newAction === Util.ACTION_CREATE_EXAMPLE) {\n let names = [];\n\n for (var [key,val] of Util.EXAMPLE_MAP) {\n console.log(key +'...'+val.length);\n if (!existingNames.includes(key)) {\n names.push(key);\n }\n }\n\n this.setState({ action: newAction, cword: null,\n existingNames: names, \n updateTimestamp: Util.newDate() }); \n\n\n } else if (newAction === Util.ACTION_CLEAR) {\n\n this.storeGetNames();\n\n } else {\n\n this.setState({ action: newAction, cword: null,\n updateTimestamp: Util.newDate() }); \n } \n }", "title": "" }, { "docid": "620afaa1ca91427973a29fed18e8d3a5", "score": "0.55947036", "text": "onSelection(event, correctArticle) {\n\t\tconst selected = event.target.value;\n const newState = {...this.state};\n\n newState.displaySelection = false;\n newState.isCorrect = (correctArticle.title === selected);\n newState.correctArticle = correctArticle\n\n\t\tthis.setState(newState);\n\t}", "title": "" }, { "docid": "a335b149bfe2fb15b222ce30fd6fba24", "score": "0.5578667", "text": "restoreUI() {\n this.setState({\n selEntity: AppData.entity[\"0\"].id,\n selCombinator: AppData.combinator[\"0\"],\n selAttribute: \"Attribute\",\n selOperator: \"Operator\"\n }); \n }", "title": "" }, { "docid": "b9b02d760bd7e441a6eb2b3cd891470e", "score": "0.55685526", "text": "onDishSelect(dish){\n\t\tthis.setState({selectedDish:dish});\n\t}", "title": "" }, { "docid": "cac0e68caae09568c32745d6d062d05d", "score": "0.5565166", "text": "retClicked()\n\t{\n\t\tthis.setState({view: views.LANDING});\n\t}", "title": "" }, { "docid": "a54a1b8ebb4c0fa5fdc372dd3fee00bb", "score": "0.55445856", "text": "rightClickUpEvent() {\r\n this.setState(!this.getState());\r\n }", "title": "" }, { "docid": "a54a1b8ebb4c0fa5fdc372dd3fee00bb", "score": "0.55445856", "text": "rightClickUpEvent() {\r\n this.setState(!this.getState());\r\n }", "title": "" }, { "docid": "b57dab045442207d3757d0c3def6f955", "score": "0.55149025", "text": "enter(event) {\n if (event.keyCode === 13) {\n const value = event.target.value;\n if (value.slice(0, 3) === 'add') { // inserts a new nurse in db\n event.target.value = '';\n this.add(value);\n } else if (value.slice(0, 9) === 'discharge') {\n event.target.value = '';\n console.log('test inside enter func in app.jsx');\n this.discharge(value);\n } else if (value === 'clear') { // turned off for now\n event.target.value = '';\n this.reset();\n } else if (value === 'assign') {\n event.target.value = '';\n this.assign();\n } else if (value.slice(0, 6) === 'remove') {\n event.target.value = '';\n this.remove(value);\n } else if (value === 'populate') { // development only\n event.target.value = '';\n const beds = { beds: this.state.beds };\n $.ajax({\n method: 'POST',\n url: '/populate',\n data: beds\n });\n } else if (value.slice(0, 5) === 'admit') {\n event.target.value = '';\n this.admit(value);\n } else if (value.slice(0, 4) === 'note') {\n event.target.value = '';\n this.addNote(value.slice(5));\n } else {\n event.target.value = '';\n this.setState({ view: value });\n }\n }\n }", "title": "" }, { "docid": "2f6a612d8a297ed37c615820cb63fe74", "score": "0.5501932", "text": "handleClearShoes() {\n this.setState({\n shoes: []\n })\n }", "title": "" }, { "docid": "9e4a18e48b126d09c2383ca18ef44053", "score": "0.5465836", "text": "handleClickEncours() {\n this.setState({ tousClicked: false });\n this.setState({ encoursClicked: true });\n this.setState({ expireClicked: false });\n this.setState({ initialStateEncours: false });\n }", "title": "" }, { "docid": "558f2a08cd89b6d9db63533c924105af", "score": "0.5464674", "text": "function purgeState(){\n\tif(Sburb.rooms){\n\t\tdelete Sburb.rooms;\n\t}\n\tif(Sburb.sprites){\n\t\tdelete Sburb.sprites;\n\t}\n\tSburb.rooms = {};\n\tif(Sburb.bgm){\n\t\tSburb.bgm.stop();\n\t\tSburb.bgm = null;\n\t}\n for(var bin in Sburb.Bins) {\n if(!Sburb.Bins.hasOwnProperty(bin)) continue;\n Sburb.Bins[bin].innerHTML = \"\";\n }\n\tSburb.gameState = {};\n\tSburb.globalVolume = 1;\n\tSburb.hud = {};\n\tSburb.sprites = {};\n\tSburb.buttons = {};\n\tSburb.effects = {};\n\tSburb.curAction = null;\n\tSburb.actionQueues = [];\n\tSburb.nextQueueId = 0;\n\tSburb.pressed = {};\n\tSburb.pressedOrder = [];\n\tSburb.chooser = new Sburb.Chooser();\n\tSburb.dialoger = null;\n\tSburb.curRoom = null;\n\tSburb.char = null;\n\tSburb.assetManager.resourcePath = \"\";\n\tSburb.assetManager.levelPath = \"\";\n\tSburb.loadedFiles = {};\n}", "title": "" }, { "docid": "bdbb8d13d3e3ded98e1646783d8c818d", "score": "0.5452433", "text": "handleClick() {\n if (this.state.enteringNewPhrase) {\n this.setState({enteringNewPhrase: false});\n } this.setState({enteringNewPhrase: true});\n }", "title": "" }, { "docid": "c1f9f8c44001928571433c5812f2c1d8", "score": "0.54493135", "text": "unselect(event){\n const temp=this.state.selectedInterests;\n const tempObj=temp.splice(event.currentTarget.value,1)[0];\n this.setState(prevState => ({\n unselectedInterests:[...prevState.unselectedInterests,tempObj].sort(),\n selectedInterests:temp,\n })\n )\n }", "title": "" }, { "docid": "905a437afd67ce533a9525bada48e787", "score": "0.5447197", "text": "handleCheck(e) {\n if (this.state.programs.includes(e.target.value)) {\n console.log(this.state.programs, e.target.value);\n var idx = this.state.programs.indexOf(e.target.value);\n this.state.programs.splice(idx, 1);\n }\n else {\n this.state.programs.push(e.target.value);\n }\n this.setState({\n [e.target.name]: this.state.programs\n });\n }", "title": "" }, { "docid": "4b65f93c922752ada64b1b7fb6809a29", "score": "0.5430193", "text": "select(event){\n let temp=[];\n if(this.state.search===\"\"){\n temp=this.state.unselectedInterests;\n }else{\n temp=this.state.queriedInterests;\n }\n const tempObj=temp.splice(event.currentTarget.value,1)[0];\n if (this.state.search!==\"\"){\n temp=this.state.unselectedInterests;\n temp.splice(temp.indexOf(tempObj),1);\n }\n event.preventDefault();\n this.setState(prevState=>({\n selectedInterests: [...prevState.selectedInterests,tempObj].sort(),\n unselectedInterests: temp,\n search:\"\",\n }))\n }", "title": "" }, { "docid": "3d298303db14a84e3dfa7b879d9d0ccc", "score": "0.5404615", "text": "handleSelect(e) {\n\n // This ensures that the React synthetic event is preserved as an ordinary DOM event,\n // which is needed to extract the event target value, etc.\n e.persist();\n e.preventDefault();\n e.stopPropagation();\n\n // Get the selected data list key.\n const selected = e.target.parentNode.parentNode.parentNode.getAttribute(\"data-field\");\n\t\t\n\t\t// Get the word cloud size modifiers.\n\t\tconst mods = this.state.mods[selected];\n\t\tconst max = mods.max || 1;\n\t\tconst mod = mods.mod || config.cloud.mods.base;\n\t\t\n\t\t// Get the data list.\n const list = this.state[selected];\n\n // Update the app state.\n const newState = update(this.state, {\n current: {\n list: { $set: list },\n header: { $set: config.data.headers[selected] }\n }\n });\n\n const app = this;\n app.setState(newState, function handleSelectCallback() {\n console.log(\"\\nApp.handleSelectCallback(\" + selected + \"):\", app.state.current);\n\n // Render a word cloud after the managing state data object has updated.\n // A timer is not strictly needed, but useful in case of random browser lag.\n window.setTimeout(() => {\n app.__renderCloud(max, mod);\n }, config.timers.base);\n });\n }", "title": "" }, { "docid": "99c278c35b1d2fe4355425c41bd935f1", "score": "0.54037577", "text": "despedirse(){\n\t\talert('adios');\n\t\t//this.state.saludo = 'Hasta Luego' <-- MAL, no se puede hacer directamente\n\t\tthis.setState({\n\t\t\tsaludo: 'Hasta Luego'\n\t\t})\n\t}", "title": "" }, { "docid": "c0bea8c4d0b87cbcc2019345be114e20", "score": "0.5402617", "text": "_onChange() {\n this.setState(getListState());\n//usercanchange\n this.setState(getDistributorQuantiy());\n//usercantchange\n this.setState(getBillDev());\n this.setState(getBillPlatform());\n this.setState(getBillDesign());\n this.setState(getBillBonus());\n this.setState(getUsersQuantity());\n this.setState(getQualityLevel());\n this.setState(getContactsQuantity());\n\n this.setState(getAllSum());\n }", "title": "" }, { "docid": "e7730f4f5b13428180875b5091e4459b", "score": "0.5401365", "text": "sellAnimal() {\n game.animals[game.selectedAnimal].alive = false;\n game.bank += game.animals[game.selectedAnimal].value;\n }", "title": "" }, { "docid": "4ef9067edd569221515965d2a4b8dac8", "score": "0.54004985", "text": "handleClick4 (){\n console.log(\"RESTAURANT ID 1 button clicked\")\n this.setState({longitude: 23.102628 })\n this.setState({latitude: 60.389487})\n this.setState({NAME: \"SADE Canteen\"})\n this.setState({DESCRIPTIO: \"Try out the kvarg!\" })\n this.setState({selectedFood: foodData})\n console.log(this.state);\n }", "title": "" }, { "docid": "6012a8fd31a22e183f936470ba929a05", "score": "0.53966284", "text": "static selectEventHandler(e) {\n // if the user hasn't started a word yet, just return\n if (!Controller.startSquare) {\n return\n }\n\n // if the new square is actually the previous square, just return\n let lastSquare = Controller.selectedSquares[Controller.selectedSquares.length - 1];\n if (lastSquare == e.detail) {\n return\n }\n\n // see if the user backed up and correct the selectedSquares state if\n // they did\n let backTo\n for (let i = 0; i < Controller.selectedSquares.length; i++) {\n let selectedSquare = Controller.selectedSquares[i]\n if (selectedSquare.x == e.detail.x && selectedSquare.y == e.detail.y) {\n backTo = i + 1\n break\n }\n }\n\n while (backTo < Controller.selectedSquares.length) {\n let target = Controller.selectedSquares[Controller.selectedSquares.length - 1]\n Controller.myView.removeSelected(target.x, target.y)\n\n Controller.selectedSquares.splice(Controller.selectedSquares.length - 1, 1);\n Controller.curWord = Controller.curWord.substr(0, Controller.curWord.length - 1)\n lastSquare = Controller.selectedSquares[Controller.selectedSquares.length - 1]\n }\n\n // see if this is just a new orientation from the first square\n // this is needed to make selecting diagonal words easier\n let newOrientation = Controller.calcOrientation(\n Controller.startSquare.x,\n Controller.startSquare.y,\n e.detail.x,\n e.detail.y\n )\n\n if (newOrientation) {\n Controller.selectedSquares.forEach( sq => {\n Controller.myView.removeSelected(sq.x, sq.y)\n })\n Controller.myView.addSelected(Controller.startSquare.x, Controller.startSquare.y)\n\n Controller.selectedSquares = [Controller.startSquare]\n Controller.curWord = Controller.myQuiz.grid[Controller.startSquare.y][Controller.startSquare.x]\n Controller.curOrientation = newOrientation\n lastSquare = Controller.startSquare\n }\n\n // see if the move is along the same orientation as the last move\n let orientation = Controller.calcOrientation(\n lastSquare.x,\n lastSquare.y,\n e.detail.x,\n e.detail.y\n )\n\n // if the new square isn't along a valid orientation, just ignore it.\n // this makes selecting diagonal words less frustrating\n if (!orientation) {\n return\n }\n\n // finally, if there was no previous orientation or this move is along\n // the same orientation as the last move then play the move\n if (!Controller.curOrientation || Controller.curOrientation === orientation) {\n Controller.curOrientation = orientation;\n Controller.playTurn(e.detail);\n }\n }", "title": "" }, { "docid": "1d7585c56e4d4ed2b4e0b1613a33af8c", "score": "0.53947365", "text": "onSuggestionClick(toReserveItem){\n /* Add items to toReserve state */\n let toReserve = this.state.toReserve.map(item=>Object.assign({}, item));\n toReserve.push(toReserveItem);\n\n /* Remove item from items*/\n let items = this.state.items.map(item=>Object.assign({}, item));\n items = items.filter(item=>{return item._id !== toReserveItem._id});\n this.setState({items, toReserve});\n\n }", "title": "" }, { "docid": "572396a8125f313438dcd8b5432e5cb9", "score": "0.5393089", "text": "function handleButtonPress() {\n setGame(new Game(4));\n }", "title": "" }, { "docid": "fb8373e7500ba227c222d4fc7034c5ad", "score": "0.5392011", "text": "checkedState(e) {\n switch (e.target.value) {\n case \"Surgeon\":\n {\n this.setState({ surgeon: !this.state.surgeon });\n break;\n }\n case \"Anesthesiologist\":\n {\n this.setState({ anesthesiologist: !this.state.anesthesiologist });\n break;\n }\n case \"Nurse\":\n {\n this.setState({ nurse: !this.state.nurse });\n break;\n }\n case \"Room cleaned\":\n {\n this.setState({ roomCleaned: !this.state.roomCleaned });\n break;\n }\n }\n\n }", "title": "" }, { "docid": "b9fca5a75aeab7dcd6725571c6b683b8", "score": "0.5389853", "text": "removeOne(e) {\n if (this.countAll <= 0) {\n alert('You shoud choose one ticket');\n return;\n }\n if (e.target.className.includes('remove-adult') && this.countAdult > 0) {\n this.countAdult--;\n this.removeBookedSeat();\n } else if (e.target.className.includes('remove-kid') && this.countKid > 0) {\n this.countKid--;\n this.removeBookedSeat();\n } else if (\n e.target.className.includes('remove-retired') &&\n this.countRetired > 0\n ) {\n this.countRetired--;\n this.removeBookedSeat();\n }\n if (this.countAll === 0) {\n this.bookButton = false;\n }\n this.render();\n }", "title": "" }, { "docid": "53268316cb12af3f831ee4520a4d03e8", "score": "0.5389068", "text": "roomToggle (event) {\n event.preventDefault();\n const rooms = this.state.rooms.slice(0);\n const roomId = event.target.id.replace ( /[^\\d.]/g, '' );\n\n rooms[roomId].show = !(rooms[roomId].show == undefined || rooms[roomId].show);\n this.setState({\n rooms: rooms,\n });\n }", "title": "" }, { "docid": "c291e70d7575b6ee10fd55f4063cf06d", "score": "0.5386201", "text": "function MissionSelector({initialmission, onMissionChange}) {\n\n\n const [mission, setMission] = useState(initialmission)\n \n useHotkeys(\"1\",()=>{setMission('S1')}) \n useHotkeys(\"2\",()=>{setMission('S2')}) \n useHotkeys(\"3\",()=>{setMission('S3')}) \n useHotkeys(\"5\",()=>{setMission('S5P')}) \n useHotkeys(\"6\",()=>{setMission('ENVISAT')})\n\n useEffect(() => {\n console.log('Mission changed to: '+ mission)\n onMissionChange(mission)\n }, [mission]);\n \n \n //console.log('mission rendering')\n return (\n <div className='MissionSelector'>\n <div className={(mission == 'S1')?'CircleButtonSelected':'CircleButton'}><img className='MissionIcon' src='./images/s1_black.png' alt='' onClick={() => setMission('S1')} /></div>\n <div className={(mission == 'S2')?'CircleButtonSelected':'CircleButton'}><img className='MissionIcon' src='./images/s2_black.png' alt='' onClick={() => setMission('S2')} /></div>\n <div className={(mission == 'S3')?'CircleButtonSelected':'CircleButton'}><img className='MissionIcon' src='./images/s3_black.png' alt='' onClick={() => setMission('S3')} /></div>\n <div className={(mission == 'S5P')?'CircleButtonSelected':'CircleButton'}><img className='MissionIcon' src='./images/s5p_black.png' alt='' onClick={() => setMission('S5P')} /></div>\n \n \n </div>\n )\n}", "title": "" }, { "docid": "d678ec103221cd95f4c2fdfa16f5b5f3", "score": "0.5383364", "text": "function state_(){this.state$QW4L=( {});}", "title": "" }, { "docid": "028bcecfc28e4db3eb72a738acd270b8", "score": "0.5375625", "text": "function resetPressedState() {\n for (var key in pressedState) {\n delete pressedState[key];\n }\n }", "title": "" }, { "docid": "984d057b76063cd293d8f7c9768b919c", "score": "0.53743047", "text": "ChosenTherapist(e)\n\t{\n\t\tthis.setState({\n\t\t\ttherapist: e.target.value\n\t\t})\n\t}", "title": "" }, { "docid": "ac120807c5f096ddf10ad082cc58e997", "score": "0.53664315", "text": "deleteHandler(){\n\t\tthis.state.handleClick(this.state.idKey);\n\t}", "title": "" }, { "docid": "5f749a1e1017ff9c7c3d6fa1ef8eb058", "score": "0.5361876", "text": "updateSelection(aspect, e) {\n var selection = this.state.selection.slice();\n\n if (!selection.includes(aspect))\n selection.push(aspect);\n else\n selection = selection.filter(function(val){ return val != aspect })\n\n this.setState({\n selection: selection\n })\n }", "title": "" }, { "docid": "db0ff517ddaf350c4ee46ab1b4e9943a", "score": "0.53521276", "text": "switchAlgoMode(e){\n this.setState({algoMode: parseInt(e.target.value)});\n this.resetHull();\n }", "title": "" }, { "docid": "c811d25e7b256c58def4d4802621c35d", "score": "0.5348817", "text": "handleInteraction(e) {\r\n\t\t// These will stand in for both click and keyboard events\r\n\t\tlet theKeyButtonLI, theClickedKeyButtonText;\r\n\r\n\t\t// Is this a click event or a keydown event?\r\n\t\t// Click\r\n\t\tif (e.type === \"click\") {\r\n\t\t\t// Otherwise get the list item from e.target and the letter value\r\n\t\t\ttheKeyButtonLI = e.target;\r\n\t\t\ttheClickedKeyButtonText = theKeyButtonLI.textContent;\r\n\r\n\t\t\t// If the area clicked wasn't a button, exit the function.\r\n\t\t\tif (theKeyButtonLI.nodeName !== \"BUTTON\") return;\r\n\r\n\t\t\t// Keydown\r\n\t\t} else if (e.type === \"keydown\" && (e.key >= \"a\" && e.key <= \"z\")) {\r\n\t\t\t// Get the letter value from the key property\r\n\t\t\ttheClickedKeyButtonText = e.key;\r\n\r\n\t\t\t// Use the letter value to find the matching on-screen key button list item\r\n\t\t\ttheKeyButtonLI = [...qwertyKeys].find(\r\n\t\t\t\tkeyButton => keyButton.textContent === theClickedKeyButtonText\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// If the letter clicked has been clicked previously, exit the function.\r\n\t\tif (this.lettersUsed.includes(theClickedKeyButtonText)) return;\r\n\r\n\t\t// Reset the letter button's class\r\n\t\tif (theKeyButtonLI) theKeyButtonLI.className = \"key\";\r\n\r\n\t\t// Add the letter to our list of used letters\r\n\t\tthis.lettersUsed += theClickedKeyButtonText;\r\n\r\n\t\t// If the phrase includes the letter, the letter-button gets the 'chosen' class, and the letters in the phrase get 'show'. If not, the letter-button gets the 'wrong' class and we remove a life.\r\n\t\tif (\r\n\t\t\tthis.activePhrase.checkLetter(theClickedKeyButtonText)\r\n\t\t) {\r\n\t\t\ttheKeyButtonLI.className = \"key chosen\";\r\n\t\t\tthis.activePhrase.showMatchedLetter(theClickedKeyButtonText);\r\n\t\t\tif (this.checkForWin()) this.gameOver(\"won\");\r\n\t\t} else {\r\n\t\t\tif (theKeyButtonLI) theKeyButtonLI.className = \"key wrong\";\r\n\t\t\tthis.removeLife();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ea338c5502d44925ff3b475103a7a04f", "score": "0.5346931", "text": "_handleGChange(e) {\n e.persist();\n let newGreen = e.target.value;\n this.setState({g: newGreen});\n this.updateGreen();\n }", "title": "" }, { "docid": "6b5c5af26e028cf8e97050b0fb72a5ae", "score": "0.53420895", "text": "selectPack(e) {\n this.setState({\n selectedPack: e.currentTarget.value,\n buttonState: true,\n });\n }", "title": "" }, { "docid": "a4b07541f0c9b5d0274e5f66a1ddee2b", "score": "0.5339225", "text": "function selectBadGuy() {\n // game screen state 2: \n console.log(\"---> select villian\")\n\n // extract hero id from attrivute figherId of clicked object\n badguyId = parseInt($(this).attr(\"badguyId\")); // !!!!!Marking References to display pieces\n\n // set Hero global variable for battle \n badguy = activeplayerList[badguyId];\n match.enterVillian(badguy);\n console.log(\"defender\", badguy)\n\n // update activeplayerList by extracting selected badguy\n activeplayerList.splice(badguyId, 1);\n console.log(activeplayerList);\n\n // draw defender row, this is the bad guy line\n drawDefender(\"#defender\");\n console.log(\"Add in function here! \");\n\n // draw enemy list (updates with character gone)\n drawEnemyRow('#enemyRow');\n\n}", "title": "" }, { "docid": "02f61f090d8e29bed614b75e77e53006", "score": "0.5338812", "text": "handleClick(event) {\n event.preventDefault();\n this.setState({\n joined: !this.state.joined\n });\n }", "title": "" }, { "docid": "59a1a89088738cbb52e62189a55f2526", "score": "0.53344876", "text": "function handleClick() {\n // Udpate the states in here\n updQuoteIndex(Math.floor(Math.random() * quotes.length));\n updColorIndex(Math.floor(Math.random() * colors.length));\n }", "title": "" }, { "docid": "be132edab33419ceb22da8e8893e3405", "score": "0.5332608", "text": "selectedValue(e) {\n console.log(e.target.value);\n this.setState({choice: e.target.value});\n\n }", "title": "" }, { "docid": "505e6a9e3c1e82084132787e657edeb6", "score": "0.5326256", "text": "handleDeleteAllClick(e) {\n\t\tif (!Display.handlingEvent) {\n\t\t\tDisplay.handlingEvent = true;\n\t\t\t\n\t\t\tthis._interstruct.deleteAll();\n\t\t\t\n\t\t\tDisplay.handlingEvent = false;\n\t\t}\n\t}", "title": "" }, { "docid": "b51692492a378237d8854223a0740187", "score": "0.5321909", "text": "onClose() {\n this.selections = { ...{} };\n }", "title": "" }, { "docid": "e8b283321e4a58c605a859f63d549710", "score": "0.53211886", "text": "getWeapon() {\n const numX = this.state.playerX - weapon.x;\n const numY = this.state.playerY - weapon.y;\n if (Math.abs(numX) < 15 && Math.abs(numY) < 15) {\n this.clearItem(weapon);\n switch (this.state.myWeapon) {\n case 'stick':\n myWeapon = 'knife';\n attacks = 18;\n break;\n case 'knife':\n myWeapon = 'bow and arrows';\n attacks = 36;\n break;\n case 'bow and arrows':\n myWeapon = 'sword';\n attacks = 54;\n break;\n case 'sword':\n myWeapon = 'gun';\n attacks = 72;\n break;\n }\n weapon = {};\n }\n this.setState({\n myWeapon: myWeapon,\n attacks: attacks\n });\n }", "title": "" }, { "docid": "3f9acb4b0673fa3229893ab87e908392", "score": "0.531865", "text": "handleNoonSelection(evt) {\n this.setState({noonOnBtn: evt});\n }", "title": "" }, { "docid": "4a2aab743f1c785ca52fe17e5cca3832", "score": "0.5318383", "text": "handleClick(event) {\n let state = {text: event.target.text};\n switch (state.text) {\n case \"Pictures\":\n state.value = \"P\";\n break;\n case \"Words\":\n state.value = \"W\";\n break;\n case \"Both\":\n state.value = \"B\";\n break;\n default:\n state.text = \"\";\n state.value = \"\";\n }\n this.setState(state);\n this.props.parentCallback(state);\n }", "title": "" }, { "docid": "7a0f5dde609f1f0130f9f4439b88142d", "score": "0.53101414", "text": "function clickHandler(e) {\n\tswitch(currentCase) {\n\t\n\tcase \"Add\":\n\t\t//draws state at user click coordinates\n\t\tdraw(e);\n\tbreak;\n\t\n\tcase \"Remove\":\n\t\tif (document.addEventListener ){\n \t\tdocument.addEventListener(\"click\", function(event){});\n \t\t\t//find element under click\n \t\tvar targetElement = event.target || event.srcElement;\n \t\t//remove state that was clicked, and associated arcs\n \t\tif (targetElement.tagName == \"circle\" || targetElement.tagName == \"text\"){\n \t\t\tvar stateId = targetElement.parentNode.getAttribute(\"id\");\n \t\t\tvar thisArcs = stateArcs[stateId];\t\t//arcs of state to remove\n \t\t\t/*for each arc of state to remove, remove arc from every state's list of arcs\n \t\t\ton which it appears, remove arc from document*/\n \t\t\tfor (var i = 0; i < thisArcs.length; i++) {\n \t\t\t\tvar arcId = thisArcs[i];\n \t\t\t\t//states\n \t\t\t\tvar toRemove = document.getElementById(arcId);\n \t\t\t\ttoRemove.remove();\n \t\t\t\tvar states = arcId.split(\"\");\n\t \t\t\t\tfor(var j = 0; j < states.length; j++){\n \t\t\t\t\tvar currState = states[j];\n \t\t\t\t\tif(currState != stateId){\n \t\t\t\t\t\tvar currArcs =stateArcs[currState];\n \t\t\t\t\t\tvar index = currArcs.indexOf(arcId);\n \t\t\t\t\t\tif (index > -1){\n\t\t\t\t\t\t\t\t\tcurrArcs.splice(index, 1);\n\t\t\t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tvar n = parseInt(stateId);\n \t\t\tdelete stateArcs[n];\n \t\t\t//update startState if current startState is removed\n \t\t\tif(targetElement.parentNode.childNodes.item(1).textContent == \"0\"\n \t\t\t|| targetElement.parentNode.childNodes.item(2).textContent == \"0\"){\n \t\t\t\tstartState = undefined;\n \t\t\t\tconsole.log(\"here\");\n \t\t\t}\n \t\t\tconsole.log(\"startState after remove: \", startState);\n \t\t\t//update list of accepting states, if accepting state is removed\n \t\t\tvar acceptIndex = accepting.indexOf(stateId);\n \t\t\tif (acceptIndex > -1){\n \t\t\t\taccepting.splice(acceptIndex, 1);\n \t\t\t}\n \t\t\ttargetElement.parentNode.remove();\n \t\t\t\n \t\t}\n \t}\n \t/* format for firefox?\t\n\t\t else if (document.attachEvent) { \n \t\tdocument.attachEvent(\"onclick\", function(){\n \t\tvar targetElement = event.target || event.srcElement;\n \t\tif (targetElement.tagName == \"circle\" || targetElement.tagName == \"text\"){\n \t\t\ttargetElement.parentNode.remove();\n \t\t}\n \t\t});\n\t\t}*/\n\t\tbreak;\n\t\t\n\tcase \"Accept\":\n \tvar targetElement = event.target || event.srcElement;\n \tif ((targetElement.tagName == \"circle\" || targetElement.tagName == \"text\")){\n \t\t/*if click state is not already an accepting state, add ring in document\n \t\tto indicate accepting status, add state to accepting states list*/\n \t\tif (targetElement.parentNode.childNodes.length < 4){\n \t\t\tvar g = targetElement.parentNode;\n \t\t\tvar cx = targetElement.getAttribute(\"cx\");\n \t\t\tvar cy = targetElement.getAttribute(\"cy\");\n \t\t\tvar circle = document.createElementNS(\"http://www.w3.org/2000/svg\", \"circle\");\n \t\t\t\tcircle.setAttribute(\"cx\",cx);\n\t\t\t\t\tcircle.setAttribute(\"cy\",cy);\n\t\t\t\t\tcircle.setAttribute(\"r\",17);\n\t\t\t\t\tcircle.setAttribute(\"fill\", \"none\");\n\t\t\t\t\tcircle.setAttribute(\"stroke\", \"#A9A9A9\");\n\t\t\t\t\tg.insertBefore(circle, g.childNodes.item(1));\n\t\t\t\t\taccepting.push(g.getAttribute(\"id\"));\n\t\t\t\t}\n \t}\n\n\tbreak;\n\t\n\t}\n}", "title": "" }, { "docid": "6ee47f2f8b0da4668bf15cbec2b7f3f2", "score": "0.53086305", "text": "clearAllLetters(){\n const newCards = this.state.cards.map((cv) => {\n return {\n ...cv,\n isSelected: false \n };\n });\n this.setState({cards: newCards, listSelectedLetters: []});\n }", "title": "" }, { "docid": "b5d9c71411bcf73ce4d8fd1b6cffc7fa", "score": "0.5301339", "text": "handleInteraction (keySelected) {\n if (keySelected.className === 'key') {\n keySelected.disabled = true;\n if (this.activePhrase.checkLetter(keySelected)) {\n keySelected.className = 'chosen';\n this.activePhrase.showMatchedLetter(keySelected);\n if (game.checkForWin()) {\n game.gameOver();\n }\n } else if (this.activePhrase.checkLetter(keySelected) === false) {\n keySelected.className = 'wrong';\n game.removeLife();\n }\n }\n }", "title": "" }, { "docid": "2fb77dfd6af3b879006600004df967d1", "score": "0.52973676", "text": "function GetGumball() {\n let obtainedGumball = myFavoriteGumballMachine.GetGumball();\n UpdateUI(obtainedGumball);\n}", "title": "" }, { "docid": "cdc772b51fc6ea3ef2105a4ad2502ef5", "score": "0.529714", "text": "checkCards(val){\n let firstCardId = this.state.firstCardID;\n let secondCardId = this.state.secondCardID;\n let score = this.state.score;\n if(this.state.firstCard === this.state.secondCard){\n\n let cards = this.state.listOfCards;\n score += 100;\n cards.pop(val);\n this.enableAll();\n\n document.getElementById(firstCardId).disabled = true;\n document.getElementById(secondCardId).disabled = true;\n\n let state1 = _.extend(this.state, {firstCard: \"Click\", firstCardID:null, secondCard: \"\", secondCardID:null, listOfCards: cards, score: score});\n this.setState(state1);\n }\n else{\n\n document.getElementById(firstCardId).innerHTML = \"Click\";\n document.getElementById(secondCardId).innerHTML = \"Click\";\n this.enableAll();\n score -= 10;\n let state1 = _.extend(this.state, {firstCard: \"Click\",firstCardID: null, secondCard: \"\", secondCardID: null, score:score});\n this.setState(state1);\n }\n }", "title": "" }, { "docid": "ffec4a53680fa709fa4a6ad7d5bd6792", "score": "0.5296725", "text": "handleSelect(e) {\n\t\tlet state = this.state;\n\t\tstate.answers[e.currentTarget.name] = e.currentTarget.value;\n\t\tthis.setState(state, () => {\n\t\t\t//console.log(this.state);\n\t\t});\n\t}", "title": "" }, { "docid": "bbbdd99605d9aab5970bf56cc6a5ccbb", "score": "0.5294858", "text": "_updateStateButtonPress() {\n this.props.onSetState(this.state.text);\n }", "title": "" }, { "docid": "ab183236f5b1907ac3edc4dec5557211", "score": "0.5290555", "text": "recordLetter(e){\n // e.preventDefault();\n let letter = e.currentTarget.textContent;\n let deal = this.state.Cards;\n for (let foo in deal) {\n if (deal[foo][0] === letter) {\n let newKey = foo;\n let obj = {};\n obj[newKey] = deal[foo];\n this.setState({clicked: obj})\n }\n }\n }", "title": "" }, { "docid": "8a6ebd7d399b4dfadd10d206eefafeb8", "score": "0.52882546", "text": "onPressGenderFemale() {\n this.state = {genderMale: false, genderFemale: true};\n }", "title": "" }, { "docid": "9de276a7c153a8a98e6058ce8c73bb90", "score": "0.5287095", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n\tdinnerMenu: this.props.model.getFullMenu()\t\n })\n }", "title": "" }, { "docid": "d78f9753f415635a8a6a3c8b8ade6191", "score": "0.52844316", "text": "buttonSelectChanger(button) {\n const currentState = this.state;\n const newCurrentData = this.displayOptions(button);\n this.setState({...currentState, selectedButton: button, currentData: newCurrentData});\n }", "title": "" }, { "docid": "2b35f398556fd7a0523203932f1440b5", "score": "0.5283276", "text": "limpiarRamas() {\n this.state.selectedRama = []\n }", "title": "" }, { "docid": "bb96fb6a9998fda11c45ad5fe6d85628", "score": "0.5275306", "text": "activateBericht(){\n if(weergeven_nieuws() === 1) {\n this.setState({\n actief1: \"actief\",// net iets handigers doen\n });\n }else if(weergeven_nieuws() === 2){\n this.setState({\n actief2: \"actief\",\n });\n }else if(weergeven_nieuws() === 3){\n this.setState({\n actief3: \"actief\",\n });\n }else if(weergeven_nieuws() === 4){\n this.setState({\n actief4: \"actief\",\n });\n }else if(weergeven_nieuws() === 5){\n this.setState({\n actief5: \"actief\",\n });\n }else if(weergeven_nieuws() === 6){\n this.setState({\n actief6: \"actief\",\n });\n } \n }", "title": "" }, { "docid": "6c3f0fff446cc1124ae4072d822e3afd", "score": "0.527528", "text": "handleClick() {\n this.selected(true);\n }", "title": "" }, { "docid": "b0ad9abc4d26d4485934674db3897fe1", "score": "0.5273858", "text": "rightClickDownEvent() {\r\n this.setState(!this.getState());\r\n }", "title": "" }, { "docid": "d85aff22daa1fec98ce25ef8baad7393", "score": "0.5272", "text": "limpiarGrupo() {\n this.state.selectedRama = []\n }", "title": "" }, { "docid": "3044dbbc3e8659a43bc7280f23854b8f", "score": "0.52719617", "text": "function sub() {\n nameValue = nameInput.value();\n friendValue = friendInput.value();\n foodValue = foodInput.value();\n gameState++;\n\n // Remove the input slots for the mini game\n nameInput.remove();\n friendInput.remove();\n foodInput.remove();\n button1.remove();\n }", "title": "" }, { "docid": "810f79245aa4aa082a4fa13c17263014", "score": "0.5271629", "text": "handleClick() {\n\t\tif(this.props.chooseScreenHide==='') {\n\t\t\tthis.props.handleClick('home');\n\t\t} else {\n\t\t\tthis.props.handleClick('choose');\n\t\t}\n\t}", "title": "" }, { "docid": "8146c5320d3cd83d60d759058ec04847", "score": "0.5268324", "text": "selectHandler(){\n \n this.props.onSelect(this.state.selected)\n }", "title": "" }, { "docid": "2cda2dc65cd4864c4add34619b0de14a", "score": "0.5266725", "text": "addButtonPressed() {\n this.props.addIngredient(this.props.activeSearchBars);\n }", "title": "" }, { "docid": "146dd4f30398c5534b20bdc9d1abdb64", "score": "0.5259755", "text": "function handleClick(){\n if( value == 'EMPTY' )takeTurn(position)\n }", "title": "" }, { "docid": "1b4b5a37af892d4cbf750ea2262ac94b", "score": "0.5258422", "text": "handleControls(unit){\n this.clearHighlight()\n this.setState({\n unitToPlace: unit\n })\n }", "title": "" }, { "docid": "a84643e8f2d5d6c77267c9c31daacc36", "score": "0.52559423", "text": "function handleChange(event) {\n setDogPicked(event.target.value);\n }", "title": "" }, { "docid": "f9db6b3264e2a95285af7b336809546b", "score": "0.5255657", "text": "onPressGenderMale() {\n this.state = {genderMale: true, genderFemale: false};\n }", "title": "" }, { "docid": "c6581093b7b9cf8612646b53cf848aa6", "score": "0.5255202", "text": "function handleSelection(value) {\n setCategory(value);\n setVisible(false);\n }", "title": "" }, { "docid": "ba29fcc60badd6b1a50b850327b965d9", "score": "0.52460694", "text": "handleSwitch(e) {\n this.setState({ signup: !(this.state.signup)})\n }", "title": "" }, { "docid": "6307bb06ea786a2fdf1b3e975e4371ca", "score": "0.5242382", "text": "endPlant() {\n this.setState({ plant: false })\n }", "title": "" }, { "docid": "f2ffa46f77ce62788781792d7b532d0b", "score": "0.52392596", "text": "onBreedSelected(selected) {\n this.props.history.push('/?breed=' + selected.id);\n this.props.dispatch(loadCats(selected));\n }", "title": "" }, { "docid": "6eb390a869103d7479aea633133ef657", "score": "0.523861", "text": "handleMouseUpBattle() {\n this.toggleBattle();\n }", "title": "" }, { "docid": "7bfce65be25c5c2a82ba8b37ae6f090c", "score": "0.52357", "text": "handleInteraction(clickedLetter) { // check letter\n if (phrase.checkLetter(clickedLetter) == true) { // checkLetters returns true || false and if true\n phrase.showMatchedLetter(clickedLetter); // letter is shown in hidden phrase \n this.checkForWin(); // checks for win\n // console.log('this entered the if')\n } else {\n this.removeLife();\n //console.log('this entered the else')\n //console.log(this.missed);\n }\n }", "title": "" }, { "docid": "3706a3d21fc1ab3cf2dc0bc9b3bc65c8", "score": "0.5235369", "text": "onSelectBettingSlot() {\n this.setState({\n selectAnteSlot: !this.state.selectAnteSlot\n });\n }", "title": "" }, { "docid": "58b7e6b3e60a90e4d57e7138e5906bd0", "score": "0.52353394", "text": "setSGW() {\n this.setState(\n {\n region: {\n latitude: 45.495598,\n longitude: -73.57785\n },\n pressed: {\n pressedRight: false,\n pressedLeft: true\n }\n },\n () => {\n this.props.updateRegion(this.state.region);\n }\n );\n }", "title": "" }, { "docid": "dd27462c0ea3c3e1962b7681f1f4970b", "score": "0.5234359", "text": "render() {\n const { allergies, diet } = this.state\n return (\n <Segment>\n <h2>Update Your Dietary Requirements</h2>\n <Diet\n diet={diet}\n addDietToState={this.addDietToState}\n clearOptionsState={this.clearOptionsState}\n />\n <h2>Update Your Allergies </h2>\n <Allergies\n allergies={allergies}\n addAllergiesToState={this.addAllergiesToState}\n clearOptionsState={this.clearOptionsState}\n />\n </Segment>\n );\n }", "title": "" }, { "docid": "5b8f6fd09c16ada60dd3b78e14a2c543", "score": "0.52338314", "text": "function _handleNeighborhoodClick() {\n dispatch({ type: 'SET_NBHD', payload: !state.neighborhoods });\n }", "title": "" }, { "docid": "e3de382e913f73a0ef6072c6313586ef", "score": "0.52325165", "text": "handleTechTap_() {\n this.userActive(!this.userActive());\n }", "title": "" }, { "docid": "e7925f70b954e43cf4060c7eb9f2725b", "score": "0.52322716", "text": "onKeypress() {\n // If user press a key, just clear the default value\n if (this.opt.default) {\n this.opt.default = undefined;\n }\n\n this.render();\n }", "title": "" }, { "docid": "e7925f70b954e43cf4060c7eb9f2725b", "score": "0.52322716", "text": "onKeypress() {\n // If user press a key, just clear the default value\n if (this.opt.default) {\n this.opt.default = undefined;\n }\n\n this.render();\n }", "title": "" }, { "docid": "63a4b6e41e523d20774872ebedd15a65", "score": "0.522828", "text": "update() {\n this.setState({\n numberOfGuests: this.model.getNumberOfGuests(),\n menu: this.model.getMenu()\n });\n }", "title": "" }, { "docid": "708313abec3c0ba960902dd74ecf7cb9", "score": "0.52282786", "text": "handleButtonClick(button_label){\n for(let button in this.state.selected) {\n let newSelected = this.state.selected;\n if(this.buttons.indexOf(button) !== -1 && button === button_label) {\n newSelected[button] === true ? newSelected[button] = false : newSelected[button] = true;\n }\n else {\n if(this.buttons.indexOf(button) !== -1) {\n newSelected[button] = false;\n }\n }\n this.setState({selected: newSelected});\n }\n }", "title": "" } ]
4683e76c7c1a6174fcffc385c5334072
remove given trello from the list
[ { "docid": "4818ed808a092c3415fe6e79731754ea", "score": "0.7563", "text": "removetrello (trello) {\n this.trellos.splice(this.trellos.indexOf(trello), 1);\n }", "title": "" } ]
[ { "docid": "801dd93bcca8743acf3291cb1bf23693", "score": "0.65744936", "text": "function removeFromPlaylist(p, s) {\n var pref = cloudPlaylists.doc(p);\n console.log(\"REMOVING FROM PLAYLIST:\", p, s.id);\n pref.update({\n tracks: firebase.firestore.FieldValue.arrayRemove(cloudSongs.doc(s.id))\n });\n const templist = state.displaylist;\n var index = state.displaylist.indexOf(s);\n templist.splice(index, 1);\n setState(state => ({ ...state, displaylist: templist }))\n }", "title": "" }, { "docid": "e46eb7bf6ffdc03fa23ea01ea6f6e332", "score": "0.6397478", "text": "removeToy(toy) {\n const index = this.toy.indexOf(toy)\n this.toy.splice(index, 1)\n return this.toys\n}", "title": "" }, { "docid": "2b2fb765a2c74f75da13f16f2eb6b48a", "score": "0.631942", "text": "remove(word) {\r\n var size = this.list.length;\r\n for(var i=0; i<size; i++) {\r\n if(this.list[i] == word) { \r\n if(i < (size-1))\r\n this.list[i] = this.list[size-1];\r\n this.list.pop();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ad201388995f1d3bf0a303c3a6db1d56", "score": "0.6303232", "text": "function removeAddedTVshow(el) {\n\tfor (let i = 0; i < addedTVShowsArr.length; i++) {\n\t\tlet trenTitle = addedTVShowsArr[i].title;\n\t\tif (trenTitle === el.title) {\n\t\t\taddedTVShowsArr.splice(i, 1);\n\t\t\tbreak;\n\t\t}\n\t}\n\taddToListNumber();\n\tprikaziMyList();\n}", "title": "" }, { "docid": "639062cf756a082de3a2cc6714ab55bc", "score": "0.6270914", "text": "function removeToDo(li) {\n list.removeChild(li)\n}", "title": "" }, { "docid": "23011e9bea3e67695c816d49b9ea3731", "score": "0.6266968", "text": "removeTrack(track){\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter(playlistTrack => playlistTrack.id !== track.id);\n this.setState({playlistTracks: tracks});\n }", "title": "" }, { "docid": "7e4bb0e34388974cb3db9552a229df47", "score": "0.62408704", "text": "removeTrack(thisTrack)\n {\n this.tracks = this.tracks.filter(track => track == thisTrack);\n }", "title": "" }, { "docid": "73b84a42e630fa00fac1e33464dc90ba", "score": "0.62298465", "text": "removeTrack(track) {\n let tracks = this.state.playListTracks;\n\n tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n this.setState({playListTracks: tracks});\n }", "title": "" }, { "docid": "2c844b7782bb8823abf7d5d6d8da6092", "score": "0.6203188", "text": "function rimuoviContenuto(id) {\r\n const id_int = parseInt(id);\r\n let indexToRemove;\r\n \r\n for(contenuto of lista_preferiti) {\r\n if(contenuto.id == id_int){\r\n indexToRemove = lista_preferiti.indexOf(contenuto);\r\n }\r\n }\r\n lista_preferiti.splice(indexToRemove, 1);\r\n}", "title": "" }, { "docid": "2218739b5c9c7bb46fc394f483e73c65", "score": "0.6191203", "text": "remove(){\n\t\tif(tracers.includes(this))\n\t\t\ttracers.splice(tracers.indexOf(this), 1);\n\t}", "title": "" }, { "docid": "a21dbb1b6ecbadc1d60d7f7abc726a24", "score": "0.61824894", "text": "removeTrack(track) {\n if(this.state.playlistTracks.indexOf(track) !== -1) {\n let index = this.state.playlistTracks.indexOf(track);\n this.state.playlistTracks.splice(index, 1);\n this.setState({ playlistTracks: this.state.playlistTracks })\n }\n }", "title": "" }, { "docid": "4234e580aab0c6138edf461ff617c8ca", "score": "0.6175366", "text": "removeTrack(trackPassin) {\n let tracks = this.state.playlistTracks\n //keep the tracks that have different id than track passed in\n tracks = tracks.filter(track => track.id !== trackPassin.id)\n this.setState({ playlistTracks: tracks });\n }", "title": "" }, { "docid": "707338227de0c636c43af4fd0dd55524", "score": "0.6161961", "text": "function removeFromPlaylist(inx){\n wjs().removeItem(inx);\n $('#PLcontainer .collection-item[data-item-number = \"' + inx + '\"]').remove();\n reorderIndex();\n}", "title": "" }, { "docid": "13fe87c93e65aa5819264f2a4d90c26e", "score": "0.61503845", "text": "remove() { }", "title": "" }, { "docid": "2e67af617f2ae3d546ccde283ae85d18", "score": "0.6117183", "text": "function removeColoredNodeFromList(node){\n\n var index = listOfRemNode.indexOf(node);\n if(index >= 0){\n listOfRemNode.splice(index, 1);\n }\n\n}", "title": "" }, { "docid": "c86cae5cd55d64dc258c7c212dfab575", "score": "0.6116377", "text": "function removeFromPlaylist(playlist, artist) {\n delete playlist[artist];\n return playlist;\n}", "title": "" }, { "docid": "b3034fe6cf1f060a644f848e281685e5", "score": "0.6093824", "text": "removeTrack(track){\n const removeTrack = this.state.playlistTracks.filter(playlistTrack => track.id !== playlistTrack.id);\n this.setState({playlistTracks : removeTrack});\n }", "title": "" }, { "docid": "1e115acfe8628eb086f4e231928ce689", "score": "0.6092466", "text": "function removeFromClanList(){\n var blacklistClan = getGMArray(\"blacklistClan\");\n for(var i=0; i<blacklistClan.length; i++){ \n if(blacklistClan[i].indexOf(document.getElementById(\"newBlockedClan\").value)>-1){ \n blacklistClan.splice(i, 1); \n console.log(\"Freigeschaltet: \"+blacklistClan[i]); \n }\n } \n setGMArray(\"blacklistClan\",blacklistClan); \n location.reload();\n}", "title": "" }, { "docid": "581b86af72750e72140d95e5c4db3982", "score": "0.607665", "text": "function removerTarefa() {\n var tarefaId = event.target.parentElement.dataset.id\n var posicao = toDoList.findIndex(function (tarefa) {\n return tarefa.id == tarefaId\n })\n\n toDoList.splice(posicao, 1)\n event.target.parentElement.remove()\n atualizarContadores()\n\n localStorage.setItem('tasks', JSON.stringify(toDoList))\n}", "title": "" }, { "docid": "5b4dc90ce34194ebd8ab7ef6eb223b15", "score": "0.6071709", "text": "function removeFromList() {\n setMyCollection((prev) => {\n if (containsInMyList(myCollection, myMovie)) {\n return prev.filter((item) => {\n return item.imdbID !== imdbID;\n });\n } else {\n return prev;\n }\n });\n }", "title": "" }, { "docid": "c4501b28527f1d597cd374e2cbba2ee4", "score": "0.6069571", "text": "function removeFromPlaylist(list, artistName) {\n delete list[artistName];\n return list;\n}", "title": "" }, { "docid": "5ee2ef909376c14bc9a62f14cd71173d", "score": "0.60579646", "text": "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n \n}", "title": "" }, { "docid": "0217f29603af15a1aa73cb78fd2b7d48", "score": "0.60281605", "text": "function remove(){ \n previous() // Llamar a la funcion previus que obtiene el id anterior al puntero\n var transaction = db.transaction(['list'], 'readonly'); //Solicitud de lectura\n var objectStore = transaction.objectStore('list');\n var request = objectStore.get(prompter);//Buscar el valor que corresponda al puntero actual\n request.onsuccess = function(event) {\n let data = request.result;\n if(prompter != firstid){\n removetemp();\n alterRemove(data.next)\n return\n }if(prompter == lastid){\n alterRemove(null);\n removetemp();\n\n }else{\n removetemp();\n firstid = prompter\n return\n }\n }\n }", "title": "" }, { "docid": "6c0dbfabdbeb855b729934d0ad578b6e", "score": "0.6026104", "text": "removeTrack(TrackToDelete) {\n\n const updatedPlaylist = [];\n\n this.state.playlistTracks.forEach(element => {\n if(element.id !== TrackToDelete.id) {\n updatedPlaylist.push(element)}\n })\n\n this.setState({playlistTracks: updatedPlaylist})\n }", "title": "" }, { "docid": "461518da5428a686ac6b87ce53e3af20", "score": "0.60018134", "text": "removeTrack(track) {\n const array = this.state.playlistTracks;\n const index = array.findIndex(x => x.id === track.id)\n array.splice(index,1);\n this.setState({playlistTracks: array});\n}", "title": "" }, { "docid": "0bea83a512d8ce4d0879ef122511d22c", "score": "0.60013187", "text": "function remove_el(item){\n var to_remove = todo.indexOf(item);\n todo.splice(to_remove,1);\n}", "title": "" }, { "docid": "3fc0ee78d325f5482c543d00ba98a98f", "score": "0.5986262", "text": "function eliminarEquipoLista(nombre){\n\n $('#lista-equipos').children().last().remove();\n $($(\"#lista-equipos\")[0]).children('div').each(function () {\n var obj = $(this)[0];\n var a = ($(this).children(0)[0]);\n if($(a).text() === nombre){\n $(obj).remove();\n return true;\n }\n });\n}", "title": "" }, { "docid": "24a32b7b5bdaacb45e99e0ecde13f002", "score": "0.59796566", "text": "function remover() {\n while(slcItem.length > 0){\n slcItem[0].parentNode.removeChild(slcItem[0]);\n }\n}", "title": "" }, { "docid": "189be363904abca6e21f0ac96127f738", "score": "0.5955055", "text": "function eliminarPlatilloLocalStorage(platillo) {\n let platillosLS;\n platillosLS = obtenerPlatillosLocalStorage();\n\n platillosLS.forEach(function(platilloLS, index){\n if(platilloLS.id === platillo) {\n platillosLS.splice(index, 1);\n }\n });\n\n localStorage.setItem('platillos', JSON.stringify(platillosLS));\n}", "title": "" }, { "docid": "cf318464e560c154eb913356389fac03", "score": "0.5953626", "text": "function removeFromPlayList(track) {\n if (!localStorage.getItem('playListTime')) {\n localStorage.setItem(\"playListTime\", JSON.stringify(new Date().getTime()));\n }\n\n var index = getIndexFromPlayListByid(track.id);\n if (index >= 0) {\n playList.splice(index, 1);\n localStorage.setItem(\"playlist\", JSON.stringify(playList));\n $('.playlist-songs .track-' + track.id).remove();\n $('#' + track.id + ' .genre').toggleClass(\"selected-genre\");\n $('#' + track.id + ' .genre .text').text(\"Add to playlist\");\n updatePlayListCountAndTime();\n }\n}", "title": "" }, { "docid": "4e88a2c47cfcf7fa3f75b37eff8b43f9", "score": "0.59199554", "text": "function RemoveFromList(x,list){\n for(let i=0;i<list.length;i++){\n if(list[i]==x){\n list.splice(i,1);\n }\n }\n return list;\n}", "title": "" }, { "docid": "4b194e24b5ff7d7cc93853e2dc15103a", "score": "0.5914777", "text": "function removeFromClanListOnClick(evt){\t\n var blacklistClan = getGMArray(\"blacklistClan\"); \n for(var i=0; i<blacklistClan.length; i++){ \n if(blacklistClan[i].indexOf(this.innerText.substr(0,document.getElementById(\"blacklistClanList\").childNodes[0].innerText.length-1))>-1){ \n blacklistClan.splice(i, 1); \n }\n } \n if(confirm(\"Soll User/Clan \\\"\"+this.innerText.substr(0,document.getElementById(\"blacklistClanList\").childNodes[0].innerText.length-1)+\"\\\" von der Blacklist genommen werden?\")){\n setGMArray(\"blacklistClan\",blacklistClan); \n location.reload();\n }\n}", "title": "" }, { "docid": "f501a589aada3a5b4fa0e29cc209a3bc", "score": "0.5911406", "text": "function removeLocalFB(moveobj) {\n for (var i = 0; i < localFB.length; i++) {\n if (moveobj.id === localFB[i].id) {\n localFB.splice(i, 1);\n }\n }\n}", "title": "" }, { "docid": "02dbfbadbc5d5d47917f20ac8e6c0db2", "score": "0.5908889", "text": "function removeMPlayer(data){\n mPlayers = mPlayers.filter(function(item){\n return item.id != data;\n })\n}", "title": "" }, { "docid": "9d02c2dcb5cec3ed2bed73c457a6e1d3", "score": "0.5907441", "text": "function removeFrom(list, value) {\n for (var i = 0; i < list.length; i++) {\n if (list[i] === value) {\n list.splice(i, 1);\n break;\n }\n }\n }", "title": "" }, { "docid": "a1a1c0b44798d6e4d410df87d0ea7446", "score": "0.59016514", "text": "function removeFromPlaylist(playlist, artistName) {\n delete playlist.Kanye;\n return playlist;\n}", "title": "" }, { "docid": "54b0eed56fc78000faed866033bed7cf", "score": "0.59015495", "text": "function remove(item){if(contains(item)){_items.splice(indexOf(item),1);}}", "title": "" }, { "docid": "475cc5b33260ccef50331945cf3fc7b8", "score": "0.58925307", "text": "removeTodo(todo){\n const indexTodo = this.todos.indexOf(todo);\n this.todos.splice(indexTodo,1);\n }", "title": "" }, { "docid": "f76e5e7b7065c5a408e54e4ca7b06ada", "score": "0.5891481", "text": "function removeFromList(ele, list)\n{\n list = list.slice();\n\n for(var i = 0; i < list.length; i++)\n {\n if(list[i] === ele)\n {\n list.splice(i, 1);\n return list;\n }\n }\n}", "title": "" }, { "docid": "de536cae0bccdc95448b99d2c926c299", "score": "0.58806247", "text": "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName]\n return playlist\n}", "title": "" }, { "docid": "de536cae0bccdc95448b99d2c926c299", "score": "0.58806247", "text": "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName]\n return playlist\n}", "title": "" }, { "docid": "be30f4c288df0b77b9a6089191c98b81", "score": "0.5867665", "text": "function removeTshirtLocalStorage(id){\n let tshirtsLS = getTshirtfromStorage();\n\n //Loop through the array and find the array to remove\n tshirtsLS.forEach(function(tshirtLS, index){\n if (tshirtLS.id === id ){\n tshirtsLS.splice(index, 1);\n }\n });\n //Adding the rest of the array back again in Local storage\n localStorage.setItem('tshirts', JSON.stringify(tshirtsLS));\n\n}", "title": "" }, { "docid": "cac94cc6095321c8dfd7257f86d7e1f5", "score": "0.58495057", "text": "function removerMunicoesForaDaTela(){\n\tmunicoes.forEach(removeMunicaoForaDaTela);\n}", "title": "" }, { "docid": "8fcef0b4508f1ec612c207e1dc22a831", "score": "0.58465385", "text": "function removeFromPlaylist(playlist, name) {\n delete playlist[name]\n}", "title": "" }, { "docid": "7a5b4725143f73f53fb74ea7c5e3c526", "score": "0.5843101", "text": "function cutGuy(id){\n id = Number(id);\n for(var i=0; i<team.length; i++){\n if(team[i].id === id){\n team.splice(i, 1);\n return;\n }\n }\n}", "title": "" }, { "docid": "7ffaf53a019ebf1da99ef6e257d679d2", "score": "0.5841624", "text": "removeItem(id){\n const index = todoList.findIndex(item => item.id === id);\n todoList.splice(index, 1);\n\n DOM.buildList();\n DOM.sendDataToLocalStorage();\n }", "title": "" }, { "docid": "f05b9b025f8591baf6d004fdb525f859", "score": "0.5841151", "text": "function removeOneFromRec(trackArtistInfo) {\n setReccomendationData(\n reccomendationData.filter((item) => item.uri !== trackArtistInfo.uri)\n );\n }", "title": "" }, { "docid": "fe257465f6ce3d6505c2da40f27340aa", "score": "0.583179", "text": "function removeFromList (listName, url) {\n\t// get list from settings\n\tvar list = settings[listName];\n\t// get index of URL to remove\n\tvar index = list.indexOf(url);\n\t// remove URL from list and store updated list locally\n\tif (index !== -1){\n\t\tlist.splice(index, 1);\n\t\tvar obj = {};\n\t\tobj[listName] = list;\n\t\tchrome.storage.local.set(obj);\n\t}\n}", "title": "" }, { "docid": "0aca93888764e104da26e0b2b5ca45ef", "score": "0.58123845", "text": "function removeTrelloLinks(docId) {\n var doc = DocumentApp.openById(docId);\n var body = doc.getBody();\n \n var paragraphs = body.getParagraphs();\n for (var ix = 0; ix < paragraphs.length; ix++) {\n var paragraph = paragraphs[ix];\n var url = paragraph.getLinkUrl();\n if (url && url.indexOf(\"trello.com\") > -1) {\n body.removeChild(paragraph);\n }\n }\n}", "title": "" }, { "docid": "2ece40b66d2a0e4fe40902a5e8897ce3", "score": "0.58123785", "text": "function deletall(){\n //on rappelle toute la liste\n let ul = document.getElementById(\"list\")\n //on créé une boucle while: tant qu'il y a un \"enfant\" li il l'efface\n while(ul.firstChild){\n ul.removeChild(ul.firstChild);\n }\ntabUser.splice(0, tabUser.length)\n}", "title": "" }, { "docid": "5e7c6153ac73fd8a49fa39bb777b4e99", "score": "0.58032155", "text": "function removerBalasForaDaTela(){\n\tbalas.forEach(removeBalaForaDaTela);\n}", "title": "" }, { "docid": "eb2dd63db53654417522c0f676f46d46", "score": "0.5802874", "text": "remove(poistion) {\n if (poistion < 0 || poistion >= this.length) {\n return undefined;\n }\n if (poistion === this.length - 1) {\n this.pop();\n return;\n }\n if (poistion === 0) {\n this.shift();\n return;\n }\n console.log('________________');\n let previousNode = this.get(poistion - 1);\n // console.log('Previous Node : ', previousNode);\n let removedNode = previousNode.next;\n // console.log('Removed NOde', removedNode);\n previousNode.next = removedNode.next;\n this.length--;\n console.log('________________');\n return removedNode;\n }", "title": "" }, { "docid": "dd30936783408deaf9c5a9f52cdb75b3", "score": "0.5789372", "text": "function eliminarMueble(e) {\n console.log(e.target.id);\n let posicion = carrito.findIndex(mueble => mueble.id == e.target.id);\n carrito.splice(posicion, 1);\n console.log(carrito);\n carritoUI(carrito);\n localStorage.setItem(\"CARRITO\", JSON.stringify(carrito));\n}", "title": "" }, { "docid": "3c5d7f6577844a66f88c3fd8321424d9", "score": "0.5788833", "text": "delete(state, payload){\n //Utilizamos filter de javascript \n state.tareas = state.tareas.filter( item => item.id !== payload)\n }", "title": "" }, { "docid": "5f79ac0d8c58d482ce67d46b1f9a8a1b", "score": "0.578764", "text": "function removeNode(arr) {\n arr.forEach(function(obj) {\n // let parent = document.getElementById(\"thumbnails\");\n // let child = document.getElementById(obj.flavorID);\n // parent.removeChild(child);\n document.getElementById(\"thumbnails\").removeChild(document.getElementById(obj.flavorID));\n })\n}", "title": "" }, { "docid": "2688d517ca8a6d584c688c210a3e927b", "score": "0.57757556", "text": "removeTrack({ commit, dispatch }, track) {\n api\n .delete(\"mytunes/\" + track._id)\n .then(res => {\n dispatch(\"getMyTunes\")\n })\n .catch(err => {\n console.log\n })\n }", "title": "" }, { "docid": "4b9b7d600694f43cb0472690b32244e7", "score": "0.5775547", "text": "function deletePost() {\n\n let deletedPost = this.parentNode.parentNode.parentNode;\n let id = deletedPost.id;\n\n\n //remove from array\n primaryDataList = primaryDataList.filter((data) => {\n return (parseInt(id) !== data.id);\n });\n\n displayedDataList = displayedDataList.filter((data) => {\n return (parseInt(id) !== data.id);\n });\n\n //remove from node\n list.removeChild(deletedPost);\n\n}", "title": "" }, { "docid": "65f9aa8c044e712477699729ec626f5f", "score": "0.57741994", "text": "function removerItem(codigo){\n var item;\n var indexRemover;\n for(item in lista){\n var itemAtual = lista[item];\n if(itemAtual.codigo == codigo){\n indexRemover = item;\n break;\n }\n }\n lista.splice(indexRemover,1);\n}", "title": "" }, { "docid": "46df51df2e3d48af110bd59c9a01044c", "score": "0.57727796", "text": "remove(index) {\n const unwantedNode = this.traverseToIndex(index - 1);\n // const unwantedNode = leader.next;\n const prevNode = unwantedNode.prev;\n const nextNode = unwantedNode.next;\n nextNode.prev = prevNode;\n prevNode.next = nextNode;\n this.length--;\n return this.printList();\n }", "title": "" }, { "docid": "5197e3f1dbecbb95c5b46ffc5a96a76e", "score": "0.57724273", "text": "function removePlayer() {\n \"use strict\";\n if (selectedPlayer !== null) {\n index = list.indexOf(selectedPlayer);\n if (index > -1) {\n list.splice(index, 1);\n logMessage(selectedPlayer.name + \" has been removed from combat.\");\n }\n }\n selectedPlayer = null;\n sortPlayers();\n}", "title": "" }, { "docid": "3dc5e1563ac9a4161e65b2b71144f669", "score": "0.57700723", "text": "removeItem(itemToRemove) {\n console.log(\"passage methode removeItem\");\n if(this.fancyList.includes(itemToRemove)) {\n this.fancyList.forEach(function(item, fancyList) {\n if(item == itemToRemove) {\n removeItemAt(fancyList.indexOf(item));\n console.log(\"itemToRemove is removed\");\n }\n })\n } else {\n console.log(\"itemToRemove doesn't exist\");\n }\n }", "title": "" }, { "docid": "5f1c2877f110f4924abd1065b443fc11", "score": "0.57688856", "text": "function removeLi(arr){\n const liParent = arr.parentNode.parentNode;\n const li = arr.parentNode;\n liParent.removeChild(li);\n}", "title": "" }, { "docid": "fdd9eafd3dc4f3eb9cb53e42caad0879", "score": "0.57657105", "text": "remove(v) {\n let curr = this.head;\n let prev;\n while (curr) {\n const next = curr && curr.next;\n if (curr.val === v) {\n if (curr === this.tail) {\n this.tail = prev;\n }\n if (curr === this.head) {\n this.head = next;\n next && (next.prev = prev);\n } else {\n prev.next = next;\n next && (next.prev = prev);\n }\n this._length--;\n }\n prev = curr;\n curr = next;\n }\n }", "title": "" }, { "docid": "c304bdb16d0338ad2f765ddb53b3357b", "score": "0.5765164", "text": "removeTrack(track) {\n let tracks = this.state.playlistTracks.filter(currentTrack => currentTrack.id !== track.id);\n this.setState({playlistTracks: tracks})\n console.log(tracks)\n }", "title": "" }, { "docid": "e6f52fc1c85e199ed15337f4a3e12bc6", "score": "0.57648116", "text": "function eliminar(id){\n\n // Seleccionando los botoncitos para luego\n var btnAgregar = document.getElementById('anadir'+id)\n var btnEliminar = document.getElementById('eliminar'+id)\n\n // Recorriendo el playlist para encontrar y eliminar esta cancion\n for(song in playlist){\n if(playlist[song]==id){\n // Encontramos el id asi que lo eliminamos\n playlist.splice(song, 1);\n }\n }\n \n console.log(playlist)\n\n //Guardo el objeto como un string\n localStorage.setItem('playlist', JSON.stringify(playlist));\n\n // Escupimos el array actualizado por propositos de debugging\n console.log(JSON.parse(localStorage.getItem('playlist')))\n\n // Oculto el botoncito de agregar y muestro el de eliminar\n btnAgregar.style.display = \"block\";\n btnEliminar.style.display = \"none\";\n\n}", "title": "" }, { "docid": "ca44ebc1189f423dbda8d230403a4497", "score": "0.5764561", "text": "function RemoveTask(e) {\nvar id = e.target.parentElement.id;\ntask_array = task_array.filter(data => data.title != id);\ncreate_list();\ne.preventDefault();\n}", "title": "" }, { "docid": "814a39d2a9e53324d160707829c98985", "score": "0.575719", "text": "function remove_list_item (list, item) {\n var item_index = list.indexOf(item);\n if (item_index !== -1) {\n list.splice(item_index, 1)\n }\n }", "title": "" }, { "docid": "8feb5699ef15b3b5e45b121296bead61", "score": "0.574287", "text": "removeItem(item){\n var index = this.currentList.list.indexOf(item);\n this.currentList.list.splice(index,1);\n }", "title": "" }, { "docid": "dcb4754a4832bd940543f143d4d50882", "score": "0.5739623", "text": "removeTally(list) {\n delete this.data[list];\n this._updateFile();\n }", "title": "" }, { "docid": "2fac0cde4142387b003de69e5abc00f4", "score": "0.5738562", "text": "removeFavorite(element) {\n element.remove();\n }", "title": "" }, { "docid": "35adcb5128099e6cccdc95c67a02ee1a", "score": "0.5736707", "text": "remove(){\n const n = this.numberPrompt( this.captions.removePrompt );\n const item = this.state.a[ n - 1 ];\n\n if( item === undefined ) {\n return this.captions.notFound.replace( '$', n );\n }\n\n // Remove item\n this.state.a = this.arrayPluck( this.state.a, n - 1 );\n\n return this.removed( item );\n }", "title": "" }, { "docid": "9a910063326b27aaeb75e1523e4d5173", "score": "0.5736297", "text": "function removerTodasMunicoes(){\n\tmunicoes.forEach(removeDoArray);\n}", "title": "" }, { "docid": "d34a12068dfcadab2bf5e0a7d01e18ae", "score": "0.5733231", "text": "function removerCarrito(e){\n const botonDelete = e.target\n const tr = botonDelete.closest('.ItemCarrito')\n const nombre = tr.querySelector('.nombre').textContent;\n for(let i=0; i<carrito.length; i++){\n if(carrito[i].nombre.trim() === nombre.trim()){\n carrito.splice(i,1)\n }\n }\n tr.remove()\n carritoTotal()\n\n}", "title": "" }, { "docid": "616f75be8fbb3fbc36775cdcc71096ae", "score": "0.57311887", "text": "function remove(){\r\n\tteamArray.pop();\r\n teamsremain--;\r\n}", "title": "" }, { "docid": "6b51258689e5b5e0c2531410c13cc032", "score": "0.57249033", "text": "removeEntry(t) {\n const e = this.docs.get(t);\n e && (this.docs = this.docs.remove(t), this.size -= e.size);\n }", "title": "" }, { "docid": "ac4fa4c7c2df17db4ac75e1039215518", "score": "0.5723757", "text": "function limpiarListado() {\n while (listadoTweets.firstChild) {\n listadoTweets.removeChild(listadoTweets.firstChild);\n }\n}", "title": "" }, { "docid": "3fd0dd4299f5d3c63006d11fa5220970", "score": "0.5721461", "text": "function remove(elt) {\n elt.remove();\n }", "title": "" }, { "docid": "4b5b6fa2a3e3a47626e4c60e4443c4ff", "score": "0.572146", "text": "function removeOldList() {\n var myNode = document.getElementById(\"songlist\");\n\n while(myNode !== null) {\n myNode.remove();\n myNode = document.getElementById(\"songlist\");\n }\n\n var wrapNode = document.getElementById(\"song-list-wrap\");\n while(wrapNode !== null) {\n wrapNode.remove();\n wrapNode = document.getElementById(\"song-list-wrap\");\n }\n\n}", "title": "" }, { "docid": "62eb61bb7feb75d14562b47ec19e1f07", "score": "0.572128", "text": "function removeFromHistory(o){\n\t\tconsole.log(\"???????????\")\n\t\thistory.remove(o)\n\t}", "title": "" }, { "docid": "2596b30fea4661b450ad38d9b3b64da2", "score": "0.57182705", "text": "function removeFromList( name )\n{\n $( \"#\" + name ).remove();\n}", "title": "" }, { "docid": "40682d4e1802756a0754c2ec69955e9f", "score": "0.571257", "text": "function removerInimigosForaDaTela(){\n\tinimigos.forEach(removeInimigoForaDaTela);\n}", "title": "" }, { "docid": "df3595768915d29ba8246e363b9e3b11", "score": "0.5710813", "text": "function removerElemento(_atomo) {\n\t\n\tvar achou = false;\n\tvar codigo = null;\n\tvar nome = null;\n\tvar numeroCarb = carbonosEmTela();\n\t\n\tif((_atomo.nome == 'carbono') && (_atomo.numero != -1)) \n\t{\n\t\tfor(var i = 0; i < elementosNoJogo.length; i++) \n\t\t{\t\t\t\n\t\t\tif(elementosNoJogo[i].nome == 'carbono')\n\t\t\t{\n\t\t\t\tif(elementosNoJogo[i].numero >= numeroCarb) \n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\telementosNoJogo[i].numero--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnumerarCarbonos();\n\t\tnumerarCarbonos();\n\t}\n\t\n\tfor(var i = 0; i < elementosNoJogo.length; i++)\n\t{\t\t\t\n\t\tif(elementosNoJogo[i] == _atomo)\n\t\t{\n\t\t\t_atomo.div.remove();\n\t\t\tcodigo = elementosNoJogo[i].codigo;\n\t\t\tnome = elementosNoJogo[i].nome;\n\t\t\telementosNoJogo.splice(i,1);\n\t\t\tachou = true;\n\t\t}\n\t\t\n\t\tif(achou && i < elementosNoJogo.length)\n\t\t{\n\t\t\tif(elementosNoJogo[i].nome == nome)\n\t\t\t{\n\t\t\t\telementosNoJogo[i].codigo = codigo;\n\t\t\t\n\t\t\t\t$(elementosNoJogo[i].div).attr('id', elementosNoJogo[i].nome + '-' + elementosNoJogo[i].codigo);\n\t\t\t\tcodigo++;\n\t\t\t}\n\t\t}\t\t\n\t}\n}", "title": "" }, { "docid": "6f9baeddd42c014d9f294cc7fea4da77", "score": "0.5707461", "text": "removeSub(sub){\n let index = this.sub.indexOf(sub);\n this.sub.splice(index, 1);\n }", "title": "" }, { "docid": "cfcc63bde4722ddc1fb6151b0461209e", "score": "0.5702082", "text": "function removeThis() {\n while (planetList.lastChild) {\n planetList.removeChild(planetList.lastChild)\n }\n}", "title": "" }, { "docid": "2af059fa52387d4ab65931af8bd12165", "score": "0.5698411", "text": "function undress_item(id) {\n array_length = items_on_figur.length;\n var index = -1;\n for (var i = 0; i < array_length; i++)\n {\n if ( items_on_figur[i] === id )\n {\n $(\"#\" + items_on_figur[i]).remove();\n $(\"#\" + items_on_figur[i] + \"_back\").remove();\n index = i;\n break;\n }\n }\n // jeste ho vyjmu z pole\n if (index > -1) {\n items_on_figur.splice(index, 1);\n }\n}", "title": "" }, { "docid": "b61eb9998064a110e4a26599606d09ff", "score": "0.5697545", "text": "function borrarNota(id) {\n //debo recorrer la lista y comprar el id pasado por parametro con cada posicion\n let notas = JSON.parse(localStorage.getItem(\"notas\"));\n let choque = notas.findIndex(nota => nota.id == id);\n\n //ahora elimino con splice pasandole esa posicion.\n notas.splice(choque, 1);\n localStorage.setItem(\"notas\", JSON.stringify(notas));\n\n alert(\"Nota eliminada\");\n location.reload();\n}", "title": "" }, { "docid": "bb99181edab986366b756bfa5e7e669c", "score": "0.5697075", "text": "function removeItem(remove_this_item) {\n delete groceryList[remove_this_item];\n}", "title": "" }, { "docid": "7fe67e59bf9288aca8370a75985cface", "score": "0.56963223", "text": "removeTodo (id) {\n this.todos = this.todos.filter(todo => todo.id !== id); /*return items which != id which we take*/\n console.log('removeTodo ', this.todos);\n }", "title": "" }, { "docid": "e66c62d8424a4ad50c0e89309868a994", "score": "0.5694453", "text": "function removetweettocalstorage(tweet) {\r\n //Get tweets from storage \r\n let tweets= getTweetsFromStorage();\r\n \r\n //Remove the X from the tweet\r\n \r\n const tweetDelete= tweet.substring( 0, tweet.length-1);\r\n \r\n // Loop throught the tants and remove the topets that's equal\r\n tweets.forEach(function(tweetLS, index) {\r\n if(tweetDelete=== tweetLS) {\r\n tweets, splice(findex, 1);\r\n }\r\n});\r\n \r\n // save the data\r\n localStorage.setItem ('tweets', JSON.stringify(tweets) );\r\n}", "title": "" }, { "docid": "2d67f8a0b5e20a9a8acb5d5c61d83001", "score": "0.56935", "text": "removeTrack(track){\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n this.setState(\n { playlistTracks: tracks }\n )\n\n //adds track that is removed from playlist back to the search results\n let results = this.state.searchResults;\n if (results.find(unsavedTrack => unsavedTrack.id === track.id)){\n return;\n }\n\n results.unshift(track);\n this.setState(\n { SearchResults: results }\n )\n\n }", "title": "" }, { "docid": "996130449d069259b5c09a03e2b489ab", "score": "0.56913656", "text": "function MaakTitelLeeg(){\n $(\".titeltje\").remove();\n}", "title": "" }, { "docid": "2327779a00da1e8c5dc6e275cc710e55", "score": "0.56910163", "text": "remove(pet){\n console.log(pet);\n let pets = ODPet.ListOfPets.filter( p => {\n return p.fullName.toUpperCase() !== pet.info;\n });\n ODPet.ListOfPets = pets; \n console.log(pets)\n Model.listChange(pets.length) \n }", "title": "" }, { "docid": "f6691f48d63c586c634791b58d2deaf9", "score": "0.5690517", "text": "removeSockId(id) {\n this._list = this._list.filter(item => item._id !== id)\n }", "title": "" }, { "docid": "a9746f58f099fae04d6bc7ccfd1533c7", "score": "0.56890565", "text": "function removeTaskFromLs (taskItem) {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n }else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(function (task, index) {\n if(taskItem.textContent === task) {\n tasks.splice(index, 1);\n }\n });\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "title": "" }, { "docid": "d0184a060cf14e416ad5d2873785bf8f", "score": "0.56879675", "text": "remove(value) {\n const array = this.toArray();\n const index = array.indexOf(value);\n\n if (index > -1) {\n array.splice(index, 1);\n\n this.root = null;\n\n array.forEach(item => this.add(item));\n }\n }", "title": "" }, { "docid": "2381b2ab1a412ecbf58073ef715161a1", "score": "0.56873274", "text": "function removeItem() {\n // console.log(this.parentNode.parentNode);\n //grabbing the lsit item by giving parent.parent\n //giving the particular destination of the item we want to delete\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var value = item.innerText;\n\n if (id === \"todo\") {\n data.todo.splice(data.todo.indexOf(value), 1);\n } else {\n data.completed.splice(data.completed.indexOf(value), 1);\n }\n dataObjectUpdated();\n\n parent.removeChild(item);\n}", "title": "" }, { "docid": "6fb36b2a6f8c3203a1e4e0187eaf1ef6", "score": "0.5686901", "text": "static remove_all(list, youth_to_remove) {\n return list.filter(youth => !Youth.contains(youth_to_remove, youth));\n }", "title": "" }, { "docid": "305366d910867ab4729107f88fe30064", "score": "0.56864053", "text": "function eliminar_linga_selec(elemento){\n\n var id_linga=$(elemento).attr(\"id\");\n var i;\n for(i=0;i<Linga.length;i++){\n if(id_linga==Linga[i].id){\n eliminar_linga_bd(Linga[i].id_linga);\n Linga.splice(i,1);\n break;\n }\n }\n info_bodegas();\n datos_tier();\n $(elemento).remove();\n}", "title": "" }, { "docid": "333e609f77baa77f88c226c8fdfa6996", "score": "0.5681579", "text": "function removeTweetLocalStorage(tweet) { \n //get tweets from storage\n let tweets = getTweetsFromStorage();\n\n //remove the x from the tweet \n const tweetDelete = tweet.substring(0,tweet.length-1);\n\n //loop through the tweets and remove the tweet that is equal \n tweets.forEach(function(tweetLS, index){\n if(tweetDelete===tweetLS){\n tweets.splice(index,1);\n }\n });\n\n //save the data\n localStorage.setItem('tweets',JSON.stringify(tweets));\n \n}", "title": "" }, { "docid": "e7e062889e7cb6638967cdcf9489e9fe", "score": "0.56778383", "text": "function removebyid(elementId){\r\n \r\n let element = document.getElementById(elementId);\r\n element.parentNode.removeChild(element);\r\n chrome.storage.sync.get(['Words_list'], function(data){\r\n let index = data.Words_list.indexOf(elementId);\r\n data.Words_list.splice(index, 1);\r\n chrome.storage.sync.set({Words_list: data.Words_list});\r\n });\r\n \r\n }", "title": "" } ]
fdf16b50fd5ea74c181d4ce9a1ca3476
FUNCION ENCARGADA DE CREAR NUEVO RESULTAD DE PRODUCCION
[ { "docid": "64897e5954d7395e6059dd96c4569551", "score": "0.53387797", "text": "function nuevoResultadoProduccion(){\n var finca = $(\"#finca\").val();\n var unidad_agricola = $(\"#unidad_agricola\").val();\n var fechaCosecha = $(\"#fechaCosecha\").val();\n var fechaInicio = $(\"#fechaInicio\").val();\n var fechaFin = $(\"#fechaFin\").val();\n var area = $(\"#area\").val();\n var descripcion = $(\"#descripcion\").val();\n var corte = $(\"#codigoCorte\").val();\n var variedad = $(\"#variedad\").val();\n var edad = $(\"#edad\").val();\n var TCT = $(\"#TCT\").val();\n var TCH = $(\"#TCH\").val();\n var TCHM = $(\"#TCHM\").val();\n var rendimiento = $(\"#rendimiento\").val();\n var nFinca = $(\"#finca option:selected\").html();\n var nSuerte = $(\"#unidad_agricola option:selected\").html();\n //Validar campos\n if( codigoCorte === \"\")\n {\n alert(\"Por favor ingrese el codigo\");\n }else if( codigoCorte === \"\" )\n {\n\n }else{\n $.ajax({\n cache:false,\n dataType:\"json\",\n type:\"POST\",\n url: \"./querys/q-prontuario.php\",\n data: {\n opcion:1,\n finca:finca,\n unidad_agricola:unidad_agricola,\n fechaCosecha:fechaCosecha,\n fechaInicio:fechaInicio,\n fechaFin:fechaFin,\n area:area,\n descripcion:descripcion,\n corte:corte,\n variedad:variedad,\n edad:edad,\n TCT:TCT,\n TCH:TCH,\n TCHM:TCHM,\n rendimiento:rendimiento\n },\n success: function(res)\n {\n if(res.estado === \"ERROR\")\n {\n jAlert('¡¡Lo sentimos, ocurrió un error al guardar los datos', 'ERROR');\n console.log(\"Error:\"+ res.msg);\n }else if(res.estado === \"EXIST\")\n {\n jAlert('¡¡El Corte ' + corte + ' ya Existe en la ' + nSuerte + ' ' + nFinca + ' ', 'ERROR');\n console.log(\"Error:\"+ res.msg);\n }\n else if(res.estado === \"OK\")\n {\n jAlert('¡Registro Creado con exito!', 'CONFIRMACION');\n recargarDatos();\n recargarFomGuardar();\n }\n }\n });\n }\n}", "title": "" } ]
[ { "docid": "1a6245a0de5678b7cd642b1fc8f9f88e", "score": "0.6941942", "text": "static createResult () {\n return new Result()\n }", "title": "" }, { "docid": "3c3ca3007e215c7268afc12e0ab31c43", "score": "0.6533808", "text": "function createResultObject(title) {\n var result = {\n \"title\": title\n , \"pass\": true\n };\n results.push(result);\n\n return result;\n }", "title": "" }, { "docid": "9d1a28e71c4e2cf4b91f7d15609c725c", "score": "0.62629515", "text": "crearRespuesta(texto, cantidad) {\n return {'textoRespuesta':texto, 'cantidad': cantidad};\n }", "title": "" }, { "docid": "f03b28e89c3fe5ff698b6eb77961dcf9", "score": "0.57965726", "text": "function createProduct(result) {\n var basics = result[0][0];\n var product = {\n product_id: basics.product_id,\n name: basics.name,\n desc: basics.description,\n key: db.createKey([basics.product_id, basics.name]),\n brand_name: basics.brand_name,\n company_name: basics.company_name,\n link: '/product/' + basics.product_id,\n categories: _.pluck(result[1], 'name'),\n variants: _.map(result[2], function selector(variant) {\n return {variant_id: variant.variant_id,\n name: variant.name,\n price: parseInt(variant.price),\n weight: parseInt(variant.weight),\n key: db.createKey([basics.product_id, basics.name,\n variant.variant_id, variant.name])}\n })\n };\n return product;\n}", "title": "" }, { "docid": "164cb0d993b726a5798c564fe8a4f3dc", "score": "0.577479", "text": "function genResultTable(inputData) {\n var docXml = createXMLDoc();\n\n var rootNode = createXMLNode('result', '', docXml);\n var childNodeTitle = createXMLNode('title', '', docXml, rootNode);\n var childNodeTit = createXMLNode('rowtitle1', CONST_STR.get('COM_NO'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle2', CONST_STR.get('COM_MAKER'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle3', CONST_STR.get('COM_CREATED_DATE'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle4', CONST_STR.get('COM_AMOUNT'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle5', CONST_STR.get('COM_CHEKER'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle6', CONST_STR.get('COM_TRANS_CODE'), docXml, childNodeTitle);\n childNodeTit = createXMLNode('rowtitle7', '', docXml, childNodeTitle);\n\n var stt = 1;\n var i = (gTrans.curPage - 1) * rowsPerPage;\n var j = i + rowsPerPage;\n for (i; i < j; i++) {\n var obj = inputData[i];\n if (typeof obj !== \"undefined\") {\n var childNodeCont = createXMLNode('content', '', docXml, rootNode)\n var childNodeDeta = createXMLNode('acccontent1', stt++, docXml, childNodeCont);\n childNodeDeta = createXMLNode('acccontent2', obj.SHORTNAME, docXml, childNodeCont);\n childNodeDeta = createXMLNode('acccontent3', obj.DATMAKE, docXml, childNodeCont);\n childNodeDeta = createXMLNode('acccontent4', formatNumberToCurrency(obj.NUMAMOUNT) + \" VND\", docXml, childNodeCont);\n childNodeDeta = createXMLNode('acccontent5', obj.SIGNEDBY, docXml, childNodeCont);\n childNodeDeta = createXMLNode('transId', obj.IDFCATREF, docXml, childNodeCont);\n childNodeDeta = createXMLNode('idx', i, docXml, childNodeCont);\n }\n };\n\n return docXml;\n}", "title": "" }, { "docid": "84ce80c20085150b5deb9b54ba81c781", "score": "0.572657", "text": "function generarResultado() {\n this.guardarNumero2();\n\n //BUG muestra NaN\n //FIXME error\n console.log(this.numero1, this.numero2);\n\n if(guardarNumero1){\n switch(this.tipoOperacion){\n //TODO quitar console log\n case 'suma':\n this.numero1 = this. sumar(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break;\n case 'resta':\n this.numero1 = resta(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break; \n case 'multiplicacion':\n this.numero1 = multiplicacion(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break; \n case 'division':\n this.numero1 =this.division(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break;\n case 'potencia':\n this.numero1 =this.potencia(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break;\n case 'raizCuadrada':\n this.numero1 =this.raizCuadrada(this.numero1, this.numero2);\n this.mostrarDisplay(this.numero1);\n break;\n }\n }\n \n}", "title": "" }, { "docid": "583d879419088164ee042c7d7a7abf6f", "score": "0.56949556", "text": "function generateRes() {\n let newRes = new Res(\"formName\", \"formPhone\", \"formEmail\", \"formID\");\n resArray.push(newRes);\n}", "title": "" }, { "docid": "cef83bd77e2ba4aa7a556fa0d4fd4302", "score": "0.5688077", "text": "function makeResult(){\n return {\n\t ri:new CANNON.Vec3(), // Vector from body i center to contact point\n\t rj:new CANNON.Vec3(), // Vector from body j center to contact point\n\t ni:new CANNON.Vec3() // Contact normal protruding body i\n\t};\n }", "title": "" }, { "docid": "cef83bd77e2ba4aa7a556fa0d4fd4302", "score": "0.5688077", "text": "function makeResult(){\n return {\n\t ri:new CANNON.Vec3(), // Vector from body i center to contact point\n\t rj:new CANNON.Vec3(), // Vector from body j center to contact point\n\t ni:new CANNON.Vec3() // Contact normal protruding body i\n\t};\n }", "title": "" }, { "docid": "cef83bd77e2ba4aa7a556fa0d4fd4302", "score": "0.5688077", "text": "function makeResult(){\n return {\n\t ri:new CANNON.Vec3(), // Vector from body i center to contact point\n\t rj:new CANNON.Vec3(), // Vector from body j center to contact point\n\t ni:new CANNON.Vec3() // Contact normal protruding body i\n\t};\n }", "title": "" }, { "docid": "885262d8fa53bbfdd91ecb7c3ae490c3", "score": "0.5652059", "text": "static async prepareResult({operation, cache}) {\n const result = new Result(operation);\n\n const {inputHash, outputHash} = await operation.getHashes();\n result.inputHash = inputHash;\n result.outputHash = outputHash;\n\n const basename = `${slug(result.action).substring(0, 32)}-${result.inputHash.substring(0, 8)}`;\n const ext = operation.compress ? 'tar.gz' : 'tar';\n const filename = `${basename}.${ext}`;\n\n result.filename = await incrementFilename({\n filename,\n getAbsolutePath: p => cache.getAbsolutePath(p),\n });\n\n return result;\n }", "title": "" }, { "docid": "eae4a35419ad7c5cded2c5d25e30c040", "score": "0.5650305", "text": "constructor(result) {\n this.protoId = result.proto_id;\n this.result = result.result;\n }", "title": "" }, { "docid": "b706c79cd103c82349bf12c2877f354d", "score": "0.5635436", "text": "constructor(result) {\n super(result);\n }", "title": "" }, { "docid": "b706c79cd103c82349bf12c2877f354d", "score": "0.5635436", "text": "constructor(result) {\n super(result);\n }", "title": "" }, { "docid": "ae3762a9d8d7cfe1883991ea41f25e5f", "score": "0.56289995", "text": "result() {}", "title": "" }, { "docid": "4d870ee5eb45ff7a0c7182f97ce739b1", "score": "0.5601008", "text": "function TestRunner_createTestResult() { return new TestResult(); }", "title": "" }, { "docid": "04ab1f30ffbf06f93de8672687adb208", "score": "0.5589673", "text": "static create(newPet, result) {\n sql.query('INSERT INTO pets SET ?', newPet, (err, res) => {\n if (err) {\n result(null, err)\n return\n }\n\n result(null, { id: res.insertId, ...newPet })\n })\n }", "title": "" }, { "docid": "a27a7989d94a54832f4d59c338916290", "score": "0.5584224", "text": "function resultObj()\t{\r\n\tthis.capId = null;\r\n\tthis.capIdString = null;\r\n\tthis.inspType = null;\r\n\tthis.inspResult = null;\r\n\tthis.inspId = null;\r\n\t}", "title": "" }, { "docid": "e7b6b5f0d87d3372fa242fd99bb79943", "score": "0.5567521", "text": "async crearOperario(objeto){\n return operarioPersonaDao.crearOperario(objeto);\n }", "title": "" }, { "docid": "7fc4c0836ea0802ad651376bc3134ab2", "score": "0.55420995", "text": "function BuildResultSetfroMxID(details)\n{\n var resultSet = new Array();\n\n for(i in details)\n {\n var arg1 = new Object();\n console.log(i);\n arg1.firstName = details[i].firstName;\n arg1.middleName = details[i].middleName;\n arg1.lastName = details[i].lastName;\n arg1.city = details[i].city;\n arg1.specializations = details[i].specializations;\n arg1.fees = details[i].fees;\n arg1.seqId = 'MX' + details[i].mxId + details[i].mxIdSuffix;\n arg1.id = details[i]._id;\n resultSet.push(arg1);\n }\n var jsonResultSet = JSON.parse(JSON.stringify(resultSet));\n\n return jsonResultSet;\n\n}", "title": "" }, { "docid": "eef0ca5bd9119aa82cf28d85e0f7a551", "score": "0.55224603", "text": "function populateResult() {\n\tAlloy.createCollection('result');\n\tvar result = [\n\t\t{ key: 'Blood Type'\t, value: ''\t },\n\t\t{ key: 'AMH Level'\t, value: ''\t },\n\t\t{ key: 'FSH Level'\t, value: '' },\n\t\t{ key: 'Sperm Count', value: '' }\n\t];\n\tvar db = Ti.Database.open('ivfplanner');\n\tdb.execute('BEGIN;');\n\tfor ( var i = 0, rl = result.length; i < rl; i++ ) {\n\t\tvar sql = \"INSERT INTO result('result_key', 'result_value') VALUES ('\" + result[i].key + \"', '\" + result[i].value + \"')\";\n \t\tdb.execute( sql );\n\t} \n\tdb.execute('COMMIT;');\n\tdb.close();\n}", "title": "" }, { "docid": "f915a19a11acff6605496342d57e60c4", "score": "0.5518808", "text": "static request(result, param)\n {\n let response = { request : \"bad\", msg : \"❌ => Proporcione el parametro de busqueda\" };\n\n if (result.length > 0 )\n response = {request : \"success\", data : Api.images(result)};\n else\n response.msg = `🔍 => La busqueda de ${param} no arrojo resultados`;\n\n return response;\n }", "title": "" }, { "docid": "a7ef600d68db6f094ca83f30250b5936", "score": "0.5517505", "text": "function createResultObject(item){\n\n\tlet resultObject = {\n\t\tname: item.name,\n\t\trating: item.rating,\n\t\taddress: createSimpleAddress(item.formatted_address),\n\t\tplace_id: item.place_id,\n\t\ticon: item.icon,\n\t\topenNow: item.opening_hours.open_now,\n\t\tlat: item.geometry.location.lat,\n\t\tlng: item.geometry.location.lng\n\t}\n\treturn resultObject\n}", "title": "" }, { "docid": "a0f6099b03f7e05268fd197e937eaa52", "score": "0.54586816", "text": "function getResultCreatorNode(resultInstance, path, traceabilityResults, program) {\n function returnerNodes(result) {\n var returnsResult = function returnsResult(_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n node = _ref2[0],\n callTraces = _ref2[1];\n\n return callTraces.some(function (c) {\n return c.result === result;\n });\n };\n var nodesCallTraces = Array.from(traceabilityResults.traceabilityInfo.callTraces.entries());\n return nodesCallTraces.filter(returnsResult).map(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n node = _ref4[0],\n callTrace = _ref4[1];\n\n return (0, _getNodeById.getNodeById)(program, node);\n });\n }\n function wasReturnedByNode(result) {\n return returnerNodes(result).length !== 0;\n }\n //Find the first result of path that was returned nodes.\n //Return the first node that returned that result.\n //TODO FIXME Garanty that the returned node is actually the one that created the result.\n var currentResultIdx = 0;\n while (currentResultIdx < path.length) {\n var currentResult = path[currentResultIdx];\n var returners = returnerNodes(currentResult);\n if (returners.length !== 0) {\n return returners[0];\n }\n currentResultIdx++;\n }\n //Otherwise, default to the node that represent the whole program.\n return (0, _program.sourceToAst)(program);\n}", "title": "" }, { "docid": "7d1de248a9b7351d81404ffc364d313e", "score": "0.5455861", "text": "function createResults(tables){\n dati = tables; //sets global variable (dati) with server's result\n var keys = Object.keys(tables); //it gets all keys of result\n \n if(keys.length == 0){ //if there aren't results an error string is made in #sectionResult_body and the execution ends.\n $(\"<p id=\\\"emptyResultWarning\\\"class=\\\"text-danger\\\">*No result! Please, retry with other params.</p>\").appendTo('#sectionResult_body');\n $('a[href=\"#Result\"]').tab('show'); //it displays Result's section\n return;\n }\n /* for each key a series of functions are called for display result */\n $.each(keys, function(index,tableName){\n var dataTable = tableToDataTable(tables[tableName]); //it makes result for DataTable() from the structure of result that is sent by the server\n \n createResultTab(index, index); //it makes a new TAB for the table\n createResultTable(dataTable, index); //it makes a new TABLE\n createDivChart(dataTable, index); //it makes a new CHART\n createColumnsSides(dataTable, index); //it create a list of checkbox with names of column as values\n createSectionColumnsForChart(dataTable, index); //it create a div for choose elements that will be shown\n });\n /* this part of function hide all div just made and show the first element's divs */\n $('.myIndexColumn').hide();\n $('.myChart').hide();\n $('.mySectionColumnsForChart').hide();\n \n showDivOfFirstKey();\n $('a[href=\"#Result\"]').tab('show'); //it displays Result's section\n}", "title": "" }, { "docid": "738078944d0692f4d9186764bf468b55", "score": "0.54514974", "text": "function getResult() {\n // Your code here\n}", "title": "" }, { "docid": "947e21d8b177380987782a4274a6c3c1", "score": "0.5450095", "text": "peliculasRelacionadas(res){\n var pR=[];\n for(var i=0 ; i<5 ; i++){\n pR.push(res['results'][i]);\n }\n return pR;\n }", "title": "" }, { "docid": "d0d4d986d8c9fdfe7cdffd2fb269bf19", "score": "0.54429084", "text": "function createQuery(query) {\n\tconst counter = global.store.output.length + 1;\n\n\treturn {\n\t\tname: `query${counter}`,\n\t\tquery: query,\n\t\tresults: new Object\n\t};\n}", "title": "" }, { "docid": "2a8857a40fa007c6cc3bdf88ff9ba560", "score": "0.5424659", "text": "function results() {}", "title": "" }, { "docid": "2715fa078d6560493c7b8356e36c77a8", "score": "0.54186255", "text": "function createResultList(dta){\n\tx = 0;\n\tcontent = \"\";\n\tdta.forEach(function(element) {\n\t\t\t\n\t\t\tcontent += '<div id=\"p'+element['id']+'\" > ';\n\t\t\t\n\t\t\tcontent += '<a href=\"#\" onClick=\"triggerView('+element['id']+')\" class=\"navigation waves-effect waves-light teal-text\">';\n\t\t\t\n\t\t\tcontent += element['name']+', ' \n\t\t\t+ element['vorname'] + '( '\n\t\t\t+ element['klasse'] \n\t\t\t+')</a></div>'\n\t\t\tx++;\n\t\t\t});\t\n\t\treturn content;\n\t}", "title": "" }, { "docid": "7c3b08c0ad46934a8bba92479c196499", "score": "0.54173046", "text": "formResult( res, extension ) {\n\n\t\tlet model = res.scene || res.object || res;\n\t\tif ( model.isBufferGeometry || model.isGeometry ) {\n\n\t\t\tconst material = new MeshPhongMaterial( { color: 0xffffff } );\n\t\t\tmodel = new Mesh( model, material );\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tmodel,\n\t\t\textension,\n\t\t\toriginalResult: res\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "7e9adb651565ab99bec33d10e809e165", "score": "0.5391676", "text": "function crearJSONVehiculo(){\n try{ \n \n if(!isVehiculo)\n return '';\n if(Ext.getCmp('cbxAccionVehiculo').getValue()==2)\n return '';\n \n var tmpJSONVehiculo = '{';\n tmpJSONVehiculo += 'ACCION:\"'+tmpAccionVehiculo+'\",';\n tmpJSONVehiculo += 'TIPO:\"'+tmpTipoTramite+'\",';\n tmpJSONVehiculo += 'VEHICULO:\"'+tmpTipoVehiculo+'\",';\n tmpJSONVehiculo += 'FABRICACION:\"'+numCvmtr_anio_fabricacion.getValue()+'\",';\n tmpJSONVehiculo += 'CVCMB_CODIGO:\"'+tmpDatos['COMBUSTIBLE']+'\",';\n tmpJSONVehiculo += 'CVCLN_CODIGO:\"'+tmpDatos['CILINDRAJE']+'\",';\n tmpJSONVehiculo += 'CVMTR_TONELAJE:\"'+numCvmtr_tonelaje.getValue()+'\"';\n if(txtCvctg_codigo.getValue())\n tmpJSONVehiculo += ',CVCTG_CODIGO:\"'+tmpDatos['CATEGORIA']+'\"';\n if(txtCvsct_codigo.getValue())\n tmpJSONVehiculo += ',CVSCT_CODIGO:\"'+tmpDatos['SECTOR']+'\"';\n if(txtCsctp_codigo.getValue())\n tmpJSONVehiculo += ',CSCTP_CODIGO:\"'+tmpDatos['PRODUCTIVO']+'\"';\n tmpJSONVehiculo +='}';\n }catch(inErr){\n alert(inErr); \n }\n return tmpJSONVehiculo;\n }", "title": "" }, { "docid": "fe0e8763bd547b5b152052210fa50c5b", "score": "0.53900594", "text": "static makeNewFromResult(req, res, jrResult) {\n\t\t// static helper.\n\t\treturn new JrContext(req, res, undefined, jrResult);\n\t}", "title": "" }, { "docid": "56ec0f6e0aabe385b5bc10394d19dca6", "score": "0.538975", "text": "_createResultDialog () {\n const dialog = document.createElement('tg-entity-editor-result');\n\n dialog.addEventListener(\"iron-overlay-opened\", this._resultOpened.bind(this));\n dialog.addEventListener(\"iron-overlay-closed\", this._resultClosed.bind(this));\n dialog.addEventListener(\"iron-overlay-canceled\", this._resultCanceled.bind(this));\n dialog.addEventListener(\"dblclick\", this._done.bind(this));\n dialog.selectionListKeyDown = this._onKeydown.bind(this);\n dialog.selectionListTap = this._entitySelected.bind(this);\n dialog.retrieveContainerSizes = this._retrieveContainerSizes.bind(this);\n dialog.noAutoFocus = true;\n dialog.acceptValues = this._done.bind(this);\n dialog.loadMore = this._loadMore.bind(this);\n dialog.changeActiveOnly = this._changeActiveOnly.bind(this);\n dialog._activeOnly = this._activeOnly; // synchronises value in entity editor result\n dialog.multi = this.multi;\n if (this.additionalProperties) {\n dialog.additionalProperties = JSON.parse(this.additionalProperties);\n }\n dialog.setAttribute(\"tabindex\", \"-1\");\n dialog.setAttribute(\"id\", \"result\");\n return dialog;\n }", "title": "" }, { "docid": "4ff7a6280c3e5b3e4ec1e2a39000ad55", "score": "0.5362762", "text": "function createEntity(resultSet, data) {\n var result = {};\n\tresult.entry_id = resultSet.getInt(\"ENTRY_ID\");\n result.value = uralize.urlize(resultSet.getString(\"VALUE\"));\n result.description = uralize.urlize(resultSet.getString(\"DESCRIPTION\"));\n \n return result;\n}", "title": "" }, { "docid": "4745350b9aa13c7de6a57de648bb50dd", "score": "0.53559977", "text": "constructor(code, result) {\n this.code = code;\n this.result = result;\n }", "title": "" }, { "docid": "b93d33684707eb3bf4199f4d4613804e", "score": "0.5345358", "text": "getResult() {\n return _result;\n }", "title": "" }, { "docid": "740551792a5be915ab7817ca5432a0aa", "score": "0.5341625", "text": "function createEntity(resultSet, data) {\n var connection = datasource.getConnection();\n var i = 0;\n response.setCharacterEncoding(\"UTF-8\");\n try{\n var result = {};\n result.event_id = resultSet.getInt(\"EVENT_ID\");\n result.date_begining = new Date(resultSet.getDate(\"DATE_BEGINING\").getTime() - resultSet.getDate(\"DATE_BEGINING\").getTimezoneOffset()*60*1000);\n result.time_begining = new Date(resultSet.getTime(\"TIME_BEGINING\").getTime() - resultSet.getDate(\"TIME_BEGINING\").getTimezoneOffset()*60*1000);\n result.date_end = new Date(resultSet.getDate(\"DATE_END\").getTime() - resultSet.getDate(\"DATE_END\").getTimezoneOffset()*60*1000);\n result.time_end = new Date(resultSet.getTime(\"TIME_END\").getTime() - resultSet.getDate(\"TIME_END\").getTimezoneOffset()*60*1000);\n result.location = resultSet.getString(\"LOCATION\");\n result.description = resultSet.getString(\"DESCRIPTION\");\n result.creator_id = resultSet.getInt(\"CREATOR_ID\");\n var sql = \"SELECT USER_ID FROM PARTICIPANTS WHERE EVENT_ID = ?\";\n var statement = connection.prepareStatement(sql);\n statement.setInt(++i, result.event_id);\n var results = statement.executeQuery();\n result.participants = [];\n while(results.next()){\n result.participants.push(results.getInt(\"USER_ID\"));\n }\n return result;\n } catch (e) {\n var errorCode = javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;\n entityLib.printError(errorCode, errorCode, e.message);\n } finally {\n connection.close();\n }\n}", "title": "" }, { "docid": "e00d3a51188b04e79f4a7c70fa443d0b", "score": "0.5335639", "text": "addNew() {\n return db.result(`INSERT into property\n (property_name,street_address,county,city,state,zipcode,squarefeet,description,directions,contact_id,type,show_mp,show_di,show_pd,pd_description,year_opened,major_tenants,photo,mapx,mapy)\n values\n ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20) returning id`,[this.propertyName,this.streetAddress, this.county, this.city, this.state,this.zipcode, this.squarefeet,this.description,this.directions, this.contactId,this.type,this.showMP, this.showDI, this.showPD,this.pdDescription,this.yearOpened, this.majorTenants, this.photo, this.mapx, this.mapy]);\n\n // ('${this.propertyName}','${this.streetAddress}','${this.county}','${ this.city }','${this.state}','${this.zipcode}', ${this.squarefeet},'${this.description}','${this.directions}', ${this.contactId},'${this.type}',${this.showMP}, ${this.showDI}, ${this.showPD},'${this.pdDescription}',${this.yearOpened},'${this.majorTenants}',${this.photo}, ${this.mapx},${this.mapy}) returning id` );\n \n// ('${this.propertyName}','${this.streetAddress}','${this.county}','${ this.city }','${this.state}','${this.zipcode}',\n// ${this.squarefeet},'${this.description}','${this.directions}', ${this.contactId},'${this.type}',${this.showMP}, ${this.showDI}, ${this.showPD},'${this.pdDescription}',${this.yearOpened},\n// '${this.majorTenants}',${this.photo}, ${this.mapx},${this.mapy}) returning id` );\n \n }", "title": "" }, { "docid": "0ece52b11467db97bb1183331eeed6e8", "score": "0.5302515", "text": "function expresion(valor1, operador, valor2) {\n var json = [];\n json = json.concat(returnVector(valor1));\n json = json.concat(returnVector(operador));\n json = json.concat(returnVector(valor2));\n return json;\n}", "title": "" }, { "docid": "fc6e7ae916b00a75a49f72473324e6af", "score": "0.52990836", "text": "createResumenDeVentas() {\n let efectivo = document.getElementById(\"lblEfectivo\").value;\n\n let cambio =\n efectivo - this.ordenSelected.total - this.propina - this.domicilio;\n\n let fechaResumen = this.convertDate();\n let productosOrden = this.ordenSelected.detalleOrden;\n let totalOrden = parseFloat(this.ordenSelected.total.toFixed(2));\n let obj = [];\n for (let i = 0; i < productosOrden.length; i++) {\n let array = {\n nombre: productosOrden[i].nombre,\n cantidad: productosOrden[i].cantidad,\n };\n obj.unshift(array);\n }\n this.nuevoResumen.fecha = fechaResumen;\n this.nuevoResumen.total = totalOrden;\n this.nuevoResumen.productos = obj;\n this.nuevoResumen.propina = parseFloat(this.propina);\n if (this.domicilio > 0) {\n this.nuevoResumen.costoEnvio = parseFloat(this.domicilio);\n }\n console.log(this.nuevoResumen.propina);\n var cadena =\n \"./ordenes.html?alert=Orden%20cobrada:%20\" +\n this.ordenSelected.id.substr(-4) +\n \",%20con%20un%20total%20de:%20$\" +\n (totalOrden + this.propina + this.domicilio) +\n \",%20efectivo%20de:%20$\" +\n efectivo +\n \"%20y%20cambio%20de:%20$\" +\n cambio.toFixed(2);\n axios\n .post(this.uriVentas, JSON.stringify(this.nuevoResumen), {\n headers: {\n \"content-type\": \"application/json\",\n },\n })\n .then((response) => {\n window.location = cadena;\n })\n .catch((ex) => {\n console.log(ex);\n });\n\n }", "title": "" }, { "docid": "d1448fb87ffadeed0326f019b31f6259", "score": "0.52986366", "text": "function createData(arg) {\n let obj = {}\n schema.forEach((e, i) => {\n obj[e] = arg[i]\n })\n obj.id = ++counter;\n dataObj.push(obj);\n return obj;\n}", "title": "" }, { "docid": "4034533f83d22bbb6fac53e2203359ee", "score": "0.52802503", "text": "createResultsTemplate(moduleConfig) {\n const results = {};\n const reducedConfig = {\n jobs: moduleConfig.jobs,\n datafeeds: moduleConfig.datafeeds,\n kibana: moduleConfig.kibana,\n };\n\n function createResultsItems(configItems, resultItems, index) {\n resultItems[index] = [];\n configItems.forEach((j) => {\n resultItems[index].push({\n id: j.id,\n success: false\n });\n });\n }\n\n Object.keys(reducedConfig).forEach((i) => {\n if (Array.isArray(reducedConfig[i])) {\n createResultsItems(reducedConfig[i], results, i);\n } else {\n results[i] = {};\n Object.keys(reducedConfig[i]).forEach((k) => {\n createResultsItems(reducedConfig[i][k], results[i], k);\n });\n }\n });\n return results;\n }", "title": "" }, { "docid": "85f174b390fd5e04c27af81b90deb35b", "score": "0.5276374", "text": "function getNewResultDiv(){\r\n\tconst result = document.createElement('div');\r\n\tresult.classList.add('taskItem__result');\r\n\tresult.innerHTML = '<b>Result: </b><br>';\r\n\tif(arguments.length == 0){\r\n\t\treturn result;\r\n\t}\r\n\tconst spanArgs = document.createElement('span');\r\n\tfor(i = 0; i < arguments.length; i++){\r\n\t\tconst string = \"Value \" + (i+1) + \": \" + arguments[i] + \" <br>\";\r\n\t\tspanArgs.innerHTML += string;\r\n\t}\r\n\tresult.appendChild(spanArgs);\r\n\treturn result;\r\n}", "title": "" }, { "docid": "12de62e75e6e20c29c81d68662c86173", "score": "0.5260901", "text": "function writeResult(result){\n console.log(\"writing\");\n var propertyNumber = result.PropertyDetails[\"account\"][\"Property_ID\"];\n var flatPath = resultPathFlattened + subFolderIndex + '/'\n var deepPath = resultPathDeep + subFolderIndex + '/';\n writeFileP(deepPath + propertyNumber + '.json', JSON.stringify(result))\n .then(writeFileP(flatPath + propertyNumber + '.json', JSON.stringify(flatten(result,{}))))\n .then(writeFileP('indexLog.txt', index + '\\n'))\n return nightmare.end();\n }", "title": "" }, { "docid": "dc76494184ae242adc02b2474cfc411b", "score": "0.52604747", "text": "getSAWResult(){\n\n // validasi jika param fasilitas kosong\n if (this.param.facility.values.length == 0){\n\n // tampilkan dialog\n this.showWarning(\"Perhatian\",\"Harap memilih fasilitas wisata minimal satu!\")\n return;\n }\n\n // validasi jika param min dan max tiket kosong\n if (this.param.ticket_price.min_value == \"\" || this.param.ticket_price.max_value == \"\"){\n\n // tampilkan dialog\n this.showWarning(\"Perhatian\",\"Harap memilih harga tiket!\")\n return;\n }\n\n // alihkan ke halaman loading\n this.switchPage(\"loading-page\")\n\n // menggunakan library axio\n // untuk melakukan http request\n axios\n\n // isi url target dan form data\n .post(baseURL + 'api/all_data_pariwisata_spk.php',this.createFormData())\n \n // saat response didapat\n .then(response => {\n \n this.results = response.data.data\n this.switchPage(\"result-page\")\n })\n\n // saat error didapat\n .catch(errors => {\n\n console.log(errors)\n this.switchPage(\"result-page\")\n }) \n }", "title": "" }, { "docid": "3c795d8e722633274ec8ebc41bb4a8a9", "score": "0.52603155", "text": "function generarRespuestaExitosa(accion, idPeticion, resultados) {\n\n\tlet respuesta = {\n\t\texito: true,\n\t\taccion: accion,\n\t\tidPeticion: idPeticion,\n\t\tresultados: resultados\n\t}\n\treturn respuesta;\n}", "title": "" }, { "docid": "97efc824a048ac7321814c5ad71a61c6", "score": "0.52587986", "text": "salvarDesbravador(connection, desbravador, fichaMedica, Responsaveis){\n let queryDesbravador = new PrepareQuery();\n let queryMontada = queryDesbravador.salvarDesbravadorQuery(desbravador);\n let modelDesbravador = new ModelDesbravador(connection);\n var resultado = '';\n var erro = '';\n \n //console.log(queryMontada);\n\n modelDesbravador.salvar(queryMontada, function(error, result){\n let id_desbrava = result.insertId\n let queryFichaMedica = queryDesbravador.salvarFichaMedicaDesbravador(fichaMedica, result.insertId);\n modelDesbravador.salvar(queryFichaMedica, (error, result) => {\n \n let queryResponsaveis = queryDesbravador.salvarResponsaveisDesbravadores(Responsaveis, id_desbrava)\n modelDesbravador.salvar(queryResponsaveis, (error, result)=> {\n let queryAguitosCoin = queryDesbravador.inserirAguitosCoin(id_desbrava);\n modelDesbravador.salvar(queryAguitosCoin, (error, result) => {\n console.log(error)\n console.log(result)\n })\n })\n });\n\n })\n \n }", "title": "" }, { "docid": "1ffe8c1e72dca3a851531ae79e4a329f", "score": "0.5254282", "text": "function createData(name, simbolo, cotacao) {\n return { name, simbolo, cotacao };\n}", "title": "" }, { "docid": "1fcbf45f2dfa47626ea64754098b0aaf", "score": "0.52528787", "text": "static initialize(obj, name, result, type) { \n obj['name'] = name || '';\n obj['result'] = result;\n obj['type'] = type || 'LabeledActionResult';\n }", "title": "" }, { "docid": "9c810b90372d4782c75820aabfb73285", "score": "0.5245998", "text": "function addResult(result) {\n var e = $(\"<p/>\",\n {text: result}\n );\n\n $(\"#results\").append(e)\n }", "title": "" }, { "docid": "1591e706ac8f6ced3ad33c644ef24ead", "score": "0.5223264", "text": "function getProduct2(resultsQuery){\n\t// Bắt đầu detail product\n\t//Color\n\tvar arr2 = [];\n\tfor (var i = 0; i < resultsQuery.length; i++) {\n\t\tarr2[i] = resultsQuery[i].pdId + \"//\" + resultsQuery[i].TotalFigure + \"//\" + resultsQuery[i].Description + \"//\" + resultsQuery[i].Type +\n\t\t\t\"//\" + resultsQuery[i].Size + \"//\" + resultsQuery[i].Tittle + \"//\" + resultsQuery[i].CoverPrice + \"//\" + resultsQuery[i].OriginPrice + \"//\" + resultsQuery[i].clId;\n\t}\n\t//Size\n\t//K12\n\tvar k12 = convertToArr2(resultsQuery, arr2);\n\n\tvar keyy = [];\n\tfor (let h1 = 0; h1 < k12.length; h1++) {\n\t\tvar result_key = k12[h1].key1;\n\n\t\tvar result_key_split = result_key.split(\"//\");\n\n\t\tvar result_value = k12[h1].result;\n\t\tvar result_value_split = result_value.split(\":\");\n\n\t\tkeyy.push({\n\t\t\t\"product_id\": result_key_split[0],\n\t\t\t\"figure\": result_key_split[1],\n\t\t\t\"description\": result_key_split[2],\n\t\t\t\"size\": result_key_split[4],\n\t\t\t\"indexQ\": result_value_split[0]\n\t\t});\n\t}\n\treturn keyy;\n}", "title": "" }, { "docid": "7a91e28205c968412abe6567c492bc88", "score": "0.52089375", "text": "static fromObject(value) {\n return new Result(value);\n }", "title": "" }, { "docid": "363479823e7e1222e1bfd40cbdca236f", "score": "0.5183085", "text": "function createData (uptradeid, name, image, category, users, status) {\n // counter += 1;\n return { id: name, uptradeid, name, image, category, users, status }\n}", "title": "" }, { "docid": "4af8e019c731be4c37e4df3ff80c9a53", "score": "0.5179655", "text": "concat(result) {\n let strings = [...this.strings];\n strings[strings.length - 1] += result.strings[0];\n strings.push(...result.strings.slice(1));\n let values = [...this.values];\n return new TemplateResult(this.type, strings, values);\n }", "title": "" }, { "docid": "9f3efa0ebc94444682e5f000aa362a4c", "score": "0.51712954", "text": "buildResponse (opCode, resultCode) {\n var buffer = new Buffer.alloc(3)\n buffer.writeUInt8(0x08, 0)\n buffer.writeUInt8(opCode, 1)\n buffer.writeUInt8(resultCode, 2)\n return buffer\n }", "title": "" }, { "docid": "bf743669734981b96f1becfa6f7da2a3", "score": "0.51707035", "text": "function createProjectData(values) {\n const uzivManager = [{\n vedouci: true,\n dateStart: format(values.start, \"yyyy-MM-dd\"),\n dateEnd: null,\n aktivni: true,\n uzivatel: {\n id: values.manager\n }\n }];\n\n const uzivResitele = values.resitele.map(resitel => {\n return {\n vedouci: false,\n dateStart: format(values.start, \"yyyy-MM-dd\"),\n dateEnd: null,\n aktivni: true,\n uzivatel: {\n id: resitel\n }\n }\n });\n\n\n return {\n nazev: values.nazev,\n popis: values.popis,\n start: format(values.start, \"yyyy-MM-dd\"),\n konec: format(values.konec, \"yyyy-MM-dd\"),\n aktivni: true,\n swot: null,\n itemUzProj: [...uzivManager, ...uzivResitele]\n };\n\n }", "title": "" }, { "docid": "55f4cee062aad9ec649aa89d5d09806c", "score": "0.51655775", "text": "function generateResults(recognitionResults, q, context) {\n const LABEL = \"Maven Central\";\n const ICON_URL = \"https://search.maven.org/favicon.ico\";\n const URL_PREFIX = \"https://search.maven.org/#search%7Cga%7C1%7C\";\n const EMBEDDABLE = false; // Page does some Ajax that doesn't work\n\n const resultList = recognitionResults['com.solveforall.recognition.programming.java.JavaClassName'];\n\n if (resultList && resultList[0]) {\n return _(resultList).map(function (result) {\n let uri = URL_PREFIX;\n\n if (result.packageName && (result.packageName.length > 0)) {\n uri += 'fc%3A%22';\n uri += encodeURIComponent(result.fullyQualifiedClassName);\n } else {\n uri += 'c%3A%22';\n uri += encodeURIComponent(result.simpleClassName);\n }\n uri += '%22';\n\n return {\n label: LABEL,\n iconUrl: ICON_URL,\n uri: uri,\n tooltip: 'Search Maven Central for ' + result.fullyQualifiedClassName,\n relevance: result.recognitionLevel,\n embeddable: EMBEDDABLE\n };\n });\n }\n\n return [{\n label: LABEL,\n iconUrl: ICON_URL,\n uri: URL_PREFIX + encodeURIComponent(q),\n tooltip: 'Search Maven Central for ' + q,\n relevance: 0.0,\n embeddable: EMBEDDABLE\n }];\n}", "title": "" }, { "docid": "edcde55868474528bc7425bf25845bf6", "score": "0.5147926", "text": "async getResult() {\n // here we are using axiom instead of fetch because fetch migght not be recognized by older browser . so install it first from the terminal \n\n // we have now installed the package so now we need to import it\n\n // it automatically returns json so no need to convert it. No api or proxy required for us inm this project\n try {\n const res = await axios(`https://forkify-api.herokuapp.com/api/search?q=${this.query}`);\n //console.log(res);\n // this.query because query is already passed to the function before. When u console.log(res) u will get all the info from this search property and from there we knew the data name was recipes\n //console.log(res);\n\n\n // The result property of the Search object was created and initialized with a value in one line. That's why you haven't seen it declared before. that is why we have this.result\n\n \n\n // We're declaring and initializing the result property with a value in one line. Let's say you have some object\n\n // const obj = {};\n\n // obj.result = 'some result';\n // you can add a property to an object using dot notation, like this obj.result = 'some result';\n\n\n this.result = res.data.recipes;// it is in the console of data the name recipes\n\n //console.log(this.result);\n } catch (error) {\n alert(error);\n }\n }", "title": "" }, { "docid": "6b99a1708ed559a3b7394bdeaa61431c", "score": "0.51474607", "text": "createRespuestas () {\n if (this.dataRespuestas) {\n const arr = Object.values(this.dataRespuestas)\n const lista = arr.map((value) => {\n return ({\n 'text': '',\n 'image': '',\n 'key': value.key\n })\n })\n return lista\n } return []\n }", "title": "" }, { "docid": "78aac4f78bb8a8c217a5340ae2fe0d79", "score": "0.51416844", "text": "function resultWrapper(result) {\n if (result && result.entries && typeof result.entries !== 'undefined') {\n if (result.entries && result.entries.length) {\n for (var i = 0, _i = result.entries.length; i < _i; i++) {\n result.entries[i] = (0, _result2.default)(result.entries[i]);\n }\n } else {\n result.entries = [];\n }\n } else if (result && typeof result.entry !== 'undefined') {\n result.entry = (0, _result2.default)(result.entry);\n }\n return result;\n}", "title": "" }, { "docid": "2ad9cc1add87033f3f8868dcf75b621d", "score": "0.5140658", "text": "function creating (info) {\n //console.log('paintingInfo defined?',defineCreate.paintingInfo);\n var result = defineCreate.paintingInfo();\n //console.log('result?', result);\nresult.sync().then(function () {\n for (var i = 0; i< info.length; i++){\n result.create ({\n number: i,\n image: info[i].image,\n link: info[i].link,\n title: info[i].title,\n maker: info[i].maker,\n medium: info[i].medium,\n place: info[i].place,\n date: info[i].date\n })\n }\n })\n.then(function(painting){\n//console.log('able to retrieve',painting.get('link'));\n//console.log('paintingggg', painting)\n })\n}", "title": "" }, { "docid": "6900d60c19147c250608ee179e0d1a1c", "score": "0.51339555", "text": "function createJsonStandQueryOne()\n{\n var resultJson = {\n \"id\": null,\n \"geotable_id\": CONST_STAND_LOCATION_INFO_TABLEID,\n \"ak\": CONST_AK\n };\n return resultJson;\n\n\n}", "title": "" }, { "docid": "85c87c86be6c00927a8603a6f2347afe", "score": "0.51304173", "text": "async beforeSuccess() {\n this.setResult(this.generateResult())\n }", "title": "" }, { "docid": "b7fdf76a48530c1c0c32934cb66cbc3d", "score": "0.511937", "text": "function returnResultsStructuredCloning() {\n // Create results Array\n var resultsArray = [];\n resultsArray[0] = games;\n resultsArray[1] = wins;\n resultsArray[2] = draws;\n resultsArray[3] = losses;\n resultsArray[4] = total_turns;\n if (debug) resultsArray[5] = echo;\n\n // Send batch results back to main thread\n self.postMessage({ \"cmd\": \"return_results\", \"data\": resultsArray });\n}", "title": "" }, { "docid": "8a0c689c7405136c56834b087f680311", "score": "0.5117533", "text": "function createNewResultSet(baseSet)\n{\n\t// resultSet(base, filters, expands, results)\n\tvar resultSet = \n\t{ \n\t\tbase : baseSet,\n\t\tfilters : [], \n\t\texpands: [],\n\t\tcurrentExpand : null,\n\t\tresults : [],\n\t\trelatedSets: [],\n\t\tclasses: [],\n\t\tisEmpty : function() {\n\t\t\treturn this.filters.length == 0 && this.base == null;\n\t\t},\n\t\tgetRoot : function() {\n\t\t\treturn this.base == null ? this : this.base.getRoot();\n\t\t}\n\t}\n\n\treturn resultSet;\n}", "title": "" }, { "docid": "a2fd6b6072bfe2e9c27921b9cafc5fa0", "score": "0.51159835", "text": "function createEntity(resultSet) {\n var result = {};\n\tresult.bookid = resultSet.getInt('BOOKID');\n result.bookisbn = resultSet.getString('BOOKISBN');\n result.booktitle = resultSet.getString('BOOKTITLE');\n result.bookauthor = resultSet.getString('BOOKAUTHOR');\n result.bookeditor = resultSet.getString('BOOKEDITOR');\n result.bookpublisher = resultSet.getString('BOOKPUBLISHER');\n result.bookformat = resultSet.getString('BOOKFORMAT');\n if (resultSet.getDate('BOOKPUBLICATIONDATE') !== null) {\n\t\tresult.bookpublicationdate = convertToDateString(new Date(resultSet.getDate('BOOKPUBLICATIONDATE').getTime()));\n } else {\n result.bookpublicationdate = null;\n }\n result.bookprice = resultSet.getDouble('BOOKPRICE');\n return result;\n}", "title": "" }, { "docid": "ae6617cb3eda92aa2a7d070d7a416b27", "score": "0.51153916", "text": "function Result(source, value) {\n\tthis.init(source, value);\n}", "title": "" }, { "docid": "5918591e48db49e53e5c619a8cb8a19c", "score": "0.51142156", "text": "function createData(user, from, to, number) {\n return { user, from, to, number};\n}", "title": "" }, { "docid": "4fefb0c9a473cbf04867444f3d47753a", "score": "0.5113079", "text": "function addResult() {\n var time = times[time_i][1];\n var outcome = WK.TestResult.Outcome.fromCharacter(results[result_i][1]);\n zippedResults.push(new WK.TestResult(time, outcome));\n }", "title": "" }, { "docid": "e605862035001521bd0beabd181b8a97", "score": "0.5110434", "text": "function saveResult(result) {\n _result = result;\n}", "title": "" }, { "docid": "33a5e593af8bad9f7ba5fb34825533e3", "score": "0.50816154", "text": "function createPromotion() {\n fetch(\"http://api-students.popschool-lens.fr/api/promotions\", {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: \"POST\",\n // we tranform the inputs value int the json string by using function stringyfy\n body: JSON.stringify({\n name: newPromotion.value,\n startDate: startdate.value,\n endDate: enddate.value,\n students: []\n })\n })\n .then(response => response.json())\n .then(promotionresponse => {\n // I call back the function get promo to refresh my list\n getPromotion();\n // Now I screen promotionresponse.name in console log to check if the resposnse and my method has been done corretly\n console.log(promotionresponse.name + \" créé\")\n })\n}", "title": "" }, { "docid": "b948f19be118866d7559a702eb19a566", "score": "0.50812334", "text": "static readQuery(result){\n if (!result) return [];\n if (!Array.isArray(result)) result=[result];\n return result.map(row=>new this.nodeConstructor(row));\n }", "title": "" }, { "docid": "dc71c336fff4059a876c25109e126652", "score": "0.50768876", "text": "prepareRequestedResults(results) {\n let userNameList = [];\n\n results.forEach(result => {\n userNameList.push({ text: result.login, value: result.id});\n });\n return userNameList;\n }", "title": "" }, { "docid": "57f3baeb530b79a6a7852d1620648f93", "score": "0.507388", "text": "function createData(photo,name, id, mail, adress,adress1,workadress, phone, website, cname) {\n return { photo,name, id, mail, adress,adress1,workadress,phone,website,cname };\n}", "title": "" }, { "docid": "8eb4df6ea7bcf0809422a9541c0372b5", "score": "0.5070873", "text": "constructor(result){\n \n let code = 0;\n let message = 'Unknown error, please check GetResult().';\n let type = '';\n \n if (typeof (result.error) != \"undefined\" && result.error.constructor == Object)\n {\n if (typeof (result.error.code) != \"undefined\")\n code = result.error.code;\n if (typeof (result.error.message) != \"undefined\")\n message = result.error.message;\n if (typeof (result.error.type) != \"undefined\")\n type = result.error.type;\n }\n\n super(message);\n\n this._result = result;\n this._type = type;\n this._code = code;\n \n }", "title": "" }, { "docid": "dbd5c52dae75aa06ebd3b422138f9e0e", "score": "0.506564", "text": "updateResult({results},result){\n results.push(result)\n }", "title": "" }, { "docid": "c96205ce398226fa600835f63de272fc", "score": "0.50641876", "text": "function crearActividad(pedido,respuesta) {\n var fecha_i=new Date(pedido.body.fecha_inicio);\n var fecha_f=new Date(pedido.body.fecha_fin);\n var registro = {\n nombre: pedido.body.nombre,\n descripcion: pedido.body.descripcion,\n fecha_inicio: fecha_i.toLocaleDateString(),\n fecha_fin: fecha_f.toLocaleDateString(),\n comentario: pedido.body.comentario,\n proyecto: pedido.body.proyecto,\n responsable: pedido.body.responsable\n };\n console.log(registro);\n var sql = 'insert into tb_actividades set ?';\n conexion.query(sql, registro, function (error, resultado) {\n if (error) {\n console.log(\"error\");\n console.log('error en la consulta');\n respuesta.write('{\"exito\":false}');\n respuesta.end();\n }else{\n respuesta.write('{\"exito\":true}');\n respuesta.end();\n }\n });\n\n}", "title": "" }, { "docid": "6a24789be291253ba37dab6f8ddaed61", "score": "0.5053272", "text": "prepareData(res){\n if(typeof res != 'object' ){\n throw(\"Fehler: Ungültige Eingabe (res ist kein Objekt)\");\n }\n let data = [];\n if(res.resource){ // catch if only one resource instead of a bundle was passed as argument\n res.entry = [];\n res.entry.push(res);\n }\n for(var i in res.entry){\n if(res.entry[i].resource.resourceType == 'Observation' && new Date(res.entry[i].resource.meta.lastUpdated) > cutOffDate){\n\n // create template object from SnomedService\n let code = \"\";\n let invalid = true;\n if(res.entry[i].resource.valueCodeableConcept != undefined){\n code = res.entry[i].resource.valueCodeableConcept.coding[0].code;\n invalid = false;\n }\n else if(res.entry[i].resource.component && res.entry[i].resource.component[0].code) {\n code = res.entry[i].resource.component[0].code.coding[0].code;\n\n if(res.entry[i].resource.code.coding[0].code == 162306000){\n // this is a fix for headache resources that miss a valueCodeableConcept\n // since it is possible to save such with heMIGrania\n code = \"74964007h\"\n }\n\n invalid = false;\n }\n\n\n // we have to catch possible \"other diagnosis\" and \"other headache\",\n // which are persisted with a wrong and colliding SNOMED code in heMigrania\n if(code == \"74964007\" && res.entry[i].resource.code.coding[0].code == \"418138009\"){ // diagnosis\n code = \"74964007d\"\n }\n if(code == \"74964007\" && res.entry[i].resource.code.coding[0].code == \"162306000\"){ // headache\n code = \"74964007h\"\n }\n\n // get the template for the sct code from snomed service\n const templateArr = sct.getFiltered(x => (x.code == code));\n\n // if code was not found in SNOMED CT, we abort and log an error:\n if(templateArr.length == 0){\n console.log(\"Fehlerhafte Daten: SNOMED-Code \" + code + \" ist nicht bekannt (Objekt \" + i + \").\\nObjekt übersprungen.\");\n }\n else{\n\n // we only expect this array to have one entry anyway, since code is unique\n // we have to do the json stringify dance, so the object is later not passed by reference,\n // which was causing strange errors\n let template = JSON.parse(JSON.stringify(templateArr[0]));\n\n // fill template with actual values from resource\n if(template.category == 'EatingHabit' || template.category == 'Diagnosis'){ // EatingHabit and diagnosis has only one Time\n if(res.entry[i].resource.effectiveDateTime){\n template.date = new Date(res.entry[i].resource.effectiveDateTime);\n\n // mark entries with invalid time values\n invalid = template.startTime > new Date();\n }\n else {\n template.date = new Date(1);\n invalid = true;\n }\n }\n else { // all other have start and end times\n if(res.entry[i].resource.effectivePeriod){\n template.startTime = new Date(res.entry[i].resource.effectivePeriod.start);\n template.endTime = new Date(res.entry[i].resource.effectivePeriod.end);\n\n // mark entries with invalid time values\n invalid = (template.startTime > template.endTime) || (template.startTime > new Date());\n }\n else{ // some older entries don't even have time entries, and are thus invalid\n template.startTime = new Date(0);\n template.endTime = new Date(1);\n invalid = true;\n }\n }\n\n if(template.category == 'VariousComplaint' || template.category == 'Headache' || template.category == 'SleepPattern'){\n // these Categories have intensities\n\n if(res.entry[i].resource.component && res.entry[i].resource.component[0].valueQuantity){ // catch old faulty entries\n template.quantity = res.entry[i].resource.component[0].valueQuantity.value;\n }\n else{\n invalid = true;\n }\n }\n\n\n if(template.category == 'Headache'){\n // headaches also have body sites\n if(res.entry[i].resource.bodySite && res.entry[i].resource.bodySite.coding[0]){\n template.bodySiteSCT = res.entry[i].resource.bodySite.coding[0].code;\n template.bodySiteDE = sct.getGerman(template.bodySiteSCT);\n }\n else{\n template.bodySiteSCT = \"\";\n template.bodySiteDE = \"unbekannte Seite\"\n }\n }\n\n // create metadata\n let meta = {};\n meta.id = res.entry[i].resource.id;\n if(res.entry[i].resource.meta){\n meta.versionId = res.entry[i].resource.meta.versionId;\n meta.timestamp = new Date(res.entry[i].resource.meta.lastUpdated);\n meta.source = res.entry[i].resource.meta.extension[0].extension[0].valueCoding.display;\n }\n else {\n invalid = true;\n }\n meta.invalid = invalid;\n template.meta = meta;\n data.push(template);\n }\n }\n\n else if(res.entry[i].resource.resourceType == 'Patient'){\n let pat = {};\n pat.id = res.entry[i].resource.id;\n pat.name = res.entry[i].resource.name[0].family;\n pat.firstName = res.entry[i].resource.name[0].given[0];\n pat.fullName = pat.firstName + \" \" + pat.name;\n pat.birthDate = res.entry[i].resource.birthDate\n\n let meta = {};\n meta.versionId = res.entry[i].resource.meta.versionId;\n meta.timestamp = res.entry[i].resource.meta.lastUpdated;\n meta.participantId = \"\";\n // identifier is an array of various identifiers in MIDATA\n let ident = res.entry[i].resource.identifier;\n for(var entry in ident){\n // we want the participant-name the user has in a study\n if (ident[entry].system == 'http://midata.coop/identifier/participant-name'){\n meta.participantId = ident[entry].value;\n }\n }\n pat.meta = meta;\n data.push(pat);\n }\n else if(res.entry[i].resource.resourceType == 'MedicationStatement' && new Date(res.entry[i].resource.meta.lastUpdated) > cutOffDate){\n let med = {\n code: 'medication',\n category: 'Medication',\n superCategory: '',\n colour: '#FD8DD7'\n };\n let invalid = true;\n\n if(res.entry[i].resource.medicationCodeableConcept && res.entry[i].resource.medicationCodeableConcept.coding){\n med.en = res.entry[i].resource.medicationCodeableConcept.coding[0].display;\n med.de = med.en;\n invalid = false;\n }\n\n // again, catching inconsistent data from heMIgrania\n if(med.de == undefined){\n med.de = \"unbekannt\";\n med.en = \"unknown\";\n }\n // check if the name is a string with only digits - then we assume it's\n // a GTIN and resolve it to fetch the matching drug name\n if(/^\\d+$/.test(med.en)){\n try{\n med.de = mediService.getMedName(med.en);\n }\n catch(err){\n console.log(err);\n }\n\n }\n\n if(res.entry[i].resource.dosage && res.entry[i].resource.dosage[0].doseQuantity){\n med.dosage = res.entry[i].resource.dosage[0].doseQuantity.value;\n med.effect = res.entry[i].resource.dosage[0].text;\n med.effect = med.effect == 'Good' ? 'geholfen' : med.effect == 'Bad' ? 'die Situation verschlechtert' : 'nicht geholfen';\n }\n else{\n med.dosage = 0;\n invalid = true;\n }\n\n med.taken = res.entry[i].taken == 'y';\n\n\n if(res.entry[i].resource.effectiveDateTime){\n med.date = new Date(res.entry[i].resource.effectiveDateTime);\n\n // mark entries with invalid time values\n invalid = med.startTime > new Date();\n }\n else {\n med.date = new Date(1);\n invalid = true;\n }\n\n // heMIGrania had a bug that persisted medication statements wrong until 10.5.2019\n if(res.entry[i].resource.meta.extension[0].extension[0].valueCoding.display.toLowerCase() == 'hemigrania' && new Date(res.entry[i].resource.meta.lastUpdated) < new Date(\"2019-05-10\")){\n invalid = true;\n }\n\n // create metadata\n let meta = {};\n meta.id = res.entry[i].resource.id;\n if(res.entry[i].resource.meta){\n meta.versionId = res.entry[i].resource.meta.versionId;\n meta.timestamp = new Date(res.entry[i].resource.meta.lastUpdated);\n meta.source = res.entry[i].resource.meta.extension[0].extension[0].valueCoding.display; // this is a bit shaky and should be done more flexible for generalisation\n }\n else {\n invalid = true;\n }\n meta.invalid = invalid;\n med.meta = meta;\n\n data.push(med);\n }\n else{\n if(new Date(res.entry[i].resource.meta.lastUpdated) > cutOffDate){\n throw(\"Fehler: Kann momentan nur Bundles mit Observation-, MedicationStatement- oder Patient-Ressourcen verarbeiten.\");\n }\n }\n\n }\n return data;\n }", "title": "" }, { "docid": "8786876e51f4c022e3e8784f69d5a525", "score": "0.50506526", "text": "constructor(resultRow) {\r\n this.resultRow = resultRow;\r\n this._initData();\r\n }", "title": "" }, { "docid": "186b14f9c6e232810419eb10440bd192", "score": "0.5047655", "text": "function createEntity(resultSet) {\n var result = {};\n result.id = resultSet.getShort('ID');\n result.student_id = resultSet.getShort('STUDENT_ID');\n result.subject_id = resultSet.getShort('SUBJECT_ID');\n result.grade = resultSet.getFloat('GRADE');\n return result;\n}", "title": "" }, { "docid": "10955d27713c1e5a9df6de1df3311936", "score": "0.5040207", "text": "function createData(email, status, dateInvited) {\n return { email, status, dateInvited };\n}", "title": "" }, { "docid": "2f12e69658e4239e5ac1a2cbe3590aa2", "score": "0.503952", "text": "responseCreation(email, roleName) {\n\t\tlogger.info('responseCreation() initiated');\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tlet sql = `select a.applicant_id, a.account_type, a.next_step, c.email, c.first_name, c.gender, c.last_name, c.mobile,c.phone,\n\t\t\tad.address_line1, ad.address_line2, ad.city, ad.country_id, ad.postal_code, ad.region, ad.town, k.kyc_status\n\t\t\tfrom applicant a, contact c, address ad, kyc k\n\t\t\twhere a.applicant_id=c.applicant_id and a.applicant_id= ad.applicant_id and a.account_type ='${roleName}' and a.applicant_id= k.applicant_id and c.email = '${email}'`;\n\t\t\tDbInstance.executeQuery(sql).then(result => {\n\t\t\t\tlogger.info('responseCreation() execution completed');\n\t\t\t\tresolve(result);\n\t\t\t}).catch((err) => {\n\t\t\t\tlogger.error(err);\n\t\t\t\tlogger.info('responseCreation() execution completed');\n\t\t\t\treject(`${err}`);\n\t\t\t})\n\n\t\t})\n\t}", "title": "" }, { "docid": "8482b1367eb6ec527851ab8cde83d40f", "score": "0.50349426", "text": "function crearCargo(pedido,respuesta) {\n var registro = {\n nombre: pedido.body.nombre,\n descripcion: pedido.body.descripcion,\n salario: pedido.body.salario,\n horario: pedido.body.horario,\n proyecto: pedido.body.proyecto\n };\n console.log(registro);\n var sql = 'insert into tb_cargos set ?';\n conexion.query(sql, registro, function (error, resultado) {\n if (error) {\n console.log(\"error\");\n console.log('error en la consulta');\n respuesta.write('{\"exito\":false}');\n respuesta.end();\n }else{\n respuesta.write('{\"exito\":true}');\n respuesta.end();\n }\n });\n\n}", "title": "" }, { "docid": "7887624bf71c16d83f54a30d73f15a10", "score": "0.5024714", "text": "GenerateReturnBody_Array(code, result, message, data, error){\n var success = {\n code: code,\n result: result,\n message: message,\n data: data,\n error: error\n }; //result can be fail or success\n\n\n logger.Logger.log('API Builder - GenerateReturnBody_Array', 'Object returning - ' + JSON.stringify(success),'',5,false);\n return success;\n }", "title": "" }, { "docid": "7ea801d14138cd8879495c77701640d5", "score": "0.5022311", "text": "function transformData(res) {\n var object = {};\n for(var i = 0; i < res.length; i++) {\n if(res[i].mark > 5) {\n var keyObject = res[i].login; // Значение ключа login из res назначаем 1-м ключем object\n var itFN = res[i].firstName; // Берем значение ключа firstName из res в переменную.\n var itLN = res[i].lastName; // Берем значение ключа lastName из res в переменную.\n var itKeyObject; // Назначаем значение, которое будет передаваться в каждый ключ нового object\n\n if(itFN == '' || itLN == '') {\n itKeyObject = itFN + itLN; \n } else {\n itKeyObject = itFN + ' ' + itLN; // Если в двух значениях есть имена, то между ними нужен пробел. \n }\n //itKeyObject = itFN + itLN; \n object[keyObject] = itKeyObject;\n }\n }\n\n return object;\n //Checking\n //return console.log(object);\n\n}", "title": "" }, { "docid": "51daf2a6a1366186d4d3505b53b9a227", "score": "0.5021708", "text": "function criterioBusquedaFichaPendiente() {\n let codigoCriterioBusqueda = 0;\n let codigoTipoDocumento = 0;\n let busqueda = '';\n codigoCriterioBusqueda = parseInt($('#cboCriterioBusqueda').val());\n if (codigoCriterioBusqueda === 1) {\n codigoTipoDocumento = parseInt($('#cboTipoDocumento').val());\n busqueda = $('#txtNumeroDocumento').val().trim();\n } else if (codigoCriterioBusqueda === 2) {\n busqueda = $('#txtApellidos').val().trim();\n } else if (codigoCriterioBusqueda === 3) {\n busqueda = $('#dpFechaRegistro').val().trim();\n }\n let JSONCriterioBusqueda = {\n codigoCriterioBusqueda: codigoCriterioBusqueda,\n codigoTipoDocumento: codigoTipoDocumento,\n busqueda: busqueda\n };\n return JSONCriterioBusqueda;\n}", "title": "" }, { "docid": "5924cc38f3ff4da09e5f69e2e8f8a162", "score": "0.5014982", "text": "build() {\n // quem vai fazer o trabalho pesado e o build.\n // ele ira retornar o resultado final.\n\n const results = [];\n\n for(const item of this.#database) {\n // se retornar false, e porque o filtro que foi passado não foi encontrado.\n if (!this.#performWhere(item)) continue;\n\n const currentItem = this.#performSelect(item);\n\n results.push(currentItem);\n\n // se retornar true e porque acabou o limite.\n if (this.#performLimit(results)) break;\n }\n\n const finalResult = this.#performOrderBy(results);\n\n return finalResult;\n }", "title": "" }, { "docid": "097f1fd4a5976601316acfcab6c928e0", "score": "0.50100017", "text": "function createEntity() {\n try {\n return datacontext.crearEntidad(vm.entityName);\n }\n catch (error) {\n logger.error(\"Error durante la creación de entidad.\" + error, vm.entityName);\n }\n }", "title": "" }, { "docid": "ac41bcb5c3ab6cb27271cda535e292c0", "score": "0.5002359", "text": "static PermiPresenOneMes(){\r\n return db.execute(\"select * from VistaPermisosPresentados30Total;\");\r\n}", "title": "" }, { "docid": "cb2c3aad7566ee87e032f7ed334516f3", "score": "0.50010437", "text": "defaultResult() {\n return;\n }", "title": "" }, { "docid": "9ecf1a36d3c4ed361a0569aec1d0701c", "score": "0.49992636", "text": "function BuscadorResultados({resultados}) {\n return(\n <div className={\"general\"}>\n \n {!resultados?.length && <p style={{color: \"#e8e7e7\"}}>No existen resultados</p> }\n {resultados?.map((value) => \n \n {/*<BuscarResultadosItem key={value.id} name={value.name} email={value.email}/> {/*Peor qué pasaría si tuveramos más propiedades no solo name y email, sino 15, 20 prioiedades...? Entonces: */}\n <BuscarResultadosItem key={value.id} {...value}/> {/*Fácil, hacemos un spret! con eso le pasamos tooodas las 1000 propiedades que vengan en value */} \n )}\n\n </div>\n );\n\n}", "title": "" }, { "docid": "de405719b305f5c7af172645bf217e01", "score": "0.49987873", "text": "_showResult(result) {\n result.open();\n }", "title": "" }, { "docid": "50f193f60fdfff63b8921c72c21533a4", "score": "0.49934757", "text": "function pushData1(result) {\r\n\tvar arrayData = [];\r\n\t//var result = res['data'];\r\n\tfor (var i = 0; i < result.length; i++) {\r\n\t\tvar item = result[i];\r\n\t\tarrayData.push({\r\n\t\t\tid: item.id,\r\n\t\t\tteacher_id: item.student_teacher_id,\r\n\t\t\tattendance_date: item.attendance_date,\r\n\t\t\ttime_in: item.time_in,\r\n\t\t\ttime_out: item.time_out,\r\n\t\t\thours: item.hours\r\n\t\t});\r\n\t}\r\n\treturn arrayData;\r\n}", "title": "" }, { "docid": "fc5d294d6b04b2f5eb5676ddbb79a0e9", "score": "0.49929434", "text": "function convertXml2Js( xml , requestType , resultClass , portal ){\n\t\t\n\t\t//rather than parsing errors.\n\t\tif(!xml){return\n\t\t\t[{\"ERRORCODE\" : \"-1\",\"DESCRIPTION\" : \"No XML Results from the FileMaker Server\"}]\n\t\t};\n\t\t\n\t\tvar c = 0;\n\t\tvar v = 0;\n\t\tvar dataTag = \"DATA\";\n\t\tvar colTag = \"COL\";\n\t\tvar resultTag = \"RESULTSET\" ;\n\t\tvar errorCodeTag = \"ERRORCODE\" ;\n\t\tvar description = \"DESCRIPTION\"\n\t\tvar metadataTag = \"METADATA\" ;\n\t\tvar dataBaseTag = \"DATABASE\" ;\n\t\tvar dateFormatTag = \"DATEFORMAT\" ;\n\t\tvar timeFormatTag = \"TIMEFORMAT\" ;\n\t\tvar recordTag = \"ROW\" ;\n\t\tvar foundTag = \"FOUND\";\n\t\tvar recid = \"RECORDID\";\n\t\tvar modid = \"MODID\";\n\t\tvar id = \"\";\n\t\tvar mid = \"\";\n\t\tvar row = \"\";\n\t\tvar result = [];\n\t\tvar obj = {};\n\t\tvar newArray = [];\n\t\t\n\t\t//function for generating layout/field info from the METADATA Node\n\t\t//returns an object with two objects and an array: \n\t\t//model{}: fieldnames reference index position \n\t\t//fields{}: fieldnames reference data type\n\t\t//index[]: fieldnames (no TO:: pre-fix) in their index position\n\t\tfunction layoutModel ( FMXMLMetaData ){\n\t\t\t\n\t\t\tvar index = [];\n\t\t\tvar result = {}\n\t\t\tvar fields = {};\t\t\n\t\t\tvar model = {};\n\t\t\tvar nameTag = \"NAME\";\n\t\t\tvar typeTag = \"TYPE\";\n\t\t\tvar field = \"\";\n\t\t\tvar type = \"\";\n\t\t\tvar fieldCount = FMXMLMetaData.childNodes.length ;\n\t\t\tvar i = 0;\n\t\t\t\n\t\t\twhile(i<fieldCount){\n\t\t\t\tfield = FMXMLMetaData.childNodes[i].getAttribute(nameTag);\n\t\t\t\ttype = FMXMLMetaData.childNodes[i].getAttribute(typeTag);\n\t\t\t\t//related field\n\t\t\t\tif(field.indexOf(\"::\")>0 && portal===true){\n\t\t\t\t\tvar pos = field.indexOf(\"::\");\n\t\t\t\t\tvar t = field.substring(0,pos);\n\t\t\t\t\tvar f = field.substring(pos+2);\n\t\t\t\t\tt = \"-\" + t; //add hyphen prefix to keep from coliding with parent fields\n\t\t\t\t\t//does this proprty t exist in our model\n\t\t\t\t\tif(!model[t]){model[t]=[]};\n\t\t\t\t\tmodel[t].push(i);\n\t\t\t\t\tindex[i]=f;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//local field\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmodel[field] = [i];\n\t\t\t\t\tindex[i]=field;\n\t\t\t\t}\n\t\t\t\tfields[field]=type;\n\t\t\ti++;\n\t\t\t};\n\t\t\tresult[\"model\"]=model;\n\t\t\tresult[\"fields\"]=fields;\n\t\t\tresult[\"index\"]=index;\n\t\t\treturn result;\n\t\t};\n\t\t\n\t\t//retrieve value from the current XML DATA node by field name\n\t\t//returns an array as there can be 1...n values\n\t\tfunction valueByField(field){\n\t\t\t//can return a string or an array.\n\t\t\tif(field===\"-recid\"){return id};\n\t\t\tif(field===\"-modid\"){return mid};\n\t\t\tvar a = fieldObjects[\"model\"][field];\n\t\t\tif(a.length>1&&field.indexOf(\"-\")===0){ //fields in a portal\n\t\t\t\tvar i = 0;\n\t\t\t\tvar result = [];\n\t\t\t\tfor (i in a){\n\t\t\t\t\tresult.push(valueByIndex(a[i]))\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\telse{\t\n\t\t\t\treturn valueByIndex(a[0]);\n\t\t\t}\n\t\t};\n\t\t\n\t\t//retrieve value from the current XML DATA node by field name\n\t\t//returns a string if there is just one value.\n\t\tfunction valueByFieldString(field){\n\t\t\t//can return a string or an array.\n\t\t\tif(field===\"-recid\"){return id};\n\t\t\tif(field===\"-modid\"){return mid};\n\t\t\tvar a = fieldObjects[\"model\"][field];\n\t\t\tif(a.length>1){ //fields in a portal\n\t\t\t\tvar i = 0;\n\t\t\t\tvar result = [];\n\t\t\t\tfor (i in a){\n\t\t\t\t\tresult.push(valueByIndex(a[i]))\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\telse{\t\n\t\t\t\treturn valueByIndex(a[0])[0];\n\t\t\t}\n\t\t};\n\t\t\n\t\t//retrieve value from the current XML DATA node by field index\n\t\tfunction valueByIndex(i){\n\t\t\t//Just get the values by index\n\t\t\t//return as an array as we may have multiples.\n\t\t\tvar column = row.getElementsByTagName(colTag)[i];\n\t\t\tif(!column){\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\tvar children = column.childNodes.length;\n\t\t\t//override the count if portal is set to false so we just get the first value\n\t\t\tif(!portal){children=1};\n\t\t\tvar c = 0;\n\t\t\tvar data = \"\";\n\t\t\tvar val = \"\";\n\t\t\tvar result = [];\n\t\t\twhile (c<children){\n\t\t\t\tdata = column.getElementsByTagName(dataTag)[c].childNodes[0];\n\t\t\t\tif(data){val=data.nodeValue} else {val=\"\"};\n\t\t\t\tresult.push(val);\n\t\t\tc++;\n\t\t\t};\n\t\t\treturn result;\n\t\t};\n\t\t\n\t\t//turns arrays/columns into javascript objects. arrays come from layout portals\n\t\t//index is an array of field names to use for the nested object prop names\n\t\t//arrays is an array of the arrays of valuesreturned valuesByField\n\t\tfunction arraysToObjects(index, arrays){\n\t\t\tvar result = [];\n\t\t\tvar aLgth = arrays[0].length;\n\t\t\tif(aLgth===0){\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\tvar iLgth = index.length;\n\t\t\tvar i = 0;\n\t\t\tvar a = 0;\n\t\t\twhile (a<aLgth){\n\t\t\t\tresult[a]={};\n\t\t\t\tfor (i in index){\n\t\t\t\t\tresult[a][index[i]] = arrays[i][a];\n\t\t\t\t}\n\t\t\t\ta++;\n\t\t\t};\t\n\t\t\treturn result;\n\t\t};\n\t\t\n\t\t//creates the new Objects for results.\n\t\t//custom is an object that maps our FileMaker fields to a new object.\n\t\t//see demo page postQueryFMS() example 5 for custom example\n\t\tfunction newObject(custom){\n\t\t\tvar thisObject = {};\n\t\t\tvar c = 0;\n\t\t\tvar i = 0;\n\t\t\tvar val = \"\";\n\n\t\t\tif(custom){\n\t\t\t\tvar props = Object.getOwnPropertyNames(custom);\n\t\t\t\tfor (c in props){\n\t\t\t\t\tthisObject[props[c]] = custom[props[c]][\"getValue\"](valueByFieldString);\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthisObject[\"-recid\"]=id;\n\t\t\t\tthisObject[\"-modid\"]=mid;\n\t\t\t\tvar props = Object.getOwnPropertyNames(fieldObjects[\"model\"]);\n\t\t\t\tfor (c in props){\n\t\t\t\t\tvar arrays = [];\n\t\t\t\t\tvar index = [];\n\t\t\t\t\tvar fields = [];\n\t\t\t\t\tval = valueByField(props[c]);\n\t\t\t\t\tif (val.length===1&&props[c].indexOf(\"-\")!==0){;\n\t\t\t\t\t\tthisObject[props[c]] = val[0];\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tindex = fieldObjects[\"model\"][props[c]]; //index of fields from the model\n\t\t\t\t\t\tfor (var i = 0 ; i < index.length ; i++ ){ //get the field name from the index array\n\t\t\t\t\t\t\tfields.push(fieldObjects[\"index\"][index[i]]); //fieldnames\n\t\t\t\t\t\t\tarrays.push(val[i]); //array of arrays\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthisObject[props[c]] = arraysToObjects(fields, arrays);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\treturn thisObject;\n\t\t};\n\t\t\n\t\t//define layout model\n\t\tvar mData = xml.getElementsByTagName(metadataTag)[0];\n\t\tvar fieldObjects = layoutModel(mData);\n\t\t\n\t\t//we handle the results format a little differently for these queries so flag them,\n\t\tvar isDeleteRequest = false;\n\t\tif (requestType===\"-delete\"){\n\t\t\tvar isDeleteRequest = true;\n\t\t};\n\t\tvar isFindAnyRequest = false;\n\t\tif (requestType===\"-findany\"){\n\t\t\tvar isFindAnyRequest = true;\n\t\t};\n\t\t\t\n\t\t//error check return error code object if not 0 OR delete request.\n\t\tvar error = xml.getElementsByTagName(errorCodeTag)[0].childNodes[0].nodeValue;\n\t\t\n\t\tif ( error!=0 || isDeleteRequest ) {\n\t\t\t// exit with errcode object\n\t\t\tvar desc = errorDescription(error);\n\t\t\tvar errorObject = {};\n\t\t\tvar errorJs = [];\n\t\t\terrorObject[errorCodeTag] = error ;\n\t\t\terrorObject[description] = desc ;\n\t\t\terrorJs[0] = errorObject ;\n\t\t\treturn errorJs;\n\t\t}\n\t\t\n\t\t//altrnate formatting depending on request\n\t\tif(isFindAnyRequest){// return as object with two contained objects {model,result}\n\t\t\tvar dateFormat = id = xml.getElementsByTagName(dataBaseTag)[0].getAttribute(dateFormatTag);\n\t\t\tvar timeFormat = id = xml.getElementsByTagName(dataBaseTag)[0].getAttribute(timeFormatTag);\n\t\t\t\n\t\t\tresult = [\n\t\t\t\t{\n\t\t\t\t\t\"DATEFORMAT\":dateFormat,\n\t\t\t\t\t\"TIMEFORMAT\":timeFormat,\n\t\n\t\t\t\t\t\"FIELDS\":fieldObjects.fields,\n\t\t\t\t}\n\t\t\t];\n\t\t\treturn result;\n\t\t}\n\t\telse{\n\t\t\t//cycle through XML records and create objects accordingly.\n\t\t\tvar numResults = xml.getElementsByTagName(resultTag)[0].childNodes.length;\n\t\t\twhile ( c < numResults ) {\n\t\t\t\trow = xml.getElementsByTagName(recordTag)[c];\n\t\t\t\tid = xml.getElementsByTagName(recordTag)[c].getAttribute(recid);\n\t\t\t\tmid = xml.getElementsByTagName(recordTag)[c].getAttribute(modid);\n\t\t\t\tresult.push(newObject(resultClass));\n\t\t\t\tc++;\t\n\t\t\t};\n\t\t\treturn result;\n\t\t};\n\n}", "title": "" }, { "docid": "3ab89b16c2fe23e28bf709caf5e4e5a5", "score": "0.4984254", "text": "createObj() {\n let data1 = new UserObj(InputUser.value.toUpperCase(), InputEmail.value, InputPassword1.value,new Date().getTime(),[],[]);\n return data1\n\n }", "title": "" }, { "docid": "a38b82dcee1cca4cdc4a022dbf442000", "score": "0.49816272", "text": "function construct(result) {\n return '<div class=\"response\">' +\n '<a href=\"https://en.wikipedia.org/wiki/' + encodeURIComponent(result.title) + '\">' +\n '<h2>' + result.title + '</h2>' +\n result.extract +\n '</a>' +\n '</div>';\n}", "title": "" }, { "docid": "996f019da6bfc16ae4172f3b42d66f78", "score": "0.49781325", "text": "function createResultTable(table, id){\n /* THE STRUCTURE IS: <div id=\"table_id\" class=\"myTable\" style=\"overflow:auto; height:100%\"> </div> */\n $(\"<div id=\\\"table_\"+id+\"\\\" class=\\\"myTable\\\" style=\\\"overfloaw:auto ; height:100%\\\"></div>\").appendTo('#sectionResult_body_content_'+ id);\n /* THE STRUCTURE IS: <table border=\"3\" class=\"class1 class2 class3\" id=\"exampleid\"> </table> */\n $(\"<table border=\\\"3\\\" class=\\\"table table-striped table-condensed\\\" id=\\\"example\"+ id +\"\\\" style='width: 100%;'></table>\").appendTo('#table_'+ id);\n $('#example'+ id).dataTable(table); //table is made with the structure that dataTable() wants in input. This line sends it and the response is put in \"exampleid\".\n //For more information please read the documentation of dataTable()\n}", "title": "" }, { "docid": "bfd238a068dc96df747e9a3969035c2c", "score": "0.49730375", "text": "function createResultTableStructure(name,resultList)\n {\n var newTableDiv=document.createElement(\"div\");\n newTableDiv.appendChild(document.createElement(\"br\"));\n var newTable=document.createElement(\"table\");\n newTable.innerHTML=entries[0];\n newTable.createCaption().innerHTML=name;\n newTableDiv.appendChild(newTable);\n var button1=document.createElement(\"input\");\n button1.type=\"button\";\n button1.value=\"Show Table\";\n button1.onclick=showTable;\n newTableDiv.appendChild(button1);\n var delButton=document.createElement(\"input\");\n delButton.type=\"button\";\n delButton.value=\"Delete this table\";\n delButton.onclick=deleteTable;\n newTableDiv.appendChild(delButton);\n newTableDiv.appendChild(document.createElement(\"br\"));\n newTableDiv.appendChild(document.createTextNode(\"Modification options:\"));\n var modifyMethod=document.createElement(\"select\");\n var temp=document.createElement(\"option\");\n temp.text='Copy (do not modify)';\n modifyMethod.add(temp,null);\n var temp=document.createElement(\"option\");\n temp.text='Add';\n modifyMethod.add(temp,null);\n var temp=document.createElement(\"option\");\n temp.text='Subtract';\n modifyMethod.add(temp,null);\n var temp=document.createElement(\"option\");\n temp.text='Intersect';\n modifyMethod.add(temp,null);\n newTableDiv.appendChild(modifyMethod);\n newTableDiv.appendChild(document.createTextNode(\"Modify this table by\"));\n var modifyBy=document.createElement(\"input\");\n modifyBy.type=\"text\";\n newTableDiv.appendChild(modifyBy);\n newTableDiv.appendChild(document.createElement(\"br\"));\n newTableDiv.appendChild(document.createTextNode(\"Name for new table:\"));\n var newName=document.createElement(\"input\");\n newName.type=\"text\";\n newTableDiv.appendChild(newName);\n var button2=document.createElement(\"input\");\n button2.type=\"button\";\n button2.value=\"Replace this table\";\n button2.onclick=replaceTable;\n newTableDiv.appendChild(button2);\n var button3=document.createElement(\"input\");\n button3.type=\"button\";\n button3.value=\"Create as new table\";\n button3.onclick=newModTable;\n newTableDiv.appendChild(button3);\n newTableDiv.appendChild(document.createElement(\"br\"));\n record=new queryRecords(name,newTableDiv,newTable,button1,resultList,modifyMethod,modifyBy,newName);\n button1.queryObject=record;\n delButton.queryObject=record;\n button2.queryObject=record;\n button3.queryObject=record;\n queries[name]=record;\n document.getElementById(resultId).appendChild(newTableDiv);\n }", "title": "" }, { "docid": "00918f1f4497c7586e174386be2ab0aa", "score": "0.4969385", "text": "function resultAddRoomReservation(result){\n if (result.code == \"executed\") {\n if (result.jsonExpression == null) {\n View.showMessage(result.message);\n }\n else {\n var reserveInfo = eval(\"(\" + result.jsonExpression + \")\");\n var resId = reserveInfo.res_id;\n \n if (result.message != \"OK\") \n alert(result.message);\n \n if (resId != \"\") {\n alert(getMessage(\"CopyOk\"));\n \n //Close the form\n View.closeThisDialog();\n \n //Show by default the first editable report\n roomCopyReservController.opener.detailstabs.selectTab(\"info-reservations\");\n }\n }\n }\n else {\n View.showMessage(result.message);\n }\n}", "title": "" } ]
946c2be70b00a075b85117d36733fee6
Load configuration from congin.json file
[ { "docid": "96d40f4b2c10f7f96895d060df3fdc83", "score": "0.6347866", "text": "function loadConfig() {\n\t\t\t\t\t\t\t\n\tnconf.file({\n\t\tfile:configFile\n\t});\n\tnconf.defaults({\n\t\tbase_dir: __dirname,\n\t\tviews_dir: path.join(__dirname, 'build'),\n\t\tversion: pkg.version\n\t});\n}", "title": "" } ]
[ { "docid": "e85332fb3c1f1530e59b81c866c9dba2", "score": "0.7439537", "text": "function loadConfig() {\n\treturn JSON.parse(fs.readFileSync('config.json'));\n}", "title": "" }, { "docid": "e74478edab0aff6f0be397c3cb170b4c", "score": "0.7429934", "text": "function loadConfig() {\n return JSON.parse(fs.readFileSync(\"./server/config.json\"));\n}", "title": "" }, { "docid": "9a75852e8c02b717f5fdbfdba00b4623", "score": "0.72724056", "text": "function sycnLoad() {\n\n config = JSON.parse(di.fs.readFileSync(CONFIG_FILE_NAME, 'utf8'));\n\n}", "title": "" }, { "docid": "4cf286dbb7b93acb973f8b7059bf0954", "score": "0.72047806", "text": "function loadConfig() {\r\n var config = JSON.parse(fs.readFileSync(__dirname+ '/config.json', 'utf-8'));\r\n log('Configuration');\r\n for (var i in config) {\r\n config[i] = process.env[i.toUpperCase()] || config[i];\r\n if (i === 'oauth_client_id' || i === 'oauth_client_secret') {\r\n log(i + ':', config[i], true);\r\n } else {\r\n log(i + ':', config[i]);\r\n }\r\n }\r\n return config;\r\n}", "title": "" }, { "docid": "70b58bd04e02c0d9a9bfbd7905eadff6", "score": "0.7183503", "text": "function loadConfig() {\n var config = JSON.parse(fs.readFileSync(__dirname + '/config.json', 'utf-8'));\n for (var i in config) {\n config[i] = process.env[i.toUpperCase()] || config[i];\n }\n console.log('Configuration');\n console.log(config);\n return config;\n}", "title": "" }, { "docid": "0cc22c536d0f8f20d17a89026d6c5d8e", "score": "0.6992059", "text": "function loadJsonConfig () {\n\treturn JSON.parse(fs.readFileSync('./src/tokens.json'));\n}", "title": "" }, { "docid": "e079927b78d1f4529087ea67a6993bc5", "score": "0.69829506", "text": "_loadConfigFile() {\n if (this._existsAndNotAFolder(CONFIG_JSON)) {\n const fileContents = fs.readFileSync(CONFIG_JSON, 'utf8');\n try {\n const data = JSON.parse(fileContents);\n _.each(data.config, (valueCur, configCur) => {\n if (typeof(this._opts[configCur]) === 'undefined') {\n this._opts[configCur] = ((configCur.indexOf('Path') > -1) ? fixupPathForOS(valueCur) : valueCur);\n }\n });\n } catch (e) {\n this._exitWithError(ERROR_INVALID_CONFIG_FILE);\n }\n }\n }", "title": "" }, { "docid": "09fffb6c25d82010697a2c71fbe9dbf7", "score": "0.6921728", "text": "function loadConfigurations() {\n console.log(configFile);\n fetch(configFile)\n .then(response => response.json())\n .then(json => {\n config = json;\n logThis('configuration loaded is', config);\n initialize();\n })\n .catch(err => {\n logThis('Please verify if the config file is there.', 'Using defaults.');\n config = defaults;\n initialize();\n })\n }", "title": "" }, { "docid": "f7d71aeb745689e4099bdff5381f0d0e", "score": "0.685251", "text": "async function readConfig() {\n try {\n let file = await readFile('config.json');\n let obj = JSON.parse(file.toString());\n console.log(obj);\n } catch (error) {\n console.log(`An error occured ${error}`);\n }\n}", "title": "" }, { "docid": "7787cdaa57efaa7890f916dba1c9d171", "score": "0.6756379", "text": "function jsonConfig(name) {\n // Grab config from name.\n var configPath = [\n paths.config,\n name+'.json'\n ].join('/'),\n config = grunt.file.readJSON(configPath);\n // Assign to conf.\n conf[name] = config;\n }", "title": "" }, { "docid": "b0f5f72661e35bfc2016e98d4d7fff46", "score": "0.67418915", "text": "function loadFromFile() {\n let data;\n try {\n data = JSON.parse(jsmin.jsmin(fs.readFileSync(\n module.exports.configFileName, 'utf8')));\n logger.info('Loading controller configuration from [%s]',\n fs.realpathSync(module.exports.configFileName));\n } catch (err) {\n logger.error('Failed to load configuration from file [%s]',\n module.exports.configFileName);\n logger.error(err);\n throw (err);\n }\n return data;\n}", "title": "" }, { "docid": "1dd7c2ae15a1d39042bff6fe8b907076", "score": "0.6715551", "text": "function loadConfig() {\n var config = JSON.parse(fs.readFileSync(__dirname + configJson, 'utf-8'));\n for(var i in config) {\n config[i] = process.env[i.toUpperCase()] || config[i];\n }\n console.log('Wordpress API Configured for ' + environment + '');\n //console.log(config);\n return config;\n }", "title": "" }, { "docid": "c7ee4af8deb9642025fca35d4fe0f2b2", "score": "0.6690254", "text": "loadConfiguration() {\n const configManager = new ConfigManager()\n global.conf = configManager.getConfigurations()\n }", "title": "" }, { "docid": "2f66ee64836c5af70e649a3777f641b0", "score": "0.668131", "text": "function loadConfig() {\n var args = process.argv.slice(2); // remove unneeded boilerplate args\n if (args[0] != '--config') {\n console.error('arguments: --config CONFIG [--state STATE] [--properties CATALOG]');\n return new Promise(function (resolve, reject) {\n reject(\"missing required '--config' argument\");\n });\n }\n else {\n return lib.readFile(args[1]).then(function (buffer) {\n let config = JSON.parse(buffer.toString());\n // if (config instanceof configType) {\n // }\n return { config: config };\n });\n }\n}", "title": "" }, { "docid": "1198e2ba53258907ec43ea10cd4f82f9", "score": "0.6646621", "text": "LoadConfiguration() {\n if (configurationcontroller.__filesystem.existsSync(__appglobals.config_dataconfigFile)) {\n let file_content = configurationcontroller.__filesystem.readFileSync(__appglobals.config_dataconfigFile, __appglobals.config_fileEncoding);\n configurationcontroller.__config_list = JSON.parse(file_content);\n configurationcontroller.__CreateCards();\n __appglobals.RestartVisualElements();\n\n }\n }", "title": "" }, { "docid": "64688a8df299f2f5784309fdfcc57d30", "score": "0.65901434", "text": "config(path) {\n // if there exists a config.json file in the path, apply it\n fs.readFile(path + \"/config.json\", (error, data) => {\n if (error) {\n if (error.code === \"EACCES\")\n console.log(`No permission to read ${path}/config.json`);\n else if (error.code !== \"ENOENT\") throw error;\n } else {\n let options = null;\n try {\n options = JSON.parse(data);\n } catch (e) {\n console.log(e);\n }\n\n if (options) this._setOptions(options);\n }\n });\n }", "title": "" }, { "docid": "ef8dd0ad1ae16475c3c7a2d2e49b9d85", "score": "0.6580083", "text": "function _readConfig() {\n\tconst fs = require('fs');\n\ttry {\n\t\treturn obj = JSON.parse(fs.readFileSync('config.json'));\n\t} catch(e) {\n\t\tthrow new Error(\"VideoCreator: \" + e);\n\t}\n}", "title": "" }, { "docid": "a23f9d9a595a054a81dd38cb444095ed", "score": "0.6568938", "text": "load () {\n if (fs.existsSync(this.cfgfile))\n this.data = jsonfile.readFileSync(this.cfgfile)\n return this\n }", "title": "" }, { "docid": "34777a3a2d9870eb9a763bab5129c608", "score": "0.6558917", "text": "async function readConfig(filename) {\n let baseDir = Path.join(OS.homedir(), '.config', 'hashbrown-cli');\n \n try {\n let file = await FileHelper.read(Path.join(baseDir, filename + '.json'));\n\n if(!file || file.length < 1) { return {}; }\n\n return JSON.parse(file);\n\n } catch(e) {\n return {};\n\n }\n}", "title": "" }, { "docid": "9c4bfbdb08798fd9ccbe9e63e733671e", "score": "0.6523063", "text": "function setDBConfigFromFile() {\n var configJson = fs.readFileSync(__dirname + \"/config.json\").toString();\n console.log(\"USING DATA BASE CONFIG AS , IF INCORRECT MODIFY THE CONFIG.JSON FILE\");\n console.log(configJson);\n theDbConfig = JSON.parse(configJson);\n}", "title": "" }, { "docid": "82bba2bf307ab5fc54a94391096f7183", "score": "0.65198165", "text": "function loadConfig() {\n if (fs.existsSync('./config/dev/config.local.json')) {\n config = extend(true, config, require('./config/dev/config.local'));\n }\n return config;\n }", "title": "" }, { "docid": "8f73c604c9579d191541f921cbf4d0ac", "score": "0.6480408", "text": "function getConfigurationByFile(env) {\n const pathToConfigFile = path.resolve(\"cypress/config\", `${env}.config.json`);\n\n return fs.readJson(pathToConfigFile);\n }", "title": "" }, { "docid": "57c1178c8ed0af10b02c227f4c0fe153", "score": "0.6473586", "text": "function getConfig() {\n return JSON.parse(fs.readFileSync(path.join(exports.controllerDir, \"conf/iobroker.json\"), \"utf8\"));\n}", "title": "" }, { "docid": "2530f685343b095fcad3e9a92523c94e", "score": "0.6407238", "text": "function readHockeyConfig(configPath) {\n\tvar filePath = null;\n\tif(typeof configPath == 'undefined' ) {\n\t\tfilePath = path.join(process.cwd(), 'hockey.json');\n\t} else {\n\t\tfilePath = configPath;\n\t}\n\n\n\tvar config = null;\n\ttry { config = require(filePath); } catch(ex) {}\n\t// console.log('config: ' + JSON.stringify(config));\n\treturn config;\n}", "title": "" }, { "docid": "18aedeabb60a061e151d50db84efbcd3", "score": "0.6402751", "text": "function loadBotSettings() {\n\tconfigFile.read()\n\tconfig = configFile.get(\"config\").value()\n}", "title": "" }, { "docid": "c2921888a1fa610bacfb0fe514f8b7a7", "score": "0.6399253", "text": "function loadConfiguration(filename, silent)\n{\n try\n {\n filename = filename || defaults.CONFIG_FILENAME;\n var data = Filesystem.readFileSync(filename, 'utf8');\n return JSON.parse(data);\n }\n catch (error)\n {\n if (!silent)\n {\n console.warn('Warning: Could not load application configuration:');\n console.warn(' with path: '+filename);\n console.warn(' exception: '+error);\n console.warn('The default application configuration will be used.');\n console.warn();\n }\n return defaultConfiguration();\n }\n}", "title": "" }, { "docid": "a10796ef4b5f76a95b5ebe8a16598cc7", "score": "0.6392103", "text": "function getConfig() {\n return JSON.parse(fs.readFileSync(controllerDir + '/conf/iobroker.json'));\n}", "title": "" }, { "docid": "3e8a1b26c20d12ab0f24f303d2749037", "score": "0.6386065", "text": "function readConfigFile(callback) {\n fs.readFile('./config.json', 'utf8', function (err, data) {\n try {\n config = JSON.parse(data);\n\n if (callback) {\n callback();\n }\n }\n catch (e) {\n console.log(e);\n console.error('Could not load config file');\n }\n });\n}", "title": "" }, { "docid": "059f66ead48153e53535d84faaeaff61", "score": "0.6328561", "text": "init() {\n let userConfig = {};\n try {\n userConfig = JSON.parse(fs.readFileSync(defaultConfigLocation, 'utf8')); // eslint-disable-line no-sync\n } catch (e) {\n this.debug(e);\n this.log(chalk.red(`Unable to load wrhs config from ${defaultConfigLocation}`));\n\n if (e.code === 'ENOENT') {\n this.log(seeTheDocsMessage);\n }\n }\n\n this.config = userConfig;\n }", "title": "" }, { "docid": "04696756d65439a42e6097c9f0d9527d", "score": "0.6325857", "text": "function loadConfig(file)\n{\n config_file = file;\n}", "title": "" }, { "docid": "d94f3d8af1ba3881343303461b45f7ea", "score": "0.6322868", "text": "function load(path) {\n let json;\n try {\n json = utils_1.getJsonFile(path);\n }\n catch (e) {\n throw Error(`Could not load config at \"${path}\".\\n\\n${e}`);\n }\n assertAppConfig(json);\n return json;\n}", "title": "" }, { "docid": "8c6376cf6b696f1cf8caebcce58612f4", "score": "0.62573856", "text": "function read_config(path) {\n\tdebug.assert(path).is('string');\n\treturn FS.exists(path).then(function read_file(exists) {\n\t\tif(!exists) {\n\t\t\treturn {};\n\t\t}\n\t\treturn FS.readFile(path, {'encoding':'utf8'}).then(function parse_json(data) {\n\t\t\tdebug.assert(data).is('string');\n\t\t\treturn JSON.parse(data);\n\t\t});\n\t}).then(function init_config(config) {\n\t\tdebug.assert(config).is('object');\n\n\t\tif(config.applications === undefined) {\n\t\t\tconfig.applications = {};\n\t\t}\n\n\t\treturn config;\n\t});\n}", "title": "" }, { "docid": "d441ec67d71688b3d70f59af6d80769e", "score": "0.6243262", "text": "function loadConfigFileForAmMapChart() {\n $.getJSON(\"../js/jsonFilesForAmcharts/amMapJSONConfig.json\", function(jsonData) {\n am4core.createFromConfig(\n jsonData.mapchartdata,\n \"am-mapchart\",\n am4maps.MapChart\n );\n });\n}", "title": "" }, { "docid": "2ae0339c3f3f4bc0c79b1bdb2b1c13f6", "score": "0.6231302", "text": "function loadConfig(name, src) {\n // attempt to load\n var cosmic = cosmiconfig_1.cosmiconfigSync(name || '').search(src || '');\n // use what we found or fallback to an empty object\n var config = (cosmic && cosmic.config) || {};\n return config;\n}", "title": "" }, { "docid": "e4b4368aa5abc5db604e4e4c4b3b144e", "score": "0.62282026", "text": "function loadConfig() {\n\tvar fs = require( 'fs' );\n\tlet ymlFile = fs.readFileSync( './build/config.yml', 'utf8' );\n\treturn plugins.yaml.load( ymlFile );\n}", "title": "" }, { "docid": "c99183105d12bcac71ab1af449764d15", "score": "0.621132", "text": "static load() {\n if (configStore.data) {\n WindowManager.emit('store-update', configStore.data);\n }\n fs.readFile(configFile, 'utf8', (err, data) => {\n if (err) {\n configStore.data = configStore.defaultConfig;\n } else {\n configStore.data = JSON.parse(data);\n }\n WindowManager.emit('store-update', configStore.data);\n });\n }", "title": "" }, { "docid": "5983f1c6ceb583a5838f734dc9c681ed", "score": "0.6206374", "text": "function initializeConfigurations() {\n if (!fs.existsSync(path.join(__dirname,\"conf.json\"))) {\n fs.writeFileSync(path.join(__dirname,\"conf.json\"), JSON.stringify(defaultOptions, null, 4), \"utf-8\");\n } else {\n try {\n const conf = JSON.parse(fs.readFileSync(path.join(__dirname,\"conf.json\"), \"utf-8\"));\n putter.conf(conf);\n } catch (err) {}\n }\n}", "title": "" }, { "docid": "6e7a2aa12b64dc8ebda1e51a152e48cc", "score": "0.61794573", "text": "function loadConfig() {\n switch (process.env.NODE_ENV) {\n case 'production':\n return require('./config.prod');\n case 'development':\n return require('./config.dev');\n case 'test':\n return require('./config.test');\n default:\n throw new Error('NODE_ENV environment variable is not set.');\n }\n}", "title": "" }, { "docid": "a10550bfebed4bdf86649a585e888a0b", "score": "0.6139387", "text": "loadFromFile(fileName) {\n var fileBufer = fs.readFileSync(fileName);\n this.settingsJSON = JSON.parse(\n fileBufer\n );\n\n this.pythonPath = this.settingsJSON[\"PYTHON_PATH\"];\n }", "title": "" }, { "docid": "fd7a5fcaae53dc214e4fcbee32b77609", "score": "0.61213696", "text": "function loadConfig(){\r\n var configPath = (config && config._configPath) || defaultConfig._configPath || scriptName + '.conf';\r\n\r\n if (fs.existsSync(configPath)) {\r\n var mtime = fs.statSync(configPath).mtime;\r\n if ((configModified ? configModified.getTime() : null) !== mtime.getTime()) {\r\n //if (config && config.debug)\r\n resetConfig();\r\n configModified = mtime\r\n config._configModified = mtime;\r\n var data = String(fs.readFileSync(configPath));\r\n\r\n // zero byte config files are allowed\r\n if (data.length !== 0) {\r\n var json;\r\n // eval allows comments in the config file\r\n ////var json = JSON.parse(data);\r\n eval('json = \\n' + data);\r\n\r\n for (var i in json) {\r\n config[i] = json[i];\r\n }\r\n\r\n config._configPath = path.resolve(configPath);\r\n }\r\n compileConfig();\r\n }\r\n } else {\r\n if (configModified) {\r\n resetConfig();\r\n compileConfig();\r\n configModified = null;\r\n config._configModified = null;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "231789b4c8af8802786ce2f45d52f8de", "score": "0.6108692", "text": "function readConfig(cb) {\n fs.readFile(nservDir + 'domains.json', function (err, data) {\n error(err, \"Could not read proxy table.\");\n var config = JSON.parse(data);\n cb(config);\n });\n}", "title": "" }, { "docid": "bcec34a604d84a536d775bdaceef6183", "score": "0.61037344", "text": "async setupConfig() {\n this.config = new RainbowConfig(path.join(this.serviceDir, 'config'), this.serviceDir);\n await this.config.load();\n }", "title": "" }, { "docid": "7a358057fcaf3e4159ffb63360ce90a8", "score": "0.60944116", "text": "async loadConfig() {\n data = Object.assign({}, await config.load());\n\n // Request github token if necessary\n if (!data.token) {\n setTimeout(() => open('https://github.com/settings/tokens'), 2000);\n\n const {token} = await inquirer.prompt({\n type: 'input',\n name: 'token',\n message: 'I need a Github token, with \"repo\" rights (check your browser) : ',\n filter: tk => tk.trim()\n });\n\n data.token = token;\n\n await config.write(data);\n }\n }", "title": "" }, { "docid": "9444f3b55e4aad342979b5598bff4e17", "score": "0.6087575", "text": "function loadConfig(files) {\n if (files.length) {\n const file = files[0];\n const reader = new FileReader();\n reader.onload = function () {\n parseConfigJSON(this.result);\n };\n reader.readAsText(file);\n }\n}", "title": "" }, { "docid": "1e226ff1166ac5df0633317aadac0a72", "score": "0.60655534", "text": "async getConfigFromJson() {\n if (!this.config) {\n try {\n let res = await fetch(_CONFIG_FILE_PATH,_FETCH_ARGS);\n return res.json();\n } catch(err) {\n console.log(err);\n return null; \n }\n } else {\n return this.config;\n }\n \n }", "title": "" }, { "docid": "d543ed3eaa5df9963ef8707092ea48f3", "score": "0.6062023", "text": "function loadConfig(path) {\n\t\tvar glob = require('glob');\n\t\tvar object = {};\n\t \tvar key;\n\t \n\t\tglob.sync('*', {cwd: path}).forEach(function(option) {\n\t\t\tkey = option.replace(/\\.js$/,'');\n\t\t\tobject[key] = require(path + option);\n\t\t});\n\t \n\t\treturn object;\n\t}", "title": "" }, { "docid": "5eb68fe32ce2edd18688cca70cfa4a28", "score": "0.60614944", "text": "analyzePackage() {\n this.logger.info('Reading configuration from package.json file...');\n const file = './package.json';\n let pkg;\n try {\n let content = fs.readFileSync(file, 'utf8');\n pkg = JSON.parse(content);\n } catch (e) {\n this.logger.info('No configuration found. Setting defaults.');\n this.conf = this.createConfig();\n return;\n }\n const conf = pkg['api-console'];\n if (conf) {\n this.logger.info('Found API console configuration in package.json file.');\n }\n this.conf = this.createConfig(conf);\n this.logger.info('Configuration set.');\n }", "title": "" }, { "docid": "15265fc9ffd01b0b5b8b3d973553e3ec", "score": "0.60339934", "text": "function LoadSettings(filename) {\n console.log(\"reading settings from \" + filename);\n let settings = JSON.parse(JSON.minify(fs.readFileSync(filename, \"utf-8\")));\n console.log(\" projects_dir : \" + settings.projects_dir);\n console.log(\" npm_packages_dir : \" + settings.npm_packages_dir);\n console.log(\" github api tokens : \" + settings.github_api_tokens.length);\n return settings;\n}", "title": "" }, { "docid": "bb6706cd0d14fc54c3af8ed2244986db", "score": "0.60248643", "text": "static getConfigs() {\n try {\n const data = fs.readFileSync(DEFAULT_PATH,\n { encoding: 'utf8', flag: 'r' });\n return JSON.parse(data);\n } catch (err) {\n return JSON.stringify(Configuration.getDefaults());\n }\n }", "title": "" }, { "docid": "a3e9b72db33357f9442807b286b9aa96", "score": "0.60139745", "text": "static load() {\n try {\n this._configuration = requireAll({\n dirname: FULL_PATH,\n filter: /(.*)\\.js$/,\n });\n } catch (error) {\n if (error.code !== 'ENOENT') throw error;\n }\n }", "title": "" }, { "docid": "4b80bba747e90d5aed40ca5bdcf0bf0a", "score": "0.5984309", "text": "function loadConfig(path) {\n var glob = require('glob');\n var object = {};\n var key;\n\n glob.sync('*', { cwd: path }).forEach(function (option) {\n key = option.replace(/\\.js$/, '');\n object[key] = require(path + option);\n });\n\n return object;\n }", "title": "" }, { "docid": "76665e4dc0922c534c3d404c8e59f667", "score": "0.59743065", "text": "function readConfig(path){\n\td3.json(path, function(error, data) {\n\t\tif (error) return console.warn(error);\n\t\tconfigData = data;\n\t\treaddata();\n\t\t\n\t})\n}", "title": "" }, { "docid": "0f1548af45d6ecd3cc20bcf7f8f8e3a2", "score": "0.5972795", "text": "function loadConfig(path) {\n var glob = require(\"glob\");\n var object = {};\n\n glob.sync(\"*.js\", { cwd: path }).forEach(function (option) {\n var key = option.replace(/\\.js$/, \"\");\n var value = require(path + option);\n if (typeof (value) === 'function') {\n value = value(grunt);\n }\n object[key] = value;\n });\n\n return object;\n }", "title": "" }, { "docid": "dd4b7283b268920e00c2e85c04b30d69", "score": "0.59646976", "text": "function load() {\n\tif (!config) {\n\t\tvar path = scan();\n\t\tconfig = require(path);\n\t}\n\treturn config;\n}", "title": "" }, { "docid": "2fe9868bf04120ed6332f3016be3c293", "score": "0.59619516", "text": "function requireConfig (path) {\n try {\n return require('../studio/sanity.json')\n } catch (e) {\n console.error(\n 'Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js'\n )\n return {\n api: {\n projectId: process.env.SANITY_PROJECT_ID || '',\n dataset: process.env.SANITY_DATASET || ''\n }\n }\n }\n}", "title": "" }, { "docid": "b991ce8c95943e5aac15dd2f5f391485", "score": "0.58993465", "text": "function loadJSON(callback) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', './config.json', true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(JSON.parse(xobj.responseText));\n }\n };\n xobj.send(null); \n}", "title": "" }, { "docid": "6b97947e4b2ec9a73684c92b4d1fb965", "score": "0.5898757", "text": "function loadConfig(){\n return new Promise(function(resolve){\n fs.readFile(CONFIG_FILENAME, {encoding: \"utf8\"}, function(err, data) {\n if (err) {\n // The config file doesn't exist, so just use a copy of the defaults.\n config = getDefaultConfig();\n } else {\n try {\n var c = validateConfig(data);\n if (c) {\n config = c;\n } else {\n console.warn(\"WARNING: The todoview config in %s is not valid, using default config instead.\", CONFIG_FILENAME);\n config = getDefaultConfig();\n }\n } catch (e) {\n console.warn(\"WARNING: The todoview config in %s is not valid JSON, using default config instead.\", CONFIG_FILENAME);\n config = getDefaultConfig();\n }\n }\n resolve(true);\n });\n });\n}", "title": "" }, { "docid": "c5c2020d43de0eac040844bdfa05c48f", "score": "0.58902574", "text": "getConfig(configName) {\n\t\tconst environment = process.env.ENVIROMENT;\n\t\treturn require(`../../../configs/${environment.toLowerCase()}/${configName}.config.js`);\n\t}", "title": "" }, { "docid": "f46df20212321a71d27d25b942b680f9", "score": "0.5879331", "text": "function loadConfig(path) {\n 'use strict';\n\n var glob = require('glob'),\n object = {},\n key;\n\n glob.sync('*', {cwd: path}).forEach(function (option) {\n key = option.replace(/\\.js$/, '');\n object[key] = require(path + option);\n });\n\n return object;\n}", "title": "" }, { "docid": "92fbc33ab22352b18e7cd16132868660", "score": "0.586458", "text": "function fnLoadConfig(){\n // if there's a \"config.json\" file, try to read from it\n if (fs.existsSync(`${CFG}/config.json`)){\n try {\n const raw = fs.readFileSync(`${CFG}/config.json`, \"utf8\");\n const parsed = JSON.parse(raw);\n return { config: parsed, rawConfig: raw, sourceConfig: `${CFG}/config.json` };\n }\n catch (error){\n return { config: false, rawConfig: false, sourceConfig: false };\n }\n }\n // otherwise, try to read from \"remote-api.config.json\",\n // in case \"config.gen.js\" is missing and Remote API is running\n else if (fs.existsSync(`${CFG}/config.gen.js`) !== true && fnIsRunning(\"node /startup/remote-api/index.js\")) {\n try {\n const raw = fs.readFileSync(`${CFG}/remote-api.config.json`, \"utf8\");\n const parsed = JSON.parse(raw);\n return { config: parsed, rawConfig: raw, sourceConfig: `${CFG}/remote-api.config.json` };\n }\n catch (error){\n return { config: false, rawConfig: false, sourceConfig: false };\n }\n }\n\n return { config: false, rawConfig: false, sourceConfig: false };\n}", "title": "" }, { "docid": "ebc027505aefd024676ed49f8c8b6218", "score": "0.586188", "text": "function readConfig(defaultConfig, configPath = \"./config.json\"){\n var configJson = {} ;\n try{\n configJson = JSON.parse(fs.readFileSync(configPath, 'utf8')) ;\n } catch(e){\n console.log( \"Erro ao ler o config\", e ) ;\n }\n return merge( defaultConfig, configJson ) ;\n}", "title": "" }, { "docid": "ebf958d14fa5f82215c8ac3f321d3286", "score": "0.5854637", "text": "async init(configPath = 'config.yml') {\n let me = this;\n return new Promise(async (resolve, reject) => {\n fs.readFile(configPath, 'utf8', (err, data) => {\n if(err) {\n reject(err);\n return;\n }\n me.config = yaml.safeLoad(data);\n resolve(me.config);\n });\n });\n\n }", "title": "" }, { "docid": "f1fa01b79d21dd43ddb17f5903b7d584", "score": "0.5814344", "text": "function readConfigurationData() {\n\n return new Promise((resolve, reject) => {\n console.info('Reading configuration data...');\n\n // Read input file\n const configFilePath = path.join(__dirname, '../config.conf');\n const lineReader = readline.createInterface({\n input: fs.createReadStream(configFilePath)\n });\n\n lineReader.on('line', line => {\n var lineArr = line.split('=');\n\n switch (lineArr[0]) {\n case 'repositoriesURL':\n configData.repositoriesURL = lineArr[1];\n break;\n case 'username':\n configData.username = lineArr[1];\n break;\n case 'password':\n configData.password = lineArr[1];\n break;\n case 'interestedMembers':\n configData.interestedMembers = lineArr[1].split(':');\n break;\n default:\n break;\n }\n });\n\n lineReader.on('close', () => {\n console.info('Finish reading configuration data.');\n resolve(configData);\n });\n });\n}", "title": "" }, { "docid": "6a13598119c15a67f534ec1ec1313f82", "score": "0.5805005", "text": "loadConfig() {\n this.filename(this.configFile());\n this.loadSync();\n\n this.on(\"schema.invalid\" , (err) => {\n Logger.error(err);\n });\n\n if ( this.invalid() ) {\n throw new Error(`The config file ${ this.configFile() } isn't a valid Mount File`);\n }\n }", "title": "" }, { "docid": "a3b7836095eae7b39dc92719bb3de060", "score": "0.5801845", "text": "readConfig(fileRef) {\n const { filename, error: error2 } = fileRef;\n if (error2) {\n fileRef.error = error2 instanceof ImportError ? error2 : new ImportError(`Failed to read config file: \"${filename}\"`, error2);\n return { __importRef: fileRef };\n }\n const s = {};\n try {\n const r = this.cspellConfigExplorerSync.load(filename);\n if (!r?.config)\n throw new Error(`not found: \"${filename}\"`);\n Object.assign(s, r.config);\n normalizeRawConfig(s);\n validateRawConfig(s, fileRef);\n } catch (err) {\n fileRef.error = err instanceof ImportError ? err : new ImportError(`Failed to read config file: \"${filename}\"`, err);\n }\n s.__importRef = fileRef;\n return s;\n }", "title": "" }, { "docid": "46d72a575b3f3c02937166983d5f4c84", "score": "0.5796573", "text": "function readConfiguration(done) {\n try {\n var configPath = path.join(__dirname, 'config.json');\n\n if (!fs.existsSync(configPath)) {\n configPath = path.join(process.cwd(), 'config.json');\n }\n\n var config = JSON.parse(fs.readFileSync(configPath));\n\n logger.info('configuration successfully read: %s', configPath);\n\n done(null, config);\n } catch (e) {\n done(new Error('unable to read the configuration: ' + e.message));\n }\n}", "title": "" }, { "docid": "dcee20004118bfdaaf888a2fac5cb4fc", "score": "0.57875735", "text": "function requireConfig(path) {\n try {\n return require(path);\n } catch (e) {\n console.error(\n 'Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js',\n );\n return {\n api: {\n projectId: process.env.SANITY_PROJECT_ID || '',\n dataset: process.env.SANITY_DATASET || '',\n },\n };\n }\n}", "title": "" }, { "docid": "8896f87eea70c37032b05224166dfc9e", "score": "0.57820374", "text": "getConfig() {\n return fetch('/admin/config.json')\n .then(function(response) {\n return response\n .json()\n .then(function(json) {\n return json;\n });\n });\n }", "title": "" }, { "docid": "0db3397b1be5b591fe6f4c5a186d4888", "score": "0.57739943", "text": "function readConfig(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function() {\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\n callback(rawFile.responseText);\n }\n }\n rawFile.send(null);\n}", "title": "" }, { "docid": "b99fbf513d6deb4b70083e7264bffe08", "score": "0.57608974", "text": "function loadConfig (cfgPath, ctx) {\n cfgPath = path.resolve(cfgPath)\n console.log(`Loading custom configuration from ${cfgPath}`)\n const cfg = require(cfgPath)\n // Drop \"undefined\"s\n Object.keys(cfg).forEach(key => {\n if (cfg[key] === undefined) {\n delete cfg[key]\n }\n })\n ctx.config = { ...ctx.config, ...cfg }\n\n if (ctx.config.downloadLinks) {\n const dlp = path.resolve(path.dirname(cfgPath), ctx.config.downloadLinks)\n ctx.config.downloadLinks = JSON.parse(fs.readFileSync(dlp).toString())\n }\n\n if (ctx.config.indexDownloadLinks) {\n const idlp = path.resolve(path.dirname(cfgPath), ctx.config.indexDownloadLinks)\n ctx.config.indexDownloadLinks = JSON.parse(fs.readFileSync(idlp).toString())\n }\n\n return ctx\n}", "title": "" }, { "docid": "d2ec8b0b0ddf92209a73e0e3cec0d727", "score": "0.5758076", "text": "function doConfigurationLoad()\n{\n\t// Debug\n\tconsole.log( 'Configuration.' );\n\t\n\t// Set configuration details\n\tconfiguration = JSON.parse( xhr.responseText );\n\t\n\t// Bluemix\n\tIBMBluemix.initialize( configuration.bluemix );\n\t\t\n\t// Cloud Code\n\tibmcloud = IBMCloudCode.initializeService();\t\n\n\t// Get initial weather from server\n\tibmcloud.get( WEATHER_SERVICE ).then( function( results ) {\n\t\tvar data = null;\n\n\t\t// Debug\n\t\tconsole.log( 'Cloud Code.' );\n\n\t\t// Parse JSON results\n\t\tdata = JSON.parse( results );\n\n\t\t// Update user interface\n\t\tupdate( data.docs[0] );\n\t},\n\tfunction( error ) {\n\t console.log( error );\n\t} );\t\n\t\n\t// Clean up\n\txhr.removeEventListener( 'load', doConfigurationLoad );\n\txhr = null;\n}", "title": "" }, { "docid": "f10df8eb0bfbf07dedfe106814bcb267", "score": "0.5754372", "text": "async loadConfig (consoleClient) {\n // are we in a local aio app project?\n const localProject = aioConfig.get('project', 'local')\n if (localProject && localProject.org && localProject.workspace) {\n // is the above check enough?\n aioLogger.debug('retrieving console configuration from local aio application config')\n const workspaceIntegration = this.extractServiceIntegrationConfig(localProject.workspace)\n // note in the local app aio, the workspaceIntegration only holds a reference, the\n // clientId is stored in the dotenv\n aioLogger.debug(`loading local IMS context ${workspaceIntegration.name}`)\n const integrationCredentials = (await context.get(workspaceIntegration.name)).data\n if (!integrationCredentials || !integrationCredentials.client_id) {\n throw new Error(`IMS configuration for ${workspaceIntegration.name} is incomplete or missing`)\n }\n\n return {\n isLocal: true,\n org: { id: localProject.org.id, name: localProject.org.name, code: localProject.org.ims_org_id },\n project: { id: localProject.id, name: localProject.name, title: localProject.title },\n workspace: { id: localProject.workspace.id, name: localProject.workspace.name },\n integration: { id: workspaceIntegration.id, name: workspaceIntegration.name, clientId: integrationCredentials.client_id }\n }\n }\n\n // use global console config\n aioLogger.debug('retrieving console configuration from global config')\n const { org, project, workspace } = aioConfig.get(CONSOLE_CONFIG_KEY) || {}\n if (!org || !project || !workspace) {\n throw new Error(`Your console configuration is incomplete.${EOL}Use the 'aio console' commands to select your organization, project, and workspace.${EOL}${this.consoleConfigString(org, project, workspace).value}`)\n }\n let { integration, workspaceId } = aioConfig.get(EVENTS_CONFIG_KEY) || {}\n if (integration) {\n aioLogger.debug(`found integration in ${EVENTS_CONFIG_KEY} cache with workspaceId=${workspaceId}`)\n if (workspaceId !== workspace.id) {\n aioLogger.debug(`cannot use cache as workspaceId does not match selected workspace: ${workspace.id}`)\n }\n }\n if (!integration || workspaceId !== workspace.id) {\n aioLogger.debug('downloading workspace JSON to retrieve integration details')\n // fetch integration details\n const consoleJSON = await consoleClient.downloadWorkspaceJson(org.id, project.id, workspace.id)\n const workspaceIntegration = this.extractServiceIntegrationConfig(consoleJSON.body.project.workspace)\n const integrationType = workspaceIntegration.integration_type\n const credentialJsonKey = INTEGRATION_TYPES_TO_JSON_KEYS_MAP[integrationType]\n integration = {\n id: workspaceIntegration.id,\n name: workspaceIntegration.name,\n clientId: workspaceIntegration[credentialJsonKey].client_id\n }\n\n // cache the integration details for future use\n aioLogger.debug(`caching integration details with workspaceId=${workspace.id} to ${EVENTS_CONFIG_KEY}`)\n aioConfig.set(EVENTS_CONFIG_KEY, { integration, workspaceId: workspace.id }, false)\n }\n return {\n isLocal: false,\n org,\n project: { id: project.id, name: project.name, title: project.title },\n workspace,\n integration\n }\n }", "title": "" }, { "docid": "4f123b87ca2b7d0903b5d6528cc7be29", "score": "0.5745868", "text": "getConfigFile() {\n const configName = this.getConfigName();\n let fileContents = '';\n let json = null;\n\n if (configName) {\n try {\n fileContents = fs.readFileSync(configName, 'UTF-8');\n } catch (e) {\n Log.error(chalk.red(`\\nConfiguration not found. Error: ${configName} ::: ${e.message}`));\n }\n\n try {\n json = JSON.parse(fileContents);\n } catch (e) {\n Log.error(chalk.red(`\\nThere was a problem parsing the configuration file : ${configName} ::: ${e.message}`));\n }\n\n return json;\n }\n Log.warn('No configuration file present, please create either davos.json or dw.json');\n return null;\n }", "title": "" }, { "docid": "356725d91e927835ec39cf066bf692da", "score": "0.57436174", "text": "loadConfig() {\n const data = vscode.workspace.getConfiguration('code-for-ibmi');\n this.homeDirectory = data.homeDirectory;\n this.libraryList = data.libraryList.split(',').map(item => item.trim());\n this.spfShortcuts = data.sourceFileList;\n this.tempLibrary = data.temporaryLibrary;\n this.logCompileOutput = data.logCompileOutput || false;\n this.autoRefresh = data.autoRefresh;\n this.sourceASP = (data.sourceASP.length > 0 ? data.sourceASP : undefined);\n }", "title": "" }, { "docid": "6dd812417bbc6bfb9f54d7be98a4274f", "score": "0.5735874", "text": "function _readConfigFiles(){\n\n\t\t//read configuration file if available\n\t\ttry{\n\t\t\tvar content = fs.readFileSync(applicationJSON, configuration.encoding);\n\t\t\tif(content){\n\t\t\t\tcontent = content.replace(/\\$\\{root\\}/gm, path.dirname(require.main.filename));\n\t\t\t\tmodule.exports.configuration = configuration = JSON.parse(content);\n\t\t\t}\n\t\t}\n\t\tcatch(ex){\n\t\t\tpublishError(ex);\n\t\t\treturn false;\n\t\t}\n\n\t\t//setup verbose interim start modes\n\t\tvar verboseRoute = configuration.verbose.route;\n\t\tvar verboseCache = configuration.verbose.cache;\n\t\tconfiguration.verbose.route = function(){};\n\t\tconfiguration.verbose.cache = function(){};\n\n\t\t//read routes configuration file if available\n\t\ttry{\n\t\t\tvar content = fs.readFileSync(routesJSON, configuration.encoding);\n\t\t\tif(content)\n\t\t\t\tRouting.routes = JSON.parse(content).routes;\n\t\t}\n\t\tcatch(ex){\n\t\t\tpublishError(ex);\n\t\t}\n\n\t\t//check for safeString method\n\t\tif(configuration.template.engine == 'handlebars'){\n\t\t\tconfiguration.template.safeString = function(html){\n\t\t\t\treturn new (require('handlebars')).SafeString(html);\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tvar dir = [configuration.path.root, configuration.path.application].join(path.sep);\n\t\t\tvar bootstrap = Zenhance.script(dir, 'Bootstrap');\n\t\t\tif(bootstrap){\n\n\t\t\t\tbootstrap = new bootstrap();\n\n\t\t\t\t//reflect and execute all init methods\n\t\t\t\tfor (var i of Object.getOwnPropertyNames(Object.getPrototypeOf(bootstrap))) {\n\t\t\t\t\tvar method = bootstrap[i].name;\n\n\t\t\t\t\tif(method.indexOf('init') == 0)\n\t\t\t\t\t\tbootstrap[method]();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ex){\n\t\t\tpublishError(ex);\n\t\t\treturn false;\n\t\t}\n\t\t//setup verbose modes\n\t\tconfiguration.verbose.route = verboseRoute ? verbose : function(){};\n\t\tconfiguration.verbose.cache = verboseCache ? verbose : function(){};\n\n\t\tnext();\n\t}", "title": "" }, { "docid": "06c54b7857b3057eb385fae84c6a17a5", "score": "0.57211626", "text": "function loadConfig() {\n\n if (checkFileExists('config.yml')) {\n // config.yml exists, load it\n var ymlFile = fs.readFileSync('config.yml', 'utf8');\n return yaml.load(ymlFile);\n\n } else {\n // Exit if config.yml & config-default.yml do not exist\n notify('Exiting process, no config file exists.');\n process.exit(1);\n }\n}", "title": "" }, { "docid": "7569860befb07d62776c605776ca78e7", "score": "0.56866795", "text": "function getConfig() {\n const tasks = {};\n let config = { tasks };\n if (!fs.existsSync(CONFIG_FILENAME) && isInteractive()) {\n console.log(CONFIG_FILENAME, 'does not exist.');\n const answer = readline.question('Do you want to create one (Y/n)? ').toUpperCase();\n if (answer === 'Y' || answer === 'YES') {\n let conf = SAMPLE_CONFIG.trim();\n if (os.type() === 'Windows_NT') {\n // ping on Window does not support \"-c\"\n conf = conf.replace(/ping -c/gi, 'ping -n');\n }\n fs.writeFileSync(CONFIG_FILENAME, conf, 'utf-8');\n return yaml.load(SAMPLE_CONFIG);\n } else {\n console.error('Can not continue, configuration does not exist!');\n process.exit(-1);\n }\n } else {\n try {\n const contents = fs.readFileSync(CONFIG_FILENAME, 'utf-8');\n config = yaml.load(contents);\n } catch (e) {\n console.error('Can not load configuration file');\n console.error(e.toString());\n process.exit(-1);\n }\n }\n return config;\n}", "title": "" }, { "docid": "04af111b312773728dfe8c19a03108fa", "score": "0.567932", "text": "function read() {\n var nconf = require('nconf'),\n environment = process.env.NODE_ENV;\n\n // verify that $NODE_ENV is set, if not, fall back to development\n if (environment && typeof(environment) === 'string') {\n environment = environment.trim().toLowerCase();\n }\n\n switch(environment) {\n case 'production':\n case 'staging':\n case 'qa':\n case 'integration':\n case 'development':\n case 'localhost':\n case 'test':\n break;\n default:\n environment = 'development';\n }\n\n nconf.clear();\n nconf.reset();\n\n // priority #1 - overridden key/value pairs that will always be used\n nconf.overrides({\n environment: environment\n });\n\n // priority #2 - read from command line arguments using the optimist module\n nconf.argv();\n\n // priority #3 - read from environmental variables\n // sub keys like { database : { host: 'localhost'} } translate to database_host\n nconf.env({\n separator: '_'\n /* whitelist: [] */\n });\n\n // priority #4 - read from values in the environmental json file\n //nconf.add('optional', { type: 'file', file: 'app/config/config.json' });\n\n // priority #5 - hard-coded values loaded from $NODE_ENV.json\n nconf.add('environment', { type: 'file', file: 'server/config/' + environment + '.json' });\n // force the two files to apply in order; https://github.com/flatiron/nconf/issues/15\n nconf.load();\n\n // priority #6 - hard-coded default values loaded from defaults.json\n try {\n nconf.defaults(require('../config/defaults.json'));\n } catch (e) {\n throw('failed to read the \"server/config/defaults.json\" file');\n }\n\n nconf.reload = reload;\n\n return nconf;\n}", "title": "" }, { "docid": "8f01a8670f4a062652c7ee14a89749e5", "score": "0.56530166", "text": "function loadConfig(builder){\n\treturn builder.loadConfig('system.config.js')\n\t .then(() => builder);\n}", "title": "" }, { "docid": "17ad0920cf6a55c310a0f7d899fc3571", "score": "0.56469804", "text": "function loadAppSettings() {\n const settingsPath = path.join(__dirname, 'config', 'settings.json');\n if (!fs.existsSync(settingsPath)) {\n const msg = `App settings file \"${settingsPath}\" not found.`;\n console.error(msg);\n throw new Error(msg);\n }\n try {\n const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8') || '{}');\n const settingsOverrides = process.env['DATALAB_SETTINGS_OVERRIDES'];\n if (settingsOverrides) {\n // Allow overriding individual settings via JSON provided as an environment variable.\n const overrides = JSON.parse(settingsOverrides);\n for (const key of Object.keys(overrides)) {\n settings[key] = overrides[key];\n }\n }\n return settings;\n }\n catch (e) {\n console.error(e);\n throw new Error(`Error parsing settings overrides: ${e}`);\n }\n}", "title": "" }, { "docid": "b7d8ebbadf4c96e8e4871a132f8ba4b2", "score": "0.56336224", "text": "function loadConfiguration( itcb ) {\n function onConfigLoaded( err, formsConfig ) {\n if ( err ) {\n Y.log( 'Could not load forms config: ' + JSON.stringify( err ), 'warn', NAME );\n return itcb( err );\n }\n pack.config = formsConfig;\n itcb( null );\n }\n Y.doccirrus.formsconfig.getConfig(user, onConfigLoaded);\n }", "title": "" }, { "docid": "dab305f4273e8202efb0db6af846b542", "score": "0.56230575", "text": "function _loadConfig(configPath){\n\n // try to load one file\n if(path.extname(configPath) === '.js'){\n return require(configPath);\n }\n // try to load config folder\n else{\n var config = {};\n var files = fs.readdirSync(configPath);\n files = files.filter(function(entry){\n return path.extname(entry) === '.js';\n });\n files.forEach(function(filePath){\n var file = require(path.join(configPath, filePath));\n config = _.merge(config, file);\n });\n\n // load specific env config\n return config;\n }\n }", "title": "" }, { "docid": "bd45bdefb6844e437d3d7e9b66d7af02", "score": "0.5613666", "text": "readConfig(fileRef) {\n // cspellConfigExplorerSync\n const { filename, error } = fileRef;\n if (error) {\n fileRef.error =\n error instanceof ImportError_1.ImportError\n ? error\n : new ImportError_1.ImportError(`Failed to read config file: \"${filename}\"`, error);\n return { __importRef: fileRef };\n }\n const s = {};\n try {\n const r = this.cspellConfigExplorerSync.load(filename);\n if (!r?.config)\n throw new Error(`not found: \"${filename}\"`);\n Object.assign(s, r.config);\n (0, normalizeRawSettings_1.normalizeRawConfig)(s);\n validateRawConfig(s, fileRef);\n }\n catch (err) {\n fileRef.error =\n err instanceof ImportError_1.ImportError ? err : new ImportError_1.ImportError(`Failed to read config file: \"${filename}\"`, err);\n }\n s.__importRef = fileRef;\n return s;\n }", "title": "" }, { "docid": "f47f5262ea4a1c491b0752fb38a229b8", "score": "0.5588513", "text": "function readConfigFile(path, callback) {\n fs.readFile(path, \"utf8\", (err, text) => {\n if (err) {\n // Something went wrong reading the file\n console.error(err);\n callback(null);\n return;\n }\n let data = null;\n try {\n data = JSON.parse(text);\n } catch (e) {\n // Something went wrong parsing the file contents\n console.error(e);\n }\n callback(data);\n });\n}", "title": "" }, { "docid": "4e59f7c505118e20ed541ceffc331be7", "score": "0.5587387", "text": "function readConfigFile(key, config) {\n if(config[key]) {\n let filePath = config[key];\n\n // check if config file exists\n if(fs.existsSync(filePath)) {\n config[key] = fs.readFileSync(filePath);\n } else {\n throw new Error(`File, ${filePath}, not found!!`);\n }\n }\n return config;\n}", "title": "" }, { "docid": "08816c16e1f49b9d0c110455aeed5d99", "score": "0.55837876", "text": "function loadConfigFile()\n{\n\tvar filename = $(\"#txtConfigFilename\").val();\n\n\tif(filename)\n\t{\n\t\t$.getJSON(filename, function(data)\n\t\t\t{\n\t\t\t\t//\tOn success, data will contain the configuration settings.\n\t\t\t\tif(data)\n\t\t\t\t{\n\t\t\t\t\tif(data.HVPVersion > 0.0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//\tAny version of file.\n\t\t\t\t\t\tconsole.log(`Configuration file loaded: ${filename}`);\n\t\t\t\t\t\tselectedButton = null;\n\t\t\t\t\t\tselectedTimeline = null;\n\t\t\t\t\t\tconfigData = data;\n\t\t\t\t\t\tif(configData.Buttons)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tselectedButton = configData.Buttons[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(configData.Timelines)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tselectedTimeline = configData.Timelines[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapplyConfig();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}", "title": "" }, { "docid": "66d035e7bb00fc74fe8a7b1a49713735", "score": "0.55805254", "text": "function get_config(svg_path, root, fs) {\n let dirs = path.relative(root, svg_path).split(path.sep);\n let config = {};\n dirs.forEach(function (dir, index) {\n // Search for index.json in all folders from the filepath up to root\n const json_path = path.join(root, ...dirs.slice(0, index), \"index.json\");\n if (fs.existsSync(json_path)) {\n // Load every index.json found\n let subconfig = JSON.parse(fs.readFileSync(json_path));\n // If it has is an \"import\", import that configuration\n if (subconfig.import) {\n const extend_path = path.join(json_path, \"..\", subconfig.import);\n _.merge(config, get_config(extend_path, root, fs));\n _.unset(subconfig, \"import\");\n }\n // In any case, merge this index.json\n _.merge(config, subconfig);\n }\n });\n return config;\n}", "title": "" }, { "docid": "c2e7709008bfaf402731a9640e1fe2b3", "score": "0.5572443", "text": "function readConfigFile() {\n\treturn ini.parse(readFileSync(confFile, 'utf-8'));\n}", "title": "" }, { "docid": "a2c25747becd1a3be02b05fb8b58eb66", "score": "0.5558418", "text": "function setUpConfiguration() {\n var env;\n\n config\n .argv()\n .env()\n ;\n env = config.get('NODE_ENV') || 'production';\n config\n .file({ \n file: './config/config.json' \n })\n .add('env', {\n type: 'file'\n , file: './config/environments/' + env + '.json' \n })\n .set('root', __dirname + '/server')\n ;\n}", "title": "" }, { "docid": "c61f19cb7e081be916309a18389d0f88", "score": "0.55583984", "text": "static loadFromFileOrDefault(jsonFilename) {\r\n let commandLineJson = undefined;\r\n if (node_core_library_1.FileSystem.exists(jsonFilename)) {\r\n commandLineJson = node_core_library_1.JsonFile.loadAndValidate(jsonFilename, CommandLineConfiguration._jsonSchema);\r\n }\r\n return new CommandLineConfiguration(commandLineJson);\r\n }", "title": "" }, { "docid": "17764d9ccf602be4e3170dcd2a27d194", "score": "0.5550302", "text": "function getConfiguration () {\n return configuration;\n}", "title": "" }, { "docid": "d1c7a5ef04c733375a32ca66da20a085", "score": "0.55346614", "text": "function ConfigService($http) {\n this.defaults = {auth: {type: 'liteauth',\n url: '/auth/v1.0'}};\n this.conf = $http.get('config.json');\n}", "title": "" }, { "docid": "4f8e6c0ef5f7af50cbe805cd829eb1ae", "score": "0.5533451", "text": "configuring() {\n this.config.set('projectName', this.projectName);\n this.config.set('gameFolder', this.gameFolder);\n }", "title": "" }, { "docid": "a313148d6987abad6859f35df7b9a62a", "score": "0.55301577", "text": "configuring(){\n this.confg.set(DEFAULT_CONFIG);\n }", "title": "" }, { "docid": "d95dc1e00e1f5cb310bcd9530ef0d60f", "score": "0.55291206", "text": "function load() {\n\n if (!fs.existsSync(file)) return;\n\n fs.readFile(file, (err, d) => {\n if (err) throw err;\n data = JSON.parse(d);\n });\n\n}", "title": "" }, { "docid": "3f7c0b31c1bd7c4c6b6da8e078830bf6", "score": "0.55220604", "text": "static loadConfig(){\n return loadJS('MiniTests/_config.js')\n}", "title": "" }, { "docid": "ab90f3efb30f91852513a629af9f3fb1", "score": "0.55170023", "text": "function loadCustomConfig () {\n\tvar settings = vscode.workspace.getConfiguration(packageJson.displayName);\n\tcustomConfig = settings.get(\"config\");\n\n\tvar rootPath = vscode.workspace.rootPath;\n\tif (rootPath) {\n\t\tvar configFilePath = path.join(rootPath, configFileName);\n\t\tif (fs.existsSync(configFilePath)) {\n\t\t\ttry {\n\t\t\t\tcustomConfig = JSON.parse(fs.readFileSync(configFilePath, \"utf8\"));\n\t\t\t\tvscode.window.showInformationMessage(configOverride);\n\t\t\t} catch (ex) {\n\t\t\t\tvscode.window.showWarningMessage(badConfig + \"'\" + configFilePath + \"' (\" + (ex.message || ex.toString()) + \")\");\n\t\t\t}\n\t\t}\n\t}\n\n\t// Re-lint all open files\n\t(vscode.workspace.textDocuments || []).forEach(lint);\n}", "title": "" }, { "docid": "3c57236466edc88ae3dc445dec40355c", "score": "0.5515672", "text": "function getConfiguration() {\n return configuration;\n}", "title": "" }, { "docid": "d19504e52b0b8203d207233a01cecf12", "score": "0.5497881", "text": "function getConfig(name) {\n\n var filename = name + '.conf';\n var host_filename = name + '.' + os.hostname() + '.conf';\n var local_filename = name + '.local.conf';\n\n var data = []; // undefined;\n\n fs.existsSync(filename) && data.push(fs.readFileSync(filename) || null);\n fs.existsSync(host_filename) && data.push(fs.readFileSync(host_filename) || null);\n fs.existsSync(local_filename) && data.push(fs.readFileSync(local_filename) || null);\n\n if (!data[0] && !data[1])\n throw new Error(\"Unable to read config file:\" + (filename + '').magenta.bold)\n\n function merge(dst, src) {\n _.each(src, function(v, k) {\n if (_.isArray(v)) {\n dst[k] = [];\n merge(dst[k], v);\n }\n // if(_.isArray(v)) { if(!_.isArray(dst[k])) dst[k] = [ ]; merge(dst[k], v); }\n else if (_.isObject(v)) {\n if (!dst[k] || typeof(dst[k]) != 'object') dst[k] = {};\n merge(dst[k], v);\n } else {\n if (_.isArray(src)) dst.push(v);\n else dst[k] = v;\n }\n })\n }\n\n var o = {}\n _.each(data, function(conf) {\n if (!conf || !conf.toString('utf-8').length)\n return;\n var layer = eval('(' + conf.toString('utf-8') + ')');\n merge(o, layer);\n })\n\n return o;\n}", "title": "" }, { "docid": "4d66a35ff5927631b65d33e95206671c", "score": "0.549164", "text": "loadConfig(config) {\n if (config.hasOwnProperty('vars')) {\n Object.assign(this.vars, config.vars);\n }\n\n if (config.hasOwnProperty('id')) {\n Module.assignID(config.id, this);\n this.id = config.id;\n }\n\n if (config.hasOwnProperty('class')) {\n this.class = config.class;\n }\n\n if (config.hasOwnProperty('plugins')) {\n this.plugins = config.plugins;\n }\n\n }", "title": "" } ]
a181f20d4069236d97a36788c3651a63
Find the max in array (context : personalitiesWeight)
[ { "docid": "1f6d1f9e5a96c85d61c641cb248df896", "score": "0.7170311", "text": "function wpvq_getMax(myArray, randomIfEgal)\n\t\t{\n\t\t\tvar maxPersonalityId = 0, \n\t\t\t\tmaxPersonalityWeight = 0,\n\t\t\t\tforceReplacement = false;\n\n\t\t\t$.each(myArray, function(index, elem) \n\t\t\t{\n\t\t\t\tif (elem > maxPersonalityWeight) \n\t\t\t\t{\n\t\t\t\t\tmaxPersonalityId \t\t= index;\n\t\t\t\t\tmaxPersonalityWeight \t= elem;\n\t\t\t\t}\n\t\t\t\t// If 2 value are equal AND if we want to fetch a random answer\n\t\t\t\telse if (elem == maxPersonalityWeight && randomIfEgal)\n\t\t\t\t{\n\t\t\t\t\tvar randNum = parseInt(Math.random() * 4);\n\t\t\t\t\tif (randNum%2 == 0 || maxPersonalityId == 0 /* prevent from empty result */) \n\t\t\t\t\t{\n\t\t\t\t\t\tmaxPersonalityId \t\t= index;\n\t\t\t\t\t\tmaxPersonalityWeight \t= elem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t return maxPersonalityId;\n\t\t}", "title": "" } ]
[ { "docid": "ae9c279d8fa246a787fc647ce1d9bc75", "score": "0.72133017", "text": "function findMaxSalary(data) {\n // data.data[0] is the entry for (var i = 0; i < array.length; i++) {\n array[i]\n }", "title": "" }, { "docid": "06b5f2f798ca65afdfc944ca0582face", "score": "0.69555473", "text": "max () {\n return this.data.reduce(function (a, b) {\n return Math.max(a, b)\n })\n }", "title": "" }, { "docid": "f1f01589da70a1246928d66028b703b5", "score": "0.6945942", "text": "function getMax(arr) {\r\n var max = 0;\r\n arr.forEach(function (item, i) {\r\n if (item.value > max) max = item.value;\r\n });\r\n\r\n return max;\r\n }", "title": "" }, { "docid": "7848afc6940ee2e1b9967ec0e6b2157c", "score": "0.68851805", "text": "function get_max_value(array, index) {\r\n return Math.max.apply(Math, array.map(function (o) { return o[index]; }))\r\n }", "title": "" }, { "docid": "bef634c8c7641a1496c31ee1d11fe7a6", "score": "0.6879524", "text": "function myArrayMax (arr) { //Esta funcion puedo usar para encontrar el mas alto en un array\n return Math.max.apply(null, arr)// Es equivalente a Math.max(1,2,3)\n}", "title": "" }, { "docid": "f58db136a4e07fb9f0bf0a3b9b3b9dba", "score": "0.68504405", "text": "function maxProfit(arr) {\n\tlet min = ;\n\tlet max = 0;\n\tfor(let i=0;i < arr.length;i++) {\n\t\tconst elmt = arr[i];\n\n\t}\n}", "title": "" }, { "docid": "7affb639505ecb1d4cadecd19d578d3c", "score": "0.6760911", "text": "get max() {}", "title": "" }, { "docid": "7affb639505ecb1d4cadecd19d578d3c", "score": "0.6760911", "text": "get max() {}", "title": "" }, { "docid": "482f32d0d8c8a16ad7e7867cfa87d2d3", "score": "0.67243916", "text": "function max(array) {\n\n}", "title": "" }, { "docid": "3d3ff2724cc20a48acbf8f75ccd437c2", "score": "0.66752744", "text": "function max(array){\r\r return reduce(array , function(maxElement ,number ){\r // check if number greater than maxElement => array[0] \r if(maxElement < number){\r // change the maxElement value to the number \r maxElement = number \r }\r // return max value in array\r return maxElement;\r })\r}\r\r\r \r //Good Luck :))", "title": "" }, { "docid": "28b1540c09d3ea0439259e298e58aed1", "score": "0.66680604", "text": "function getMaxFitness() {\n var record = 0;\n for (var i = 0; i < specimens.length; i++) {\n if (specimens[i].fitness > record) {\n record = specimens[i].fitness;\n }\n }\n return record;\n \n }", "title": "" }, { "docid": "f2bf8eb5bbe67a81b2a358825bb3e354", "score": "0.6648705", "text": "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "title": "" }, { "docid": "f2bf8eb5bbe67a81b2a358825bb3e354", "score": "0.6648705", "text": "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "title": "" }, { "docid": "f2bf8eb5bbe67a81b2a358825bb3e354", "score": "0.6648705", "text": "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "title": "" }, { "docid": "1a292b210c892ab92a65e751d6b1138b", "score": "0.66432995", "text": "function maxProfit(array) {\n\t\n var profitArray = array.map(function(currentValue, index) {\n return array.slice(index, array.length)\n .sort(function(a, b){return b-a})[0] - currentValue\t\t\n })\n \n return profitArray.sort(function(a, b){return b-a})[0];\n\n}", "title": "" }, { "docid": "55f4653b1b2f8e2936d84bf299b51bd9", "score": "0.6641745", "text": "function getMax(arr){\n let large=arr[0];\n for(let i=0; i<arr.length; i++){\n if(large <arr[i]){\n large=arr[i];\n \n }\n } \n\n return large;\n\n }", "title": "" }, { "docid": "93670abdf0d55fdcb97b4f77af4ac1ba", "score": "0.6620392", "text": "function maxScore(array, elements) {\n return array[maxScoreIndex(array, elements)];\n}", "title": "" }, { "docid": "2b64fcae54c65865f6d4dc6c4c9bc464", "score": "0.659769", "text": "function getMaxOfArray(tempArr) {\r\n return (tempSum = Math.max.apply(null, tempArr));\r\n }", "title": "" }, { "docid": "fa45fa5a381079ab530e8095042fbb7f", "score": "0.6592675", "text": "function maxOf(arr){\n\tif (arr.length ===1) {\n\treturn arr[0]\n\t} else {\n\treturn Math.max(arr.pop(),maxOf(arr))\n\t} \n\t}", "title": "" }, { "docid": "97ab544b2d3d30b0699247cb05251c01", "score": "0.6583132", "text": "function maxValue(array){\n\n if (0 < array.length ) {\n return Math.max(...array)\n}\n return null;\n}", "title": "" }, { "docid": "2e143a4ed9a549f9f52a7fc4ec0f3713", "score": "0.65600073", "text": "function findMaxElement(arr) {\n var max = arr.reduce(function(a, b) {\n return Math.max(a, b);\n });\n console.log(max);\n}", "title": "" }, { "docid": "dd9c447c18aa35fc019c5aefeb8fa032", "score": "0.65283793", "text": "function findMax(){\r\n var arr = [-3,3,5,7];\r\n var max = Math.max(...arr);\r\n return max;\r\n}", "title": "" }, { "docid": "2d8bd1043869a0c25324e6e7c5cdd136", "score": "0.65136856", "text": "function findMax(array) {\r\n\treturn Math.max.apply(null,array);\r\n}", "title": "" }, { "docid": "4be2bc45f39e57b1082b225c3ffadc54", "score": "0.65001076", "text": "function max(arr) {\n let max = Math.max(...arr);\n return max; \n}", "title": "" }, { "docid": "1dd7cde8b70d1bd907686cbf50528e3d", "score": "0.649959", "text": "function max(){\n var maximo = arr[0];\n for(var i = 1; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "d160371a83e523ef83eb0b13df69d854", "score": "0.64864844", "text": "function getMaxY(dataArray) {\n return 1.1*dataArray.reduce((max, p) => p.earnings > max ? p.earnings : max, dataArray[0].earnings);\n}", "title": "" }, { "docid": "c5c52d27d9e2324aa61e75d32dc1c189", "score": "0.6480446", "text": "function max (myArray) {\n if (myArray == false) {\n return 0\n } else {\n const largestArrayValue = Math.max(...myArray)\n return largestArrayValue\n }\n}", "title": "" }, { "docid": "22ac7e8539577a6a8295f50c8c82fcad", "score": "0.6475455", "text": "extractMax() {}", "title": "" }, { "docid": "bb706c55a5ec3dd25ca3c935fc470a09", "score": "0.64682037", "text": "getMaxValue()\n {\n // Avoid using spread operator or .apply as they may fail\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max\n return this.m_datasets\n .map((dataset) => dataset.d_data.reduce(function(a, b) {\n return Math.max(a, b);\n }))\n .reduce(function(a, b) {\n return Math.max(a, b);\n })\n }", "title": "" }, { "docid": "0b429bcd1b701f6ea42c1a095ccc4343", "score": "0.64657253", "text": "function max(arr)\n{\n var mx = 1;\n \n for (var i = 0; i < arr.length; i++)\n if (arr[i][1] > mx)\n mx = arr[i][1];\n return mx;\n}", "title": "" }, { "docid": "a0c5f2a1de9fad4701192e85e2aa04c7", "score": "0.646276", "text": "function maxPrice(arr) {\n\tif (!arr || arr.length < 1) {\n\t\treturn 0;\n\t}\n\treturn arr.reduce((a, b) => Math.max(a, b));\n}", "title": "" }, { "docid": "f8dfa1a9f02a0251a7c7016025379962", "score": "0.6457756", "text": "function calculateMax(data) {\n\tvar m = 0;\n\n\tfor (var year in data) {\n\t\tvar ages = data[year];\n\n\t\tfor (var i in ages) {\n\t\t\tm = Math.max(m, ages[i][0], ages[i][1]);\n\t\t}\n\t}\n\n\treturn m;\n}", "title": "" }, { "docid": "f33431d0393224023fb9c00a94117261", "score": "0.6455877", "text": "function max(userArray) {\n\treturn Math.max(...userArray); // I found this online.\n}", "title": "" }, { "docid": "a9bb53461a187ea152805e920a725049", "score": "0.64421964", "text": "function maxValue(array) { // []\n let max = null; // there is no max\n // let max = array[0]; // undefined\n for (let i = 0; i < array.length; i++) { // i = 0\n let num = array[i]; // 12\n\n if (max === null || num > max) { // if there is no current max val, or the curr num is greater than max\n max = num;\n }\n }\n\n return max;\n}", "title": "" }, { "docid": "c00160aea18fd589df7ceba02e1ee0e3", "score": "0.64327985", "text": "function getLargest(arr) {\n var largest = Math.max.apply(Math, arr);\n\n return largest > max ?\n largest :\n max;\n }", "title": "" }, { "docid": "4dedbc0baf2f2d929cd32b8aa7c1a87d", "score": "0.6426778", "text": "maximum() {\n return this._stats().max;\n }", "title": "" }, { "docid": "b18063e9170b0f88ad23155453e97be3", "score": "0.6424117", "text": "function getMax(arr) {\n let max = arr[0];\n for (let elm of arr) {\n if (elm > max) {\n max = elm;\n }\n }\n return max;\n}", "title": "" }, { "docid": "dd9f605d49fe715d4ef24d31c1341984", "score": "0.64161545", "text": "function maxBy(ary, iteratee) {\n if (!ary || !ary.length) return undefined\n if (typeof iteratee != \"function\") {\n var name = iteratee\n iteratee = o => o[name]\n }\n var max = ary[0]\n for (var i = 1; i < ary.length; i++) {\n if ((iteratee(ary[i]) || -Infinity) > (iteratee(max) || -Infinity)) {\n max = ary[i]\n }\n }\n return iteratee(max) ? max : undefined\n }", "title": "" }, { "docid": "2da69d103e3ac513277f0ddf0609a09b", "score": "0.6404664", "text": "function findmax(array) {\n return Math.max.apply(null, array);\n}", "title": "" }, { "docid": "6e7d23a44650c4b85bd895576e569b2a", "score": "0.6404536", "text": "function findMax(anArray){\n return 0\n}", "title": "" }, { "docid": "cf0334081d06656afee55c2ed0246e22", "score": "0.6398934", "text": "function getMax(arr, prop) {\n var max;\n for (var i = 0; i < arr.length; i++) {\n if (!max || parseInt(arr[i][prop]) > parseInt(max[prop]))\n max = arr[i];\n }\n return max;\n }", "title": "" }, { "docid": "79d9197d742f2d769ff09db25762b9bc", "score": "0.63951325", "text": "function max(ary) {\n if(ary === undefined || ary.length === undefined || ary.length === 0){\n return undefined\n }\n let maxVal = ary[0]\n for (let i = 0, length = ary.length; i < length; i++) {\n if (maxVal) {\n if (maxVal < ary[i]) {\n maxVal = ary[i]\n }\n }\n }\n return maxVal\n}", "title": "" }, { "docid": "01fcb4091e40b47d292e55cacbba5393", "score": "0.6388976", "text": "function getMax(arr, prop) {\n var max;\n for (var i=0 ; i<arr.length ; i++) {\n if (!max || parseInt(arr[i][prop]) > parseInt(max[prop]))\n max = arr[i];\n }\n return max;\n}", "title": "" }, { "docid": "479e9fa2137914e09ac1ec05c5a8eb28", "score": "0.63853395", "text": "getBiggest() {\n invariant(this.options.series, \"You have not supplied any arrays to find the biggest value.\");\n this.biggestValue = 0;\n this.options.series.forEach(series => {\n series.data.forEach(value => {\n if (value[1] > this.biggestValue) {\n this.biggestValue = value[1];\n }\n });\n });\n }", "title": "" }, { "docid": "983bd03a564136ae47d871950bd208d3", "score": "0.6373155", "text": "function max(arr) {\n return Math.max.apply(null, arr);\n}", "title": "" }, { "docid": "e68c8048bf78aae459995ead641efb1a", "score": "0.6367035", "text": "function arrayMax(data){var i=data.length,max=data[0];while(i--){if(data[i]>max){max=data[i];}}return max;}", "title": "" }, { "docid": "eda24b41063a4881805202f40209b06a", "score": "0.63621074", "text": "function getHighest() {\n return Math.max(...heights);\n }", "title": "" }, { "docid": "c1d7f9b4b5032665a43bfba92481b338", "score": "0.63591695", "text": "function getMaxArray(inputMatrix) {\n\tvar outputVariable = d3.max(inputMatrix, function(array) {\n\t\treturn d3.max(array, Number);\n\t});\n\treturn outputVariable;\n}", "title": "" }, { "docid": "08c7dff642d69014641cd2d76eeba216", "score": "0.63558525", "text": "maxLike() {\n return Math.max(...this.d.values());\n }", "title": "" }, { "docid": "37da015c179c023a892d78f80bce6a8b", "score": "0.635155", "text": "function getMax(arr, prop) {\r\n var max;\r\n for (var i = 0; i < arr.length; i++) {\r\n if (max == null || parseInt(arr[i][prop]) > parseInt(max[prop]))\r\n max = arr[i];\r\n }\r\n return max;\r\n }", "title": "" }, { "docid": "fd58cb20fc4907b217baaa4c50fafea3", "score": "0.63477266", "text": "function getMax(){\n\t\t\tvar max = 0;\n\t\t\tfor (var i = 1; i < histogramData.length; i++) {\n\t\t\t\tmax = Math.max(histogramData[i],max);\n\t\t\t}\n\t\t\treturn max;\n\t\t}", "title": "" }, { "docid": "2a605b0ad7ffcb78c3b8b14226df958f", "score": "0.6336722", "text": "function getMaxNumber(arr){\n return Math.max.apply(null, arr); \n}", "title": "" }, { "docid": "55035748eeb8c91c571d0a55a3a03f4c", "score": "0.632196", "text": "function arrayMax(arr) {\n return arr.reduce(function (p, v) {\n return ( p > v ? p : v );\n });\n}", "title": "" }, { "docid": "4ad24b06aec80f66525200e364720847", "score": "0.6316111", "text": "function maximum() {\r\nvar mini = Math.max.apply(null, numbers);\r\nconsole.log(\"maximum cherez matem funchii-\",mini);\r\n}", "title": "" }, { "docid": "4124356dee22f2ebe0da1bb2ac0634af", "score": "0.630939", "text": "function maxOf(arr) {\n if (arr.length === 1) {\n return arr[0];\n } else {\n return Math.max(arr.pop(), maxOf(arr));\n }\n}", "title": "" }, { "docid": "9b24f4f1c1cdf0d8cee4ed6fe59b29bc", "score": "0.630416", "text": "function maxFunc(myArray)\n{\n\tconsole.log(\"max: myArray is: \", myArray);\n var max = myArray[0][\"value\"];\n var result = {};\n result[\"key\"] = myArray[0][\"key\"];\n result[\"value\"] = max;\n\n\tvar i;\n\tfor(i=0;i<myArray.length; i++)\n\t{\n\t\tif(myArray[i][\"value\"] > max)\n\t\t{\n\t\t\tmax = myArray[i][\"value\"];\n result[\"key\"] = myArray[i][\"key\"];\n result[\"value\"] = max;\n\t\t}\n\t}\n\tconsole.log(\"result is: \", result);\n\treturn result;\n}", "title": "" }, { "docid": "796dde715fa32702a65d20fcfb937634", "score": "0.6302494", "text": "max(arr) {\n return Math.max(...arr);\n }", "title": "" }, { "docid": "e86a15a995aacdf141b396e99f30de26", "score": "0.63005674", "text": "getMaxLikes(pics){\n/* const picsArray = array.map(i=> i.pictures)\nconst pics = picsArray.flat() */\n\nconst likes = pics.map(i=> i.likes)\nconst maxValue = Math.max.apply(Math, likes);\n\nreturn maxValue;\n\n}", "title": "" }, { "docid": "ac3ecb2665771847c86579cb0d4be82d", "score": "0.6300337", "text": "function max(lista) {\n maior = parseFloat(lista[0]);\n\n for (let i = 1; i<lista.length; i++){\n numero = parseFloat(lista[i])\n if (numero > maior) {\n maior = numero;\n };\n };\n\n return maior\n\n}", "title": "" }, { "docid": "aa0c42a6fd028dd8f9cba45efc0a2fdf", "score": "0.62889975", "text": "function LargestOf(arr){\n let Arr = [];\n for (var i = 0;i<arr.length;i++){\n Arr.push(Math.max(...arr[i]));\n };\n return Arr;\n}", "title": "" }, { "docid": "28b84752a152294f11d2dc36dd9799be", "score": "0.6287123", "text": "function maxValue(array)\n{\n\tvar maxValue = array[0];\n\tfor(var i = 1; i<= array.length - 1; i++)\n\t{\n\t\tvar newValue = array[i];\n\t\tif(newValue > maxValue)\n\t\t{\n\t\t\tmaxValue = newValue;\n\n\t\t}\n\t}\n\treturn maxValue;\n}", "title": "" }, { "docid": "24a220e27d3621d24f361b063fc9611b", "score": "0.6273712", "text": "function max(writer, value) {\n if ( !isArray(value) ) {\n return typeof value === 'number' ? value : NaN;\n }\n return Math.max.apply(Math, value);\n}", "title": "" }, { "docid": "095f69862a1c6b4f8eac6a1c3528d670", "score": "0.6269387", "text": "function loyalCustomer(arr) {\n\tvar orders = [];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\torders.push(arr[i].order);\n\t}\n\tconsole.log(Math.max(...orders));\n}", "title": "" }, { "docid": "8c6d8a8942d00d2a4914e4989a282249", "score": "0.62608796", "text": "function largestElement(arr){\n return Math.max.applu(null, arr)\n }", "title": "" }, { "docid": "7b459ce19d596466f054f0d7640fd96c", "score": "0.62604916", "text": "function max(arr) {\n\n let result = 0;\n\n arr.forEach(function (number) {\n if (number > result) {\n result = number;\n }\n });\n\n return result;\n\n}", "title": "" }, { "docid": "19ac9b61412f555a57d0171f3042bf1c", "score": "0.6257856", "text": "function getMaxValue(arr) {\n const values = arr.map(i => {\n return i.getBoundingClientRect().height;\n });\n\n return Math.max(...values);\n }", "title": "" }, { "docid": "0f21c8e71bb0eb04003d61cadbee7b5c", "score": "0.62572604", "text": "function task17_20_8(){\r\n A = [24, 53, 78, 91, 12];\r\n var max = +Math.max(...A);\r\n document.write(\"Array : \"+A + '<br>');\r\n document.write(\"Largest: \" + max);\r\n\r\n}", "title": "" }, { "docid": "c85c77bf5f0ada876f77669ad5ddad1f", "score": "0.6256844", "text": "function maxProfit (input) {\n //convert input into numbers in array \n let arrayNum = input.split(' ').map((num) => { return parseInt(num); })\n let currentProfit = 0;\n let max = 0;\n\n //loop through array \n for(let value of arrayNum) {\n //add current value, if sum is negative, reset current to 0\n currentProfit = Math.max(0, currentProfit+value);\n //max to keep track of the max value \n max = Math.max(max, currentProfit);\n }\n return max;\n}", "title": "" }, { "docid": "3389ebd84f2e374d4115ad50aa30a7ce", "score": "0.6256073", "text": "function maximumValue(numbers){\n aux = numbers\n result = aux[0]\n for (let i = 1; i < aux.length; i++){\n if (aux[i] >= result){\n result = aux[i]\n }\n }\n return result\n}", "title": "" }, { "docid": "bfefd21035d6590db7137f6bb8758da0", "score": "0.62499714", "text": "function maxValue(bubblesType) {\n var filteredTotals = covidAffectedTotals.map(a => a[bubblesType]);\n return Math.max.apply(Math, filteredTotals);\n }", "title": "" }, { "docid": "8d64a6567fbddb345dfe3dc5e6d8c876", "score": "0.62496424", "text": "function arrayMax(array) {\n return Math.max.apply(Math, array);\n }", "title": "" }, { "docid": "c79f52c90c988ce8ee25d345119657bc", "score": "0.62486714", "text": "function arrayMax(array) {\n return array.reduce(function(a, b) {\n return Math.max(a, b);\n });\n\t\t}", "title": "" }, { "docid": "95f409f60aae45b419c6af00dfe44bcd", "score": "0.6240241", "text": "function findMax(ar)\r\n{\r\nreturn Math.max(...ar)\r\n}", "title": "" }, { "docid": "dcd3aaa84fb2da7fe6779d1309509bb5", "score": "0.6237488", "text": "function findMax(ar)\r\n{\r\nvar big = Math.max(...ar);\r\nreturn big;\r\n}", "title": "" }, { "docid": "c719977ac1ac2064b72441946384ea16", "score": "0.6233791", "text": "function findMax(array) {\r\n\t//CODE HERE\r\n\treturn Math.max(...array);\r\n}", "title": "" }, { "docid": "448dc70e83e42b5f7381dda6129e6704", "score": "0.62318575", "text": "function getUserWithTheMostSkills() {\n const userEntries = Object.entries(users);\n let max = 0;\n let skilledPerson = '';\n for (let user of userEntries) {\n if (user[1].skills.length >= max) {\n max = user[1].skills.length;\n skilledPerson = user[0];\n }\n }\n console.log(`The most skilled person is ${skilledPerson}`);\n}", "title": "" }, { "docid": "2da78f00207c2d860b9a69bd3604314d", "score": "0.62287265", "text": "function max(arr) {\n return arr.reduce(function(a, b) {\n return a > b ? a : b;\n });\n}", "title": "" }, { "docid": "79715144e349124ae0944a3743d698ca", "score": "0.6219569", "text": "function findMax() {\n var _sum = 0;\n var _max = 0, _maxSum = 0;\n var _maxSumAll = [];\n\n return {\n calc: function(x, z, value) {\n _sum += value;\n if (_max < value)\n _max = value;\n if (_maxSumAll[z] === undefined)\n _maxSumAll[z] = 0;\n _maxSumAll[z] += value;\n if (_maxSum < _maxSumAll[z])\n _maxSum = _maxSumAll[z];\n },\n\n sum: function() { return _sum; },\n max: function() { return _max; },\n maxSum: function() { return _maxSum; }\n };\n }", "title": "" }, { "docid": "9ceee5866b30f3d0ba3370ecf49e35fb", "score": "0.62142926", "text": "function findMax() {\n let high = ar[0];\n for (let i = 1; i < ar.length; i++) {\n if (ar[i] > high) {\n high = ar[i];\n }\n }\n return high;\n }", "title": "" }, { "docid": "74656007deb42ab3a87f526cd477d4e2", "score": "0.6211897", "text": "function max(array) {\r\n var max = array[0];\r\n\r\n array.forEach(function(item) {\r\n if(item > max) {\r\n max = item;\r\n }\r\n });\r\n return max;\r\n}", "title": "" }, { "docid": "fcb3fffb897aae6763929d819b5949dd", "score": "0.620814", "text": "function max(array){\n var max = array[0];\n array.forEach(function(numbers){\n if(numbers > max){\n max = numbers;\n }\n })\n return max;\n}", "title": "" }, { "docid": "74d9bbf997b7f1949e40b1d0f18c038a", "score": "0.6203343", "text": "function maximum(arr) {\nlet max = arr[0];\nfor( i =1; i<arr.length;i++){\n if(arr[i] > max){\n max = arr[i];\n }\n }\nreturn max;\n}", "title": "" }, { "docid": "6cd042587eb36759033d8f626c439071", "score": "0.62005186", "text": "function getMaxProfit(array){\n let minPrice = array[0];\n let maxProfit = array[1] - array[0];\n\n for(let i = 1; i < array.length; i++){\n let currentPrice = array[i];\n let potentialPrice = currentPrice - minPrice;\n minPrice = Math.min(minPrice, currentPrice);\n maxProfit = Math.max(potentialPrice, maxProfit);\n }\n return maxProfit;\n}", "title": "" }, { "docid": "f73fa13f6e2133d26cf68843c6dc878c", "score": "0.6199724", "text": "function maxArray(array){\n let maxim = -Infinity;\n for(let i = 0; i < array.length; i++) {\n if (array[i] > maxim) {\n maxim = array[i]}\n }\n return maxim;\n}", "title": "" }, { "docid": "5c27edcbdaddbf623ab5448ba58c2142", "score": "0.6199164", "text": "function maxValue(array) {\n return Math.max.apply(Math, array.map(function(d) {\n return Math.abs(d);\n }));\n }", "title": "" }, { "docid": "a2b6bbbcc1cdda4459a237fa7e1f46ea", "score": "0.6191429", "text": "function getMax(){\r\n Array.prototype.max = function() {\r\n return Math.max.apply(null, this);\r\n };\r\n console.log(fieldIdList.max());\r\n return fieldIdList.max.apply(null,this);\r\n}", "title": "" }, { "docid": "d095cdf1436e09a7a61e4ba79d7426e3", "score": "0.6187632", "text": "function maxDuffelBagValuePractice(weightCapacity, cakeTypes) {\n maxValueAtCapacity = new Array(weightCapacity + 1).fill(0);\n\n for (let currentCapacity = 0; currentCapacity <= weightCapacity; currentCapacity++){\n let maxCurrentValue = maxValueAtCapacity[currentCapacity];\n\n for (let i = 0; i < cakeTypes.length; i++){\n let currentCake = cakeTypes[i];\n // infinite value\n if (currentCake.weight === 0 && currentCake.value !== 0) {\n return Infinity;\n }\n if (currentCake.weight <= currentCapacity) {\n // potential max is max value at current weight minus cake weight + cake value\n let potentialMaxValue = currentCake.value + maxValuesAtCapacity[currentCapacity - currentCake.weight];\n // set max current value to whatever is bigger\n maxCurrentValue = Math.max(maxCurrentValue, potentialMaxValue);\n }\n }\n\n // set currentCapacity to max current value\n maxValuesAtCapacity[currentCapacity] = maxCurrentValue;\n }\n\n // grab whatever the value is at weightCapacity\n return maxValuesAtCapacity[weightCapacity];\n}", "title": "" }, { "docid": "333194c45c6d404c424939f6c3dfd64a", "score": "0.61826867", "text": "function highestScorePupil(pupils) {\n array = [];\n pupils.forEach((pupil, index) => {\n scores = Object.values(pupil);\n array.push(scores[1]);\n });\n\n let first = array[0];\n\n array.forEach(value => {\n if(value > first){\n first = value\n }\n })\n\n let position = array.indexOf(first);\n\n return pupils[position];\n}", "title": "" }, { "docid": "56286d4418b0a60e4b36ab415b8e6372", "score": "0.61789584", "text": "function get_actual_max(data, accessor) {\n var max = 0;\n data.forEach(function(d) { max = Math.max(d[accessor], max); })\n return max;\n}", "title": "" }, { "docid": "34c1c8c5ac08e24ab369b067fc07c8b7", "score": "0.6178194", "text": "function findMost(a) {\n var maxEle;\n var maxNum = 1;\n a.reduce(function (x, y) {\n console.log(x);\n console.log(\"y = \" + y);\n x[y] ? x[y]++ : x[y] = 1;\n if (x[y] > maxNum) {\n maxEle = y;\n maxNum++;\n }\n return x;\n }, {});\n return maxEle;\n }", "title": "" }, { "docid": "6d18ef7ed9f0f15c2163cd1678dcc4a2", "score": "0.61778015", "text": "function maxValue (arr) {\r\n// returns the index number of the elmentem in the array 'arr' with the largest wert\r\n var maxV;\r\n if (arr.length > 0) { // If the array contains any elements\r\n maxV = 0;\r\n for (i = 1; i < arr.length; i++) {\r\n if (arr[i]>arr[maxV]) { maxV = i; }\r\n }\r\n } else {\r\n maxV = null\r\n }\r\n return maxV; \r\n}", "title": "" }, { "docid": "73bea7a251e84d3e11e0c3f25cbc9b8d", "score": "0.6176839", "text": "function getMaxProfit(arr) {\n let profit = [];\n for(let i in arr) {\n for (let j in arr) {\n if (i == j) {\n continue;\n }\n profit.push(arr[i] - arr[j]);\n }\n }\n\n profit.sort((a, b) => a - b);\n console.log('最多进行一次交易的情况下可以获取的最大利润: ', profit, profit[0]);\n}", "title": "" }, { "docid": "c9c8a448b3a8a4469f6f9a6de22204c6", "score": "0.61740434", "text": "findMax() {\n \n this.migration.forEach((d) => {\n // exclude unkown and total\n if (d.type === \"Immigrants\" && d.od_id !== \"XX\") {\n for (const [key, value] of Object.entries(d)) {\n if (!isNaN(key) && value > this.maxIm) {\n this.maxIm = value;\n }\n }\n }\n\n if (d.type === \"Emigrants\" && d.od_id !== \"XX\") {\n for (const [key, value] of Object.entries(d)) {\n if (!isNaN(key) && value > this.maxEm) {\n this.maxEm = value;\n }\n }\n }\n });\n }", "title": "" }, { "docid": "5280773f576bc502e33d8c934353bb04", "score": "0.6167655", "text": "function max(arr){\n\tvar result = arr[0];\n\tfor(var i = 0 ; i < arr.length ; i++){\t\n\t\tif(result < arr[i]){\n\t\t\tresult = arr[i];\n\t\t}\n\t}\n\treturn result;\n\n}", "title": "" }, { "docid": "2b754cc435c12bd10f17571a6829b22b", "score": "0.61653274", "text": "function getMaxNumber(arr) {\n return Math.max.apply(null, arr);\n}", "title": "" }, { "docid": "02653309238a213da75a483c04b2bde0", "score": "0.6158421", "text": "function max(arr) {\r\n return Math.max(...arr);\r\n}", "title": "" }, { "docid": "88cf7a15f8f82b22d8a9fecc7323fba3", "score": "0.6152658", "text": "function maxi(arr){\n return Math.max(...arr)\n\n}", "title": "" }, { "docid": "31a855c09e6fe08df17d797e37cc406f", "score": "0.61480534", "text": "function findMaxTwo(arr) {\n let max = 0;\n for(let num of arr) {\n if(num > max) {\n max = num;\n } else {\n return max;\n }\n }\n return max;\n}", "title": "" }, { "docid": "6a28b96fbe31a39a01cb8fb406108839", "score": "0.6146371", "text": "function max(arr) {\n // var num = Number(arr);\n var maxNum = Math.max(...arr);\n console.log(maxNum);\n}", "title": "" }, { "docid": "24ae41ca9e2fad45b06d7a970e41a831", "score": "0.6145909", "text": "function megaFriend(listOfFriends) {\n\n if (!listOfFriends.length) { //Checking Empty Array\n console.log(\"This array is empty\");\n }\n else {\n var temp = 0;\n var max;\n for (var i = 0; i < listOfFriends.length; i++) {\n if (listOfFriends[i].length > temp) {\n var temp = listOfFriends[i].length;\n max = listOfFriends[i];\n }\n }\n return max;\n\n }\n}", "title": "" } ]
227941d2dcf866664180b5e0045620a1
Move an element in an array from one index to another.
[ { "docid": "763a61595bbf03e413ac0354c9b2aea4", "score": "0.7522845", "text": "function arrayMove(arr, old_index, new_index) {\n while (old_index < 0) {\n old_index += arr.length;\n }\n while (new_index < 0) {\n new_index += arr.length;\n }\n if (new_index >= arr.length) {\n var k = new_index - arr.length;\n while (k-- + 1) {\n arr.push(undefined);\n }\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n return arr;\n }", "title": "" } ]
[ { "docid": "8a1dd8986544513cff0739da713e3767", "score": "0.79713464", "text": "function arrayMove(arr, from, to) {\n var element = arr.splice(from, 1);\n arr.splice(to, 0, element[0]);\n }", "title": "" }, { "docid": "a416361b2405c1b8f96f333023d43dba", "score": "0.7861958", "text": "function arrayMove(array, from, to) {\n array.splice(to, 0, array.splice(from, 1)[0]);\n}", "title": "" }, { "docid": "a458848e8ae5d6a61c427de7f696ccaf", "score": "0.76941276", "text": "function move(array, from, to) {\n array.splice(to, 0, array.splice(from, 1)[0]);\n}", "title": "" }, { "docid": "ec197e68fc369d542e48fb2c15cc1ce4", "score": "0.7619943", "text": "array_move(arr, fromIndex, toIndex) {\n\t\tvar element = arr[fromIndex];\n\t\tarr.splice(fromIndex, 1);\n\t\tarr.splice(toIndex, 0, element);\n\t}", "title": "" }, { "docid": "3962ba4cf7810078f8d6c35dc4388d00", "score": "0.76182055", "text": "function arraymove(arr, fromIndex, toIndex) {\n var element = arr[fromIndex];\n arr.splice(fromIndex, 1);\n arr.splice(toIndex, 0, element);\n}", "title": "" }, { "docid": "e3e8cd2788e4477c3b7882461892aa64", "score": "0.7514107", "text": "function arraymove(arr, fromIndex, toIndex) {\n\t\t\tvar element = arr[fromIndex];\n\t\t\tarr.splice(fromIndex, 1);\n\t\t\tarr.splice(toIndex, 0, element);\n\t\t\treturn arr\n\t\t}", "title": "" }, { "docid": "2624d0cbb2c09934361cd44c470ad680", "score": "0.7454411", "text": "function array_move(arr, old_index, new_index) {\n\tif (new_index >= arr.length) {\n\t\tvar k = new_index - arr.length + 1;\n\t\twhile (k--) {\n\t\t\tarr.push(undefined);\n\t\t}\n\t}\n\tarr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n\treturn arr;\n}", "title": "" }, { "docid": "01b17a1cce9034fe8b441ba4f7cfb344", "score": "0.74369204", "text": "function arrayMove(arr, fromIndex, toIndex) {\n let element = arr[fromIndex];\n arr.splice(fromIndex, 1);\n arr.splice(toIndex, 0, element);\n }", "title": "" }, { "docid": "9e19070d08d0686a0c91ac3c4473f076", "score": "0.7404626", "text": "function move(arr, old_index, new_index) {\r\n while (old_index < 0) {\r\n old_index += arr.length;\r\n }\r\n while (new_index < 0) {\r\n new_index += arr.length;\r\n }\r\n if (new_index >= arr.length) {\r\n var k = new_index - arr.length;\r\n while ((k--) + 1) {\r\n arr.push(undefined);\r\n }\r\n }\r\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\r\n return arr;\r\n}", "title": "" }, { "docid": "5863c91c4eda36ff92a7af23aabcc337", "score": "0.7209811", "text": "function move(array, index, offset) { //array, index of the element to move, offset \n const position = index + offset;\n if (position >= array.length || position < 0) {\n console.error('Invalid Offset.');\n }\n\n const output = [...array];\n const element = output.splice(index, 1)[0];\n output.splice(index + offset, 0, element);\n return output;\n}", "title": "" }, { "docid": "b80ba82994968ba15656919efa50960e", "score": "0.71168387", "text": "function move(array, element, toIndex) {\n // @todo this implementation must be the same as the List.moveValue method\n // @todo don't do anything if the desired index is the same as the current index\n var index = indexOf(array, element);\n // @todo remove all old values rather than only the first ?\n if (index !== -1) {\n removeIndex(array, index);\n }\n if (toIndex == null) {\n array.push(element);\n }\n else {\n insertIndex(array, toIndex, element);\n }\n}", "title": "" }, { "docid": "30ab4861ccc9f709f75896bf0e477b85", "score": "0.71120524", "text": "static arrayMove(arr, oldIndex, newIndex) {\n\t\tif (newIndex >= arr.length) {\n\t\t\tlet k = newIndex - arr.length + 1;\n\t\t\twhile (k--) {\n\t\t\t\tarr.push(undefined);\n\t\t\t}\n\t\t}\n\t\tarr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]);\n\t\treturn arr;\n\t}", "title": "" }, { "docid": "d1be1d2f85d7af49cd1d944ac452cd03", "score": "0.7062179", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(0, toIndex)), [item], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(toIndex, moveIndex)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(0, moveIndex)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(moveIndex + 1, toIndex + 1)), [item], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "c86b50b4457164584185fcc961b1b6e5", "score": "0.7038064", "text": "function move(arr, oldIndex, newIndex) {\n while (oldIndex < 0) {\n oldIndex += arr.length;\n }\n while (newIndex < 0) {\n newIndex += arr.length;\n }\n if (newIndex >= arr.length) {\n var k = newIndex - arr.length;\n while ((k--) + 1) {\n arr.push(undefined);\n }\n }\n arr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]); \n return arr;\n }", "title": "" }, { "docid": "c8e88ddb92833235584b20493fb0342b", "score": "0.69486713", "text": "function move(array, index, offset) {\n const position = index + offset;\n if (position >= array.length) {\n console.error(\"Invalid 0ffset\");\n return;\n }\n const output = [...array];\n const element = output.splice(index, 1)[0];\n output.splice(position, 0, element);\n return output;\n}", "title": "" }, { "docid": "a332a4ad2fec6bdc65f486ca8582352f", "score": "0.6929828", "text": "function transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n var from = clamp$1(currentIndex, currentArray.length - 1);\n var to = clamp$1(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n }", "title": "" }, { "docid": "821c55b2f81d503b17c1846e745a5503", "score": "0.6918346", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, toIndex)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, toIndex + 1)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "821c55b2f81d503b17c1846e745a5503", "score": "0.6918346", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, toIndex)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, toIndex + 1)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "821c55b2f81d503b17c1846e745a5503", "score": "0.6918346", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, toIndex)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(0, moveIndex)), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(moveIndex + 1, toIndex + 1)), [item], Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "bdc41462de1035042efede379bbb0aea", "score": "0.68898934", "text": "MoveArrayElement() {}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.68431497", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.68431497", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.68431497", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "3686fb53e86a3afb8c73a838a60bee12", "score": "0.6800494", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (\n moveIndex < 0 ||\n moveIndex >= length ||\n toIndex < 0 ||\n toIndex >= length\n ) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(0, toIndex)),\n [item],\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(toIndex, moveIndex)),\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(moveIndex + 1, length)),\n );\n }\n\n if (diff < 0) {\n // move right\n return [].concat(\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(0, moveIndex)),\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(moveIndex + 1, toIndex + 1)),\n [item],\n Object(\n _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ],\n )(array.slice(toIndex + 1, length)),\n );\n }\n\n return array;\n }", "title": "" }, { "docid": "a7ad68de72570385b60ef9de14f52fac", "score": "0.6787648", "text": "function swap( index1, index2, arr ) {\n const temp = arr[ index1 ];\n arr[ index1 ] = arr[ index2 ];\n arr[ index2 ] = temp;\n}", "title": "" }, { "docid": "9ea2841356ba72d58cb2bf2d73de71d3", "score": "0.6779069", "text": "function moveForward(theArray, pos) {\n for (var i = theArray.length; i > pos; i--) {\n theArray[i] = theArray[i-1];\n }\n}", "title": "" }, { "docid": "15a5650a03bf46623d0fc14537dafb71", "score": "0.6755279", "text": "function moveElement(fromIndex, toIndex) {\n\tvar element = objects[fromIndex];\n\tobjects.splice(fromIndex, 1);\n objects.splice(toIndex, 0, element);\n return objects;\n}", "title": "" }, { "docid": "ead824cf520c6a971ceaebd06b183023", "score": "0.6720595", "text": "function swap(arr, index1, index2) {\n var temp = arr[index1]\n arr[index1] = arr[index2]\n arr[index2] = temp\n return arr\n}", "title": "" }, { "docid": "d0346d398f365e440f632c587e6d8748", "score": "0.6719287", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (\n moveIndex < 0 ||\n moveIndex >= length ||\n toIndex < 0 ||\n toIndex >= length\n ) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(\n _toConsumableArray(array.slice(0, toIndex)),\n [item],\n _toConsumableArray(array.slice(toIndex, moveIndex)),\n _toConsumableArray(array.slice(moveIndex + 1, length)),\n );\n }\n\n if (diff < 0) {\n // move right\n return [].concat(\n _toConsumableArray(array.slice(0, moveIndex)),\n _toConsumableArray(array.slice(moveIndex + 1, toIndex + 1)),\n [item],\n _toConsumableArray(array.slice(toIndex + 1, length)),\n );\n }\n\n return array;\n}", "title": "" }, { "docid": "6a07fcf9c7fb29256e71c635d616cd9e", "score": "0.6708356", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat((0, _toConsumableArray2.default)(array.slice(0, toIndex)), [item], (0, _toConsumableArray2.default)(array.slice(toIndex, moveIndex)), (0, _toConsumableArray2.default)(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat((0, _toConsumableArray2.default)(array.slice(0, moveIndex)), (0, _toConsumableArray2.default)(array.slice(moveIndex + 1, toIndex + 1)), [item], (0, _toConsumableArray2.default)(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "b3f1152782bceac9138b8bbccdef4c26", "score": "0.67044616", "text": "function swap(arr, index1, index2){\n var temp = arr[index1];\n arr[index1] = arr[index2];\n arr[index2] = temp;\n}", "title": "" }, { "docid": "caf49ad55402d5f82fabe6b784c5f5a3", "score": "0.6697677", "text": "function swap(array, index1, index2) {\n var aux = array[index1];\n array[index1] = array[index2];\n array[index2] = aux;\n}", "title": "" }, { "docid": "836f3a1c800b7843c6556b723a057525", "score": "0.66896015", "text": "function swapIndex(arr) {\n var newArr = arr.slice();\n var temp = newArr[0];\n newArr[0] = newArr[newArr.length-1];\n newArr[newArr.length-1] = temp;\n return newArr; \n}", "title": "" }, { "docid": "b906d3b8b58c85daba793cf1022f3304", "score": "0.6673927", "text": "function move(array, moveIndex, toIndex) {\n var length = array.length;\n\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n\n if (diff > 0) {\n // move left\n return [].concat(_toConsumableArray(array.slice(0, toIndex)), [item], _toConsumableArray(array.slice(toIndex, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, length)));\n }\n\n if (diff < 0) {\n // move right\n return [].concat(_toConsumableArray(array.slice(0, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array.slice(toIndex + 1, length)));\n }\n\n return array;\n}", "title": "" }, { "docid": "1918c1e0202fb3962c0b17a2603c2ec6", "score": "0.6653251", "text": "function swap(index1, index2) {\n tmp = arr[index1];\n arr[index1] = arr[index2];\n arr[index2] = tmp;\n }", "title": "" }, { "docid": "1918c1e0202fb3962c0b17a2603c2ec6", "score": "0.6653251", "text": "function swap(index1, index2) {\n tmp = arr[index1];\n arr[index1] = arr[index2];\n arr[index2] = tmp;\n }", "title": "" }, { "docid": "6cf50a9277331471e8ca540c617a82fd", "score": "0.6648483", "text": "function moveObjectInArray(array, index, moveUp){\n var data = {};\n $.extend(data, array[index]);\n\n if(moveUp){\n if(index > 0){\n array.splice(index, 1);\n array.splice(index - 1, 0, data);\n }\n }else{\n if(index < array.length - 1){\n array.splice(index, 1);\n array.splice(index + 1, 0, data);\n }\n }\n }", "title": "" }, { "docid": "2f69faf8ee8c95371300b032eca2ad8f", "score": "0.66179407", "text": "function moveElementToEndOfArray(array,toMove){\n let i = 0;\n let j = array.length - 1;\n while(i < j){\n while(array[j] === toMove && i < j){\n j--;\n }\n if(array[i]=== toMove){\n swap(i,j,array);\n }\n i++;\n }\n return array;\n }", "title": "" }, { "docid": "a93af6c0b2da861cde4892d81fb59926", "score": "0.6597145", "text": "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "a93af6c0b2da861cde4892d81fb59926", "score": "0.6597145", "text": "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "a93af6c0b2da861cde4892d81fb59926", "score": "0.6597145", "text": "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "05a223cd0fbd04bfde73baa701391507", "score": "0.6595566", "text": "function move(array, fromIndex, toIndex) {\n var j = fromIndex | 0;\n if (j < 0 || j >= array.length) {\n return false;\n }\n var k = toIndex | 0;\n if (k < 0 || k >= array.length) {\n return false;\n }\n var value = array[j];\n if (j > k) {\n for (var i = j; i > k; --i) {\n array[i] = array[i - 1];\n }\n }\n else if (j < k) {\n for (var i = j; i < k; ++i) {\n array[i] = array[i + 1];\n }\n }\n array[k] = value;\n return true;\n}", "title": "" }, { "docid": "fa96ee27e2aee17e5c2327c7939582f4", "score": "0.6575119", "text": "function swap(array, posA, posB) {\n var temp = array[posA]; \n array[posA] = array[posB]; \n array[posB] = temp; \n }", "title": "" }, { "docid": "a4b3f432e980db62f82a7980cd132d79", "score": "0.65736175", "text": "function swap(arr, index1, index2) {\n var temp = arr[index1]; // store value of arr[index1]\n arr[index1] = arr[index2]; // assign value of arr[index2] to arr[index1]\n arr[index2] = temp; // assign value of arr[index1] to arr[index2] from temp store\n}", "title": "" }, { "docid": "37516dda2a0b7b6b1b44ccec8147af51", "score": "0.6563308", "text": "function swap(array, posA, posB) {\n var temp = array[posA]; \n array[posA] = array[posB]; \n array[posB] = temp; \n }", "title": "" }, { "docid": "d49a63b0d05b2e647e0fa660876e48d2", "score": "0.6557826", "text": "function swap(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "c3823f81f818053f6a0b14970c392f19", "score": "0.65431815", "text": "function move(a, start, stop) {\r\n\r\n var len = a.length;\r\n if (start < 0) {\r\n start = start + len;\r\n }\r\n if (stop < 0) {\r\n stop = stop + len;\r\n }\r\n var temp = a[start];\r\n var i = 0;\r\n if (start < stop) {\r\n while (i < stop) {\r\n a[i] = a[i + 1];\r\n i++;\r\n }\r\n\r\n } else {\r\ni=len-1;\r\n while (i >= stop) {\r\n a[i] = a[i - 1];\r\n i--;\r\n }\r\n\r\n }\r\n a[stop] = temp;\r\n return a;\r\n}", "title": "" }, { "docid": "cbbeb35a11840d3afa18d3de5d9eabf2", "score": "0.6543051", "text": "function swap(idx1, idx2, arr) {\n let temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "3c66275a5dc36551df5e8f8134f5cd00", "score": "0.65273815", "text": "function swap( arr, posA, posB ) {\n var temp = arr[posA];\n arr[posA] = arr[posB];\n arr[posB] = temp;\n}", "title": "" }, { "docid": "779694e410a5d93d323c7a1f7b3d0880", "score": "0.65221554", "text": "function copyArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n var to = clamp$1(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n }", "title": "" }, { "docid": "8b0fc09352ca012b86fcab670797b11b", "score": "0.648776", "text": "function swapElement(array, indexA, indexB) {\n const temp = array[indexA];\n array[indexA] = array[indexB];\n array[indexB] = temp;\n }", "title": "" }, { "docid": "6b91f0669ad6466f34ba3524d0dca592", "score": "0.648754", "text": "function swapItems(arr,index1,index2){\n temp=arr[index1];\n arr[index1]=arr[index2];\n arr[index2]=temp;\n return arr;\n}", "title": "" }, { "docid": "a700caf480dbbe858007e9aa061c961e", "score": "0.6484274", "text": "function replaceElement(array, newElement, index) {\r\n var copy = array.slice();\r\n copy[index] = newElement;\r\n return copy;\r\n}", "title": "" }, { "docid": "a700caf480dbbe858007e9aa061c961e", "score": "0.6484274", "text": "function replaceElement(array, newElement, index) {\r\n var copy = array.slice();\r\n copy[index] = newElement;\r\n return copy;\r\n}", "title": "" }, { "docid": "e246de614ced6ba28fc9fc36c8042259", "score": "0.6482292", "text": "function swap (arr, pos1, pos2) {\n var arr = arr, pos1 = pos1, pos2 = pos2, temp;\n\n temp = arr[pos1];\n arr[pos1] = arr[pos2];\n arr[pos2] = temp;\n\n return arr;\n}", "title": "" }, { "docid": "f973cd53951d2fbdf9dc72894d8dd695", "score": "0.64721626", "text": "function swap(array, idx1, idx2) {\n var temp = array[idx1];\n array[idx1] = array[idx2];\n array[idx2] = temp;\n}", "title": "" }, { "docid": "38ea2806be12e91b653073716c2796a2", "score": "0.64720875", "text": "function moveToBack (inArr, outArr, numOfElements) {\n for (var i = 0; i < numOfElements; i++) {\n var temp = inArr.shift();\n outArr.push(temp);\n }\n}", "title": "" }, { "docid": "0f6710534dd0795c959380f16bcd3dd3", "score": "0.6441115", "text": "function _swapArrayItems(array, leftIndex, rightIndex) {\n const temp = array[leftIndex];\n array[leftIndex] = array[rightIndex];\n array[rightIndex] = temp;\n }", "title": "" }, { "docid": "c7dc71c7700ee51e957cbbd17e329ad8", "score": "0.64341474", "text": "function swap(arr, idx1, idx2) {\n let temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "9fe6b130d824a03b45192b50602337e4", "score": "0.6428921", "text": "function moveElementToEnd(array, toMove) {\n let lastIndexToMove = null;\n\n for (let index = 0; index < array.length; index++) {\n if (array[index] === toMove) {\n if (lastIndexToMove === null) {\n lastIndexToMove = index;\n }\n } else if (lastIndexToMove !== null) {\n array[lastIndexToMove] = array[index];\n array[index] = toMove;\n lastIndexToMove++;\n }\n }\n\n return array;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.64276356", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.64276356", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.64276356", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.64276356", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "fbbea2aec4f154cb8669ca0b798d0e36", "score": "0.6403998", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n} ////////////////////////////////////////////////////////////////////////////////", "title": "" }, { "docid": "c9948bac801a3867837f92f0c15b6ac9", "score": "0.6394712", "text": "function swap(arr, idx1, idx2) {\n let temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "ba6fc493829c24161a09a2076a694785", "score": "0.63902533", "text": "function moveElementToEnd(array, toMove) {\n\n let i = 0; \n let j = array.length - 1;\n\n while (i < j) {\n while(i < j && array[j] === toMove) {\n j --;\n }\n\n if(array[i] === toMove) {\n swap(i, j, array);\n }\n i++;\n }\n\n return array;\n\n\n\n}", "title": "" }, { "docid": "863d7ec2a534505e123cfe3aedf90bef", "score": "0.6380422", "text": "function swap(array, a, b) {\n\t\t\tvar temp = array[a];\n\t\t\tarray.splice(a, 1, array[b]);\n\t\t\tarray.splice(b, 1, temp);\n\t\t}", "title": "" }, { "docid": "c06121b9edda51276e1754a9005dc964", "score": "0.63787144", "text": "function moveElementToEnd(array, toMove) {\n \tlet left = 0;\n\tlet right = array.length - 1;\n\t\n\twhile(left < right) {\n\t\tif (array[left] !== toMove) {\n\t\t\tleft++;\n\t\t} else if (array[right] === toMove) {\n\t\t\tright--;\n\t\t} else {\n\t\t\t[array[left],array[right]] = [array[right],array[left]]\n\t\t} \n\t}\n\treturn array\n}", "title": "" }, { "docid": "3ca7ae90e7ba1d4d1e2a47de7c10f2a7", "score": "0.63704425", "text": "function removex(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from: from;\n return array.push.apply(array, rest);\n}", "title": "" }, { "docid": "3ca7ae90e7ba1d4d1e2a47de7c10f2a7", "score": "0.63704425", "text": "function removex(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from: from;\n return array.push.apply(array, rest);\n}", "title": "" }, { "docid": "ffd1ddbd1303acac67a5e32436477db2", "score": "0.63533", "text": "function movefromarrays(first,second){\n for(let elem of second){\n first.push(elem);\n }\n}", "title": "" }, { "docid": "015a0fc5bb2edce0367761eb185fee45", "score": "0.63478494", "text": "function switchArrayEntries(arr,ind1,ind2){\n var temp = arr[ind1];\n arr[ind1] = arr[ind2];\n arr[ind2] = temp;\n //arrays are passed by reference and not by value so\n //there is no need to return anything\n}", "title": "" }, { "docid": "cfc103abff60c2ca9bf7d9b1d12f681a", "score": "0.63458985", "text": "function swap(currentPosition,nextPosition,array){\n\t\tvar temp = array[currentPosition];\n\t\tarray[currentPosition] = array[nextPosition];\n\t\tarray[nextPosition] = temp;\n\t}", "title": "" }, { "docid": "29859bfc733f4aeac7afef8f5006cf87", "score": "0.6344497", "text": "function arrayReplaceAt(src, pos, newElements) {\n\t return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n\t}", "title": "" }, { "docid": "2720fdabdb513797f6ecde65c04ef48b", "score": "0.6343818", "text": "function swapRows(array, from, to) {\n console.log(array, from, to);\n var tmp = array[from];\n array[from] = array[to];\n array[to] = tmp;\n }", "title": "" }, { "docid": "49c3e0575adf45afdb4db59a9cc8378c", "score": "0.6333572", "text": "function MoveInArray(arr, newPos, oldPos, hasId) {\n var savedOld = arr[oldPos];\n if (newPos > oldPos) {\n for (var i = oldPos; i < newPos; i++) {\n arr[i] = arr[i + 1];\n if (hasId) {\n arr[i]._id = i;\n }\n }\n }\n else {\n for (var i = oldPos; i > newPos; i--) {\n arr[i] = arr[i - 1];\n if (hasId) {\n arr[i]._id = i;\n }\n }\n }\n arr[newPos] = savedOld;\n if (hasId) {\n arr[newPos]._id = newPos;\n }\n }", "title": "" }, { "docid": "89e9f0ca50003a4d8b86dcaa5186b323", "score": "0.6329362", "text": "function copyAndUpdateArr(array, index, value) {\n let result = arr.slice(0, array.length);\n result[index] = value;\n return result;\n}", "title": "" }, { "docid": "28be02d118cad7bd1197671d898661d0", "score": "0.63229036", "text": "function moveElementToEnd(array, toMove) {\n let firstMatchingIndex = array.indexOf(toMove);\n if(firstMatchingIndex < 0) return array;\n for(let i=firstMatchingIndex + 1; i<array.length; i++) {\n if(array[i] !== toMove) {\n [array[firstMatchingIndex], array[i]] = [array[i], array[firstMatchingIndex]];\n firstMatchingIndex++;\n }\n }\n return array;\n }", "title": "" }, { "docid": "d1ef3eada06c5212363e508e6f61f264", "score": "0.63215834", "text": "function moveElementToEnd(array, toMove) {\n let i = 0;\n let j = array.length - 1;\n while (i < j) {\n while (i < j && array[j] === toMove) {\n j--;\n }\n if (array[i] === toMove) {\n swap(i, j, array);\n }\n i++;\n }\n return array;\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.63133806", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "7642a3e0be06af0512077f25b50cbbde", "score": "0.630842", "text": "function moveElements(source, target, moveCheck) {\n for (var i = 0; i < source.length; i++) {\n var element = source[i];\n\n if (moveCheck(element)) {\n source.splice(i, 1);\n target.push(element);\n i--;\n }\n }\n}", "title": "" }, { "docid": "2e851f3f76253518050370f54eb84e9b", "score": "0.6305861", "text": "shiftItems(index) {\n for (let i = index; i < this.length - 1; i++) {\n this.data[i] = this.data[i + 1];\n }\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "2bfedb60dc24184e9c83d267622e1217", "score": "0.6297329", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n }", "title": "" }, { "docid": "93d3acf969d56fa45e862fbb6cdcdba6", "score": "0.62803197", "text": "function removeElement(index , array){\n for(let i = index ; i<array.length-1 ; i++){\n array[i] = array[i+1];//shifting to left to override element\n }\n array.pop(); //reducing size of array\n}", "title": "" }, { "docid": "dab1dfce2d3594f16810bc7206ff388d", "score": "0.6278854", "text": "function swap(arr, idx1, idx2){\n // add whatever you parameters you deem necessary, good luck!\n [arr[idx1], arr[idx2]] = [arr[idx2],arr[idx1]]\n return arr;\n}", "title": "" }, { "docid": "7dec85ee12e846cb979198b9c866b7dd", "score": "0.6276332", "text": "function swap (arr, i, j){\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n}", "title": "" }, { "docid": "5ca098e5ded60bfb8bcd3eb4cb07111a", "score": "0.62740904", "text": "function shift(arr) {\n var firstElement = arr[0];\n var i;\n for (i = 1; i < arr.length; i++) {\n arr[i - 1] = arr[i];\n }\n arr.length = arr.length - 1;\n return firstElement;\n}", "title": "" }, { "docid": "b8ab113bab442a68cc349784729518ce", "score": "0.627166", "text": "function swap(arr, x, y) {\n var tmp = arr[x];\n arr[x] = arr[y];\n arr[y] = tmp;\n }", "title": "" }, { "docid": "5c012ecc75f4ff3c01e0cb97d3881416", "score": "0.6268373", "text": "function swap(arr, i, j) {\r\n let tmp = arr[i];\r\n arr[i] = arr[j]\r\n arr[j] = tmp\r\n\r\n}", "title": "" }, { "docid": "124c458204c68f69b0b0c5cc40b92ed5", "score": "0.6262789", "text": "function Task2(array,index, newValue){\n return array.splice(index,0, newValue);\n}", "title": "" } ]
e43376dbe2f302eeefef67a5cbc91f8e
Opens the document at the given urls
[ { "docid": "cdfd4d7037d64a6dee452548d7ac6d7e", "score": "0.0", "text": "function aa(t,e,o,a){null==a&&(\"function\"==typeof e?(a=e,e=null):\"function\"==typeof o&&(a=o,o=null));var n=0,i=!1,l={},r=Eo(e,ya.annotations),s=Eo(o||t,ya.forms);Ma.annotationsurl=r?r.url:Ma.annotationsurl,Ma.formsurl=s?s.url:Ma.formsurl;var c=function(){n--,0>=n&&(Io(!0),ca({type:\"documentloaded\"}),\"function\"==typeof a&&a.call())};if(\"string\"==typeof t)0===t.length?Go(c):(Ma.documenturl=t,Aa.initialized&&(Se(),Ie(),go(),F(xa.scrollH),F(xa.scrollV),n++,0===t.length&&Go(c),Ma.allowannotations&&r&&r.data&&(Bo(),da.extend(l,r.data)),Ma.allowforms&&s&&s.data&&(Lo(),da.extend(l,s.data)),i=!0,Ao(l,c)));else{var u=!!(null==t&&Ma.documenturl.length>0&&(e||\"\"===e||o||\"\"===o));u||f(\"openUrlError\",\"string input expected for document url.\")}i||(r&&(n++,Uo(r,c)),s&&(n++,So(s,c)))}", "title": "" } ]
[ { "docid": "489d7a6d1a95eb3daf740c359c55c8e8", "score": "0.69052976", "text": "function openDocument(location){\nvar fileRef = new File(location);\nvar docRef = app.open(fileRef);\n}", "title": "" }, { "docid": "7eca4db282ccf16a70764838f0019394", "score": "0.6432828", "text": "function pageLinks(i) {\n var links = [\n \"documentation.pdf\",\n \"setup.html\",\n \"expansion.html\"\n ];\n window.open(links[i],\"_blank\");\n}", "title": "" }, { "docid": "bc32a31127de94cee89df8ac9e114a6a", "score": "0.6093713", "text": "function openUrl(url) {\n gui.Shell.openExternal(url);\n}", "title": "" }, { "docid": "89d6e5f548da05c596fe1639716503a4", "score": "0.5977057", "text": "async loadFiles(uris) {\n uris = uris.filter(uri => this.getDocument(uri) == null);\n if (!uris.length)\n return;\n let bufnrs = await this.nvim.call('coc#util#open_files', [uris.map(u => vscode_uri_1.URI.parse(u).fsPath)]);\n let create = bufnrs.filter(bufnr => this.getDocument(bufnr) == null);\n if (!create.length)\n return;\n create.map(bufnr => this.onBufCreate(bufnr).logError());\n return new Promise((resolve, reject) => {\n let timer = setTimeout(() => {\n disposable.dispose();\n reject(new Error(`Create document timeout after 2s.`));\n }, 2000);\n let disposable = this.onDidOpenTextDocument(() => {\n if (uris.every(uri => this.getDocument(uri) != null)) {\n clearTimeout(timer);\n disposable.dispose();\n resolve();\n }\n });\n });\n }", "title": "" }, { "docid": "9fbce0864b17ec3205927d542779e2d1", "score": "0.5959469", "text": "function openPage(url){\r\n\twindow.open(url,'_blank');\r\n}", "title": "" }, { "docid": "fb75c265d15f43591cb303c9ac53e34b", "score": "0.59432244", "text": "function openURL(url) {\n window.open(url, \"_blank\");\n}", "title": "" }, { "docid": "8cb370085236357ed7e650a6f68c6039", "score": "0.58647865", "text": "function open (url, target) {\n if (target) {\n global.open(url, target)\n } else {\n global.location.href = url\n }\n }", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5818876", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "8c48561a00824dad55fc1660ef1391b6", "score": "0.5797588", "text": "function openThisFile(masterFileNameAndPath)\n{\n var fileRef = new File(masterFileNameAndPath)\n if (fileRef.exists)\n //open that doc\n {\n app.open(fileRef);\n }\n else\n {\n alert(\"error opening \" + masterFileNameAndPath)\n }\n}", "title": "" }, { "docid": "6a00243d2616a5d5e92999fe46511a11", "score": "0.57897586", "text": "function openStream()\n{\n\tvar tips = getLocalFormatString(\"tips.openUrl.prompt\", \"Xulplayer\", \"http, rtsp, mms\");\n\tvar urls = prompt(tips, getLocalString(\"tips.openUrl.title\"), \"\");\n\tif (urls) {\n\t\taddFile(urls, 0);\n\t\tstartPlay(urls);\n\t}\n}", "title": "" }, { "docid": "ae44c3860c6274fbe79b921a26376290", "score": "0.57701576", "text": "function doc_open (dir, basename) {\n var norm_path = path.normalize(dir);\n if (basename.slice(-4) === \".txt\"\n || basename.slice(-2) === \".c\") {\n open_textfile(path.join(norm_path, basename));\n } else if (basename.slice(-5) === \".html\"\n || basename.slice(-4) === \".htm\"\n || basename.slice(-4) === \".pdf\") {\n open_html(path.join(norm_path, basename));\n\n } else {\n pdsend(\"pd open\", enquote(basename), enquote(norm_path));\n }\n}", "title": "" }, { "docid": "a600a368416dcfed04b9fa58413e1db8", "score": "0.5730225", "text": "function openFiles() {\n\tgapi.load('auth', {\n\t\t'callback' : onAuthApiLoad\n\t});\n\tgapi.load('picker', {\n\t\t'callback' : onPickerApiLoad\n\t});\n}", "title": "" }, { "docid": "4d7dde64f8f59b559ab803f3ba885740", "score": "0.57197577", "text": "open (path) {\n browser.url(path)\n }", "title": "" }, { "docid": "1ebda8cebc7f2d9a5db513749557af6f", "score": "0.57179195", "text": "function openLinks() {\r\n console.debug(\"openLinks. We have \" + _selectedLinks.length + \" to open\");\r\n\r\n // Open the links\r\n var linkUrls = [];\r\n\r\n for (var i = 0; i < _selectedLinks.length; i++) {\r\n var url = _selectedLinks[i].href;\r\n\r\n // Only add if unique\r\n if (linkUrls.indexOf(url) === -1) {\r\n linkUrls.push(url);\r\n }\r\n }\r\n\r\n if (linkUrls.length > 0) {\r\n browser.runtime.sendMessage({\r\n action: \"openUrls\",\r\n urls: linkUrls\r\n });\r\n }\r\n \r\n // Then remove the box\r\n cleanUp(); \r\n}", "title": "" }, { "docid": "ae0ce2eb4aaaa708d887abe872885d52", "score": "0.571703", "text": "function doc_open (dir, basename) {\n // normalize to get rid of extra slashes, \"..\" and \".\"\n var norm_path = path.normalize(dir);\n if (basename.slice(-4) === \".txt\"\n || basename.slice(-2) === \".c\") {\n open_textfile(path.join(norm_path, basename));\n } else if (basename.slice(-5) === \".html\"\n || basename.slice(-4) === \".htm\"\n || basename.slice(-4) === \".pdf\") {\n open_html(path.join(norm_path, basename));\n\n } else {\n pdsend(\"pd open\", enquote(defunkify_windows_path(basename)),\n enquote(defunkify_windows_path(norm_path)));\n }\n}", "title": "" }, { "docid": "1eab3c2e193880df249f1ea6011e76e3", "score": "0.56991374", "text": "function content_handler_doc_viewer (ctx) {\n ctx.abort(); // abort the download\n let uri = ctx.launcher.source.spec;\n let docviewuri = \"http://docs.google.com/viewer?url=\" + encodeURI(uri);\n ctx.frame.location = docviewuri;\n\n // copy original url to clipboard\n writeToClipboard(uri);\n ctx.window.minibuffer.message(\"Copied: \" + uri);\n}", "title": "" }, { "docid": "b440e032a0da9240dbf708af14012428", "score": "0.5635569", "text": "function pd_doc_open(dir, basename) {\n doc_open(path.join(gui_dir, dir), basename);\n}", "title": "" }, { "docid": "de5b86059dd600462cd4e0691f4d5d0a", "score": "0.5628089", "text": "function loadFromUri() {\n $(\"#document_uri_area\").slideUp();\n var uri = $('input[name=\"document_uri\"]').val();\n if (uri != null) {\n DocuViewareAPI.LoadFromUri(\"docuView\"\n , uri\n , updateToolbarUI\n , updateToolbarUI\n );\n }\n}", "title": "" }, { "docid": "b69cedea86094864e874d5cf67b51bff", "score": "0.5623843", "text": "function openPDF() {\n\t\tvar fileName = 'motiur.pdf';\n\n\t\t// For iOS 11.2, workaround the Apple issue by creating a temporary file and\n\t\t// reference it. It will be removed from filesystem once the app closes.\n\t\t// Read more here: http://nshipster.com/nstemporarydirectory/\n\t\tif (isiOS11_2()) {\n\t\t\tfileName = fileInTemporaryDirectory(fileName);\n\t\t}\n\n\t\tvar docViewer = Ti.UI.iOS.createDocumentViewer({\n\t\t\turl : fileName\n\t\t});\n\n\t\tdocViewer.show();\n\t}", "title": "" }, { "docid": "f370e2c45ae085c6424f8d306024d578", "score": "0.55889535", "text": "function openWindows(site_urls) {\n var windows = [], i = 0;\n var web = site_urls.split(' ');\n for(var j= 0; j<=web.length-1; j++){\n var url = web[j]; \n if (url) {\n // Check if the URL contains \"http://\" in the string\n // If it doesn't force \"http://\" to the front of the URL\n if (!url.match(/^(http(s)?):\\/\\//i)) {\n url = 'http://' + url;\n }\n \n // Make sure the url has a length of at least 1 or else\n // do nothing\n if (url.length) {\n windows[i] = window.open(url, 'tabWindow_' + i);\n i++;\n }\n } else {\n alert('No URL Found');\n }\n }\n \n}", "title": "" }, { "docid": "5ce731b12e086e8b1fd4f1edbd8f53d7", "score": "0.5572662", "text": "function DP_OL_window_open(_pObject, _sUrl, _sName, _sFeatures, _bReplace){\n\tswitch(DP_read_obj_type(_pObject)){\n\t\tcase DP_OBJ_TYPE_NULL:\n\t\t\tbreak;\n\t\tcase DP_OBJ_TYPE_WIN:\n\t\tcase DP_OBJ_TYPE_DOC:\n\t\tcase DP_OBJ_TYPE_XML:\n\t\t\targuments[1]=_sUrl=DP_RW_URL(_sUrl);\n\t\t\tbreak;\n\t\tcase DP_OBJ_TYPE_XMLHTTP:\n\t\t\tif(!(new RegExp(str2regExp(DP_GW_URL_S))).test(_sName))\n\t\t\t\t_sName = _sName.replace((\"https://\"+window.location.host+\"/\"),DP_GW_URL_S);\n\t\t\targuments[2]=DP_RW_URL(_sName);\n\t\t\tbreak;\t\t\t\t\n\t\tdefault:\n\t\t\tbreak;\n\t}\t\n\treturn DP_callOriMethod(\"open\", arguments);\n}", "title": "" }, { "docid": "91c7c23d671554c3e88410263a86cbc1", "score": "0.55368996", "text": "open(path) {\n browser.url(path);\n }", "title": "" }, { "docid": "380f37dd85fa9d7dbc4d58d36d1ddba5", "score": "0.55298", "text": "async openFile() {\n const {\n user,\n location: { pathname },\n } = this.props;\n\n if (!user.profile.userProjects.length && pathname === \"/editor\") {\n this.openDocument(\"project\", true);\n return;\n } else {\n this.openDocument(\"file\");\n }\n }", "title": "" }, { "docid": "76b84fd1a496f9dbda6ab9975b1eccc6", "score": "0.55222183", "text": "triggerDoc() {\n window.open(config.docs.subscriptionConfig);\n }", "title": "" }, { "docid": "4907b0a1e772286c704e2cfedfe55b18", "score": "0.54852736", "text": "function openFile() {\n\tdialog.showOpenDialog({\n\t\t\tproperties: ['openFile']\n\t\t},\n\t\tfunction(fileNames) {\n\t\t\tloadPDF(fileNames[0]);\n\t\t})\n}", "title": "" }, { "docid": "2c1ceefce356fb2a8c7506ffc2100753", "score": "0.54830754", "text": "function getDocument(url) {\n var ajax;\n\n ajax=new XMLHttpRequest();\n if(ajax) {\n ajax.onreadystatechange = function() {\n if(ajax.readyState==4 || ajax.readyState=='complete') {\n processLinks(ajax);\n }\n };\n \n ajax.open('get', url, true); \n ajax.setRequestHeader('accept', g.mediaType);\n ajax.send(null);\n }\n\n return false;\n }", "title": "" }, { "docid": "04c7c2dbdcbb20412c55f395d4c1fc4f", "score": "0.545818", "text": "function open_page (href)\r\n{\r\n\twindow.open(href, \"_self\");\r\n}", "title": "" }, { "docid": "d49d9b8e3efaf1e529b24e4ad6cb5126", "score": "0.54581356", "text": "function downloadSources() {\n pdf = document.getElementsByClassName('downloads')[0];\n powerpoint = document.getElementsByClassName('downloads')[1];\n bibtex = document.getElementsByClassName('downloads')[2];\n pdf.href = (\"/downloads/\"+url+\"/publication.pdf\").replace(/\\s+/g, '');\n powerpoint.href = (\"/downloads/\"+url+\"/slides.pptx\").replace(/\\s+/g, '');\n bibtex.href = (\"/downloads/\"+url+\"/bibtex.bib\").replace(/\\s+/g, '');\n}", "title": "" }, { "docid": "6240cb9ed5231580a0f2ff6e8cba769d", "score": "0.54572016", "text": "_updateLink(n) {\n const url = $(n).attr(\"href\");\n if (url !== undefined) {\n const [file, fragment] = url.split('#', 2);\n const docIndex = this._report.documentSetFiles().indexOf(file);\n if (!url.includes('/') && docIndex != -1) {\n $(n).click((e) => { \n this._showDocumentAndElement(docIndex, fragment);\n e.preventDefault(); \n });\n }\n else if (file) {\n // Open target in a new browser tab. Without this, links will\n // replace the contents of the current iframe in the viewer, which\n // leaves the viewer in a confusing state.\n $(n).attr(\"target\", \"_blank\");\n }\n }\n }", "title": "" }, { "docid": "bdf757137a658cd429d058a895fc9fef", "score": "0.5456131", "text": "function visualizarDoc(file = null, filename = null) {\n let pdfURL = null;\n\n if (file) {\n switch (file) {\n case \"docImovel\":\n pdfURL = URL.createObjectURL(pdfImovel);\n window.open(pdfURL, \"_blank\");\n break;\n case \"docProprietario\":\n pdfURL = URL.createObjectURL(pdfProprietario);\n window.open(pdfURL, \"_blank\");\n break;\n }\n }\n\n if (filename) {\n window.open(\"/static/uploads/docs/\" + filename, \"_blank\");\n }\n}", "title": "" }, { "docid": "4432643ad6a38fca1d5bf8948832315c", "score": "0.5449726", "text": "function open_doc(doc_id) {\n // var doc = DocumentApp.openById(doc_id);\n var doc = DocumentApp.openById(doc_id);\n content = doc.getBody();\n return content.getText();\n}", "title": "" }, { "docid": "90768bd868691d8a1eccd7ad7844fa24", "score": "0.5430407", "text": "function pd_doc_open(dir, basename) {\n doc_open(path.join(lib_dir, dir), basename);\n}", "title": "" }, { "docid": "9bc6f8744f56104d44e4f12f529b4c1c", "score": "0.5414963", "text": "function openListing (url,name)\r\n\t{\r\n\t\topenWindow(url,name,'height=600,width=658','height=584,width=627','height=602,width=654','height=595,width=640','scrollbars=yes');\r\n\t}", "title": "" }, { "docid": "3b7a3f7d3c8b1f026366e526ef2d4b88", "score": "0.5413804", "text": "function mybooks()\n{\n\twindow.open(\"/mybooks\",'_self', false);\n}", "title": "" }, { "docid": "b6a3822749429c72de85cc7a4984271b", "score": "0.5410414", "text": "open (path) {\n return browser.url(path)\n }", "title": "" }, { "docid": "bf0bf5e0864ceddb8fc446a471e2de78", "score": "0.5402331", "text": "open() {\n super.open('/') //provide your additional URL if any. this will append to the baseUrl to form complete URL\n browser.pause(1000);\n }", "title": "" }, { "docid": "a31ab356e82036ce2c9d02744e7163bc", "score": "0.5392509", "text": "function getInstructions(url) {\n console.log('function is working');\n window.open(url, '_blank');\n}", "title": "" }, { "docid": "90cefffed801c1550b867bf6af101efe", "score": "0.5391366", "text": "function loadDoc(url, cFunction) {\n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n }", "title": "" }, { "docid": "224bde520fd63c22a12eb7d815feb33c", "score": "0.53734505", "text": "function browseAutomatically(urls, loadTime, linkNum, sendResponse) {\n\tif (!urls) {\n\t\tsendResponse(\"Must provide URL file.\");\n\t\treturn;\n\t}\n \n clearData();\n \n chrome.tabs.create({url: \"about:blank\"}, function(tab) { \n setTimeout(function() { browseToNext(urls, urls.length, \n 0, loadTime, linkNum, tab.id, sendResponse); }, 1000);\n });\n}", "title": "" }, { "docid": "347e2747eda6e29bede8b22090644abb", "score": "0.53561306", "text": "function loadDoc(url) {\r\n\t\tdisableFastPageLoadButton();\r\n\t\tdocument.getElementById('generalPurpose').src = url;\r\n}", "title": "" }, { "docid": "dd1d351ec3644e832586aaaf7e5c54ef", "score": "0.5344726", "text": "function openInvitations(url) {\n window.open(url, \"_blank\", \"toolbar=yes, scrollbars=yes, resizable=yes, top=0, left=50%, width=700, height=635\");\n}", "title": "" }, { "docid": "06f8284b0865b2643769ef18ee537a9b", "score": "0.53413254", "text": "onReady(fileNamesToOpen) {\n this.win = this.openWindow(fileNamesToOpen);\n }", "title": "" }, { "docid": "73edc618d26f39e12bb8cecf40dc90ad", "score": "0.5341065", "text": "function openEditors()\r\n\t\t\t{\r\n\t\t\t\tvar Dialog, List, Option, DocIndex, StyleIndex, ScriptIndex, HTMLIndex, m_FocusIndex = -1,\r\n\t\t\t\tTextIndex, EditBtn, TableDiv, Table, TBody, DocListRow, DocListCell, DocListIconSpan, DocListNameSpan;\r\n\t\t\t\t// popup a dialog with a list control to select the files to edit\r\n\t\t\t\t\r\n\t\t\t\tbuildDocList();\r\n\t\t\t\t\r\n\t\t\t\tEditBtn = \r\n\t\t\t\t{\r\n\t\t\t\t\ttext: $.i18n._(\"Edit\"),\r\n\t\t\t\t\tclick: function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar Index, SelOption;\r\n\t\t\t\t\t\t$(document).off(\"keydown\", keyNavigationHandler);\r\n\t\t\t\t\t\t$(Dialog).remove();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSelOption = TBody[0].childNodes[Index];\r\n\t\t\t\t\t\t\tif (SelOption.selected)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tDocListCell = TBody[0].childNodes[Index].childNodes[0];\r\n\t\t\t\t\t\t\t\topenEditorTab(DocListCell.value.fullurl, DocListCell.value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdisabled: true\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tDialog = $('<div title=\"Linked files\" class=\"linked-file-browser\"></div>');\r\n\t\t\t\t$(Dialog).dialog(\r\n\t\t\t\t{\r\n\t\t\t\t\tmodal: true,\r\n\t\t\t\t\tbuttons: \r\n\t\t\t\t\t[\r\n\t\t\t\t\t\tEditBtn,\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttext: $.i18n._(\"Cancel\"),\r\n\t\t\t\t\t\t\tclick: function()\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$(document).off(\"keydown\", keyNavigationHandler);\r\n\t\t\t\t\t\t\t\t$(Dialog).remove();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\tminWidth: 300,\r\n\t\t\t\t\tminHeight: 300,\r\n\t\t\t\t\tresize: function(event, ui) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tupdateSize();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdialogClass: \"linkedfilesdialog\"\r\n\t\t\t\t});\r\n\t\t\r\n\t\t\t\tfunction updateSize()\r\n\t\t\t\t{\r\n\t\t\t\t\tTableDiv.css({'height' : Dialog.height(), 'width' : Dialog.width() });\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tTableDiv = $('<div></div>').addClass(\"doclist-container\").appendTo(Dialog);\r\n\t\t\t\tTable = $('<table></table>').addClass(\"doc-list\").appendTo(TableDiv);\r\n\t\t\t\tTBody = $('<tbody></tbody>').appendTo(Table);\r\n\t\t\r\n\t\t\t\t/// Handler used to enable navigation in the list by using the keyboard \r\n\t\t\t\tfunction keyNavigationHandler(p_Event)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar StartFocusIndex = m_FocusIndex, PageSize = 8, Index, ClientRect;\r\n\t\t\t\t\tp_Event = (p_Event) ? p_Event : window.event;\r\n\t\t\r\n\t\t\t\t\tClientRect = { left:TableDiv[0].offsetLeft, top:TableDiv[0].offsetTop, right:(TableDiv[0].offsetLeft + TableDiv[0].offsetWidth), bottom: (TableDiv[0].offsetTop + TableDiv[0].offsetHeight) };\r\n\t\t\r\n\t\t\t\t\tvar KeyCodes = \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tKC_UP: 38,\r\n\t\t\t\t\t\tKC_DOWN: 40,\r\n\t\t\t\t\t\tKC_PAGEUP: 33,\r\n\t\t\t\t\t\tKC_PAGEDOWN: 34\r\n\t\t\t\t\t};\r\n\t\t\r\n\t\t\t\t\tswitch (p_Event.keyCode)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tcase KeyCodes.KC_UP:\t\t\tm_FocusIndex--;\tbreak;\r\n\t\t\t\t\tcase KeyCodes.KC_DOWN:\t\t\tm_FocusIndex++;\tbreak;\r\n\t\t\t\t\tcase KeyCodes.KC_PAGEUP:\t\tm_FocusIndex -= PageSize;\tbreak;\r\n\t\t\t\t\tcase KeyCodes.KC_PAGEDOWN:\t\tm_FocusIndex += PageSize;\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tif (m_FocusIndex < 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tm_FocusIndex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (m_FocusIndex >= m_AvailableDocs.getDocCount())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tm_FocusIndex = m_AvailableDocs.getDocCount() - 1;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t// if the shift key is pressed, selection will add to the current selection\r\n\t\t\t\t\tif (p_Event.shiftKey)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (StartFocusIndex < 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tStartFocusIndex = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\tif (StartFocusIndex < m_FocusIndex)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor (Index = StartFocusIndex; Index <= m_FocusIndex; Index++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tChildRow = TBody[0].childNodes[Index];\r\n\t\t\t\t\t\t\t\tChildRow.selected = true;\r\n\t\t\t\t\t\t\t\tChildRow.className = \"selected\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor (Index = m_FocusIndex; Index <= StartFocusIndex; Index++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tChildRow = TBody[0].childNodes[Index];\r\n\t\t\t\t\t\t\t\tChildRow.selected = true;\r\n\t\t\t\t\t\t\t\tChildRow.className = \"selected\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // else we will reset all selected items and select the current focus item\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// unselect all and select m_FocusIndex\r\n\t\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar ChildRow = TBody[0].childNodes[Index];\r\n\t\t\r\n\t\t\t\t\t\t\tif (Index == m_FocusIndex)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tChildRow.selected = true;\r\n\t\t\t\t\t\t\t\tChildRow.className = \"selected\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tChildRow.selected = false;\r\n\t\t\t\t\t\t\t\tChildRow.className = \"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tvar FocusChild = TBody[0].childNodes[m_FocusIndex];\r\n\t\t\r\n\t\t\t\t\tif (FocusChild.offsetTop - TableDiv[0].scrollTop < 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tTableDiv[0].scrollTop += FocusChild.offsetTop - TableDiv[0].scrollTop; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (FocusChild.offsetTop + FocusChild.offsetHeight > ClientRect.bottom - ClientRect.top + TableDiv[0].scrollTop)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tTableDiv[0].scrollTop += FocusChild.offsetTop + FocusChild.offsetHeight - (ClientRect.bottom - ClientRect.top + TableDiv[0].scrollTop);\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tp_Event.preventDefault();\r\n\t\t\t\t\tp_Event.cancelBubble = true;\r\n\t\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t// add the keyboard handler\r\n\t\t\t\t$(document).on(\"keydown\", keyNavigationHandler);\r\n\t\t\r\n\t\t\t\tfunction applyIcon($p_DocListIconSpan, p_IconName)\r\n\t\t\t\t{\r\n\t\t\t\t\tMimeTypeImageRetriever.getMimeTypeImagePath(p_IconName, function(p_Path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$p_DocListIconSpan.css(\"background-image\", \"url('\" + p_Path + \"')\");\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\t// fill the list with available document types\r\n\t\t\t\tfor (DocIndex = 0; DocIndex < m_AvailableDocs.getDocCount(); DocIndex++)\r\n\t\t\t\t{\r\n\t\t\t\t\tDocListRow = $('<tr/>').appendTo(TBody);\r\n\t\t\t\t\tDocListCell = $('<td/>').appendTo(DocListRow);\r\n\t\t\t\t\tDocListIconSpan = $('<span/>').addClass(\"icon\").appendTo(DocListCell);\r\n\t\t\t\t\tDocListNameSpan = $('<span/>').addClass(\"name\").appendTo(DocListCell);\r\n\t\t\t\t\tvar DocInfo = m_AvailableDocs.getDocAtIndex(DocIndex);\r\n\t\t\t\t\tDocListCell[0].value = DocInfo;\r\n\t\t\t\t\tvar IconName = \"\";\r\n\t\t\t\t\tswitch(DocInfo.type)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tcase EEditorTypes.ET_CSS.id: IconName = \"css\"; break;\r\n\t\t\t\t\tcase EEditorTypes.ET_JS.id: IconName = \"js\"; break;\r\n\t\t\t\t\tcase EEditorTypes.ET_HTML.id: IconName = \"html\"; break;\r\n\t\t\t\t\tcase EEditorTypes.ET_XML.id: IconName = \"xml\"; break;\r\n\t\t\t\t\tcase EEditorTypes.ET_PLAINTEXT.id: IconName = \"txt\"; break;\r\n\t\t\t\t\tcase EEditorTypes.ET_JSON.id: IconName = \"json\"; break;\r\n\t\t\t\t\tdefault: IconName = \"\"; break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tapplyIcon(DocListIconSpan, IconName);\r\n\t\t\t\t\tDocListNameSpan.text(DocInfo.name);\r\n\t\t\t\t\tDocListCell.attr(\"title\", DocInfo.fullurl);\r\n\t\t\t\t}\r\n\t\t\t\t// add a handler for clicking in the list\r\n\t\t\t\t$(Table[0]).on(\"click\", function(p_Event)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar HasSelected, Index;\r\n\t\t\t\t\tp_Event = (p_Event) ? p_Event : window.event;\r\n\t\t\r\n\t\t\t\t\tvar Row = p_Event.target;\r\n\t\t\t\t\twhile (Row && Row.nodeName != \"TR\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tRow = Row.parentNode;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tif (p_Event.ctrlKey)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tRow.selected = !Row.selected;\r\n\t\t\t\t\t\tRow.className = (Row.selected) ? \"selected\" : \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!Row.selected)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tHasSelected = false;\r\n\t\t\t\t\t\t\tvar SelectStart = -1;\r\n\t\t\t\t\t\t\tvar SelectEnd = -1;\r\n\t\t\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (TBody[0].childNodes[Index] === Row)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tSelectEnd = Index;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (TBody[0].childNodes[Index].selected)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif (SelectStart < 0 || Math.abs(SelectStart - SelectEnd) < Math.abs(Index - SelectEnd))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tSelectStart = Index;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t\tif (SelectStart > SelectEnd)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar Temp = SelectStart;\r\n\t\t\t\t\t\t\t\tSelectStart = SelectEnd;\r\n\t\t\t\t\t\t\t\tSelectEnd = Temp;\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t\tif (SelectStart < 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSelectStart = SelectEnd;\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t\tRow.selected = true;\r\n\t\t\t\t\t\t\tRow.className = \"selected\";\r\n\t\t\r\n\t\t\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar ChildRow = TBody[0].childNodes[Index];\r\n\t\t\r\n\t\t\t\t\t\t\t\tif (Row === ChildRow || p_Event.shiftKey && Index >= SelectStart && Index <= SelectEnd)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tChildRow.selected = true;\r\n\t\t\t\t\t\t\t\t\tChildRow.className = \"selected\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tChildRow.selected = false;\r\n\t\t\t\t\t\t\t\t\tChildRow.className = \"\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tHasSelected = false;\r\n\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (TBody[0].childNodes[Index].selected)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tHasSelected = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (TBody[0].childNodes[Index] === Row)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tm_FocusIndex = Index;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t$(\".linkedfilesdialog .ui-dialog-buttonpane button:contains('\" + EditBtn.text + \"')\").button(HasSelected ? \"enable\" : \"disable\");\r\n\t\t\r\n\t\t\t\t\tp_Event.preventDefault();\r\n\t\t\t\t\tp_Event.cancelBubble = true;\r\n\t\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t\t// add a handler for double clicking in the list (this will select annd then open the item being double clicked)\r\n\t\t\t\t$(Table[0]).on(\"dblclick\", function(p_Event)\r\n\t\t\t\t{\r\n\t\t\t\t\tp_Event = (p_Event) ? p_Event : window.event;\r\n\t\t\t\t\tvar Index;\r\n\t\t\t\t\tfor (Index = 0; Index < TBody[0].childNodes.length; Index++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (TBody[0].childNodes[Index].selected)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tDocListCell = TBody[0].childNodes[Index].childNodes[0];\r\n\t\t\t\t\t\t\t$(document).off(\"keydown\", keyNavigationHandler);\r\n\t\t\t\t\t\t\t$(Dialog).remove(); \r\n\t\t\t\t\t\t\topenEditorTab(DocListCell.value.fullurl, DocListCell.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tp_Event.preventDefault();\r\n\t\t\t\t\tp_Event.cancelBubble = true;\r\n\t\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "59404b79e2df1b68a87b9a11af6bfe66", "score": "0.5321573", "text": "openUrl(urlToOpen) {\n const parts = url.parse(urlToOpen);\n const main = this.windowManager.get(WindowManager.MAIN_WINDOW);\n\n if (!main) {\n console.log(`Ignoring URL - main window is not available, user may not be authed.`);\n return;\n }\n\n if (parts.protocol === 'mailto:') {\n main.sendMessage('mailto', urlToOpen);\n } else if (parts.protocol === 'nylas:') {\n // if (parts.host === 'calendar') {\n // this.openCalendarURL(parts.path);\n if (parts.host === 'plugins') {\n main.sendMessage('changePluginStateFromUrl', urlToOpen);\n } else {\n main.sendMessage('openExternalThread', urlToOpen);\n }\n } else {\n console.log(`Ignoring unknown URL type: ${urlToOpen}`);\n }\n }", "title": "" }, { "docid": "821ccd12dff625f792a264363e97a192", "score": "0.53168494", "text": "function gui_open_files_via_unique(filenames)\n{\n var i;\n length = filenames.length;\n if (length != 0) {\n for (i = 0; i < length; i++) {\n open_file(filenames[i]);\n }\n }\n}", "title": "" }, { "docid": "34919ec896f7ac61742fd2beb9021f59", "score": "0.5310055", "text": "function openCognosWindow(url, title, params)\n{\t\n\tvar myurl = appendQueryParameters(url, params);\n\topenPopupUrl(myurl, title);\n}", "title": "" }, { "docid": "82de307e67f83728f04cd4b157ce54f9", "score": "0.5309194", "text": "function urlChange(){\n\tif(y == 1){\n\t\tvar win = window.open('https://ccnsb06-iiith.vlabs.ac.in/exp6_10/benzoic/benzoic_acid_IR_expt10.html','_blank');\n win.focus();\n\t}\n\telse{\n\t\tvar win = window.open('https://ccnsb06-iiith.vlabs.ac.in/exp6_10/nitrophenol/2-nitrophenol_IR_expt10.html','_blank');\n win.focus();\n\t}\n}", "title": "" }, { "docid": "b58be58c336563ae98a01a76141154a7", "score": "0.52818125", "text": "function openBOOKM(path) {\n window.location.href = \"viewer.html?\" + path;\n}", "title": "" }, { "docid": "0b661a17a53f206dd807f2af6c7dc220", "score": "0.5276644", "text": "function onClick(urlName){\n window.open(\n urlName,\n '_blank' //open in a new window.\n );\n \n}", "title": "" }, { "docid": "590120816c7b341b47c0236d063945bd", "score": "0.5276468", "text": "function OpenCitiTerms()\n{\nwindow.open(\"https://www.billdesk.com/pgmerc/pgimages/citi-terms.htm\")\n}", "title": "" }, { "docid": "4131aa0894374a29542691695bbb798f", "score": "0.5272157", "text": "function doOpenCallback(filepath) {\n\n filepath = CONFIG.SRCFOLDER + \"/\" + filepath;\n\n logger.info('FILEPATH : ' + filepath);\n\n var theFile = new File(decodeURI(filepath));\n\n if (theFile.exists) {\n try {\n var session = Utils.read_json_file(theFile);\n\n if (typeof(session) == 'object') {\n\n if (session.files) {\n for(i=0; i<session.files.length; i++) {\n var ai_file_path = decodeURIComponent(session.files[i]);\n var thisFile = new File(ai_file_path);\n if (thisFile.exists) {\n doc = app.open(thisFile);\n app.executeMenuCommand('fitall');\n }\n }\n }\n }\n }\n catch(ex) {\n return ex.message;\n }\n }\n else {\n logger.error(filepath + \" does not exist\");\n }\n }", "title": "" }, { "docid": "97af886b6c4e9b46e59966e8d103d603", "score": "0.5271195", "text": "function loadDoc(url, callback) {\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n if (this.readyState == 4 && this.status == 200) {\r\n callback(this);\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "d9231204a3e1772f76caab2880908ba3", "score": "0.52711046", "text": "function loadDoc(url, cFunction, markup) {\n \n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this, markup);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "6389f8363ae179d7844eba5382574211", "score": "0.5264729", "text": "function loadDoc(url, cFunction) {\r\n var xhttp;\r\n xhttp=new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n cFunction(this);\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "8a29ae52c0d8594e166390e7d2b63269", "score": "0.52516633", "text": "function openUrl(theUrl) {\n\t\t\n\t\t//open new tab of clicked url (theUrl)\n\t\tchrome.tabs.create({\n\t\turl: theUrl,\n\t\tactive: true\n\t\t}, function() {});\n}", "title": "" }, { "docid": "839a4e5b4ae2e0a2cbd718423dec72d8", "score": "0.52497864", "text": "clickDocument(doc){\n this.get('commandRegistry').execute(DOCUMENT_OPEN, doc);\n }", "title": "" }, { "docid": "38bf9724d0dda14741859d77fe94ca18", "score": "0.5246063", "text": "function openWebsite(){\n\twindow.open(\"https://www2.gmu.edu/\");\n}", "title": "" }, { "docid": "54fe31c5bd346ae06c5c0ecd8fe28997", "score": "0.5235416", "text": "function openUrl(objectUrl) {\n\n\t$(\"#pageContent\").empty();\n\tloadSpinner();\n\n\t$(\"#pageContent\").load(objectUrl);\n\n}", "title": "" }, { "docid": "e838fe2e76dc8ebe0412da2954b9bfed", "score": "0.52282244", "text": "function open_file()\r\n{\r\n window.location.href=\"index.html\";\r\n}", "title": "" }, { "docid": "d1fd02635d968938d65129bcf16f5e43", "score": "0.5225609", "text": "async getDocumentFromUrl(url, mergeFields, cacheControl, suppressInteraction = false) {\n // Get the content of the new page\n let content = await appCommands.loadPageCacheControlSuppressInteraction(url, cacheControl, suppressInteraction);\n\n // If page content not available then create an alert\n if (!content) {\n var alert = RockTvApp.createAlertDocument(\"Error\", `Was not able to load the page. \\n Page: ${RockTvApp.AppState.HomepageGuid}`);\n return alert;\n }\n\n // Render in merge fields\n if (mergeFields) {\n console.log(\"[INFO] Parsing template \\n\" + content);\n content = content.replace(/\\{\\s*(\\w+)\\s*}/g, (_, v) => (typeof mergeFields[v] != 'undefined') ? mergeFields[v] : '');\n }\n\n // Parse the resulting string content to an XML document\n let templateParser = new DOMParser();\n\n let doc = null;\n try {\n doc = templateParser.parseFromString(content, \"application/xml\");\n }\n catch (err) {\n console.log(\"[ERROR] An error occurred parsing the document.\", err, content);\n var alert = RockTvApp.createAlertDocument(\"Error\", `An error occurred parsing the content provided.`);\n return alert;\n }\n\n if (doc) {\n return doc;\n }\n\n // The document was not able to be parsed so show alert\n var alert = RockTvApp.createAlertDocument(\"Error\", `An invalid page was returned. \\n Page: ${RockTvApp.AppState.HomepageGuid}`);\n return alert;\n }", "title": "" }, { "docid": "4a9a8f6dd4fe40a1f7894a03a54dddb9", "score": "0.52186334", "text": "function OpenOfficeDocument()\n{\n\ttry \n\t{\n\t\tvar blnReadOnly = true;\n\t\t//check the file path\n\t\tif (m_strFileUrl == \"\")\n\t\t\treturn false;\n\t\t//get the open mode\n\t\tif (m_blnEditMode)\n\t\t\tblnReadOnly = false;\n\t\t//open document\n\t\tobjOffice.Open(m_strFileUrl, blnReadOnly);\n\t\tobjOffice.EnableFileCommand(0) = false; //new\n\t\tobjOffice.EnableFileCommand(1) = false; //open\n\t\tobjOffice.EnableFileCommand(3) = false; //save\n\t\tobjOffice.EnableFileCommand(5) = false; //print\n\t\t//save the opened mark\n\t\tm_blnDocumentOpened = true;\n\t\ttry \n\t\t{\n\t\t\tif (m_blnDocumentOpened)\n\t\t\t\tspanDCWJ.style.display = \"\";\n\t\t\telse\n\t\t\t\tspanDCWJ.style.display = \"none\";\n\t\t} catch(e) {}\n\t\t//is microsoft word or Excel?\n\t\tm_blnIsMicrosoftExcel = false;\n\t\tm_blnIsMicrosoftExcel = IsMicrosoftExcel();\n\t\tm_blnIsMicrosoftWord = false;\n\t\tm_blnIsMicrosoftWord = IsMicrosoftWord();\n\t\tif (m_blnIsMicrosoftWord) \n\t\t{\n\t\t\tif (m_blnEditMode) \n\t\t\t{\n\t\t\t\tif (!UnprotectWord()) //unprotect the document\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (!ProtectWord()) //protect current document\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (m_blnTrackRevisions) \n\t\t\t{\n\t\t\t\tif (!EnabledWordRevisions()) //enable document track revisions\n\t\t\t\t\treturn false;\n\t\t\t\tif (!HideWordRevisions()) //hide the revisions\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (!DisableWordRevisions()) //disable document track revisions\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!ShowWordToolbars()) //show office toolbars\n\t\t\t\treturn false;\n\t\t}\n\t\tif (m_blnIsMicrosoftExcel)\n\t\t{\n\t\t\tif (!ShowExcelToolbars()) //show office toolbars\n\t\t\t\treturn false;\n\t\t}\n\t\t//mark the document is not dirty\n\t\tm_blnDocumentIsDirty = false;\n\t\treturn true;\n\t}\n\tcatch (e) \n\t{\n\t\talert(m_strMsg_FileCanNotOpen);\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "9258ee68b347e6c773c0452f3bcf2678", "score": "0.52175605", "text": "function open(location) {\n window.location = location;\n }", "title": "" }, { "docid": "c04b4bcd3ad0c53d7151bda4a7aba9a0", "score": "0.5214184", "text": "function openPreview( url ) {\n\n\t\tclosePreview();\n\n\t\tdom.preview = document.createElement( 'div' );\n\t\tdom.preview.classList.add( 'preview-link-overlay' );\n\t\tdom.wrapper.appendChild( dom.preview );\n\n\t\tdom.preview.innerHTML = [\n\t\t\t'<header>',\n\t\t\t\t'<a class=\"close\" href=\"#\"><span class=\"icon\"></span></a>',\n\t\t\t\t'<a class=\"external\" href=\"'+ url +'\" target=\"_blank\"><span class=\"icon\"></span></a>',\n\t\t\t'</header>',\n\t\t\t'<div class=\"spinner\"></div>',\n\t\t\t'<div class=\"viewport\">',\n\t\t\t\t'<iframe src=\"'+ url +'\"></iframe>',\n\t\t\t'</div>'\n\t\t].join('');\n\n\t\tdom.preview.querySelector( 'iframe' ).addEventListener( 'load', function( event ) {\n\t\t\tdom.preview.classList.add( 'loaded' );\n\t\t}, false );\n\n\t\tdom.preview.querySelector( '.close' ).addEventListener( 'click', function( event ) {\n\t\t\tclosePreview();\n\t\t\tevent.preventDefault();\n\t\t}, false );\n\n\t\tdom.preview.querySelector( '.external' ).addEventListener( 'click', function( event ) {\n\t\t\tclosePreview();\n\t\t}, false );\n\n\t\tsetTimeout( function() {\n\t\t\tdom.preview.classList.add( 'visible' );\n\t\t}, 1 );\n\n\t}", "title": "" }, { "docid": "c04b4bcd3ad0c53d7151bda4a7aba9a0", "score": "0.5214184", "text": "function openPreview( url ) {\n\n\t\tclosePreview();\n\n\t\tdom.preview = document.createElement( 'div' );\n\t\tdom.preview.classList.add( 'preview-link-overlay' );\n\t\tdom.wrapper.appendChild( dom.preview );\n\n\t\tdom.preview.innerHTML = [\n\t\t\t'<header>',\n\t\t\t\t'<a class=\"close\" href=\"#\"><span class=\"icon\"></span></a>',\n\t\t\t\t'<a class=\"external\" href=\"'+ url +'\" target=\"_blank\"><span class=\"icon\"></span></a>',\n\t\t\t'</header>',\n\t\t\t'<div class=\"spinner\"></div>',\n\t\t\t'<div class=\"viewport\">',\n\t\t\t\t'<iframe src=\"'+ url +'\"></iframe>',\n\t\t\t'</div>'\n\t\t].join('');\n\n\t\tdom.preview.querySelector( 'iframe' ).addEventListener( 'load', function( event ) {\n\t\t\tdom.preview.classList.add( 'loaded' );\n\t\t}, false );\n\n\t\tdom.preview.querySelector( '.close' ).addEventListener( 'click', function( event ) {\n\t\t\tclosePreview();\n\t\t\tevent.preventDefault();\n\t\t}, false );\n\n\t\tdom.preview.querySelector( '.external' ).addEventListener( 'click', function( event ) {\n\t\t\tclosePreview();\n\t\t}, false );\n\n\t\tsetTimeout( function() {\n\t\t\tdom.preview.classList.add( 'visible' );\n\t\t}, 1 );\n\n\t}", "title": "" }, { "docid": "e1b037a263b48077834beccafd9291b8", "score": "0.5194529", "text": "function getURL(){\n writeToDocument(releases_url);\n}", "title": "" }, { "docid": "33b2661df2850778894f1e157efcebba", "score": "0.51934195", "text": "_openFiles(files) {\n let fileSet = new cred.io.FileSet(files);\n if (fileSet.isValid()) {\n this._loadDialog(fileSet);\n } else {\n this._controller.notifyErrorOccurred(this, composeOpenDlgErrorMessage(fileSet));\n }\n }", "title": "" }, { "docid": "2c54774c463873796a70bee393d88235", "score": "0.5192491", "text": "function listlinks(d) {\n var newwin = window.open(\"\", \"linklist\", \n \"menubar,scrollbars,resizable,width=600,height=300\");\n\n for (var i = 0; i < d.links.length; i++) {\n newwin.document.write('<A HREF=\"' + d.links[i].href + '\">')\n\tnewwin.document.write(d.links[i].href);\n\tnewwin.document.writeln(\"</A><BR>\");\n }\n newwin.document.close();\n}", "title": "" }, { "docid": "c0286a6ee8a3a67f57adfdf11607b65b", "score": "0.5177046", "text": "function runSetOfUrls(index = 0) {\n if (index >= urls.length) {\n resolve(documents);\n return;\n }\n\n const url = urls[index];\n\n if (!url) {\n info = \"Invalid URL. Ending execution!\";\n writeUI( info ) \n reject(documents);\n return;\n }\n\n info = \"Fetching: \" + url + \" at \" + new Date();\n writeUI( info )\n\n recursiveFetch( url );\n\n setTimeout(() => {\n index++;\n runSetOfUrls(index);\n }, waitBetweenCalls)\n }", "title": "" }, { "docid": "85cd8a3af0bf4b3cfe001f92bc72f596", "score": "0.5175234", "text": "function openUrlOnDomIdClicked(domId, url) {\n $(domId).click(function () {\n self.port.emit(\"openStreamUrl\", url);\n return false;\n });\n}", "title": "" }, { "docid": "53620f4e2421d9c29524248d9a9178d9", "score": "0.51577044", "text": "function projects() {\r\n window.open('projects.html', '_blank');\r\n}", "title": "" }, { "docid": "09f153aa39fed11bff40c95a2b550564", "score": "0.51507646", "text": "function openEmbedded(url) {\n var dialog;\n Office.context.ui.displayDialogAsync(url,\n function (asyncResult) {\n if (asyncResult.status === Office.AsyncResultStatus.Failed) {\n showNotification(asyncResult.error.code = \": \" + asyncResult.error.message);\n dialog = asyncResult.error.code;\n } else {\n dialog = asyncResult.value;\n dialog.addEventHandler(Office.EventType.DialogMessageReceived, processMessage);\n }\n });\n}", "title": "" }, { "docid": "4718a4c24bee01a84eee64424ab4bc04", "score": "0.5144237", "text": "function openPage(path) {\n try { // assign page url\n var separator = path.indexOf('?') > -1 ? '&' : '?'; path = path + separator + '_ajx=yes';\n // start load page contents\n loadPageContents(path);\n }\n catch (ex) {\n console.log(ex);\n }\n }", "title": "" }, { "docid": "ab1c67a7072fa3b39148ad9b008c61c3", "score": "0.51384515", "text": "async openURL (url) {\n // Use SafariView on iOS\n if (Platform.OS === 'ios') {\n SafariView.show({\n url: url,\n fromBottom: true,\n });\n }\n // Or Linking.openURL on Android\n else {\n Linking.openURL(url);\n }\n }", "title": "" }, { "docid": "399ad2ea740a669bd17d4a81014eb749", "score": "0.51332104", "text": "function openHelpSite(){\n openUrl(HELP_SITE_LINK);\n}//openHelpSite()", "title": "" }, { "docid": "528d741a540b3c9fea6c4efda1303154", "score": "0.51255053", "text": "function openNewWin(url) {\n var x = window.open(url, '_blank');\n x.focus();\n}", "title": "" }, { "docid": "d4883716ab4503a1408c276715e51d3f", "score": "0.5124678", "text": "function viewFile() {\n\twindow.open(\"http://\" + site + \"/\" + dir + \"/\" + document.actionform.file.value, \"view\", \"resizable=yes,directories=yes,status=yes,scrollbars=yes,toolbar=yes,location=yes\");\n}", "title": "" }, { "docid": "52badba87d7fdd6d72c86d58fff75843", "score": "0.5119518", "text": "function loadSites(e) {\n\tvar urlschemes = ['http', 'https', 'file', 'view-source'];\n\tvar urls = document.getElementById('urls').value.split('\\n');\n\tvar lazyloading = document.getElementsByName('lazyloading')[0].checked;\n\n\tfor(var i=0; i<urls.length; i++){\n\t\ttheurl = urls[i].trim();\n\t\tif(theurl != '') {\n\t\t\tif(urlschemes.indexOf(theurl.split(':')[0]) == -1) {\n\t\t\t\ttheurl = 'http://' + theurl;\n\t\t\t}\n\t\t\tif(lazyloading && theurl.split(':')[0] != 'view-source' && theurl.split(':')[0] != 'file') {\n\t\t\t\tchrome.tabs.create({url: chrome.extension.getURL('lazyloading.html#') + theurl, selected: false}); \n\t\t\t} else {\n\t\t\t\tchrome.tabs.create({url: theurl, selected: false}); \n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7a0550e10276c7f4a2f64bd2a050e406", "score": "0.5115655", "text": "async open() {\n await this.ndb.open();\n\n await this.indexer.open();\n\n await this.http.open();\n }", "title": "" }, { "docid": "c2f045e28558dbde100f3a547a9d73ab", "score": "0.5115476", "text": "async openResource(uri) {\n let { nvim } = this;\n // not supported\n if (uri.startsWith('http')) {\n await nvim.call('coc#util#open_url', uri);\n return;\n }\n let wildignore = await nvim.getOption('wildignore');\n await nvim.setOption('wildignore', '');\n await this.jumpTo(uri);\n await nvim.setOption('wildignore', wildignore);\n }", "title": "" }, { "docid": "e7145cd8fb803e72a7a759398d0f319e", "score": "0.5101899", "text": "function openURL(url) {\r\n if (window.widget) {\r\n // in WRT\r\n widget.openURL(url);\r\n } else {\r\n // outside WRT\r\n window.open(url, \"NewWindow\");\r\n }\r\n}", "title": "" }, { "docid": "0a2aa8b64978e254364b42001f8d7355", "score": "0.50964713", "text": "function openUrl( url ){\n var html = HtmlService.createHtmlOutput('<html><script>'\n +'window.close = function(){window.setTimeout(function(){google.script.host.close()},9)};'\n +'var a = document.createElement(\"a\"); a.href=\"'+url+'\"; a.target=\"_blank\";'\n +'if(document.createEvent){'\n +' var event=document.createEvent(\"MouseEvents\");'\n +' if(navigator.userAgent.toLowerCase().indexOf(\"firefox\")>-1){window.document.body.append(a)}' \n +' event.initEvent(\"click\",true,true); a.dispatchEvent(event);'\n +'}else{ a.click() }'\n +'close();'\n +'</script>'\n // Offer URL as clickable link in case above code fails.\n +'<body style=\"word-break:break-word;font-family:sans-serif;\"><p>Oops...looks like you have popups blocked. <a href=\"https://support.google.com/chrome/answer/95472\" target=\"_blank\" onclick=\"window.close()\">Learn how to enable popups</a> </p>' \n +'<p><a href=\"'+url+'\" target=\"_blank\" onclick=\"window.close()\">Click here to open a blank form</a>.</p></body>'\n +'<script>google.script.host.setHeight(130);google.script.host.setWidth(410)</script>'\n +'</html>')\n .setWidth( 410 ).setHeight( 1 );\n SpreadsheetApp.getUi().showModalDialog( html, \"Opening...\" );\n}//openUrl()", "title": "" }, { "docid": "f0deb289efb03be703dbe451ff335e35", "score": "0.50814885", "text": "function loadFilesViaXMLHttpRequest(urls, callback, errorCallback, ViaXMLHttpRequest) {\n\tvar numUrls = urls.length;\n\tvar numComplete = 0;\n\tvar result = [];\n\n\t// Callback for a single file\n\tfunction partialCallback(text, index) {\n\t\tresult[index] = text;\n\t\tnumComplete++;\n\n\t\t// When all files have downloaded\n\t\tif (numComplete == numUrls) {\n\t\t\tcallback(result);\n\t\t}\n\t}\n\n\tfor (var i = 0; i < numUrls; i++) {\n\t\tif(ViaXMLHttpRequest) {\n\t\t\tloadFileViaXMLHttpRequest(urls[i], i, partialCallback, errorCallback);\n\t\t} else {\n\t\t\tloadFileViaFileReader(urls[i], i, partialCallback, errorCallback);\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "19c1e23b19aeb9f2ad9864ff26569952", "score": "0.50812227", "text": "function openLinkInBrowser(url) {\n var activity = new MozActivity({\n // Ask for the \"view\" activity\n name: \"view\",\n\n // Provide the data required by the filters of the activity\n data: {\n type: \"url\",\n url: url\n }\n });\n\n activity.onsuccess = function() {\n log(\"the url was opened\");\n };\n\n activity.onerror = function() {\n log(this.error);\n };\n}", "title": "" }, { "docid": "64cea0bba3a608cec10d3dff5acd727d", "score": "0.50684553", "text": "function generateReport() {\n\n window.open(\"/search/report.pdf\" + currentParameters);\n //window.location.href = \"/search/report.pdf\" + currentParameters;\n\n}", "title": "" }, { "docid": "58f98aa211bb42d30363c00dfafbb293", "score": "0.5068395", "text": "function openFiles(ftype, files, withRun){ \n try { \n var table = $(\"table[file-type=\"+ftype+\"]\").dataTable();\n table.fnClearTable();\n files.each(function(){\n table.fnAddData( File.row($(this).attr(\"name\"), withRun) ); \n });\n File.bindEvents(table);\n } catch(e) { if (e.type==null) throw new PsiError(\"PSIXML.PROCESS\",[this._pathtag ? this._pathtag : this.toString(),\"openFiles\", $.isFunction(this.id) ? this.id() : (this.id?this.id:\"\"), e.message ? e.message : e.toString()],[e,this]); else throw e; } \n }", "title": "" }, { "docid": "e3e98129e41ac1813bb8b62893d47b74", "score": "0.5066908", "text": "function open_page (e, word) {\n \te.preventDefault()\n\tbrowser.tabs.create( { \n\t url: WORDURL( word ) \n\t} )\n}", "title": "" }, { "docid": "c8f56827f5b8744bbd2fa27ab0f9e66e", "score": "0.5062725", "text": "function openComments(url) {\n\twindow.open(url, 'Comments', 'width=700,height=600,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1');\n}", "title": "" }, { "docid": "043caff624a66ed03409f27f8e07a920", "score": "0.5060085", "text": "open() {\n this.xhttp.open('GET', this.file, true);\n this.xhttp.send();\n }", "title": "" }, { "docid": "cbc012bfc957687efcc1bf3c236bbc23", "score": "0.5057303", "text": "open () {\n super.open('List/') //this will append `contact-us` to the baseUrl to form complete URL\n browser.pause(2000);\n }", "title": "" }, { "docid": "dd53bfe3f7f4996b7b9082fe2b5d5be9", "score": "0.5054863", "text": "function RateMyProfessorHandleOpenWithWebBrowser(link){\n WebBrowser.openBrowserAsync(link);\n }", "title": "" }, { "docid": "84bf8f7e8de9ce2e94032c9e7d6ebe12", "score": "0.5054823", "text": "function launchURL() {\n var selectedMap = dijit.byId('mapSelect').get('value'), baseURL, url, winTarget;\n switch (selectedMap) {\n case \"Measurement\":\n winTarget = '_blank';\n baseURL = \"measure.php\";\n break;\n case \"Planning and Zoning\":\n baseURL = \"pz_map.php\";\n winTarget = '_blank';\n break;\n case \"Flood Hazard\":\n baseURL = \"FEMA_map.php\";\n winTarget = '_self';\n break;\n case \"Sensitive Areas\":\n baseURL = \"sensitive.php\";\n winTarget = '_blank';\n break;\n case \"Printable\":\n baseURL = \"printable.php\";\n winTarget = '_blank';\n break;\n }\n // var url = \"measure.php?px=\" + passedX + \"&py=\" + passedY + \"&zl=\" + zoomLevel;\n url = baseURL + \"?px=\" + passedX + \"&py=\" + passedY + \"&zl=\" + zoomLevel;\n window.open(url, winTarget);\n }", "title": "" }, { "docid": "584a8378e3a6cbe414d02d2ae467df84", "score": "0.504857", "text": "function opensocial(params) {\n if (params === 1) {\n window.open(\n \"https://twitter.com/ari_ngr\",\n \"_blank\"\n );\n } else if (params === 2) {\n window.open(\n \"https://github.com/Aringr\",\n \"_blank\"\n );\n } else if (params === 3) {\n window.open(\n \"https://www.instagram.com/aringr\",\n \"_blank\"\n );\n }\n}", "title": "" }, { "docid": "d775c751b77884e0eb9087d4eea371a6", "score": "0.5044887", "text": "function postImg(urls) {\n let img = document.createElement('img');\n img.src = urls['small'];\n img.addEventListener(\"click\", function () {window.open(urls['big'],\"_self\")});\n document.getElementById('test').appendChild(img);\n}", "title": "" }, { "docid": "201997644032fdfd3dae586069b65e86", "score": "0.50400937", "text": "function CatalogHandleOpenWithWebBrowser(link){\n WebBrowser.openBrowserAsync(link);\n }", "title": "" }, { "docid": "e89abc420631be0cb3dd16beea625bb5", "score": "0.50350696", "text": "function qlik_openUserManual(URL){\n window.open(qlik_translate.instant(URL), '_blank');\n }", "title": "" }, { "docid": "e9ee100e86499ded68a14ee5bb3cdce9", "score": "0.50348985", "text": "function randomLink() { \n window.open(\"https://en.wikipedia.org/wiki/Special:Random\");\n}", "title": "" }, { "docid": "0e861d52b6d0ff0cab381a360c6e1a5a", "score": "0.5024299", "text": "function objectClickHandler() {\n window.open('http://www.pericror.com/', '_blank');\n}", "title": "" }, { "docid": "85361267f5183433aa7f65cdd9137cd9", "score": "0.50241774", "text": "async open (path) {\n await browser.url(`https://cloud.google.com//${path}`)\n await browser.maximizeWindow();\n }", "title": "" }, { "docid": "6eac12ea5faa73439b3ba1716bf8eeb1", "score": "0.5024081", "text": "function webSlides(eventname)\n{\n\t// Add an odp-extention, otherwise webodf wont load it\n\todpLink = \"odf-viewer/#../\" + getSlideUrl(eventname) + \"&ext=.odp\";\n\tvar myWindow = window.open(odpLink, \"\", \"width=800, height=640\");\n}", "title": "" }, { "docid": "d2da2161123c5e7f603cff2328a92248", "score": "0.50162065", "text": "function openLinkIn(aURL, aWhere, aOpenParams) {\n if (!aURL) {\n return;\n }\n // Open a new tab and set the regexp to open links from the Addons site in Thunderbird.\n switchToTabHavingURI(aURL, true);\n}", "title": "" }, { "docid": "46829f4612088d8999fbc09d907b8c0a", "score": "0.50139546", "text": "function returnURL() {\n window.open(document.getElementById(\"url\").value);\n}", "title": "" } ]
5576eaeaa07ce4afc90d3e1fb9796d98
This is try catch function for testing the Exceptions in the Contract tests
[ { "docid": "813d087fa200a29f65c9fcdcd8f831e5", "score": "0.57376546", "text": "async function tryCatch(promise, message) {\n // const PREFIX = \"VM Exception while processing transaction: \";\n try {\n await promise;\n throw null;\n }\n catch (error) {\n assert(error, \"Expected an error but did not get one\");\n assert(error.message.includes(message), \"Expected an error containing '\" + message + \"' but got '\" + error.message + \"' instead\");\n }\n}", "title": "" } ]
[ { "docid": "106556d16aee4c281f5a5bb7ee34cf41", "score": "0.6506542", "text": "function test_catch_region(x,y,z) {\n try { } catch (e) { }\n}", "title": "" }, { "docid": "8d594b783a8a1bd661b637f7c6f5488b", "score": "0.6261769", "text": "function ExpectedError() {}", "title": "" }, { "docid": "69a6bda2ea1c2e4ecebafe82b0dd2623", "score": "0.6236545", "text": "function testTryCatch1() {\n try {\n return 123;\n } catch (e) {\n }\n}", "title": "" }, { "docid": "14450ccb52c8220811f722767d058d80", "score": "0.62000775", "text": "async function expectThrow(promise) {\n let receipt;\n try {\n receipt = await promise;\n } catch (error) {\n // TODO: Check jump destination to destinguish between a throw\n // and an actual invalid jump.\n const invalidOpcode = error.message.search('invalid opcode') >= 0;\n // TODO: When we contract A calls contract B, and B throws, instead\n // of an 'invalid jump', we get an 'out of gas' error. How do\n // we distinguish this from an actual out of gas event? (The\n // ganache log actually show an 'invalid jump' event.)\n const outOfGas = error.message.search('out of gas') >= 0;\n const revert = error.message.search('revert') >= 0;\n const status0x0 = error.message.search('status\": \"0x0\"') >= 0 || error.message.search('status\":\"0x0\"') >= 0; // TODO better\n assert(\n invalidOpcode || outOfGas || revert || status0x0,\n 'Expected throw, got \\'' + error + '\\' instead',\n );\n return;\n }\n if (receipt.status == \"0x0\") {\n return;\n }\n assert.fail('Expected throw not received');\n }", "title": "" }, { "docid": "ee8f337bb8f025927f0f1bc6eba1a237", "score": "0.6157161", "text": "function testTryCatch2() {\n try {\n throw new Error('test');\n } catch (e) {\n return 123;\n }\n}", "title": "" }, { "docid": "5969f6e052fb859d51887f55ed275c35", "score": "0.5963352", "text": "function Exception() {}", "title": "" }, { "docid": "109d21e7538a53fe6f4452a346c4b88b", "score": "0.5936091", "text": "testException() {\n this.capture(new Error('Test!'));\n }", "title": "" }, { "docid": "77d14a1ebfc658a0ce0e4f365fb2057f", "score": "0.5810588", "text": "async function testFn () {\n const tom = {}\n a.throws(\n () => { const runner = new TestRunner(tom) },\n /valid tom required/i\n )\n }", "title": "" }, { "docid": "4c881e23b268f986b5398a6edb5a6e01", "score": "0.5810514", "text": "async loadContract() {\n this.walletDeployContract = await freeton.requireContract(this.tonInstance, 'DeployEmptyWalletFor');\n\n expect(this.walletDeployContract.address).to.equal(undefined, 'Address should be undefined');\n expect(this.walletDeployContract.code).not.to.equal(undefined, 'Code should be available');\n expect(this.walletDeployContract.abi).not.to.equal(undefined, 'ABI should be available');\n }", "title": "" }, { "docid": "53ca87aa303e6fa8732d5f930fffad15", "score": "0.57178295", "text": "async catch(error) {\n throw error;\n }", "title": "" }, { "docid": "d9a54fcd8bf9a6467e2317cea92e8345", "score": "0.5625265", "text": "function testErrorFunc(a, func) { \n try {func (a);}\n catch (ex) {\n return ex.name;\n } \n}", "title": "" }, { "docid": "501f5859af08751b41afaa7d11a3e114", "score": "0.5583791", "text": "function tryCatch(A,t,e){try{return{type:\"normal\",arg:A.call(t,e)}}catch(A){return{type:\"throw\",arg:A}}}", "title": "" }, { "docid": "bba5883bb4b17c5b1de5518b9807d339", "score": "0.5582694", "text": "function throwError(err, result){\n\tif (err) throw err;\n}", "title": "" }, { "docid": "606eb612e83d56e319737c30d94a25dd", "score": "0.55578583", "text": "function $throw(e) {throw e}", "title": "" }, { "docid": "8f654d7b15e3c2524f26cef64fc42fe3", "score": "0.5509301", "text": "function handleException(){\n\ttry{\n\t\tconsole.log(123/0);\n\t\tthrow \"Error in the function\"//what U throw is what U catch...\n\t}catch(err){\n\t\tconsole.log(\"catch:\" + err)\n\t}finally{\n\t\tconsole.log(\"finally:clean up\")\n\t}\n}", "title": "" }, { "docid": "5ba07633e7803662d9a119ef832f8c18", "score": "0.54877776", "text": "async function testFn () {\n const tom = undefined\n a.throws(\n () => { const runner = new TestRunner(tom) },\n /valid tom required/i\n )\n }", "title": "" }, { "docid": "ed7c83e4d9e0b26238e1ad2068a23ab3", "score": "0.54804564", "text": "function shouldThrow() {\n add('1', 1);\n }", "title": "" }, { "docid": "3807216f9664a1987c998cef0996d59f", "score": "0.54248005", "text": "_defaultCatch() {\n CosmoScout.notifications.print('Connection failed',\n 'Could not connect to server.', 'error');\n throw new Error('Connection timed out.');\n }", "title": "" }, { "docid": "e2fb830fa42804a71a9dac9a2995ca26", "score": "0.53882575", "text": "reThrow(error, filename, lineNumber) {\n if (error instanceof edge_error_1.EdgeError) {\n throw error;\n }\n const message = error.message.replace(/state\\./, '');\n throw new edge_error_1.EdgeError(message, 'E_RUNTIME_EXCEPTION', {\n filename: filename,\n line: lineNumber,\n col: 0,\n });\n }", "title": "" }, { "docid": "c0ddced4d57892f42763d6fb374f50e3", "score": "0.5380492", "text": "throwOnExchangeRequest(connectionName, channelId, userId, exchangeableItem) {\n const token = new ExchangeableToken();\n token.ChannelId = channelId;\n token.ConnectionName = connectionName;\n token.UserId = userId;\n token.exchangeableItem = exchangeableItem;\n const key = token.toKey();\n token.Token = this.ExceptionExpected;\n this.exchangeableTokens[key] = token;\n }", "title": "" }, { "docid": "9b0af1ac29a1c3d5ffed2712a3639fe6", "score": "0.5347407", "text": "function mockCatch(errFn, msg) {\n errFn.call(this, new Error(msg));\n }", "title": "" }, { "docid": "38f7939ec717af2688afa8e71c014dc5", "score": "0.5306101", "text": "function testCommandsException(message, options, errorMessage) {\n it('getArguments - test exception ' + message, function () {\n var command = new Command(options);\n\n expect(function () {\n command.getArguments();\n }).to.throw(errorMessage);\n });\n}", "title": "" }, { "docid": "e0ad1c54a240475c3d93bb689c6fe7fb", "score": "0.5299484", "text": "async function expectRevert(fn) {\n let errorMsg = \"__no error message__\"\n\n try {\n await fn()\n } catch (err) {\n errorMsg = err.message\n }\n\n expect(errorMsg).to.equal('VM Exception while processing transaction: revert')\n}", "title": "" }, { "docid": "e0ad1c54a240475c3d93bb689c6fe7fb", "score": "0.5299484", "text": "async function expectRevert(fn) {\n let errorMsg = \"__no error message__\"\n\n try {\n await fn()\n } catch (err) {\n errorMsg = err.message\n }\n\n expect(errorMsg).to.equal('VM Exception while processing transaction: revert')\n}", "title": "" }, { "docid": "2340b777d61261979d62870969a8d0da", "score": "0.52945966", "text": "function foo() {\n try {\n } catch(error) {\n if (error.foo === 4) {\n throw error;\n }\n }\n}", "title": "" }, { "docid": "aab2f0edff3bff5db3d91955b02f1937", "score": "0.52934635", "text": "function func(){\n try{\n throw \"An Exception Error\";\n console.log(\"Statement\");\n }catch{\n return;\n }\n \n }", "title": "" }, { "docid": "19c2028ed8f8265e3fc41c70f2b4bad5", "score": "0.52890974", "text": "function _assertSoonNoExcept(func, msg, timeout) {\n assert.soon((() => _convertExceptionToReturnStatus(func)), msg, timeout);\n }", "title": "" }, { "docid": "717d0e0ae1d9ebc016e4cd74f31406b9", "score": "0.52519053", "text": "function throwError(message) {\n try {\n throw Error(errorMarker);\n } catch (err) {\n const stack = err.stack\n .slice(err.stack.indexOf(errorMarker) + errorMarker.length)\n .split(\"\\n\");\n\n for (let i = stack.length - 1; i > 0; i--) {\n // search for the \"first\" matcher call in the trace\n if (stack[i].includes(\"toMatchJSON\")) {\n stack.splice(0, i + 1, message);\n break;\n }\n }\n\n const error = Error(message);\n error.stack = stack.join(\"\\n\");\n throw error;\n }\n}", "title": "" }, { "docid": "a65eb5069803fdea77fe141968f45f85", "score": "0.5236065", "text": "function assertThrowsTypeAndMessage( assert, block, errorConstructor, regexErrorMessage, message ) {\n\t\tvar actualException;\n\t\ttry {\n\t\t\tblock();\n\t\t} catch ( exc ) {\n\t\t\tactualException = exc;\n\t\t}\n\n\t\tassert.ok( actualException instanceof errorConstructor, message );\n\t\tassert.ok( regexErrorMessage.test( actualException ), message );\n\t}", "title": "" }, { "docid": "ace99fdcdcb592cc55670ba29bbfffa2", "score": "0.5234764", "text": "async testNewKeyBadKeyFormat() {\n const keyFormat = new PbAesCtrKeyFormat();\n const manager = new AesCtrHmacAeadKeyManager();\n\n try {\n manager.getKeyFactory().newKey(keyFormat);\n } catch (e) {\n assertEquals(\n 'CustomError: Expected AesCtrHmacAeadKeyFormat-proto', e.toString());\n return;\n }\n fail('An exception should be thrown.');\n }", "title": "" }, { "docid": "ab32631f4dd8343998543e9e4e8cbc9e", "score": "0.5217518", "text": "function check() {\n try {\n const people = [{\n id: 1,\n name: 'a',\n age: 19,\n moneyAmount: 100,\n desiredAlcoholName: 'whisky',\n desiredAlcoholAmount: 2,\n }];\n \n const legalAgePeople = getLegalAgePeople(people, 'age');\n if (!legalAgePeople || legalAgePeople[0].id !== 1) {\n throw new Error('check getLegalAgePeople function');\n }\n\n const peopleWhoHaveMoney = getPeopleWhoHaveMoneyForAlcohol(legalAgePeople);\n if (!peopleWhoHaveMoney || peopleWhoHaveMoney[0].id !== 1) {\n throw new Error('check getPeopleWhoHaveMoneyForAlcohol function');\n } \n\n const checkResult = buyAlcohole(peopleWhoHaveMoney);\n \n if (!checkResult || checkResult[0] !== \"a bought 2 bottles of whisky for 46 rubles\") {\n throw new Error('check buyAlcohole function');\n } \n\n alert('Correct! You\\'re awesome');\n } catch (err) {\n alert(err);\n }\n}", "title": "" }, { "docid": "4c4dadf2834c05def4a33c6de7253071", "score": "0.5201566", "text": "function n(e,t){if(!e){const e=new Error(t||\"Assertion failed\");throw Error.captureStackTrace&&Error.captureStackTrace(e,n),e}}", "title": "" }, { "docid": "138f870d0612d093e29230dbdee2abe0", "score": "0.519065", "text": "async function functionCatchesError() {\n try {\n await throwError();\n } catch(e) {\n // var listItem = document.createElement('li');\n // var text = document.createTextNode(`I was properly handled`);\n // listItem.className = 'list-item-good';\n // listItem.appendChild(text);\n // document.getElementById('all-promise-results').appendChild(listItem);\n }\n var listItem = document.createElement('li');\n var text = document.createTextNode(`I was properly handled`);\n listItem.className = 'list-item-good';\n listItem.appendChild(text);\n document.getElementById('all-promise-results').appendChild(listItem);\n}", "title": "" }, { "docid": "16eb0be19e07b959ac239d73a6fb8bc7", "score": "0.5173772", "text": "function emailContract() {\n throw new Error(\"Email contract not implemented!\");\n }", "title": "" }, { "docid": "ef8cc3b0bfa9d68b87b4d93321dfc07e", "score": "0.51543766", "text": "async function test() {\n throw Error(\"err\");\n}", "title": "" }, { "docid": "b9b5c965db658ec8f77e44414ae3c587", "score": "0.5152913", "text": "initContract() {\n\t\t\tif (this.$web3.isConnected()) {\n\t\t\t\tthis.getArtifact()\n\t\t\t\t\t.then(this.instanceContract)\n\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\tthis.$eventbus.$emit({\n\t\t\t\t\t\t\ttype: \"danger\",\n\t\t\t\t\t\t\tmessage: \"Error descargando el contracto ;(\"\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "62f2c9db0338351f48d251cf67fa63c0", "score": "0.51521987", "text": "throwingInvariant1() { invariant() }", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.51456", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.51456", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.51456", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "ccad22b2f542b0dacefe539a92949745", "score": "0.5144733", "text": "function throwAtHost() {\n throw \"throwing\";\n}", "title": "" }, { "docid": "855dc967c23354a401ca3a618c0d1beb", "score": "0.51432526", "text": "function deployContract() {\n\n try {\n web3.eth.accounts.wallet.add('0x' + private_key);\n } catch (err) {\n console.log(\"ERROR: web3.eth.accounts.wallet.add('0x' + private_key) ----: \" + err);\n return false;\n }\n\n try {\n console.log(\"In try ... for creating contract object\");\n // 1. Create contract object\n var contract = new web3.eth.Contract(abi);\n console.log(\"Created Contract Object:\" + req.query.ether_Addr);\n } catch (err) {\n console.log(\"ERROR: Create contract object error: \" + err);\n return false;\n }\n\n try {\n contract.deploy({\n data: '0x' + bytecode\n }).send({\n from: account,\n gas: 1500000,\n gasPrice: '800000000'\n }, function(error, transactionHash){\n\n }).on('error', function (error){\n console.log('Contract.deploy send error :' + error);\n }).on('transactionHash', function(transactionHash){\n console.log('Deployed transaction hash is: ' + transactionHash);\n }).on('receipt', function(receipt){\n console.log('Received Contract Address :' + receipt.contractAddress);\n }).on('confirmation', function (confirmationNumber, receipt){\n console.log('Confirmation : ' + confirmationNumber);\n })\n } catch (err) {\n console.log('Some error happened at the trying of contract.deploy ... Check code');\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "c6391f8d90cd72721665174ba82f1dd2", "score": "0.5121666", "text": "function tryCatch(fn,obj,arg){try{return {type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return {type:\"throw\",arg:err};}}", "title": "" }, { "docid": "c6391f8d90cd72721665174ba82f1dd2", "score": "0.5121666", "text": "function tryCatch(fn,obj,arg){try{return {type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return {type:\"throw\",arg:err};}}", "title": "" }, { "docid": "c06ef58f1c69c9adf709e8a58d56ab51", "score": "0.5119406", "text": "function tryCatch(fn, obj, arg) { // 60\n try { // 61\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 62\n } catch (err) { // 63\n return { type: \"throw\", arg: err }; // 64\n } // 65\n } // 66", "title": "" }, { "docid": "0f1155ee8f4c92c1945331ba8f9236cc", "score": "0.5113607", "text": "function trycatch(tryFn, catchFn) {\n\tfunction _TOKEN_() {\n\t\ttryFn();\n\t}\n\t_TOKEN_.token = catchFn;\n\ttry {\n\t\t_TOKEN_();\n\t} catch (err) {\n\t\terr.stack = filterInternalFrames(err.stack);\n\t\tcatchFn(err);\n\t}\n}", "title": "" }, { "docid": "a6f52c849deaaa906b70005298a1b2a8", "score": "0.51067746", "text": "function neverReturns() {\n throw new Error('an ERROR has occurred!!');\n}", "title": "" }, { "docid": "48f8656af7ace355c938e50f5d05078c", "score": "0.51036143", "text": "async function should_fail_commitvote(_from_account, _proposed_release_hash, _choice, _amount, _vary) {\nconsole.log('should fail this commitvote');\nlet expected_votehash = get_expected_votehash(_proposed_release_hash, _choice, _from_account.address, _vary);\nconsole.log('expected_votehash is', expected_votehash);\nawait truffleAssert.fails(EticaReleaseProtocolTestInstance.commitvote(web3.utils.toWei(_amount, 'ether'), expected_votehash, {from: _from_account.address}));\nconsole.log('as expected failed to make this commitvote');\n }", "title": "" }, { "docid": "a698e354e98f93f9bb9721cc035798b7", "score": "0.5099367", "text": "function neverReturns() {\n throw new Error('an error');\n }", "title": "" }, { "docid": "68053247dd2f633f824454fb5ad540eb", "score": "0.50958246", "text": "function testBadInput() {\n assertThrows('Bad input', function() { new goog.crypt.Sha256().update({}); });\n assertThrows('Floating point not allows', function() {\n new goog.crypt.Sha256().update([1, 2, 3, 4, 4.5]);\n });\n assertThrows('Negative not allowed', function() {\n new goog.crypt.Sha256().update([1, 2, 3, 4, -10]);\n });\n assertThrows('Must be byte array', function() {\n new goog.crypt.Sha256().update([1, 2, 3, 4, {}]);\n });\n}", "title": "" }, { "docid": "1c926ebd1187628d1baf8ec25e4a0858", "score": "0.50690526", "text": "function myfunc() {\n throw new Error('exception on line 32 in myfunc');\n}", "title": "" }, { "docid": "5e62a391752336cbf8db056bf8639253", "score": "0.50578886", "text": "function tryCatch(fn, obj, arg) {\n\t\t try {\n\t\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t\t } catch (err) {\n\t\t return { type: \"throw\", arg: err };\n\t\t }\n\t\t }", "title": "" }, { "docid": "5e62a391752336cbf8db056bf8639253", "score": "0.50578886", "text": "function tryCatch(fn, obj, arg) {\n\t\t try {\n\t\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t\t } catch (err) {\n\t\t return { type: \"throw\", arg: err };\n\t\t }\n\t\t }", "title": "" }, { "docid": "8491b10b8e5de452b4037d07172c2a7b", "score": "0.5047079", "text": "function handleException2(round){\n if(round >= 0 && round < 101){\n let pi = 3.14159;\n console.log(pi.toFixed(round));\n }else{\n throw new SyntaxError(\"change your number\");\n }\n }", "title": "" }, { "docid": "f76b905a2743236c08bbbc8d596bd54a", "score": "0.50359637", "text": "_assertConnection () {\n if (!this._db) throw new Error(CedictPermanentStorage.errMsgs.CLOSED_CONNECTION)\n }", "title": "" }, { "docid": "493ebac0e2cbb1b94d16943a618cc6bd", "score": "0.5033877", "text": "async function tryCatch(){\n try{\n let dataTake = await fetch('http://no-such-url');\n }catch(error){\n alert('There is no such a url!');\n }\n}", "title": "" }, { "docid": "ea49565854f81020f0ede1d592fbb2ef", "score": "0.5028583", "text": "function handleException3(round){\n try{\n let pi = 3.14159;\n console.log(pi.toFixed(round));\n }catch(error){\n console.error(\"not a valid range\")\n console.error(error.stack);\n }\n }", "title": "" }, { "docid": "89386a3e640957c16a9aae6e343bb298", "score": "0.50259787", "text": "function tryCatch(fn, obj, arg) { // 63\n try { // 64\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 65\n } catch (err) { // 66\n return { type: \"throw\", arg: err }; // 67\n } // 68\n } // 69", "title": "" }, { "docid": "c9ec518fe64a31e764dedde94db7aaef", "score": "0.5022672", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }", "title": "" }, { "docid": "f64a0a6e12e887a815d08f13a497b40b", "score": "0.501863", "text": "_generateTests() {\n throw 'not implemented';\n }", "title": "" }, { "docid": "28fbdfdfc616cf16cac80850fdfbda48", "score": "0.50140005", "text": "function shouldError() {\n\tassertEq(\"a\", \"b\");\n}", "title": "" }, { "docid": "e8f5a67892ebfec32b6b72a7b2a3e51c", "score": "0.5010081", "text": "async function functionCatchesErrorMixin() {\n const data = await throwError().catch(e => {\n var listItem = document.createElement('li');\n var text = document.createTextNode(`I was properly handled with a mixed promise and async/await syntax!`);\n listItem.className = 'list-item-good';\n listItem.appendChild(text);\n document.getElementById('all-promise-results').appendChild(listItem);\n })\n}", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5007553", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "2f7dcf6d112d7d648345cb56e11c02ee", "score": "0.50035924", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }", "title": "" }, { "docid": "2f7dcf6d112d7d648345cb56e11c02ee", "score": "0.50035924", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }", "title": "" }, { "docid": "d81d62960a16e4c6d7f1347c73dd9979", "score": "0.49998453", "text": "function tryFinally(){\n try {\n throw 'Check On Error';\n } finally {\n console.log('finally');\n }\n }", "title": "" }, { "docid": "406d13009d82148170961b0221f911ca", "score": "0.4996525", "text": "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "title": "" }, { "docid": "406d13009d82148170961b0221f911ca", "score": "0.4996525", "text": "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "title": "" }, { "docid": "82ae1493cd19c91b6628548364634c8d", "score": "0.49888253", "text": "function _convertExceptionToReturnStatus(func, msg) {\n try {\n return func();\n } catch (e) {\n if (msg) {\n print(msg);\n }\n print(\"ReplSetTest caught exception \" + e);\n return false;\n }\n }", "title": "" }, { "docid": "154d0240394562cf0aab3b9a09c4f16d", "score": "0.49877098", "text": "function equellaError(obj) {\n if (obj.error) throw Error(`${obj.code} ${obj.error}: ${obj.error_description}`)\n}", "title": "" }, { "docid": "a9a7a570aa4a3699050986e712bdf2ce", "score": "0.4987143", "text": "function throwMissingInvocation() {\n console.log(\"[InfoboxEditorPreview] WikitextConvert parse data: \", data);\n promise.reject(self.i18n.msg(\"errorarticlemissinginfobox\").plain());\n }", "title": "" }, { "docid": "511770a3fab2869b3b42390f0914452f", "score": "0.4982208", "text": "checkForErrors() {\n /**\n * We are done scanning the content and there is an open tagStatement\n * seeking for new content. Which means we are missing a closing\n * brace `)`.\n */\n if (this.tagStatement) {\n const { tag } = this.tagStatement;\n throw (0, Exceptions_1.unclosedParen)({ line: tag.line, col: tag.col }, tag.filename);\n }\n /**\n * We are done scanning the content and there is an open mustache statement\n * seeking for new content. Which means we are missing closing braces `}}`.\n */\n if (this.mustacheStatement) {\n const { mustache } = this.mustacheStatement;\n throw (0, Exceptions_1.unclosedCurlyBrace)({ line: mustache.line, col: mustache.col }, mustache.filename);\n }\n /**\n * A tag was opened, but forgot to close it\n */\n if (this.openedTags.length) {\n const openedTag = this.openedTags[this.openedTags.length - 1];\n throw (0, Exceptions_1.unclosedTag)(openedTag.properties.name, openedTag.loc.start, openedTag.filename);\n }\n }", "title": "" }, { "docid": "89918ecfc6704b170d021c1466055850", "score": "0.4981357", "text": "checkErrorsInResult(result)\n {\n // return new Error('Any error could be thrown here');\n }", "title": "" }, { "docid": "1231931c7d90fc564d1abde44a5d7afc", "score": "0.49805358", "text": "function fd() {\r\n try {\r\n f2();\r\n }\r\n catch (e) {\r\n JL('l4').fatalException(function () { return { \"i4\": 88, \"j4\": \"jkl\" } }, e);\r\n __timestamp4 = (new Date).getTime();\r\n }\r\n\r\n JLTestUtils.Check('da1', 4, [\r\n {\r\n l: 6000,\r\n m: /\\{\\\\\\\"i3\\\\\\\":77,\\\\\\\"j3\\\\\\\":\\\\\\\"ghi\\\\\\\"\\}.*?i is not defined.*?\\{\\\"i4\\\":88,\\\"j4\\\":\\\"jkl\\\"\\}/,\r\n n: 'l4',\r\n t: __timestamp4\r\n }\r\n ]\r\n );\r\n\r\n // Add inner exception, but no data\r\n\r\n try {\r\n f2();\r\n }\r\n catch (e) {\r\n JL('l5').fatalException(null, e);\r\n __timestamp5 = (new Date).getTime();\r\n }\r\n\r\n JLTestUtils.Check('da1', 5, [\r\n {\r\n l: 6000,\r\n m: /\\{\\\\\\\"i3\\\\\\\":77,\\\\\\\"j3\\\\\\\":\\\\\\\"ghi\\\\\\\"\\}.*?i is not defined.*?null/,\r\n n: 'l5',\r\n t: __timestamp5\r\n }\r\n ]\r\n );\r\n}", "title": "" }, { "docid": "f61171e55be550644fb751aff266a43d", "score": "0.4977326", "text": "function testChannelError(props, assertions, done) {\n testChannelNext(props, function (error) {\n should.exist(error);\n assertions(error);\n }, done);\n }", "title": "" }, { "docid": "479bfcdb40b248bcc9d4559c01ee6da1", "score": "0.49739805", "text": "async function functionFailsToCatch() {\n const data = await throwError();\n //None of this will run\n var listItem = document.createElement('li');\n var text = document.createTextNode(`${data}`);\n listItem.className = 'list-item-good';\n listItem.appendChild(text);\n document.getElementById('all-promise-results').appendChild(listItem);\n}", "title": "" }, { "docid": "cc03da555f80eac7eeb0b472e1e5f40f", "score": "0.49731272", "text": "function errorTraced() {\r\n\t\t\t\t try {\r\n\t\t\t\t\tvar err = new Error(\"test01\");\r\n\t\t\t\t\tthrow err;\r\n\t\t\t\t } catch (err) {\r\n\t\t\t\t\tprint(\"ddddd \" + err);\r\n\t\t\t\t\t//print(err.rhinoException.printStackTrace());\r\n\t\t\t\t\tprint(err.stack);\r\n\t\t\t\t\treturn err;\r\n\t\t\t\t }\r\n\t\t\t\t}", "title": "" }, { "docid": "e90e79647345c02cdf3c441472695967", "score": "0.49708486", "text": "function tryCatch(fn, obj, arg) {\n try {\n return { type: 'normal', arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: 'throw', arg: err };\n }\n }", "title": "" }, { "docid": "62c70d2eaaac612b01cbbc43313a6120", "score": "0.49682257", "text": "function ExhaustionException() {}", "title": "" }, { "docid": "0e7b3deb7c4793a73d954df3d9e5c25f", "score": "0.49677536", "text": "function expectThrow(value) {\n expect(function setList() { dropdown.list(value); }).toThrow(new Error([\n 'sharedOptionsFactory.list: Can only be passed an object.',\n (typeof value),\n 'found.'\n ].join(' ')));\n }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.49660757", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" } ]
27be6a7dee6fea1a175d1dd29169b91e
find if a job exists in jobs array ( for duplication validations) jobsArray array of jobs searchedJobName job name that we search
[ { "docid": "a0f6e02dbcf4eee16cfdf2ead97ed445", "score": "0.8065971", "text": "function checkJobExistInDB(jobsArray,searchedJobName){\n jobsArray.forEach(function(job){\n if(job.name == searchedJobName){\n return false;\n }\n });\n return true;\n }", "title": "" } ]
[ { "docid": "cc7ff130fa031e86243f045202c0810c", "score": "0.692029", "text": "doesJobExist(jobID) {\n return jobID in this._jobs;\n }", "title": "" }, { "docid": "eab7e45caaccb643275075f6aedeb9b9", "score": "0.6186163", "text": "function getJobRoleByJobType(jobs){\n\n var jobRoleArry = new Array();\n jobs.forEach(element =>{\n // console.log(element.jobRole);\n if(!jobRoleArry.includes(element.jobRole)){\n jobRoleArry.push(element.jobRole);\n }\n });\n\n return jobRoleArry;\n}", "title": "" }, { "docid": "d415e84c7235022da438e446c7946932", "score": "0.6122273", "text": "jobsChanged(job) {\n var newJobs = Array.from(this.state.jobs);\n if (newJobs.length !== 0) {\n var found = false;\n for (var i = 0; i < newJobs.length; i++) {\n if (newJobs[i] === job) {\n newJobs.splice(i, 1);\n this.setState({\n jobs: newJobs\n })\n return;\n }\n }\n if (!found) {\n newJobs.push(job);\n }\n } else {\n newJobs.push(job);\n }\n this.setState({\n jobs: newJobs\n })\n }", "title": "" }, { "docid": "658d7ff21d0bf6b8f05566b9734bc273", "score": "0.6044544", "text": "function filterJobsHtmlAdd() {\n console.log(newJobs);\n for (let skill of jobFilterArr) {\n newJobs = (newJobs || jobs).filter((job) => {\n return (\n job.languages.includes(skill) ||\n job.tools.includes(skill) ||\n job.role === skill ||\n job.level === skill\n );\n });\n }\n console.log(newJobs);\n displayJobListing(newJobs);\n return (flag = false);\n}", "title": "" }, { "docid": "32df02c53077a0a2e319e0d84f5d4d19", "score": "0.59549487", "text": "function lineFinder(array, jobname){\n for(var i = 0; i < array.length; i++){\n if((\" - JOB NAME: \" + jobname) === array[i]){\n return i;\n }\n }\n}", "title": "" }, { "docid": "948807ebf584acf13b3684c37e802e74", "score": "0.59381026", "text": "static async getJobs(search=null) {\n let res = await JoblyApi.request(`jobs`, {search});\n return res.jobs;\n }", "title": "" }, { "docid": "3ca7b9b17f18db0ae1fa714ddbaae959", "score": "0.58656245", "text": "function jobswithKeyword(data, keyword){\n var jobs = _.filter(data, function(num){ return num['Job Title'].indexOf(keyword) !== -1; });\n\n return _.pluck(jobs, 'Job Title');\n}", "title": "" }, { "docid": "b5092be7843a8bd588051bbbe779a454", "score": "0.5832708", "text": "function keyExists(keyval) {\n return topjobsKeys.some(function(el) {\n return el === keyval;\n }); \n}", "title": "" }, { "docid": "af6d945f3b3ed5d21f4d4e9405eba563", "score": "0.5734966", "text": "static async getJobs(data = {}) {\n const searchJobParams = {\n title: data.searchTerm || undefined,\n minSalary: data.minSalary || undefined,\n hasEquity: data.hasEquity || undefined,\n }\n\n const res = await this.request('jobs', searchJobParams)\n return res.jobs\n }", "title": "" }, { "docid": "3232e84dcf4275bd1f0a5052189853a5", "score": "0.56699646", "text": "function verifyJobs(jobs) {\n expect(_.isArray(jobs)).toBe(true);\n expect(jobs.length).toBe(2);\n expect(jobs).toContain({\n type: 'sync',\n source: 'patient lists',\n patient: {\n dfn: '3',\n name: 'EIGHT,PATIENT',\n roomBed: '722-B',\n siteId: 'SITE'\n },\n siteId: 'SITE',\n referenceInfo: referenceInfo\n });\n expect(jobs).toContain({\n type: 'sync',\n source: 'patient lists',\n patient: {\n dfn: '100162',\n name: 'TWOHUNDREDSIXTEEN,PATIENT',\n roomBed: '',\n siteId: 'SITE'\n },\n siteId: 'SITE',\n referenceInfo: referenceInfo\n });\n}", "title": "" }, { "docid": "0bd2a45b21dacb9a806d87800a7e7f7d", "score": "0.5616918", "text": "async isJobAvail() {\n const res = await this.getModel().findAll({ where: {\n status: { [Sequelize.Op.or]: [ JOB_STATUS.NEW, JOB_STATUS.RUN ] }\n }});\n return res && res.length;\n }", "title": "" }, { "docid": "cd33a08ebc1e86fbd9f929acda816cd4", "score": "0.56085396", "text": "function contains(array, searchElement) {\r\n //Determine whether the element currently being checked is in the specified database\r\n for (var index = 0; index < array.length; index++) {\r\n if (equalUserRecords(array[index], searchElement)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "239c2685aeaecc4e7f280060cbf0fe6d", "score": "0.5563259", "text": "function filterJobsHtmlDelete() {\n newJobs = null;\n if (jobFilterArr.length !== 0) {\n for (let skill of jobFilterArr) {\n newJobs = jobs.filter((job) => {\n return (\n job.languages.includes(skill) ||\n job.tools.includes(skill) ||\n job.role === skill ||\n job.level === skill\n );\n });\n }\n displayJobListing(newJobs);\n return newJobs;\n } else {\n newJobs = null;\n console.log(newJobs);\n displayJobListing(jobs);\n return newJobs;\n }\n}", "title": "" }, { "docid": "72ac4b3b296b1ba9ccbcdf1ae472abc2", "score": "0.5538843", "text": "function JobList({ applyToJob }) {\n const [jobs, setJobs] = useState(null);\n const [isLoading, setIsLoading] = useState(true);\n const [searchTerm, setSearchTerm] = useState(null);\n const [searchResultStr, setSearchResultStr] = useState(null);\n\n /* get jobs */\n useEffect(function getJobs() {\n async function getJobsWithApi() {\n const resJobs = await JoblyApi.getJobs();\n setJobs(resJobs);\n setIsLoading(false);\n }\n getJobsWithApi();\n }, []);\n\n /* set search term and search result string for the job by name */\n function searchJob(name) {\n setSearchTerm(name);\n setSearchResultStr(`results for '${name}'`)\n }\n\n /* search for job by name */\n useEffect(function search() {\n async function searchJobsByName() {\n const resJobs = await JoblyApi.getJobs(searchTerm);\n setJobs(resJobs);\n setSearchTerm(null);\n }\n if (searchTerm) {\n searchJobsByName();\n }\n }, [searchTerm]);\n\n if (isLoading) return <div>Loading...</div>;\n if (searchTerm) return <div>Searching...</div>;\n if (jobs.length === 0) {\n return (\n <div className=\"JobList col-md-8 offset-md-2\">\n <h5>\n <SearchForm search={searchJob} />\n No results found.\n </h5>\n </div>\n );\n }\n\n return (\n <div className=\"JobList col-md-8 offset-md-2\">\n <SearchForm search={searchJob} />\n {\n searchResultStr\n ? <h5>{jobs.length} {searchResultStr}</h5>\n : null\n }\n {jobs.map(j => <JobCard applyToJob={applyToJob} key={j.id} job={j} />)}\n </div>\n );\n}", "title": "" }, { "docid": "75454ea68115d36bcc859047ba5f48e6", "score": "0.551697", "text": "function getNextAvailableJob(jobArray, buildings) {\n for (let jobIndex = 0; jobIndex < jobArray.length; jobIndex++) {\n const nextJob = jobArray[jobIndex];\n\n const pickupFromId = nextJob.from;\n const deliverToId = nextJob.to;\n\n if (pickupFromId !== 'warehouse' && !buildings.hasOwnProperty(pickupFromId)) {\n continue;\n }\n\n if (deliverToId !== 'warehouse' && !buildings.hasOwnProperty(deliverToId)) {\n continue;\n }\n\n return jobIndex;\n }\n}", "title": "" }, { "docid": "59fec26523891654ff3928a8287dc668", "score": "0.54681784", "text": "function getExistJobs(){\n if (jobManager.languageExistList.length){\n $('#addLanguage').attr(\"disabled\", true);\n }\n for (var languageIndex = 0; languageIndex < jobManager.languageExistList.length; languageIndex++) {\n var currentLanguage = jobManager.languageExistList[languageIndex];\n var currentLanguageHash = currentLanguage.id;\n console.log(currentLanguageHash);\n addLanguageInMenu(currentLanguageHash, false, function(languageHash){\n $(\"#ProjectJob_source_lang_id_\" + languageHash).val(languageHash);\n setLanguageName(languageHash);\n });\n }\n\n $.getJSON(jobManager.config.base_url + '/project/createProject/prepeareExistJobList/', {\n projectId: jobManager.project.id\n }, function(elements) {\n console.log(\"buildTree: first call. Length of elements is: \" + elements.length);\n buildTree(elements);\n\n $('#addLanguage').attr(\"disabled\", false);\n rebuildGantt();\n });\n\n}", "title": "" }, { "docid": "862d709f6db49a7413bedc333051d226", "score": "0.5454385", "text": "async function search(title){\n let jobs = await JoblyApi.getJobs(title);\n setJobs(jobs);\n }", "title": "" }, { "docid": "699f73a5704073946dd4c8696a83c66e", "score": "0.5443182", "text": "contains(searchValue){\n\n for(let i = 0; i <= this.size ; i++){\n if(this.data[i] === searchValue){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "454c4126c0c555eec5cd159818986c00", "score": "0.54400885", "text": "function searchJobs() {\n searchLocation = formatInput($(\"#cityInput\").val().trim());\n category = formatInput($(\"#jobOptions\").val());\n let theMuseURL = \"https://www.themuse.com/api/public/jobs?category=\" + category + \"&location=\" + searchLocation + \"&page=1&api_key=\" + theMuseApiKey;\n isLastResult = false;\n isFirstCall = true;\n isAfterFirstCall = false;\n isAfterNoResults = false;\n $.ajax({\n url: theMuseURL,\n method: \"GET\"\n }).then(function (response) {\n page = 1;\n ongoingJobCount = 0;\n populateJobPostCards(0, response);\n alertInput();\n deleteStar();\n addStar();\n });\n }", "title": "" }, { "docid": "2feded92242d4d491912732853da60c2", "score": "0.5424536", "text": "function jobsearchUtil(item,toSearch)\n {\n /* Search Text in all 3 fields */\n\n return ( item.companyname.toLowerCase().indexOf(toSearch.toLowerCase()) > -1 || item.jobtypeid.toLowerCase().indexOf(toSearch.toLowerCase()) > -1 || item.jobtypename.toLowerCase().indexOf(toSearch.toLowerCase()) > -1 )\n ? true : false ;\n }", "title": "" }, { "docid": "68dcc978bbe19733082b94470bb5ec95", "score": "0.5411864", "text": "async function search(title) {\n\t\tlet allJobs = await JoblyApi.getJobs(title);\n\t\tsetJobs(allJobs);\n\t}", "title": "" }, { "docid": "255fc73b30fcf5072568e2ce51dfebef", "score": "0.54039395", "text": "function searchJobs() {\r\n\t\t\t\t$(\"#loading-image\").show();\r\n\t\t\t\t\t$(\"#autoload\").val(false);\r\n\t\t\t\t\t$(\"#rows\").val(25000);\r\n\t\t\t\t\t$(\"#start\").val(\"0\");\r\n\t\t\t\t\tkeywords = $(\"#keywords\").val();\r\n\t\t\t\t\tcityState = $(\"#cityState\").val();\r\n\t\t\t\t\tradius = $(\"#radius\").val();\r\n\t\t\t\t\trows = $(\"#rows\").val();\r\n\t\t\t\t\tstart = $(\"#start\").val();\r\n\t\t\t\t\tsearchtype = $(\"#searchtype\").val();\r\n\t\t\t\t\tisSorting = false;\r\n\t\t\t\t\tvar navUrl = $(\"#contextPath\").val()+\"/search/searchJob.html\";\r\n\t\t\t\t\tvar formData= $(\"#jobSearchResultBodyFormId\").serialize()+$(\"#jobSearchResultHeaderFormId\").serialize();\r\n\t\t\t\t\t$(\"#TotalRecord\").text(\"\");\r\n\t\t\t\t\t//$(\"#connectionStatus\").text(\"Searching..\");\r\n\t\t\t\t\t$.getJSON(navUrl,formData,function(data) {\r\n\t\t\t\t\t\t$.each(data, function(key, val) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// get the jobs count after search \r\n\t\t\t\t\t\t\tif (key == \"TotalNoRecords\") {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\t\r\n\t\t\t\t\t\t\t\t$('#findSearchInfo').html(data.AjaxMSG);\r\n\t\t\t\t\t\t\t\tprocessPaginationReq(data, \"20\");\r\n\t\t\t\t\t})\r\n\t\t\t\t\t$(\"#selectedCompany\").val(\"\");\r\n\t\t\t\t\t$(\"#selectedState\").val(\"\");\r\n\t\t\t\t\t$(\"#selectedCity\").val(\"\");\r\n\t\t\t\t\t$(\".otherContent\").attr(\"style\",\"display: none\");\r\n\t\t\t\t\t$(\".careersContent\").attr(\"style\",\"display: none\");\r\n\t\t\t\t\t$(\".searchContent\").attr(\"style\",\"display: block\");\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t \r\n\t\t\t}", "title": "" }, { "docid": "3f6f0e1418b15de583acb05457671dd9", "score": "0.5389498", "text": "function hasAppliedToJob(id) {\n return applicationIds.has(id);\n }", "title": "" }, { "docid": "47b50d4ac9c0b648474ab3852127850b", "score": "0.538065", "text": "function isReUsableJob(job) {\n if (job && job.status && (job.status === CONSTS.WF_STATUS_CODE.COMPLETED || job.status === CONSTS.WF_STATUS_CODE.FAILED)) {\n return true\n } else {\n \tvar currJob = currJobs.selected();\n \tif(currJob.status === CONSTS.WF_STATUS_CODE.COMPLETED || currJob.status === CONSTS.WF_STATUS_CODE.FAILED){\n \t\treturn true;\n \t} else {\n \t\treturn false\n \t}\n }\n }", "title": "" }, { "docid": "2c96f25991be34d9e27c12d2d01f7c1b", "score": "0.5371585", "text": "function getJobs(UUID, Cit) {\n\n var UserData = retrieveUserData();\n if (UserData[STUDENT_DATA.ACCESS - 1] >= ACCESS_LEVELS.ADMIN && UserData[STUDENT_DATA.ACCESS - 1] <= ACCESS_LEVELS.CAPTAIN) {\n\n var joblists = getJobList(Cit);\n\n var num = 0;\n if (joblists) {\n\n var maxjob = joblists.getLastRow();\n var jobdata = joblists.getSheetValues(2, JOB_DATA[\"UJID\"], maxjob, JOB_DATA[\"LENGTH\"]);\n\n var ReturnData = [\n []\n ];\n\n for (var check = 0; check < jobdata.length; check++) {\n\n //all captain, proctor, and prefect values\n var positiondata = jobdata[check].slice(JOB_DATA.C1 - 1, JOB_DATA[\"P2\"]); //noninclusive upper bound\n\n if (positiondata.indexOf(UUID) >= 0 || UserData[STUDENT_DATA.ACCESS - 1] == ACCESS_LEVELS.ADMIN) {\n ReturnData[num] = jobdata[check];\n num++;\n }\n\n }\n\n }\n\n if (num > 0) {\n ReturnData.sort(\n function (x, y) {\n return x[JOB_DATA.NAME - 1].localeCompare(y[JOB_DATA.NAME - 1]);\n }\n );\n return ReturnData;\n } else\n return -1;\n } else {\n writeLog(\"User lacks privilege: Get Jobs\");\n throw new Error(\"User lacks privilege\");\n }\n\n}", "title": "" }, { "docid": "2c93826d2e78373112334587cd5a43cf", "score": "0.5365152", "text": "function getJobList(Cit) {\n var jblist = SpreadsheetApp.openByUrl(PropertiesService.getScriptProperties().getProperty('jobdatURL'));\n var sheets = jblist.getSheets();\n\n for (var i = 0; i < sheets.length; i++) {\n if (sheets[i].getName() === String(\"CIT\" + Cit))\n return sheets[i];\n }\n return null;\n}", "title": "" }, { "docid": "89c41df0bbe4d4f94e46d5354c657c31", "score": "0.53638315", "text": "function getJobList() {\n return jobs;\n }", "title": "" }, { "docid": "dcda0c7813ad13f773d793c0bc1aaaa0", "score": "0.53550375", "text": "function doSearch(jobTitle, totalJobs, callback) {\n\t// Do the search using Indeed\n\tvar cityStats;\n\tvar cityList = [];\n\ttotalJobs = parseInt(totalJobs.replace(',',''));\n\tcurrPage = 0;\n\tfor (var i = 0; i < MAX_RESULTS && i < totalJobs; i += 25) {\n\t\tpageSearcher(i, cityList, jobTitle, totalJobs, callback);\n\t}\n\t// Do the same search on Monster\n\tvar monsterJobTitle = jobTitle.replace('-', '%20');\n\tdoSearchMonster(monsterJobTitle, callback);\n}", "title": "" }, { "docid": "b7f6d28b7de534669261b7a6bb4f72d9", "score": "0.53173965", "text": "function searchJob(name) {\n setSearchTerm(name);\n setSearchResultStr(`results for '${name}'`)\n }", "title": "" }, { "docid": "368e532664eb378305abead1fb6b644e", "score": "0.5316323", "text": "function scrollToJob(search) {\t\n\tif(number <= jobs.length && !(number < 1)) {\n\t\tclearInterval(jobAnimation);\n\t\tclearInterval(tableAnimation);\n\t\tremoveProgressAnimation();\n\t\t\n\t\tsetTimeout(function() {\n\t\t\ttext= \"Moment prosím.\";\n\t\t\tsay(text);\n\t\t}, 20);\n\n\t\tvar i;\n\t\tfor (i = 0; i <= search; i++) {\n\t\t\t(function(i) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsortAndAnimate(0);\n\t\t\t\t\tgetJobDetails(0);\n\t\t\t\t}, 60 * i);\n\t\t\t})(i);\n\t\t}\n\t\t\n\t\tsortAndAnimate(2000);\n\t\tgetJobDetails(2000);\n\t\t\n\t\tsetTimeout(function() {\n\t\t\tprogress.classList.add(\"progress-bar\");\n\t\t\tjobAnimation = setInterval(getJobDetails, 10000);\n\t\t\ttableAnimation = setInterval(sortAndAnimate, 10000);\n\t\t}, 4000);\n\t} else {\n\t\ttext = \"Maximálny počet riadok je \" + jobs.length + \" . Skús iné číslo.\";\n\t\tsay(text);\n\t}\n}", "title": "" }, { "docid": "44b80172b2910994db02541cb97bbbd5", "score": "0.530406", "text": "handleSearch(event) {\n var searchTerm = event.target.value; // whatever is typed\n var allPosts = this.state.posts;\n var matchingPosts = [];\n\n // Iterate through posts\n for (const key of Object.keys(allPosts)) {\n const post = allPosts[key];\n // Does this post have a value containing the search term?\n var postHasTerm = this.hasSearchTerm(post, searchTerm);\n if (postHasTerm) {\n post['postId']=(key);\n matchingPosts.push(post);\n }\n }\n\n // searchResults contains array of job objects that match the search term\n this.setState({\n searchResultsArray: matchingPosts\n });\n\n }", "title": "" }, { "docid": "aaadf3a11a5440801a53fc5462064a62", "score": "0.52994144", "text": "async getJobAvail() {\n return this.getModel().findAll({ where: { status: JOB_STATUS.NEW }});\n }", "title": "" }, { "docid": "6850cda075dc90559437a9725d020bc5", "score": "0.52871555", "text": "async _validateJob(jobDef) {\n if (!this._valid(jobDef)) return false;\n\n // jobid overrides title, because jobId is indexed whereas title is not!\n let referenceJob = null;\n if (jobDef.jobId) {\n referenceJob = await models.job.findOne({\n where: {\n id: jobDef.jobId\n },\n attributes: ['id', 'title', 'other'],\n });\n } else {\n referenceJob = await models.job.findOne({\n where: {\n title: jobDef.title\n },\n attributes: ['id', 'title', 'other'],\n });\n }\n\n if (referenceJob && referenceJob.id) {\n // found a job match\n if (referenceJob.other && jobDef.other && jobDef.other.length && jobDef.other.length > OTHER_MAX_LENGTH) {\n return false;\n } else {\n return {\n jobId: referenceJob.id,\n title: referenceJob.title,\n other: (referenceJob.other && jobDef.other) ? jobDef.other : undefined\n };\n };\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e1fd3fd4646b1b1b71ec89471d8e87a8", "score": "0.5255305", "text": "function AzunaJobsearchs(obj) {\n obj.title !== undefined ? this.title = obj.title : this.title = 'title is unavailable'\n obj.location.display_name !== undefined ? this.location = obj.location.display_name : this.location = 'location is unavailable'\n this.company = obj.company.display_name;\n this.summary = obj.description;\n this.url = obj.redirect_url;\n obj.category.label !== undefined ? this.skill = obj.category.label : this.skill = 'not available'\n\n // dataArr.push(this)\n}", "title": "" }, { "docid": "e786f18d4e4653fce899705e91766411", "score": "0.52483815", "text": "function JobCard({ job, jobs, applyForJob }) {\n return (\n <div>\n <h4>{job.title}</h4>\n <p>Salary: {job.salary}</p>\n <p>Equity: {job.equity}</p>\n {jobs.includes(job.id) ? (\n <p>applied</p>\n ) : (\n <button onClick={() => applyForJob(job.id)}>Apply</button>\n )}\n </div>\n );\n}", "title": "" }, { "docid": "95820856a25e55842ec6e38e5e000e21", "score": "0.5236807", "text": "function _get_job_list_with_assigned_from_is_not_null(){\n try{\n var extra_where_condition=_setup_query_address_string(); \n if(extra_where_condition === 'false'){\n return;\n } \n var sql = ''; \n var sql_params ={\n is_task:false,\n is_calendar:false,//in calendar or in filter\n is_scheduled:true,//query assigned_from is not null\n is_check_changed:false,//check changed field or not\n is_check_self_job:false,//only check current user's job\n order_by:'assigned_from desc',\n extra_left_join_condition:'',\n extra_where_condition:extra_where_condition,\n type:'job',\n user_id:_selected_user_id,\n company_id:_selected_company_id\n };\n sql = self.setup_sql_query_for_display_job_list(sql_params);\n\n if(sql != ''){\n var db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute(sql);\n var q_row_count = rows.getRowCount();\n var b = _query_records_num;\n _query_records_num += rows.getRowCount();\n\n\n //display the job row\n var temp_year = 0;\n var temp_month = 0;\n var temp_date = 0;\n var temp_day = 0;\n var temp_hours = 0;\n var temp_minutes = 0;\n var temp_string = temp_year+'-'+(temp_month+1)+'-'+temp_date;\n var temp_big_array = [];//save all job with schedlued from\n var temp_sub_array = [];//every day's jobs as a sub array\n var temp_sub_header_array = [];\n var q=0;\n if(rows.getRowCount() > 0){\n while(rows.isValidRow()){\n if((rows.fieldByName('assigned_from') != null)&&(rows.fieldByName('assigned_from') != '')){\n var assigned_user_count = 0;\n if(_query_records_num > 0){\n var assigned_user_rows = db.execute('SELECT count(*) as count FROM my_job_assigned_user WHERE status_code=1 and job_id=?',rows.fieldByName('id'));\n assigned_user_count = assigned_user_rows.fieldByName('count');\n assigned_user_rows.close();\n }\n var temp_date_value = self.get_seconds_value_by_time_string(rows.fieldByName('assigned_from'));\n temp_date_value = new Date(temp_date_value*1000);\n temp_year = temp_date_value.getFullYear();\n temp_month = temp_date_value.getMonth()+1;\n temp_date = temp_date_value.getDate();\n temp_day = temp_date_value.getDay();\n temp_hours = temp_date_value.getHours();\n temp_minutes = temp_date_value.getMinutes();\n var status_colour = '';\n var status_name = '';\n var status_description = '';\n for(var i=0,j=_status_code_array.length;i<j;i++){\n if(_status_code_array[i].code == rows.fieldByName('job_status_code')){\n status_colour = _status_code_array[i].colour;\n status_name = _status_code_array[i].name;\n status_description = _status_code_array[i].description;\n break;\n }\n } \n if((temp_year+'-'+temp_month+'-'+temp_date) === temp_string){\n }else{\n temp_string = temp_year+'-'+temp_month+'-'+temp_date;\n temp_sub_header_array.push(self.day_list[temp_day]+' '+temp_date+'-'+self.month_list[temp_month-1]+'-'+temp_year);\n\n if(temp_sub_array.length > 0){\n temp_sub_array.reverse();\n temp_big_array.push(temp_sub_array);\n }\n temp_sub_array = [];//every day's jobs as a sub array\n }\n\n var assigned_to_hours = '';\n var assigned_to_minutes = '';\n if((rows.fieldByName('assigned_to') != undefined) && (rows.fieldByName('assigned_to') != null) && (rows.fieldByName('assigned_to') != '')){\n var assigned_to_temp_date_value = self.get_seconds_value_by_time_string(rows.fieldByName('assigned_to'));\n assigned_to_temp_date_value = new Date(assigned_to_temp_date_value*1000);\n assigned_to_hours = assigned_to_temp_date_value.getHours();\n assigned_to_minutes = assigned_to_temp_date_value.getMinutes();\n }\n\n var params = {\n is_header:false,\n header_text:'',\n job_type:'job',\n job_title:rows.fieldByName('title'),\n job_id:rows.fieldByName('id'),\n job_reference_number:rows.fieldByName('reference_number'),\n job_status_code:rows.fieldByName('job_status_code'),\n class_name:'show_job_row_'+b,\n assigned_from_hours:temp_hours,\n assigned_from_minutes:temp_minutes,\n assigned_to_hours:assigned_to_hours,\n assigned_to_minutes:assigned_to_minutes,\n job_status_color:status_colour,\n job_status_name:status_name,\n job_status_description:status_description,\n sub_number:rows.fieldByName('sub_number'),\n unit_number:rows.fieldByName('unit_number'),\n street_number:rows.fieldByName('street_number'),\n street:rows.fieldByName('street'),\n street_type:rows.fieldByName('street_type'),\n suburb:rows.fieldByName('suburb'),\n postcode:rows.fieldByName('postcode'),\n assigned_user_count:assigned_user_count\n }; \n temp_sub_array.push(self.setup_job_row_for_job_list(params));\n b++;\n }\n if(q+1 === q_row_count){\n temp_sub_array.reverse();\n temp_big_array.push(temp_sub_array);\n }\n q++;\n rows.next();\n }\n }\n rows.close();\n db.close();\n //load data into array by new order\n for(i=0,j=temp_big_array.length;i<j;i++){\n for(var m=0,n=temp_big_array[i].length;m<n;m++){\n if(m === 0){\n temp_big_array[i][m].header = temp_sub_header_array[i];\n }\n self.data.push(temp_big_array[i][m]);\n }\n }\n for(i=0,j=self.data.length;i<j;i++){\n if(i%2 === 0){\n self.data[i].backgroundColor = self.job_list_row_background_color;\n }else{\n self.data[i].backgroundColor = '#fff';\n }\n }\n }\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_job_list_with_assigned_from_is_not_null');\n return;\n }\n }", "title": "" }, { "docid": "12a262a6cf98d7ddcd55d95a38a05626", "score": "0.52154267", "text": "function contains(name, arr, cb){\n var name = true;\n for (var i = 0; i < arr.length; i++){\n if (arr[i] === name){\n cb();\n }\n }\n return cb(arr);\n}", "title": "" }, { "docid": "7ce031f3b3757a11948e4623f6cdb173", "score": "0.52124053", "text": "searchDataSourceDB(searchKey){\n let temp_array = [];\n this.state.dataSource_array.forEach((item) => {\n if (item.firstName.toLowerCase().indexOf(searchKey.toLowerCase()) != -1 ||\n item.lastName.toLowerCase().indexOf(searchKey.toLowerCase()) != -1 ||\n item.petName.toLowerCase().indexOf(searchKey.toLowerCase()) != -1 ||\n JSON.stringify(item.petID).indexOf(searchKey) != -1){\n temp_array.push(item);\n }\n });\n this.setState({modifiedDataSource: this.state.modifiedDataSource.cloneWithRowsAndSections(this.convertArraytoMap(temp_array || []))});\n console.log(temp_array);\n }", "title": "" }, { "docid": "786c200abd12e4733ff2779cf8b8368c", "score": "0.5204018", "text": "function jobs_accept(job_id, location, class_id){\n\tif (this.jobs_has(location.tsid, job_id, class_id)) return false;\n\n\tif (!this.jobs.todo.jobs[location.tsid]) this.jobs.todo.jobs[location.tsid] = {};\n\tif (!this.jobs.todo.jobs[location.tsid][job_id]) this.jobs.todo.jobs[location.tsid][job_id] = {};\n\tthis.jobs.todo.jobs[location.tsid][job_id][class_id] = {};\n\t\n\treturn true;\n}", "title": "" }, { "docid": "f76e42703cb139deaf93e2f004e6ff80", "score": "0.51726174", "text": "function availableContains(ele, array){\n\tfor(var i = 0; i < array.length; i++)\n\t{\n\t\tif(array[i][0] == ele)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ce7b595db1869568c57e0df96f4f2a17", "score": "0.5168719", "text": "function getJobsStatus(jobs) {\n return new Promise(function (resolve, reject) {\n var promises = [];\n jobs.forEach(function (job) {\n var jobPromise = new Promise(function getJobStatus(resolveJob, rejectJob) {\n var jenkinsUrl = consts.JENKINS_JOB_URL + job.name + '/lastBuild/api/json';\n eRequest.get(jenkinsUrl, function (error, response, body) {\n var jsonIt = JSON.parse(body);\n job.result = jsonIt.result;\n job.building = jsonIt.building;\n job.number = jsonIt.number;\n resolveJob(job);\n });\n });\n promises.push(jobPromise);\n }, this);\n Promise.all(promises).then(function (jobsWithStatuses) {\n resolve(jobsWithStatuses);\n }.bind(this));\n });\n }", "title": "" }, { "docid": "2c5642a027ae4ff3faaa63824a0634a2", "score": "0.5153344", "text": "function searchWord(word, arr){\n let searchResult = [];\n for(let i = 0; i < arr.length; i++){\n if(word === arr[i].u_name){\n searchResult.push(arr[i]);\n }\n for(let j = 0; j < arr.length; j++){\n if(word === arr[i].skills[j]){\n searchResult.push(arr[i]);\n }\n }\n }\n console.log(\"test\" + searchResult);\n return searchResult;\n}", "title": "" }, { "docid": "33c71340680e69400bbb0ec5b2e37cb0", "score": "0.51322085", "text": "contains(val) {\n for (let i = this.firstIndex; i < this.lastIndex; i++) {\n if (this.queue[i] === val) return true;\n }\n \n return false;\n }", "title": "" }, { "docid": "44c0f0de4ca2dcdcd2c9ccb420c31b59", "score": "0.51267654", "text": "function fullTimeJobs(val, res) {\n if (res) { // if true\n const result = jobsArr.filter(({ type }) => type === val);\n buildJobCard(result, job_items, current_page);\n displayPagination(result, job_items, current_page);\n } else if (!res) { // if false\n buildJobCard(jobsArr, job_items, current_page);\n displayPagination(jobsArr, job_items, current_page);\n }\n}", "title": "" }, { "docid": "185aa3cc9f0befffa479020234f44a88", "score": "0.5101684", "text": "function getNotAssignedJobs() {\n\n var notAssignedJobList = [];\n var languageList = $(\"#languages_dropdowns .language_div\");\n\n for (var languageIndex = 0; languageIndex < languageList.length; languageIndex++) {\n var currentLanguage = $(languageList[languageIndex]);\n var languageHash = getHashFromString(currentLanguage.attr(\"id\"));\n var jobList = getJobsByLanguageHash(languageHash);\n\n for (var jobIndex = 0; jobIndex < jobList.length; jobIndex++) {\n// if ($(\"#in_edit_mode_\" + jobList[jobIndex]).val() == 1)\n// continue;\n\n var assignedEmployees = [];\n\n assignedEmployees = eval($(\"#task_users_\" + jobList[jobIndex]).val());\n\n if (assignedEmployees === undefined || assignedEmployees.length == 0) {\n notAssignedJobList.push(jobList[jobIndex]);\n }\n }\n }\n\n return notAssignedJobList;\n}", "title": "" }, { "docid": "c5d448e71ae6bdee14b24a364be9583b", "score": "0.51005185", "text": "function getAllJobs(Cit) {\n\n var UserData = retrieveUserData();\n if (UserData[STUDENT_DATA.ACCESS - 1] >= ACCESS_LEVELS.ADMIN && UserData[STUDENT_DATA.ACCESS - 1] <= ACCESS_LEVELS.PREFECT) {\n\n var joblists = getJobList(Cit);\n\n var num = 0;\n if (joblists) {\n\n var maxjob = joblists.getLastRow();\n\n var jobdata = joblists.getSheetValues(2, JOB_DATA[\"UJID\"], maxjob, JOB_DATA[\"LENGTH\"]);\n\n var ReturnData = [\n []\n ];\n\n for (var check = 0; check < jobdata.length; check++) {\n ReturnData[num] = jobdata[check];\n num++;\n }\n\n }\n\n if (num > 0) {\n ReturnData.sort(\n function (x, y) {\n return x[JOB_DATA.NAME - 1].localeCompare(y[JOB_DATA.NAME - 1]);\n }\n );\n return ReturnData;\n } else\n return -1;\n } else {\n writeLog(\"User lacks privilege: Get All Jobs\");\n throw new Error(\"User lacks privilege\");\n }\n\n}", "title": "" }, { "docid": "f1a4b727542fce56d3222c7665d0b2ae", "score": "0.50975496", "text": "arrayContains(needle, arrhaystack)\n\t{\n \treturn (arrhaystack.indexOf(needle) > -1);\n\t}", "title": "" }, { "docid": "950ed7db181e42106d87d90bc0ec5aca", "score": "0.50936025", "text": "function _get_job_list_with_assigned_from_is_null(){\n try{\n var extra_where_condition=_setup_query_address_string(); \n if(extra_where_condition === 'false'){\n return;\n }\n var sql = '';\n var sql_params = null;\n sql_params ={\n is_task:false,\n is_calendar:false,//in calendar or in filter\n is_scheduled:false,//query assigned_from is not null\n is_check_changed:false,//check changed field or not\n is_check_self_job:false,//only check current user's job \n order_by:'my_job.reference_number desc',\n extra_where_condition:extra_where_condition,\n type:'job',\n user_id:_selected_user_id,\n company_id:_selected_company_id\n };\n sql = self.setup_sql_query_for_display_job_list(sql_params);\n if(sql != ''){\n var db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute(sql);\n var b = _query_records_num;\n _query_records_num += rows.getRowCount(); \n if((rows != null) && (rows.getRowCount() > 0)){\n while(rows.isValidRow()){\n if((rows.fieldByName('assigned_from') === null)||(rows.fieldByName('assigned_from') === '')){\n var status_colour = '';\n var status_name = '';\n var status_description = '';\n for(var i=0,j=_status_code_array.length;i<j;i++){\n if(_status_code_array[i].code == rows.fieldByName('job_status_code')){\n status_colour = _status_code_array[i].colour;\n status_name = _status_code_array[i].name;\n status_description = _status_code_array[i].description;\n break;\n }\n } \n var params = {\n is_header:(b === 0)?true:false,\n header_text:'Not Scheduled',\n job_type:'job',\n job_title:rows.fieldByName('title'),\n job_id:rows.fieldByName('id'),\n job_reference_number:rows.fieldByName('reference_number'),\n job_status_code:rows.fieldByName('job_status_code'),\n class_name:'show_job_row_'+b,\n assigned_from_hours:'',\n assigned_from_minutes:'',\n assigned_to_hours:'',\n assigned_to_minutes:'',\n job_status_color:status_colour,\n job_status_name:status_name,\n job_status_description:status_description,\n sub_number:rows.fieldByName('sub_number'),\n unit_number:rows.fieldByName('unit_number'),\n street_number:rows.fieldByName('street_number'),\n street:rows.fieldByName('street'),\n street_type:rows.fieldByName('street_type'),\n suburb:rows.fieldByName('suburb'),\n postcode:rows.fieldByName('postcode')\n }; \n self.data.push(self.setup_job_row_for_job_list(params));\n b++;\n }\n rows.next();\n }\n }\n if(rows != null){\n rows.close();\n }\n db.close();\n }\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_job_list_with_assigned_from_is_null');\n return;\n }\n }", "title": "" }, { "docid": "e1512134ee7354f62dfe0ba4e852b6f3", "score": "0.50916964", "text": "search(value) {\n //Percorre todo o array e retorna true se o elemento for igual ao passado no argumento, caso não,retorna false\n return this.data.some((n) => n === value)\n }", "title": "" }, { "docid": "a70d09dd2bc8cdabd29e5497416fe1a7", "score": "0.5090192", "text": "function employeeSearch(managerKey, myArray) {\n for (var i = 0; i < myArray.length; i++) {\n if (myArray[i].full_name === managerKey) {\n return myArray[i];\n }\n }\n }", "title": "" }, { "docid": "701da5fb8fe6a3069386104a1d33ba86", "score": "0.5074784", "text": "function contains(array, cell)\n {\n // Check array length.\n if(array === undefined || array.length <= 0 || cell === undefined)\n {\n return false;\n }\n \n // Check if array already contains the element.\n for(let x = 0; x < array.length; x++)\n {\n if(getName(array[x]) === getName(cell))\n {\n return true;\n } \n }\n return false;\n }", "title": "" }, { "docid": "55ab3751ba3f446418bbca96a945453b", "score": "0.5067343", "text": "_checkJobStatus(statusArray) {\n //if every status is either succeeded or failed, all jobs have completed.\n if (statusArray.length === 0) return false\n return statusArray.every(status => {\n return status === 'SUCCEEDED' || status === 'FAILED'\n })\n }", "title": "" }, { "docid": "5c2833b726026da5453cb9d453723668", "score": "0.5048202", "text": "async function getJobsByLocation(keyword, location) {\n let params = {\n app_id: ADZUNA_APP_ID,\n app_key: ADZUNA_APP_KEY,\n what: keyword,\n category: category,\n results_per_page: results_per_page\n };\n\n if (location)\n params.where = location;\n\n try {\n let response = await axios.get(baseURL, { params: params });\n\n if (response.status == 200) {\n let rawJobs = response.data.results; //jobs with all the charateristics retrivied\n\n let refinedJobs = [];\n\n // clean jobs with only informations that are useful for us.\n await Promise.all(rawJobs.map(async (rawJob) => {\n let {\n title,\n description,\n company,\n location,\n latitude,\n longitude,\n salary_min,\n redirect_url\n } = rawJob; //destructoring\n\n title = title.replace(/<\\/?[^>]+(>|$)/g, \"\");\n let small_description = description.replace(/<\\/?[^>]+(>|$)/g, \"\");\n\n let full_description = await getFullDescription(redirect_url);\n\n let refinedJob = {\n title: title,\n job_category: category,\n category: keyword,\n company_name: company.display_name,\n small_description: small_description,\n full_description: full_description,\n city: location.area[3],\n nation: location.area[1],\n latitude: latitude,\n longitude: longitude,\n salary: salary_min,\n url: redirect_url\n };\n\n refinedJobs.push(refinedJob);\n\n }));\n\n return {jobs: refinedJobs, category: keyword};\n }\n } catch (err) {\n console.log(`Adzuna wrapper error: ${err}`);\n }\n\n\n}", "title": "" }, { "docid": "9d6ad50a29e0b321a84fc966a46eef7a", "score": "0.50469947", "text": "function addToJson() {\n var a = $(\"form.niche\").serializeArray();\n /*checked error value input niche */\n var p = [];\n $.each(a, function () {\n for (var i = 0; i < job.length; i++) {\n if (job[i].jobNiche == this.value) {\n p = true;\n console.log(p);\n }\n }\n });\n $.each(a, function () {\n if (this.value == '') {\n console.log(\"Pleas entry value\");\n alert(\"Pleas entry value\")\n } else if (p == true) {\n console.log(\"Pleas entry another value\");\n alert(\"Pleas entry another value\");\n } else {\n var jobID = job.length + 1;\n var jobNiche = this.value;\n var jobSelected = true;\n var jobCheck = true;\n var kaywords = [];\n mas = {\n 'jobID': jobID,\n 'jobNiche': jobNiche,\n 'jobSelected': jobSelected,\n 'jobCheck': jobCheck,\n 'kaywords': kaywords\n };\n job.push(mas);\n addToSearchList();\n checkSelect();\n }\n });\n console.log(job);\n }", "title": "" }, { "docid": "9de73c3ce271bbecedc6012ef3007ca1", "score": "0.5046346", "text": "contains(projectName) {\n return this.projects.some((project) => project.getName() === projectName)\n }", "title": "" }, { "docid": "07d93c5f143bd44bc4b9cf5295e45e7c", "score": "0.50457335", "text": "function contains(name, array, cb) {\n for(var i = 0; i < array.length; i++) {\n if(name === array[i]) {\n return cb(\"yes\");\n } else {\n }\n }\n return cb();\n}", "title": "" }, { "docid": "82176db6bd4e8780df4e8ae697a134cb", "score": "0.50444585", "text": "checkEmailExists (email, array) {\n\n for(let i = 0; i < array.length; i++) {\n if (array[i].email == email) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "5f1871f4601e3c514578f9746650f661", "score": "0.504114", "text": "function searchArray(item, arr) {\n var newarr = [];\n var newitem = item.toLowerCase();\n for (i = 0; i < arr.length; i++) {\n var newArrItem = arr[i].toLowerCase();\n newarr.push(newArrItem)\n\n }\n var result = $.inArray(newitem, newarr);\n console.log(newarr)\n if (result === -1) {\n return false;\n }\n else {\n alert(\"Already Exist!...\")\n return true;\n }\n }", "title": "" }, { "docid": "25197a23cc87ada8787365e2657b4d86", "score": "0.5038053", "text": "function is_in_batch(id) \n{ \n if($.inArray(id, in_batch) == \"-1\")\n { \n return false;\n } else { \n return true;\n }\n}", "title": "" }, { "docid": "c82f4db0d74a9705e05dfd9216c68ec3", "score": "0.5037064", "text": "function jobCombo(element) {\n\t var i;\n\t if (isGMChecked('multipleJobs')) {\n\t // Cycle jobs with the same ratio\n\t var availableJobs = eval('(' + GM_getValue('availableJobs', \"{0:{},1:{},2:{},3:{},4:{}}\") + ')');\n\t var multiple_jobs_list = getSavedList('selectMissionMultiple');\n\t var cycle_jobs = new Object();\n\t\n\t // Group selected jobs by ratio\n\t for (i = 0, iLength=multiple_jobs_list.length; i < iLength; ++i) {\n\t var job = multiple_jobs_list[i];\n\t var mission = missions[job];\n\t if(!mission) continue;\n\t // Put non-available jobs at the end of the queue\n\t if (availableJobs[mission[MISSION_CITY]][mission[MISSION_TAB]] != null &&\n\t availableJobs[mission[MISSION_CITY]][mission[MISSION_TAB]].indexOf(parseInt(job)) == -1) {\n\t mission[MISSION_RATIO] = 0;\n\t }\n\t\n\t if (cycle_jobs[mission[MISSION_RATIO]] == null) {\n\t cycle_jobs[mission[MISSION_RATIO]] = [];\n\t }\n\t cycle_jobs[mission[MISSION_RATIO]].push(multiple_jobs_list[i]);\n\t }\n\t\n\t // Rebuild the job list array\n\t multiple_jobs_list = [];\n\t for (i in cycle_jobs) {\n\t if (cycle_jobs[i].length > 1) {\n\t // Only cycle the current job's ratio group\n\t if (missions[GM_getValue('selectMission', 1)][MISSION_RATIO] == i) {\n\t cycle_jobs[i].push(cycle_jobs[i].shift());\n\t }\n\t for (var n = 0, nLength=cycle_jobs[i].length; n < nLength; ++n) {\n\t multiple_jobs_list.push(cycle_jobs[i][n]);\n\t }\n\t } else {\n\t multiple_jobs_list.push(cycle_jobs[i][0]);\n\t }\n\t }\n\t setSavedList('selectMissionMultiple', multiple_jobs_list);\n\t }\n\t}", "title": "" }, { "docid": "d5d10c85e9c5a23cbe92678f051c0d28", "score": "0.5036076", "text": "function confirmDoneTask(arrayTask,i){\n\n var taskJobID = arrayTask[0][15]\n\n if (taskJobID == \"\")\n return;\n \n var arrayJobIDs = submissionSheet.getSheetValues(1,columnJobID,submissionsLastRow,1)\n \n for(var j = 0; j < arrayJobIDs.length;j++) {\n var checkJobID = arrayJobIDs[j][0]\n \n if(taskJobID == checkJobID) {\n submissionSheet.getRange(j+1,columnProcessed).setValue(1)\n return;\n }\n }\n\n createMeaningfulError(arrayTask,'Job completed with no matching Job ID')\n}", "title": "" }, { "docid": "1676123e0fe8f2d29fbb6aa02abc1443", "score": "0.501858", "text": "function fixBusinessUnitsData(aJobOpenings){\n if(!jQuery.isEmptyObject(aJobOpenings)){\n aBusinessUnits = [];\n\n for(var oJobOpening in aJobOpenings){\n var bLocationFound = false;\n var bBusinessUnitFound = false;\n var sSavedoBusinessUnitIndex = '';\n\n var oAddress = {};\n oAddress.LocationAddress1 = aJobOpenings[oJobOpening].LocationAddress1.trim();\n oAddress.LocationCity = aJobOpenings[oJobOpening].LocationCity.trim();\n oAddress.LocationState = aJobOpenings[oJobOpening].LocationState.trim().toUpperCase();\n\n var oBusinessUnit = {};\n oBusinessUnit.BusinessUnitId = aJobOpenings[oJobOpening].BusinessUnitId;\n oBusinessUnit.LocationName = aJobOpenings[oJobOpening].LocationName.trim();\n oBusinessUnit.Address = oAddress;\n oBusinessUnit.JobOpenings = [];\n oBusinessUnit.JobOpenings.push(aJobOpenings[oJobOpening]);\n\n for(var oBusinessUnitIndex in aBusinessUnits){\n if(aBusinessUnits[oBusinessUnitIndex].LocationName.trim() === aJobOpenings[oJobOpening].LocationName.trim()){\n sSavedoBusinessUnitIndex = oBusinessUnitIndex;\n bBusinessUnitFound = true;\n break;\n }\n }\n\n if(!bBusinessUnitFound){\n aBusinessUnits.push(oBusinessUnit);\n }else{\n aBusinessUnits[sSavedoBusinessUnitIndex].JobOpenings.push(aJobOpenings[oJobOpening]);\n }\n }\n\n if(bShowLocationsWithNoJobs){\n for (var i = aBusinessUnitsAjax.length - 1; i >= 0; i--) {\n bBusinessUnitFound = false;\n\n for (var i2 = aBusinessUnits.length - 1; i2 >= 0; i2--) {\n if(aBusinessUnits[i2].BusinessUnitId === aBusinessUnitsAjax[i].Id){\n bBusinessUnitFound = true;\n break;\n }\n }\n\n if(!bBusinessUnitFound){\n var oAddress = {};\n oAddress.LocationAddress1 = aBusinessUnitsAjax[i].Address.StreetAddress1.trim();\n oAddress.LocationCity = aBusinessUnitsAjax[i].Address.City.trim();\n oAddress.LocationState = aBusinessUnitsAjax[i].Address.State.trim().toUpperCase();\n\n var oBusinessUnit = {};\n oBusinessUnit.BusinessUnitId = aBusinessUnitsAjax[i].Id;\n oBusinessUnit.LocationName = aBusinessUnitsAjax[i].Name.trim();\n oBusinessUnit.Address = oAddress;\n oBusinessUnit.JobOpenings = [];\n\n aBusinessUnits.push(oBusinessUnit);\n }\n }\n }\n\n sortByKey(aBusinessUnits, \"LocationName\", \"\")\n }else if(bShowLocationsWithNoJobs){\n for (var i = aBusinessUnitsAjax.length - 1; i >= 0; i--) {\n var oAddress = {};\n oAddress.LocationAddress1 = aBusinessUnitsAjax[i].Address.StreetAddress1.trim();\n oAddress.LocationCity = aBusinessUnitsAjax[i].Address.City.trim();\n oAddress.LocationState = aBusinessUnitsAjax[i].Address.State.trim().toUpperCase();\n\n var oBusinessUnit = {};\n oBusinessUnit.BusinessUnitId = aBusinessUnitsAjax[i].Id;\n oBusinessUnit.LocationName = aBusinessUnitsAjax[i].Name.trim();\n oBusinessUnit.Address = oAddress;\n oBusinessUnit.JobOpenings = [];\n\n aBusinessUnits.push(oBusinessUnit);\n }\n }\n}", "title": "" }, { "docid": "29ad7b5ac951e6283ae1d450cbc17dcc", "score": "0.50180775", "text": "static contains(array, thing) {\n return array.indexOf(thing) >= 0;\n }", "title": "" }, { "docid": "808528f39720c03ef5871c9e9560cb4c", "score": "0.5017297", "text": "function checkElementinArray(element, result){\n var check=result.filter(function(curr){\n return element.EmployeeID==curr.EmployeeID\n })\n if(check.length > 0){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "c78147ae403dea58c134833bc6f71bbf", "score": "0.5007186", "text": "contains(subject,search){\n return subject.indexOf(search) >= 0\n }", "title": "" }, { "docid": "0081ce5fb2dd76dc9b9c19d98a0c804c", "score": "0.50043863", "text": "watchCurrentJobIfTriggerIsAlreadyRunning() {\n if (this.trigger?.current_state?.status === 'running') {\n this.job = {\n _id: this.trigger?.current_state?.last_executed_job_id\n }\n this.watchJob({ autoSuccessTimer: false, loginSuccess: true })\n }\n }", "title": "" }, { "docid": "418260bcbd38ca4d0b4928505fc1fefd", "score": "0.50028974", "text": "function getExpiredJobs(jobs){\n var jobListArry = new Array();\n\n jobs.forEach(element =>{\n var currentDate = new Date().toLocaleDateString(\"en-US\");\n var closingDate = new Date(Date.parse(element.closingDate)).toLocaleDateString(\"en-US\");\n if(Date.parse(closingDate) < Date.parse(currentDate)){\n jobListArry.push(element);\n }\n });\n return jobListArry;\n}", "title": "" }, { "docid": "0ab17098849f598af5ea60b6fa0e4903", "score": "0.50007355", "text": "function findInArray(arr, productName){\n\tfor (let i = 0;i < arr.length; i++){\n\t\tif(arr[i][0] == productName){\n\t\t\treturn 1;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "title": "" }, { "docid": "df14adb9de2ac00ea9f15a2b7af1c09b", "score": "0.4996828", "text": "function isInArray(array, search) {\n\t\treturn array.indexOf(search) >= 0;\n\t}", "title": "" }, { "docid": "c7766a34ddef947f0eb9772a38744b11", "score": "0.49937665", "text": "function jobMastery(element, newJobs) {\n\t if (isGMChecked('repeatJob') || isGMChecked('multipleJobs')) return;\n\t\n\t var selectMission = parseInt(GM_getValue('selectMission', 1));\n\t var currentJob = missions[selectMission][MISSION_NAME];\n\t var jobno = missions[selectMission][MISSION_NUMBER];\n\t var tabno = missions[selectMission][MISSION_TAB];\n\t var cityno = missions[selectMission][MISSION_CITY];\n\t\n\t if (city != cityno || !onJobTab(tabno)) return;\n\t\n\t var currentJobRow = getJobRow(currentJob, element);\n\t DEBUG('Calculating progress for ' + currentJob + '.');\n\t\n\t // Calculate tier mastery.\n\t DEBUG('Checking mastery for each job.');\n\t var tierLevel = 0;\n\t var jobPercentComplete = -1;\n\t if (currentJobRow) jobPercentComplete = getJobMastery(currentJobRow, newJobs);\n\t\n\t var currentJobMastered = (jobPercentComplete == 100);\n\t if (currentJobRow) {\n\t if (newJobs && currentJobRow.className.match(/mastery_level_(\\d+)/i))\n\t tierLevel = RegExp.$1;\n\t else if (currentJobRow.innerHTML.match(/level (\\d+)/i))\n\t tierLevel = RegExp.$1;\n\t }\n\t\n\t var tierPercent = 0;\n\t var jobCount = 0;\n\t var firstUnmastered = selectMission;\n\t var firstFound = false;\n\t for (var i = 0, iLength = missions.length; i < iLength; i++) {\n\t // Only get the jobs from this city tier\n\t if (city == missions[i][MISSION_CITY] && tabno == missions[i][MISSION_TAB]) {\n\t var thisJobRow = getJobRow(missions[i][MISSION_NAME]);\n\t if (thisJobRow) {\n\t var masteryLevel = getJobMastery(thisJobRow, newJobs);\n\t tierPercent += masteryLevel;\n\t jobCount++;\n\t\n\t // Get the first unmastered job on this tier\n\t if (!firstFound && masteryLevel < 100) {\n\t firstFound = true;\n\t firstUnmastered = i;\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (jobCount > 0) {\n\t tierPercent = Math.floor(tierPercent / jobCount);\n\t }\n\t\n\t if (GM_getValue('tierCompleteStatus') != tierLevel + '|' + tierPercent) {\n\t GM_setValue('tierCompleteStatus', tierLevel + '|' + tierPercent);\n\t addToLog('info Icon', 'Job tier level ' + tierLevel + ' is ' +\n\t tierPercent + '% complete.');\n\t }\n\t\n\t // Calculate job mastery\n\t DEBUG(\"Checking current job mastery.\");\n\t if (currentJobMastered || jobPercentComplete == -1) {\n\t var jobList = getSavedList('jobsToDo');\n\t if (jobList.length == 0) {\n\t if (currentJobMastered)\n\t addToLog('info Icon', 'You have mastered <span class=\"job\">' + currentJob + '</span>.');\n\t else\n\t addToLog('info Icon', 'Job <span class=\"job\">' + currentJob + '</span> is not available.');\n\t DEBUG('Checking job tier mastery.');\n\t if (tierPercent == 100) {\n\t // Find the first job of the next tier.\n\t // NOTE: This assumes that the missions array is sorted by city and\n\t // then by tier.\n\t var nextTierJob;\n\t for (i = selectMission + 1, iLength=missions.length; i < iLength; ++i) {\n\t if (missions[i][MISSION_CITY] != cityno) {\n\t nextTierJob = i;\n\t addToLog('info Icon', 'You have mastered the final job tier in ' +\n\t cities[cityno][CITY_NAME] + '! Moving to the next tier in ' +\n\t cities[missions[nextTierJob][MISSION_CITY]][CITY_NAME] + '.');\n\t break;\n\t }\n\t if (missions[i][MISSION_TAB] != tabno) {\n\t nextTierJob = i;\n\t addToLog('info Icon', 'Current job tier is mastered. Moving to next tier in ' + cities[cityno][CITY_NAME] + '.');\n\t break;\n\t }\n\t }\n\t if (!nextTierJob) {\n\t addToLog('info Icon', 'You have mastered all jobs!');\n\t } else {\n\t GM_setValue('selectMission', nextTierJob);\n\t addToLog('info Icon', 'Job switched to <span class=\"job\">' + missions[GM_getValue('selectMission', 1)][MISSION_NAME] + '</span>.');\n\t }\n\t } else {\n\t GM_setValue('selectMission', firstUnmastered);\n\t addToLog('info Icon', 'Job switched to <span class=\"job\">' + missions[GM_getValue('selectMission', 1)][MISSION_NAME] + '</span>.');\n\t }\n\t } else {\n\t DEBUG(\"There are jobs in the to-do list.\");\n\t }\n\t } else {\n\t DEBUG(\"Job is not mastered. Checking percent of mastery.\");\n\t if (GM_getValue('jobCompleteStatus') != (currentJob + '|' + String(jobPercentComplete))) {\n\t GM_setValue('jobCompleteStatus', (currentJob + '|' + String(jobPercentComplete)));\n\t addToLog('info Icon', '<span class=\"job\">' + currentJob + '</span> is ' + jobPercentComplete + '% complete.');\n\t }\n\t }\n\t}", "title": "" }, { "docid": "0e29b40cc14b408f1a1773ec80b6e973", "score": "0.49931917", "text": "function containsThing(arr,theThing){ \r\n \r\n} \r\n \r\n// ANSWER: ", "title": "" }, { "docid": "ac25c99f951c49368f6b074d5343a08b", "score": "0.4964631", "text": "function compareHistoryAndSave(newJobObject) {\n getHistory();\n let isUnique = false;\n for (let i = 0; i < savedJobs.length; i++) {\n if (savedJobs[i].description === newJobObject.description) {\n isUnique = false;\n break;\n } else {\n isUnique = true;\n }\n }\n if (savedJobs.length === 0) {\n isUnique = true;\n }\n if (isUnique) {\n addLocalStorage(newJobObject);\n addJobCardtoModal(newJobObject);\n }\n }", "title": "" }, { "docid": "5aa74739e96c0fb2f9cb8405449a71c4", "score": "0.49625012", "text": "requestBatchInfo() {\n const batchId = this.model.getItem('exec.jobState.job_id'),\n jobInfo = this.model.getItem('exec.jobs.info');\n if (!jobInfo || !Object.keys(jobInfo).length) {\n return this.bus.emit(jcm.MESSAGE_TYPE.INFO, { [jcm.PARAM.BATCH_ID]: batchId });\n }\n\n const jobInfoIds = new Set(Object.keys(jobInfo));\n const missingJobIds = Object.keys(this.model.getItem(JOBS_BY_ID)).filter(\n (jobId) => {\n return !jobInfoIds.has(jobId);\n }\n );\n if (missingJobIds.length) {\n this.bus.emit(jcm.MESSAGE_TYPE.INFO, {\n [jcm.PARAM.JOB_ID_LIST]: missingJobIds,\n });\n }\n }", "title": "" }, { "docid": "169f07b7fffb88dc7483a9d3062f0e99", "score": "0.49597403", "text": "function arrayStreamNameCheck(myArray, searchTerm) {\n for(var i=0; i<myArray.length;i++) {\n if (myArray[i].streamName === searchTerm) return true;\n }\n return false;\n}", "title": "" }, { "docid": "b8863708949cf043fdfb3f09f7ba20e5", "score": "0.49561322", "text": "function Worker(){\n this._jobs = []\n this._runJobs = []\n this.running = false //of suspect usefulness?\n this.cb = void 0\n \n var self = this\n \n this._runJob = function _runJob(){\n if(self._jobs.length > 0){\n var jobConfig = self._jobs.shift()\n \n self.running = true\n jobConfig.running = true\n jobConfig.startedTime = new Date().toString()\n \n var jobRunner = new (require('../' + jobConfig.job.jobPath))()\n console.log('prepped job (name: ' + jobConfig.job.jobName + ', id: ' + jobConfig.job.id + ')')\n self._runJobs.push(jobConfig)\n \n jobRunner.workJob.run(jobConfig.job, self._clearJob)\n \n setTimeout(_runJob, 1000)\n } else {\n setTimeout(_runJob, 1000 * 60 * 10)\n }\n }\n\n this._clearJob = function _clearJob(err, result, jobId){\n if(err){\n //TODO: do something special?\n } \n ///what if i don't find it, for some reason?\n var found = false\n self._runJobs.forEach(function(jobConfig){\n if(jobConfig.job.id === jobId){\n jobConfig.running = false\n jobConfig.err = err\n jobConfig.result = result\n jobConfig.stoppedTime = new Date().toString()\n found = true\n }\n })\n if(!found){\n ///TODO: freak out.\n }\n self.running = false\n //do something with result\n self.cb(err, result, jobId)\n }\n}", "title": "" }, { "docid": "016a854940a3c4e28ea80df61cca2ed4", "score": "0.49478862", "text": "function findName(name) {\n \treturn boyName.indexOf(name) <= -1\n }", "title": "" }, { "docid": "adc37bc2dfd22c2754911313f4228d44", "score": "0.4947007", "text": "function searchCompany(e) {\n e.preventDefault();\n const input = document.querySelector(\".input--form\");\n const inputVal = input.value.trim().toLowerCase();\n\n if (inputVal !== \"\") {\n const result = jobsArr.filter(({ description }) => description.toLowerCase().includes(inputVal));\n buildJobCard(result, job_items, current_page);\n displayPagination(result, job_items, current_page);\n } else if (inputVal === \"\") {\n alert(\"Fill input\");\n }\n input.value = \"\";\n}", "title": "" }, { "docid": "003608e50b9deea5014509940421a406", "score": "0.49446312", "text": "function _get_badge_infor_for_unsynced_job_and_quote(job_type, job_id_array) {\n\t\t\ttry {\n\t\t\t\tvar _selected_company_id = Ti.App.Properties.getString('current_company_id');\n\t\t\t\t// local jobs\n\t\t\t\tvar unsynced_jobs_id_array = [];\n\t\t\t\tvar sql_str = 'SELECT * FROM my_' + job_type + ' WHERE company_id=? and status_code=1 and ';\n\t\t\t\tif (job_id_array.length > 0) {\n\t\t\t\t\tsql_str += '((id in (' + job_id_array.join(',') + ') or ';\n\t\t\t\t}\n\t\t\t\tsql_str += '(exist_any_changed=1 or changed=1)';\n\t\t\t\tif (job_id_array.length > 0) {\n\t\t\t\t\tsql_str += '))';\n\t\t\t\t}\n\t\t\t\tvar db = Titanium.Database.open(self.get_db_name());\n\t\t\t\tvar rows = db.execute(sql_str, _selected_company_id);\n\t\t\t\tif (rows.getRowCount() > 0) {\n\t\t\t\t\twhile (rows.isValidRow()) {\n\t\t\t\t\t\tunsynced_jobs_id_array.push(rows.fieldByName('id'));\n\t\t\t\t\t\trows.next();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trows.close();\n\t\t\t\t// check other relative tables\n\t\t\t\tvar table_array = [];\n\t\t\t\tif (job_type === 'job') {\n\t\t\t\t\ttable_array.push('my_' + job_type + '_operation_log');\n\t\t\t\t}\n\t\t\t\ttable_array.push('my_' + job_type + '_status_log');\n\t\t\t\ttable_array.push('my_' + job_type + '_client_contact');\n\t\t\t\ttable_array.push('my_' + job_type + '_site_contact');\n\t\t\t\ttable_array.push('my_' + job_type + '_note');\n\t\t\t\ttable_array.push('my_' + job_type + '_asset');\n\t\t\t\ttable_array.push('my_' + job_type + '_contact_history');\n\t\t\t\ttable_array.push('my_' + job_type + '_assigned_user');\n\t\t\t\ttable_array.push('my_' + job_type + '_assigned_item');\n\t\t\t\ttable_array.push('my_' + job_type + '_invoice');\n\t\t\t\ttable_array.push('my_' + job_type + '_invoice_signature');\n\t\t\t\ttable_array.push('my_' + job_type + '_custom_report_data');\n\t\t\t\ttable_array.push('my_' + job_type + '_custom_report_signature');\n\t\t\t\tfor ( var i = 0, j = table_array.length; i < j; i++) {\n\t\t\t\t\t// if any changed record does not in the\n\t\t\t\t\t// my_updating_records, then set\n\t\t\t\t\t// is_make_changed = true\n\t\t\t\t\trows = db.execute('SELECT * FROM ' + table_array[i] + ' WHERE changed=1 and ' + job_type + '_id=?', job_id_array.join(','));\n\t\t\t\t\tvar row_count = rows.getRowCount();\n\t\t\t\t\tif (row_count > 0) {\n\t\t\t\t\t\twhile (rows.isValidRow()) {\n\t\t\t\t\t\t\tunsynced_jobs_id_array.push(rows.fieldByName(job_type + '_id'));\n\t\t\t\t\t\t\trows.next();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trows.close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunsynced_jobs_id_array = self.get_unique_array(unsynced_jobs_id_array);\n\t\t\t\tif (unsynced_jobs_id_array.length > 0) {\n\t\t\t\t\tdb.execute('UPDATE my_' + job_type + ' SET exist_any_changed=1 WHERE id=?', unsynced_jobs_id_array.join(','));\n\t\t\t\t}\n\t\t\t\tdb.close();\n\t\t\t\treturn unsynced_jobs_id_array.length;\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _get_badge_infor_for_unsynced_job_and_quote');\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "15f62fb4d18130f6c4ca98a1ed0d87e7", "score": "0.49359274", "text": "function userExists(toFind) {\n for (var i = 0; i < usernames.length; i++) {\n if (usernames[i] === toFind) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "c05b7104d4194ec53e1a8f60a2b79648", "score": "0.49330226", "text": "function found (item, arr) { return (typeof arr != 'undefined') && arr != null && _findIndex(arr, function(o){return ''+o == item}) != -1; }", "title": "" }, { "docid": "da0e601cb33412d580a846c9c1fe64fa", "score": "0.4928605", "text": "function search_array(this_array,this_value) {\r\n for (var i=0;i<this_array.length;i++) {\r\n if (this_array[i] == this_value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "d6b1b47a338a3380b27a5f7001773811", "score": "0.49276805", "text": "function applytojob(){\n\n //load all database applications into the jsonApplicationListArray\n let applicationid = \"\";\n let jobid = \"\";\n let applicantid = \"\";\n let applicationObj = \"\";\n let applicantAppliedStatus = false;\n let myapplication = false;\n\n //this determines the unique applicationID primary key \n if(jsonApplicationListArray != null && jsonApplicationListArray.length > 0){\n applicationid = returnNextAvailableJobID();\n }else {\n applicationid = 0;\n }\n\n //selected job posting's jobID\n jobid = localStorage.getItem(click_key);\n //current users userID\n applicantid = JSON.parse(localStorage.getItem(msg_key)).accountID;\n \n applicationObj = {\n applicationID: applicationid, \n jobID: jobid,\n applicantID: applicantid\n };\n\n //Check to see if the user created the job posting\n //if user posted the job application is true\n //if user did not post the job application will remain false\n if(jsonJobListArray != null && jsonJobListArray.length > 0){\n for(let position = 0; position < jsonJobListArray.length; position++){\n if(jsonJobListArray[position].jobID == jobid && jsonJobListArray[position].employerID == applicantid){\n myapplication = true;\n }\n }\n }\n\n\n //Check to see if the user has already applied to this job\n //if applied already applicantAppliedStatus is true\n //if have not applied applicantAppliedStatus is false\n if(jsonApplicationListArray != null && jsonApplicationListArray.length > 0){\n for(let position = 0; position < jsonApplicationListArray.length; position++){\n if(jsonApplicationListArray[position].applicantID == applicantid && jsonApplicationListArray[position].jobID == jobid){\n applicantAppliedStatus = true;\n break;\n }\n }\n }\n\n //if the user posted this job they will not be able to apply for it\n if(myapplication === true){\n alert(\"You can't apply to your own job posting!\");\n window.location.href=\"index.html\";\n //else it is not their job posting they can apply for the job\n }else{\n //if user already applied for the job they will not be able to apply again\n if(applicantAppliedStatus === true){\n alert(\"You have already applied to this job!\");\n window.location.href=\"index.html\";\n //else the user has not applied to this job yet they will be able to apply for it\n }else{\n postApplication(applicationObj);\n alert(\"Successfully Applied!\");\n window.location.href=\"index.html\";\n }\n }\n}", "title": "" }, { "docid": "62ab0bb4c0f949371b37dd4ef7a18973", "score": "0.49198222", "text": "function isExist(array, label){\n var result = false;\n for(var i = 0; i < array.length; i++){\n //check with the incoming label and current array label\n var arrLabel = array[i].apiName_Provider;\n if(arrLabel == label){\n result = true;\n break;\n }\n }\n return result;\n }", "title": "" }, { "docid": "d4d61420801c43c7708786e7034e6f7e", "score": "0.49196237", "text": "function orgLoopArrayContains(id){\n\tvar i;\n\tvar max;\n\tmax = orgLoopArray.length;\n\t\n\tfor(i = 0; i < max; i++){\n\t\tif(id == orgLoopArray[i]){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "bfcf8ceb4af6714ae56670c23f6da022", "score": "0.49152517", "text": "function in_array(needle, a) {\r\n return array_search(needle, a) !== false;\r\n}", "title": "" }, { "docid": "4153e2e67a3dde6608b5a65b9123ea69", "score": "0.49128085", "text": "function getJobData(UJID, TranslateCaptNames, UUID, Cit) {\n\n var UserData = retrieveUserData();\n if (UserData[STUDENT_DATA.ACCESS - 1] >= ACCESS_LEVELS.ADMIN && UserData[STUDENT_DATA.ACCESS - 1] <= ACCESS_LEVELS.STUDENT) {\n\n var joblists = getJobList(Cit);\n\n var returndata = [];\n\n if (joblists) {\n\n var jobdata = joblists.getSheetValues(2, JOB_DATA[\"UJID\"], joblists.getLastRow(), JOB_DATA[\"LENGTH\"]);\n\n for (var check = 0; check < jobdata.length; check++) {\n\n if (jobdata[check][JOB_DATA[\"UJID\"] - 1] == UJID) {\n\n returndata = jobdata[check];\n\n //if you are the captain, your slip writer is either p1 (proctor) or p2 (prefect)\n if (UUID) {\n if (returndata[JOB_DATA[\"P1\"] - 1] != \"\" && (UUID == parseInt(returndata[JOB_DATA.C1 - 1]) || UUID == parseInt(returndata[JOB_DATA.C2 - 1]))) {\n returndata[JOB_DATA.C1 - 1] = returndata[JOB_DATA[\"P1\"] - 1];\n returndata[JOB_DATA.C2 - 1] = \"\";\n } else if ((returndata[JOB_DATA[\"P1\"] - 1] == \"\" && (UUID == parseInt(returndata[JOB_DATA.C1 - 1]) || UUID == parseInt(returndata[JOB_DATA.C2 - 1]))) || parseInt(UUID) == parseInt(returndata[JOB_DATA[\"P1\"] - 1])) {\n returndata[JOB_DATA.C1 - 1] = returndata[JOB_DATA[\"P2\"] - 1];\n returndata[JOB_DATA.C2 - 1] = \"\";\n }\n }\n\n if (TranslateCaptNames && (returndata[JOB_DATA.C1 - 1] || returndata[JOB_DATA.C2 - 1])) { //TranslateCaptNames captain names \n\n var classlists = SpreadsheetApp.openByUrl(PropertiesService.getScriptProperties().getProperty('classlistURL')).getActiveSheet();\n var maxclass = classlists.getLastRow();\n var classdata = classlists.getSheetValues(2, 1, maxclass, STUDENT_DATA[\"LENGTH\"]);\n\n for (var studentCheck = 0; studentCheck < classdata.length; studentCheck++) {\n if (classdata[studentCheck][STUDENT_DATA.UUID - 1] == returndata[JOB_DATA.C1 - 1] && returndata[JOB_DATA.C1 - 1]) {\n var nick1 = \" \";\n if (classdata[studentCheck][STUDENT_DATA.NICKNAME - 1])\n nick1 = \" (\" + classdata[studentCheck][STUDENT_DATA.NICKNAME - 1] + \") \";\n\n returndata[JOB_DATA.C1 - 1] = classdata[studentCheck][STUDENT_DATA[\"FIRST\"] - 1] + nick1 + classdata[studentCheck][STUDENT_DATA[\"LAST\"] - 1];\n\n if (!returndata[JOB_DATA.C2 - 1]) //break if there's no second captain.\n break;\n } else if (classdata[studentCheck][STUDENT_DATA.UUID - 1] == returndata[JOB_DATA.C2 - 1] && returndata[JOB_DATA.C2 - 1]) {\n var nick2 = \" \";\n if (classdata[studentCheck][STUDENT_DATA.NICKNAME - 1])\n nick2 = \" (\" + classdata[studentCheck][STUDENT_DATA.NICKNAME - 1] + \") \";\n returndata[JOB_DATA.C2 - 1] = classdata[studentCheck][STUDENT_DATA[\"FIRST\"] - 1] + nick2 + classdata[studentCheck][STUDENT_DATA[\"LAST\"] - 1];\n }\n \n }\n\n }\n break;\n }\n\n }\n\n }\n\n if (returndata.length > 1)\n return returndata;\n else\n return -1;\n\n } else {\n writeLog(\"User lacks privilege: Get Job Data\");\n throw new Error(\"User lacks privilege\");\n }\n\n}", "title": "" }, { "docid": "c6f4a9c88bc1d90ae75035a4dc8ffcda", "score": "0.49112412", "text": "function handleJobsQueue () {\n log.debug('Checking jobs queue', { is_processing: processingQueue, has_started_processing: startedProcessing, jobs: jobs.length });\n\n if (processingQueue) {\n log.debug('Already processing queue');\n return;\n } else if (jobs.length === 0) {\n log.debug('Queue is empty');\n if (startedProcessing) {\n log.debug('Done processing the queue');\n\n // We finished processing the job queue\n startedProcessing = false;\n\n client.gamesPlayed([]);\n\n handlerManager.getHandler().onTF2QueueCompleted();\n }\n return;\n }\n\n processingQueue = true;\n\n const job = jobs[0];\n\n if (!canProcessJob(job)) {\n // Can't process job, skip it\n log.debug('Can\\'t process job', { job: job });\n doneProcessingJob(new Error('Can\\'t process job'));\n return;\n }\n\n startedProcessing = true;\n\n log.debug('Ensuring TF2 GC connection...');\n\n exports.connectToGC(function (err) {\n if (err) {\n return doneProcessingJob(err);\n }\n\n if (job.type === 'crafting') {\n processCraftingJob(job, doneProcessingJob);\n } else if (job.type === 'use') {\n processUseJob(job, doneProcessingJob);\n } else if (job.type === 'delete') {\n processDeleteJob(job, doneProcessingJob);\n } else if (job.type === 'sort') {\n processSortJob(job, doneProcessingJob);\n } else {\n log.debug('Unknown job type', { job: job });\n doneProcessingJob(new Error('Unknown job type'));\n }\n });\n}", "title": "" }, { "docid": "35534de6c51b4785835c38e1bb9c12b6", "score": "0.4903108", "text": "function buildJob(dataValue) {\n var jobs = myJobs.options.data;\n var job = jobs.find(clicked, dataValue);\n var location;\n\n var employer = HTMLjobEmployer.replace('%data%', job.employer);\n var title = HTMLjobTitle.replace('%data%', job.title);\n var dates = HTMLjobDate.replace('%data%', job.dates);\n var description = HTMLjobDescription.replace('%data%', job.description);\n\n if (main.contentInfo.children().length !== 0) {\n main.contentInfo.children().remove();\n }\n\n if ( job.location ) {\n //location = HTMLjobLocation.replace('%data%', job.location);\n initSmallMap( [ job.location ] );\n }\n\n main.contentInfo.append(HTMLdivText, HTMLdivMultimedia);\n $('.text').append(employer, title, location, dates, description);\n}", "title": "" }, { "docid": "3d6125fc164b644d7501682f27f08b6c", "score": "0.48720703", "text": "function entryExist(name, service){\n var exist = false;\n for (var i =0; i<service.length;i++){\n if(name == service[i]){\n exist = true;\n }\n }\n\n return exist;\n }", "title": "" }, { "docid": "184ec4b5568a038b23438743d823070e", "score": "0.48675194", "text": "async getAllJobs(names = null) {\n let rows;\n\n if (names) {\n rows = await this.database.getAll(\n `select * from jobs where name = any(:names) order by created_at`,\n { names },\n );\n } else {\n rows = await this.database.getAll(`select * from jobs order by created_at`);\n }\n\n return rows.map(initJobObject);\n }", "title": "" }, { "docid": "d42db84cbbd1ae45feca7a1af878fa90", "score": "0.48637038", "text": "contains(data) {\n return this.find(data) !== -1\n }", "title": "" }, { "docid": "21ddd12074648a2720cd2cd39905eb0a", "score": "0.4862841", "text": "inQueue(item) {\n let i = 0;\n let isFound = false;\n while (i < this.q.length && !isFound) {\n if (this.q[i] === item) {\n isFound = true;\n } else\n i++;\n }\n return (isFound);\n }", "title": "" }, { "docid": "91c83c3d81653b67ac71cefadb832a92", "score": "0.48578557", "text": "function userExists(toFind){\r\n\tvar exists = false;\r\n\r\n\tfor(var i = 0; i < email.length; i++){\r\n\t\tif(email[i] === toFind){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n return false;\r\n}", "title": "" }, { "docid": "14f3881bf423dac6d505e8a544bb0444", "score": "0.4856802", "text": "function isExist(array, label){\n var result = false;\n for(var i = 0; i < array.length; i++){\n //check with the incoming label and current array label\n var arrLabel = array[i].apiName_Provider;\n if(arrLabel == label){\n result = true;\n break;\n }\n }\n return result;\n }", "title": "" }, { "docid": "6364066134423e9ffe254463909255f1", "score": "0.4856378", "text": "function applycheck(){\n\n let appliedstatus = false;\n let currentjobID = localStorage.getItem(click_key);\n let currentuserID = JSON.parse(localStorage.getItem(msg_key));\n\n if(jsonApplicationListArray != null && jsonApplicationListArray.length > 0){\n\n for(let position = 0; position < jsonApplicationListArray.length; position++){\n\n if(jsonApplicationListArray[position].jobID == currentjobID && jsonApplicationListArray[position].applicantID == currentuserID.accountID){\n\n appliedstatus = true; \n }\n }\n }\n return appliedstatus;\n}", "title": "" }, { "docid": "2c609cf110b718cdc4016075649051d0", "score": "0.48557934", "text": "function returnNextAvailableJobID(){\n let idNormalStatus = true;\n let index = 0;\n do{\n idNormalStatus = true;\n for(let position = 0; position < jsonApplicationListArray.length; position++){\n if(jsonApplicationListArray[position].applicationID === index){\n index++;\n idNormalStatus = false;\n }\n }\n }while(idNormalStatus===false);\n return index; \n}", "title": "" }, { "docid": "41df2cabf7bdba2a66e83cba5c772d19", "score": "0.4852934", "text": "createJob(inputRows) {\n let jobID = uuid();\n this._jobs[jobID] = new Job(inputRows);\n return jobID;\n }", "title": "" }, { "docid": "9bea8365e354095784c6c73ad75cad9d", "score": "0.48322433", "text": "inArray(needle, haystack) {\n let length = haystack.length;\n for (let i = 0; i < length; i++) {\n if (haystack[i] === needle) return true;\n }\n return false;\n }", "title": "" }, { "docid": "9630e32a7ba138f9651828117c55827f", "score": "0.48302618", "text": "function contains (arr, thing, cb) {\n\tcb(arr.includes(thing));\n }", "title": "" }, { "docid": "667dff240b648e81905466bcf63fcf1f", "score": "0.48299855", "text": "function CheckPreviousSearchesByName(pokemonName) \n{\n //Add search to previous search list\n for (var i = 0; i < previousSearches.length; i++)\n {\n if (previousSearches[i].pokemonName == pokemonName)\n {\n DisplayData(previousSearches[i].pokemonData, previousSearches[i].tcgData);\n return true;\n }\n }\n return false;\n}", "title": "" } ]
0dcb938add3709cd000ac1ffe6f60649
Get complete current html. Including doctype and original header.
[ { "docid": "5a3c48e8d88a4570479a9440fb9d7e3b", "score": "0.51009077", "text": "static getEditorHtmlContent(editor) {\n if (!editor) {\n throw new Error('Editor is required.');\n }\n\n const contentDocument = ContentService.getCanvasAsHtmlDocument(editor);\n\n if (!contentDocument || !contentDocument.body) {\n throw new Error('No html content found');\n }\n\n return ContentService.serializeHtmlDocument(contentDocument);\n }", "title": "" } ]
[ { "docid": "faaef94a7c84e717c56b926fb5eb1873", "score": "0.6704808", "text": "static getOriginalContentHtml() {\n // Parse HTML theme/template\n const parser = new DOMParser();\n const textareaHtml = mQuery('textarea.builder-html');\n const doc = parser.parseFromString(textareaHtml.val(), 'text/html');\n\n if (!doc.body.innerHTML || !doc.head.innerHTML) {\n throw new Error('No valid HTML template found');\n }\n\n return doc;\n }", "title": "" }, { "docid": "3a2f3e3778644ab30a1332f16f504b70", "score": "0.65275925", "text": "function getHtml() {\n jsdom.env(\n options.url,\n parseHtml\n );\n }", "title": "" }, { "docid": "38005c453e7b01e21558c6faacdcef5f", "score": "0.6202641", "text": "function getSafeBodyFromHTML(html){var doc;var root=null;// Provides a safe context\nif(!isOldIE&&document.implementation&&document.implementation.createHTMLDocument){doc=document.implementation.createHTMLDocument('foo');!doc.documentElement?process.env.NODE_ENV!=='production'?invariant(false,'Missing doc.documentElement'):invariant(false):void 0;doc.documentElement.innerHTML=html;root=doc.getElementsByTagName('body')[0];}return root;}", "title": "" }, { "docid": "ad4447a9544ba34cae45e5e1425ac97f", "score": "0.60662025", "text": "function headerHtml(){\n return '<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"><link rel=\"stylesheet\" type=\"text/css\" href=\"/css/bootstrap.min.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"/css/styles.css\"><title>M&N file management</title></head><body>'\n}", "title": "" }, { "docid": "3e6e228eface0575f9f803dd02e7d68c", "score": "0.6057055", "text": "function getSafeBodyFromHTML(html) {\n\t var doc, root = null;\n\t // Provides a safe context\n\t return !isOldIE && document.implementation && document.implementation.createHTMLDocument && (doc = document.implementation.createHTMLDocument(\"foo\"), \n\t doc.documentElement.innerHTML = html, root = doc.getElementsByTagName(\"body\")[0]), \n\t root;\n\t }", "title": "" }, { "docid": "dadc1f69c669ae91d78057fdf080c112", "score": "0.600973", "text": "function getSafeBodyFromHTML(html) {\n\t var doc;\n\t var root = null;\n\t // Provides a safe context\n\t if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n\t doc = document.implementation.createHTMLDocument('foo');\n\t doc.documentElement.innerHTML = html;\n\t root = doc.getElementsByTagName('body')[0];\n\t }\n\t return root;\n\t}", "title": "" }, { "docid": "dadc1f69c669ae91d78057fdf080c112", "score": "0.600973", "text": "function getSafeBodyFromHTML(html) {\n\t var doc;\n\t var root = null;\n\t // Provides a safe context\n\t if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n\t doc = document.implementation.createHTMLDocument('foo');\n\t doc.documentElement.innerHTML = html;\n\t root = doc.getElementsByTagName('body')[0];\n\t }\n\t return root;\n\t}", "title": "" }, { "docid": "ceb1ea1616c7861069aeb8f2439e988d", "score": "0.59918773", "text": "function importHTMLDocument(head,body) {\n\n\t\tvar doc = {},\n\t\t\tmarkup = _combineHeadAndBody(head,body),\n\t\t\thasDoctype = markup.substring(0,9).toLowerCase() == \"<!doctype\";\n\n\t\ttry {\n\t\t\tvar ext = _createStandardsDoc(markup);\n\t\t\tif (document.adoptNode) {\n\t\t\t\tdoc.head = document.adoptNode(ext.head);\n\t\t\t\tdoc.body = document.adoptNode(ext.body);\n\t\t\t} else {\n\t\t\t\tdoc.head = document.importNode(ext.head);\n\t\t\t\tdoc.body = document.importNode(ext.body);\n\t\t\t}\n\t\t}\n\t\tcatch(ex) {\n\t\t\tvar ext = new ActiveXObject(\"htmlfile\");\n\t\t\tmarkup = shimMarkup(markup);\n\t\t\text.write(markup);\n\t\t\tif (ext.head === undefined) ext.head = ext.body.previousSibling;\n\n\t\t\tdoc.uniqueID = ext.uniqueID;\n\t\t\tdoc.head = ext.head;\n\t\t\tdoc.body = _importNode(document,ext.body,true);\n\n\t\t\t// markup = markup.replace(\"<head\",'<washead').replace(\"</head>\",\"</washead>\");\n\t\t\t// markup = markup.replace(\"<HEAD\",'<washead').replace(\"</HEAD>\",\"</washead>\");\n\t\t\t// markup = markup.replace(\"<body\",'<wasbody').replace(\"</body>\",\"</wasbody>\");\n\t\t\t// markup = markup.replace(\"<BODY\",'<wasbody').replace(\"</BODY>\",\"</wasbody>\");\n\t\t}\n\t\tif (!doc.uniqueID) doc.uniqueID = documentId++;\n\n\t\treturn doc;\n\t}", "title": "" }, { "docid": "8bf9408f48bd4c92cff27bd02f9400ef", "score": "0.5946413", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null; // Provides a safe context\n\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? \"production\" !== \"production\" ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n\n return root;\n}", "title": "" }, { "docid": "466b157dbd23ab24df463a1630649432", "score": "0.5940894", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null; // Provides a safe context\n\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? true ? invariant(false, 'Missing doc.documentElement') : undefined : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n\n return root;\n}", "title": "" }, { "docid": "3cea0e2a00f991cc3f721f5f3fce374f", "score": "0.59376293", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? false ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "3cea0e2a00f991cc3f721f5f3fce374f", "score": "0.59376293", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? false ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "41ecc0f3ece8ae7216c3697229902c86", "score": "0.5937619", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? true ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "e5b10581e8ee105546caea7601f7e45d", "score": "0.5933267", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "e5b10581e8ee105546caea7601f7e45d", "score": "0.5933267", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "e5b10581e8ee105546caea7601f7e45d", "score": "0.5933267", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "e5b10581e8ee105546caea7601f7e45d", "score": "0.5933267", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "e5b10581e8ee105546caea7601f7e45d", "score": "0.5933267", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "ad70e9beb43e88cb166faf648f930cbd", "score": "0.59195083", "text": "function getSafeBodyFromHTML(html) {\n var doc;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? false ? undefined : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "69697a582dfaa05d0e9edf2aed9ddb8d", "score": "0.57085055", "text": "function html() {\n\treturn src(paths.html.dev)\n\t\t.pipe(fileinclude({\n\t\t\tprefix: '@@',\n\t\t\tbasepath: '@file'\n\t\t}))\n\t\t.pipe(dest(paths.html.dist))\n\t\t// .pipe(notify({ message: \"Html compiled!!!\", onLast: true }))\n\t\t.pipe(browserSync.stream());\n}", "title": "" }, { "docid": "1cadb355629a0d11c871ae7a9a360052", "score": "0.5649229", "text": "_parseHTMLResponse(responseHTML){\n let parser = new DOMParser();\n let responseDocument = parser.parseFromString( `<template>${responseHTML}</template>` , 'text/html');\n let parsedHTML = responseDocument.head.firstElementChild.content;\n return parsedHTML;\n }", "title": "" }, { "docid": "953c9a004901e51a0c7b29126088fa66", "score": "0.5620953", "text": "function html_content(html){\n html = html.trim()\n let close_angle_pos = html.indexOf(\">\")\n if(close_angle_pos == html.length - 1) { return \"\" }\n else {\n let open_angle_pos = html.indexOf(\"<\", 1)\n if(open_angle_pos == -1) { return \"\" } //actually this means the html is invalid syntax\n else { return html.substring(close_angle_pos + 1, open_angle_pos) }\n }\n}", "title": "" }, { "docid": "39aa16fae29a066f66375e47c2526be5", "score": "0.56209344", "text": "function DOCTYPE() {\n\treturn '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\\n';\n}", "title": "" }, { "docid": "715b53066f32e1ac91db207e6c0d8267", "score": "0.5595511", "text": "function getHTML() {\n track.enter('getHTML()');\n track.log('mPath: \"' + mPath + '\"');\n /*Common part for all paths.------------------------------------------------------------------*/\n var HTML = '<!--Style attributes are used to get control over the style used. A cascading sty' +\n 'lesheet that defines a style for a class of elements wasn\\'t good enough.-->\\n';\n var p01 = P(localization.translate('Welcome to the Service Desk.\\n'));\n var tr01 = tr(td(3, p01));\n var p02 = P(localization.translate('This is the place to ask for help from other members of t' +\n 'his wiki\\'s community.\\n'));\n var tr02 = tr(td(3, p02));\n var p03 = P(localization.translate('To create a new Service Request, answer these questions.\\n')\n );\n var tr03 = tr(td(3, p03));\n var tr04 = tr(td(3, ''));\n var tr05 = tr(th(325, localization.translate('Questions')) + th(250, localization.translate(\n 'Answers')) + th(75, ' '));\n var p061 = P(localization.translate('What can we do for you?'));\n if (mPath == '') {\n var p062 = P(localization.translate('☐ Create a new recipe page.'));\n var td062 = '<td colspan=\"1\" onclick=\"serviceDeskFrontPage.setPath(&quot;1.&quot;)\" style=\"' +\n 'height: 22px; margin: 0; border: 0px solid red; padding: 0; font-size: 14; line_height: ' +\n '22px; cursor: pointer; \">' + p062 + '</td>';\n var tr06 = tr(td(1, p061) + td062 + td(1, ''));\n var p072 = P(localization.translate('☐ Something else.'));\n var td072 = '<td colspan=\"1\" onclick=\"serviceDeskFrontPage.setPath(&quot;2.&quot;)\" style=\"' +\n 'height: 22px; margin: 0; border: 0px solid red; padding: 0; font-size: 14; line_height: ' +\n '22px; cursor: pointer; \">' + p072 + '</td>';\n var tr07 = tr(td(1, '') + td072 + td(1, ''));\n HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07);\n return HTML;\n }\n /*Branch: 1.\"Create a new recipe page.\"-------------------------------------------------------*/\n if (mPath.substr(0,2) == '1.') {\n var p062 = P(localization.translate('☑ Create a new recipe page.'));\n var button063 = Button('serviceDeskFrontPage.setPath(&quot;&quot;)', '<div style=\"position: relative; float: lef' +\n 't; \"><img src=\"http://static1.wikia.nocookie.net/recepten/nl/images/5/57/Transparent_pen' +\n 'cil.png\"/></div>' + localization.translate(' Edit'));\n var tr06 = tr(td(1, p061) + td(1, p062) + td(1, button063));\n var p071 = P(localization.translate('What shall be the name of the new page?'));\n if (mPath == '1.') {\n var i072 = InputText('What shall be the name of the new page?', mNewPageName);\n var button073 = Button('serviceDeskFrontPage.setNewPageName()', localization.translate('OK'));\n var tr07 = tr(td(1, p071) + td(1, i072) + td(1, button073));\n HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07);\n return HTML;\n }\n var p072 = P(mNewPageName);\n var button073 = Button('serviceDeskFrontPage.setPath(&quot;1.&quot;)', '<div style=\"position: relative; float: l' +\n 'eft; \"><img src=\"http://static1.wikia.nocookie.net/recepten/nl/images/5/57/Transparent_p' +\n 'encil.png\"/></div>' + localization.translate(' Edit'));\n var tr07 = tr(td(1, p071) + td(1, p072) + td(1, button073));\n var h08 = localization.translate('<h2>Dispatch</h2>\\n');\n var tr08 = tr(td(3, h08));\n var p091 = P(localization.translate('Your request will be handled by the Service Desk Wizar' +\n 'd. If you click the OK-button, this page will close and you\\'ll land on the newly create' +\n 'd page.'));\n var button093 = Button('serviceDeskFrontPage.setDocumentLocation(&quot;http://recepten.wiki' +\n 'a.com/wiki/' + mNewPageName + '?action=edit&redlink=1&wizard=1&quot;)', localization.translate('OK')\n );\n var tr09 = tr(td(2, p091) + td(1, button093));\n var p10 = P(localization.translate('Thank you for using the Service Desk Front Page.'));\n var tr10 = tr(td(3, p10));\n HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07 + tr08 + tr09 + tr10);\n return HTML;\n }\n /*Branch: 2.\"Something else.\"-----------------------------------------------------------------*/\n if (mPath.substr(0,2) == \"2.\") {\n var p062 = P(localization.translate('☑ Something else.'));\n var button063 = Button('serviceDeskFrontPage.setPath(&quot;&quot;)', '<div style=\\\"position' +\n ': relative; float: left; \\\"><img src=\\\"http://static1.wikia.nocookie.net/recepten/nl/ima' +\n 'ges/5/57/Transparent_pencil.png\\\"/></div> ' + localization.translate('Edit'));\n var tr06 = tr(td(1, p061) + td(1, p062) + td(1, button063));\n var h07 = \"<h2>\" + localization.translate('Dispatch') + '</h2>\\n';\n var tr07 = tr(td(3, h07));\n var p081 = P(localization.translate('The Board: \"Service Balie, overige vragen\" is the best ' +\n 'spot to file your request. If you click the OK-button, this page will close and you\\'ll ' +\n 'land at that board. To file your request there, start a discussion.'));\n var button083 = Button('document.location=&quot;http://recepten.wikia.com/wiki/Board:Service_Balie,_overige_vragen&quot;', localization.translate('OK'));\n var tr08 = tr(td(2, p081) + td(1, button083));\n var p09 = P(localization.translate('Thank you for using the Service Desk Front Page.'));\n var tr09 = tr(td(3, p09));\n HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07 + tr08 + tr09);\n return HTML;\n }\n }", "title": "" }, { "docid": "63bd4bde52217829da43e6572a3e252d", "score": "0.5567759", "text": "function getBody() {\n \t\treturn document.getElementsByTagName(\"BODY\")[0];\n \t}", "title": "" }, { "docid": "8908132cfbfd6b9bbf75d24b1c19ddb8", "score": "0.55364007", "text": "function getSafeBodyFromHTML(html: string): ?Element {\n let doc;\n let root = null;\n // Provides a safe context\n if (\n !isOldIE &&\n document.implementation &&\n document.implementation.createHTMLDocument\n ) {\n doc = document.implementation.createHTMLDocument('foo');\n invariant(doc.documentElement, 'Missing doc.documentElement');\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}", "title": "" }, { "docid": "9a6c03493637a7fc76fe23a8cd9c3c8f", "score": "0.55322105", "text": "function getLoadedHTML(html) {\n return Element.create(\"div\").html(html).child(0);\n }", "title": "" }, { "docid": "dfe79e3c897ce167cbec015d20cb2605", "score": "0.55271107", "text": "function frameToHtmlString(frame) {\n\tvar codeOutput = frame.contentDocument.documentElement.outerHTML;\n\tvar doctype = '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> \\n';\n codeOutput = doctype + codeOutput;\n return codeOutput;\n}", "title": "" }, { "docid": "20d846a89269cae9d272028e2ab031e6", "score": "0.5525859", "text": "function getHTML(root,options)\n {\n var copy;\n UndoManager_disableWhileExecuting(function() {\n if (options == null)\n options = new Object();\n copy = DOM_cloneNode(root,true);\n if (!options.keepSelectionHighlights)\n removeSelectionSpans(copy);\n for (var body = copy.firstChild; body != null; body = body.nextSibling) {\n if (body.nodeName == \"BODY\") {\n DOM_removeAttribute(body,\"style\");\n DOM_removeAttribute(body,\"contentEditable\");\n }\n }\n });\n\n var output = new Array();\n prettyPrint(output,options,copy,\"\");\n return output.join(\"\");\n }", "title": "" }, { "docid": "5483cedb8dbaa5bbe19ba73045ff8866", "score": "0.5494825", "text": "function Tester(z){\t\t\n var body = document.getElementsByTagName(\"html\");\n console.log(document);\n\t}", "title": "" }, { "docid": "58ca988ab3b5ec308d2bc9b14c9f8fbb", "score": "0.54828477", "text": "function requestHtmlAjax() {\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n if (xhr.status >= 200 && xhr.status < 400) {\n document.getElementById('html').innerHTML = xhr.responseText;\n }\n };\n xhr.open('GET', 'html-data.html', true);\n xhr.send(null);\n }", "title": "" }, { "docid": "3a12b59fc1ec2f0086d0e7c51b544713", "score": "0.547424", "text": "static buildHtmlDocument(content) {\n let str = \"<!DOCTYPE HTML>\";\n str += \"<html><head>\";\n \n // add metas\n if (content.metas) {\n let metas = listify(content.metas);\n for (let i = 0; i < metas.length; i++) {\n let meta = metas[i];\n let elem = document.createElement(\"meta\");\n for (let prop in meta) {\n if (meta.hasOwnProperty(prop)) {\n elem.setAttribute(prop.toString(), meta[prop.toString()]);\n }\n }\n str += elem.outerHTML;\n }\n }\n \n // add title and internal css\n str += content.title ? \"<title>\" + content.title + \"</title>\" : \"\";\n str += content.internalCss ? \"<style>\" + content.internalCss + \"</style>\" : \"\";\n \n // add dependency paths\n if (content.dependencyPaths) {\n let dependencyPaths = listify(content.dependencyPaths);\n for (let i = 0; i < dependencyPaths.length; i++) {\n let dependencyPath = dependencyPaths[i];\n if (dependencyPath.endsWith(\".js\")) str += \"<script src='\" + dependencyPath + \"'></script>\";\n else if (dependencyPath.endsWith(\".css\")) str += \"<link rel='stylesheet' type='text/css' href='\" + dependencyPath + \"'/>\";\n else if (dependencyPath.endsWith(\".png\") || dependencyPath.endsWith(\".img\")) str += \"<img src='\" + dependencyPath + \"'>\";\n else throw new Error(\"Unrecognized dependency path extension: \" + dependencyPath); \n }\n }\n str += \"</head><body>\";\n if (content.div) str += $(\"<div>\").append(content.div.clone()).html(); // add cloned div as string\n str += \"</body></html>\";\n return str;\n }", "title": "" }, { "docid": "c47650a561d8cf604ff62873beb93cc9", "score": "0.54617524", "text": "function getHTML() {\r\n\t\treturn $('#html').val();\r\n\t}", "title": "" }, { "docid": "689b9ed5ee2ab6d3b9504ef1f3f41460", "score": "0.5449661", "text": "function html() {\n return gulp.src(config.path.src.htmlIndex)\n .pipe(plugins.nunjucks.compile())\n .pipe(plugins.htmlmin({collapseWhitespace: true, removeComments: true}))\n .pipe(gulp.dest(config.path.build.root))\n .pipe(plugins.size({title: '--> HTML'}));\n}", "title": "" }, { "docid": "62120fa30c4249ef3c743740939d997e", "score": "0.54364336", "text": "function getDocumentXml(html, id){\r\n var h = html.replace(/^(.*\\n)*.*<html/i, \"<html\");\r\n h = h.replace(/<\\/html>(.*\\n)*.*$/i, \"</html>\");\r\n var parser = new DOMParser();\r\n var dom = parser.parseFromString(t, \"text/xml\");\r\n return dom;\r\n}", "title": "" }, { "docid": "a362b5d2221da3e9413fc0fe929c9967", "score": "0.54358405", "text": "function html() {\n return (\n gulp.src(paths.html.src)\n .pipe(gulpif(env === 'production', htmlmin({\n collapseWhitespace: true,\n removeComments: true\n })))\n .pipe(gulpif(env === 'production', gulp.dest(outputDir)))\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "81ca256207b3b096a1b16e5e6896e1cf", "score": "0.5433204", "text": "function getAllHTML(html){\n var tmp = html;\n var returnHtml=\"\";\n var reg = /<[^<]*>/;\n while(tmp.match(reg,\"i\")!=null){\n var foundHtml = tmp.match(reg,\"i\");\n returnHtml += foundHtml\n tmp = tmp.replace(foundHtml, \"\");\n }\n return returnHtml;\n}", "title": "" }, { "docid": "e9d3584ba2422d4927b0a57f0d8ca2ea", "score": "0.54000586", "text": "function createHTML(source) {\n var doc = document.implementation.createHTMLDocument ?\n document.implementation.createHTMLDocument('TABERARELOO') :\n document.implementation.createDocument(null, 'html', null);\n var range = document.createRange();\n range.selectNodeContents(doc.documentElement);\n var fragment = range.createContextualFragment(source);\n var headChildNames = {\n title: true,\n meta: true,\n link: true,\n script: true,\n style: true,\n /*object: true,*/\n base: true\n /*, isindex: true,*/\n };\n var child,\n head = doc.getElementsByTagName('head')[0] || doc.createElement('head'),\n body = doc.getElementsByTagName('body')[0] || doc.createElement('body');\n while ((child = fragment.firstChild)) {\n if (\n (child.nodeType === doc.ELEMENT_NODE && !(child.nodeName.toLowerCase() in headChildNames)) ||\n (child.nodeType === doc.TEXT_NODE && /\\S/.test(child.nodeValue))\n ) {\n break;\n }\n head.appendChild(child);\n }\n body.appendChild(fragment);\n doc.documentElement.appendChild(head);\n doc.documentElement.appendChild(body);\n return doc;\n }", "title": "" }, { "docid": "d0131b4feed826dcbb7d7c3f1012e1a9", "score": "0.5386898", "text": "function HDYV_parseHTML(text) {\r\n\tvar dt = document.implementation.createDocumentType('html', '-//W3C//DTD HTML 4.01 Transitional//EN', 'http://www.w3.org/TR/html4/loose.dtd'),\r\n\t\tdoc = document.implementation.createDocument('', '', dt),\r\n\t\thtml = doc.createElement('html'),\r\n\t\thead = doc.createElement('head'),\r\n\t\tbody = doc.createElement('body');\r\n\tdoc.appendChild(html);\r\n\thtml.appendChild(head);\r\n\tbody.innerHTML = text;\r\n\thtml.appendChild(body);\r\n\treturn doc;\r\n}", "title": "" }, { "docid": "485e9dcb41d43939a826f68ea4324606", "score": "0.53840935", "text": "function documentHead(self) {\n\tif (self._document.head) return self._document.head;\n\telse return self._document.querySelector(\"head\");\n}", "title": "" }, { "docid": "10b66ab6a78fc4f0eefa543acbc25343", "score": "0.5368551", "text": "function getMarkup(){\n\tpageMarkup = $('#construct').clone(true);\n\tparseElement(pageMarkup);\n\treturn $('<div></div>').append(pageMarkup).html();\n}", "title": "" }, { "docid": "b4c516a7f0945d769b6091bb56f5c32f", "score": "0.535604", "text": "function getHead () { return boot.head =\n document.getElementsByTagName('head')[0] || document.documentElement }", "title": "" }, { "docid": "65f98627795bf831dbf2174b3c6c150f", "score": "0.53506577", "text": "function parseHTML(str) {\n str = str.replace(/^[\\s\\S]*?<html(?:\\s[^>]+?)?>|<\\/html\\s*>[\\S\\s]*$/ig, '');\n var res = document.implementation.createDocument(null, 'html', null);\n var range = document.createRange();\n range.setStartAfter(document.body);\n res.documentElement\n .appendChild(res.importNode(range.createContextualFragment(str), true));\n return res;\n}", "title": "" }, { "docid": "dc38dc3281952eb41a45fc7e74c65153", "score": "0.5343908", "text": "function renderFullPage(html, preloadedState) {/* ... */}", "title": "" }, { "docid": "2bd54314767a0e776caaed795951c9fa", "score": "0.53331465", "text": "content() {\n return m.trust(this.page.contentHtml());\n }", "title": "" }, { "docid": "93a49dc99a29bb74974184408c133cc1", "score": "0.53317136", "text": "function getDocumentHead() {\n return `\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no\" data-detect-viewport-is-scaled=\"false\">\n <meta name=\"theme-color\" content=\"#000000\">\n\n <meta name=\"description\" content=\" ###DESCRIPTION### \" />\n <meta name=\"keywords\" content=\"\" />\n <meta name=\"news_keywords\" content=\"\" />\n <meta name=\"location\" content=\"welt.de,Berlin\" />\n <meta name=\"robots\" content=\"index,follow,noodp\">\n <meta name=\"Googlebot-News\" content=\"noindex,follow\">\n <meta name=\"google-site-verification\" content=\"\" />\n\n <meta name=\"apple-mobile-web-app-title\" content=\"WELT\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n\n <meta property=\"og:type\" content=\"website\" />\n <meta property=\"og:title\" content=\" ###OG-TITLE### \" />\n <meta property=\"og:description\" content=\" ###OG-DESCRIPTION### \" />\n <meta property=\"og:image\" content=\"\" />\n <meta property=\"og:url\" content=\" ###OG-URL### \" />\n <meta property=\"og:site_name\" content=\" ###OG-SITENAME### \" />\n\n <meta property=\"fb:app_id\" content=\"\" />\n <meta property=\"article:publisher\" content=\"https://www.facebook.com/welt\" />\n <meta property=\"fb:pages\" content=\"\" />\n <meta property=\"fb:pages\" content=\"\" />\n\n <meta property=\"twitter:title\" content=\" ###TWITTER-TITLE### \" />\n <meta property=\"twitter:site\" content=\"@welt\" />\n <meta property=\"twitter:card\" content=\"summary_large_image\" />\n <meta property=\"twitter:image:src\" content=\"\" />\n <meta property=\"twitter:creator\" content=\"@welt\" />\n\n <title> ###TITLE### </title>\n\n <script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>\n <script src=\"/static/document-parts.js\"></script>\n\n <link rel=\"icon\" type=\"image/vnd.microsoft.icon\" sizes=\"16x16 32x32 48x48\" href=\"https://www.welt.de/favicon.ico\">\n <link rel=\"stylesheet\" href=\"https://static.apps.welt.de/2018/test/ia/ia-wm-kader/static/general.css\">\n </head>`;\n}", "title": "" }, { "docid": "553536edb6dac325a2641d7869b94da2", "score": "0.53280365", "text": "get html() {\n return this._html$ || (this.html = bind(\n // in a way or another, bind to the right node\n // backward compatible, first two could probably go already\n this.shadowRoot || this._shadowRoot || sr.get(this) || this\n ));\n }", "title": "" }, { "docid": "edf8bfcd56c6bf9560d975fb46f55917", "score": "0.5312068", "text": "function oHtml(source) {\r\n\t\treturn source.get(0).outerHTML;\t\r\n\t}", "title": "" }, { "docid": "2e029f5e46ae99e52d97a48be2acad54", "score": "0.53115004", "text": "get html() {\n return this.container.html();\n }", "title": "" }, { "docid": "70bfd395d448a7a188f7ba9be0b9a731", "score": "0.5289951", "text": "function EZsetupDocDom()\n{\n\tEZ.doc.sourceSelectionString = '';\n\n\tEZ.doc.dom = EZgetDOM(\"document\");\n\tif (EZ.doc.dom == null) return false;\n\n\tEZ.doc.dom.synchronizeDocument();\n\tEZ.doc.source = EZ.doc.dom.documentElement.outerHTML;\n\n\t// get tag/jsp offsets if inside tag/jsp otherwise get the real selection or insertion point\n\tvar theSel = EZ.doc.dom.source.getSelection();\t\t//exact selection\n\tEZ.doc.sourceSelection = theSel;\n\tEZ.doc.sourceSelectionString = EZ.doc.source.substring(theSel[0],theSel[1]);\n\n\tvar domSelection = EZ.doc.dom.getSelection(true);\t//expands to full tag\n\tEZ.doc.domSelection = domSelection;\n\tif (domSelection[0] < theSel[0] || domSelection[1] > theSel[1])\t\t//expanded\n\t\ttheSel = domSelection;\n\n\tEZ.doc.currentSelection = theSel\n\tEZreleaseDOM(EZ.doc.dom)\n\treturn true;\n}", "title": "" }, { "docid": "70bfd395d448a7a188f7ba9be0b9a731", "score": "0.5289951", "text": "function EZsetupDocDom()\n{\n\tEZ.doc.sourceSelectionString = '';\n\n\tEZ.doc.dom = EZgetDOM(\"document\");\n\tif (EZ.doc.dom == null) return false;\n\n\tEZ.doc.dom.synchronizeDocument();\n\tEZ.doc.source = EZ.doc.dom.documentElement.outerHTML;\n\n\t// get tag/jsp offsets if inside tag/jsp otherwise get the real selection or insertion point\n\tvar theSel = EZ.doc.dom.source.getSelection();\t\t//exact selection\n\tEZ.doc.sourceSelection = theSel;\n\tEZ.doc.sourceSelectionString = EZ.doc.source.substring(theSel[0],theSel[1]);\n\n\tvar domSelection = EZ.doc.dom.getSelection(true);\t//expands to full tag\n\tEZ.doc.domSelection = domSelection;\n\tif (domSelection[0] < theSel[0] || domSelection[1] > theSel[1])\t\t//expanded\n\t\ttheSel = domSelection;\n\n\tEZ.doc.currentSelection = theSel\n\tEZreleaseDOM(EZ.doc.dom)\n\treturn true;\n}", "title": "" }, { "docid": "4e070084285e508d30b64c78768837e6", "score": "0.5285975", "text": "function buildParserFrame() {\n\tif (document.implementation && document.implementation.createHTMLDocument) {\n\t\treturn document.implementation.createHTMLDocument('');\n\t}\n\tlet frame = document.createElement('iframe');\n\tframe.style.cssText = 'position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;';\n\tframe.setAttribute('sandbox', 'allow-forms');\n\tdocument.body.appendChild(frame);\n\treturn frame.contentWindow.document;\n}", "title": "" }, { "docid": "dd73f5384c85ba2aa7e63cf2e502afb1", "score": "0.5279049", "text": "function handle_get_html(response, request)\n{\n console.log(' -> html body (From: ' + request.headers[\"user-agent\"] + \")\");\n\n // This could just be a string and submitted as ack.with_html(), but\n // keep it like this as an example of doing it low-level.\n\n let hb = ack.start_body('<!DOCTYPE \\'html\\'>\\n');\n\n hb = ack.append_to_body(hb, '<html>');\n hb = ack.append_to_body(hb, '<head>');\n hb = ack.append_to_body(hb, '<title>Hello World!</title>');\n hb = ack.append_to_body(hb, '</head>\\n');\n hb = ack.append_to_body(hb, '<body>');\n hb = ack.append_to_body(hb, 'Hello World!');\n hb = ack.append_to_body(hb, '</body>');\n hb = ack.append_to_body(hb, '</html>\\n');\n\n ack.as_html(response, 200, hb);\n}", "title": "" }, { "docid": "b41118643c9616c0a3baf745616fd1e6", "score": "0.5269246", "text": "function getDocumentBody() {\n return `<body>\n <div id=app></div>\n <script type=text/javascript src=https://static.apps.welt.de/2018/test/ia/ia-wm-kader/dev/static/js/manifest.7308a95bd280b2ecc413.js></script>\n <script type=text/javascript src=https://static.apps.welt.de/2018/test/ia/ia-wm-kader/dev/static/js/vendor.8a64a4f32cb89c1fa055.js></script>\n <script type=text/javascript src=https://static.apps.welt.de/2018/test/ia/ia-wm-kader/dev/static/js/app.55e962ccc2ca9035d7fc.js></script>\n </body>`;\n}", "title": "" }, { "docid": "879514bc34e051e42b69f0c5a3662e12", "score": "0.52678496", "text": "function FetchHtml()\r\n{\r\n var commFrame = 0;\r\n\r\n // Serialize the parameters we were passed into an XML Packet\r\n var XMLPacket = Hash2XML(GenParams(SortParams(FetchHtml.arguments)));\r\n\r\n ExpireCache();\r\n Send(FetchHtml.arguments[0], commFrame, XMLPacket);\r\n}", "title": "" }, { "docid": "848792f3dfe034b5f3060ba6e37c08af", "score": "0.52510256", "text": "function HTML2DOM(content) {\r\n\r\n\tvar host = document.location.host;\r\n\tvar dummyDiv = document.createElement('div');\r\n\tdummyDiv.innerHTML = content;\r\n\r\n\treturn dummyDiv;\r\n}", "title": "" }, { "docid": "db75c50bf0a5d94f1bb35ae0c89c9cf0", "score": "0.52377695", "text": "getHtml() {\n throw new Error('You must implement this function');\n }", "title": "" }, { "docid": "17fb8e428c4b8a29aeff5229810722f9", "score": "0.5232125", "text": "function DOMtoString(document_root) {\n var html = '',\n node = document_root.firstChild;\n while (node) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n html += node.innerText;\n break;\n /*case Node.TEXT_NODE:\n html += node.nodeValue;\n break;*/\n /*case Node.CDATA_SECTION_NODE:\n html += '<![CDATA[' + node.nodeValue + ']]>';\n break;*/\n /*case Node.COMMENT_NODE:\n html += '<!--' + node.nodeValue + '-->';\n break;*/\n /*case Node.DOCUMENT_TYPE_NODE:\n // (X)HTML documents are identified by public identifiers\n html += \"<!DOCTYPE \" + node.name + (node.publicId ? ' PUBLIC \"' + node.publicId + '\"' : '') + (!node.publicId && node.systemId ? ' SYSTEM' : '') + (node.systemId ? ' \"' + node.systemId + '\"' : '') + '>\\n';\n break;*/\n }\n node = node.nextSibling;\n }\n/*var keyInfo;\n for(i = 0; i<html.length-4;i++)\n {\n if(html[i]== '<' && html[i+1]== 'p' && html[i+2]== '>')\n {\n var u=i+3; \n While(html[u]!= '<' && html[u+1]!= '/' && html[u+2]!= 'p' && html[u+3]!='>')\n {\n keyInfo+=html[u];\n u++; \n }\n keyInfo+=' '\n }\n \n \n }*/\n\n\n /*var keyInfo = html.slice(html.indexOf(\"<table\"), html.indexOf(\"</table\"));\n\n console.log(keyInfo);*/\n\n return html;\n}", "title": "" }, { "docid": "605ca15ed0a4638361944ca6aae08444", "score": "0.52208465", "text": "function getDoctype(doc) {\n var node = doc.doctype;\n var doctype = '<!DOCTYPE html>';\n\n if (node) {\n doctype = \"<!DOCTYPE \".concat(node.name).concat(node.publicId ? \" PUBLIC \\\"\".concat(node.publicId, \"\\\"\") : '').concat(!node.publicId && node.systemId ? ' SYSTEM' : '').concat(node.systemId ? \" \\\"\".concat(node.systemId, \"\\\"\") : '', \">\");\n }\n\n return doctype;\n }", "title": "" }, { "docid": "1fcddad62b4cdee484044e4d6d8db33c", "score": "0.52184075", "text": "function buildHTML() {\r\n\t\t\treturn;\r\n\t\t}", "title": "" }, { "docid": "2bc80532b34d11cabd1ef5f3252c1096", "score": "0.52129656", "text": "function initHTML() {\n const writeToFile = this[WRITE_TO_FILE];\n\n const titleString = `aXe Accessibility Engine Report for ${\n this[OPTIONS].domain\n } \\n${new Date().toString()}`;\n\n writeToFile(`<!doctype html> <html lang=\"en\"><head><title>${\n titleString\n }</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">${STYLE_SHEETS}<style>${CSS}</style></head><body><div class=\"container\"><div class=\"row\"><div class=\"col-xs-12\">${marked(`# ${titleString}`)}`);\n writeToFile(marked('This report is not a complete accessibility audit. This report only documents those accessibility features tested by the axe-core library, and should not be considered exhaustive of the possible accessibility issues a website may have. Use this report as a tool in a complete and comprehensive process of reviewing this site for accessibility issues. More information regarding the features tested by the axe-core library may be found at [axe-core.org](https://axe-core.org/)'));\n\n if (this[OPTIONS].random !== 1) {\n writeToFile(marked(`This report represents only a random sample of ${Math.round(this[OPTIONS].random * 100)}% of all webpages on this domain.`));\n }\n}", "title": "" }, { "docid": "de26617c5cf9f462dc560ad1e118ebdc", "score": "0.5201076", "text": "function _getBody() {\n let body = document.body;\n\n if (!body) {\n body = document.createElement('body');\n body.fake = true;\n }\n\n return body;\n}", "title": "" }, { "docid": "43f9c85464bf3cf0a8d801e6f1df06ee", "score": "0.5195694", "text": "function html2WindowRaw(html) {\n\tvar features = {}\n\tfeatures.FetchExternalResources = false\n\tfeatures.ProcessExternalResources = false\n\tfeatures.QuerySelector = true\n\treturn jsdom.jsdom(html, 0, {features: features}).createWindow()\n}", "title": "" }, { "docid": "ecdae58d35b87f629b9512abef5c9fdc", "score": "0.5192762", "text": "function html() {\n return gulp\n .src(['src/**/*.html'].concat(ignoreUnderscoresGlob))\n .pipe(plugins.plumber(plumberOpts))\n .pipe(\n plugins.data(async file => {\n const filePath = file.path.replace(/\\.html$/, '');\n const localConfig = await fallbackReader(filePath, '.aml,.json')\n .then(d => io.discernParser(d.filePath)(d.contents))\n .catch(e => {\n if (e.message !== 'No file matched of the extensions specified')\n throw e;\n });\n\n fixTimes(localConfig);\n\n const configData = Object.assign({}, config, localConfig);\n writeConfig(filePath, configData);\n\n return configData;\n })\n )\n .pipe(\n plugins\n .ejs(config)\n .on('error', error =>\n errorMessage({ title: 'HTML Compilation Error', error })\n )\n )\n .pipe(gulp.dest(dest))\n .pipe(\n plugins.tap(file => {\n log(\n colors.magenta('Compiled HTML to'),\n colors.bold(dest + file.relative)\n );\n })\n );\n}", "title": "" }, { "docid": "ef8bc78a48a6206a35c3595883943b1c", "score": "0.5188327", "text": "function html() {\n return src('src/**.html')\n .pipe(include({\n prefix: '@@'\n }))\n .pipe(webphtml())\n .pipe(htmlmin({\n collapseWhitespace: false\n }))\n .pipe(dest('dist'))\n}", "title": "" }, { "docid": "c0e4f7442aa8aea1ef8e6cd8046a810f", "score": "0.51722467", "text": "function getDocument(responseText)\n{\n var html = document.createElement(\"html\");\n html.innerHTML = responseText;\n\n var response = document.implementation.createDocument(\"\", \"\", null); \n response.appendChild(html);\n\n return response;\n}", "title": "" }, { "docid": "ae7efee51fff8e02be13b7c578efa6ba", "score": "0.51684767", "text": "function minHtml() {\n\treturn src(paths.html.dev)\n\t\t.pipe(fileinclude({\n prefix: '@@',\n basepath: '@file'\n }))\n\t\t.pipe(htmlmin({ collapseWhitespace: true }))\n\t\t.pipe(dest(paths.html.dist))\n\t\t// .pipe(notify({ message: \"Html compiled!!!\", onLast: true }))\n\t\t.pipe(browserSync.stream());\n}", "title": "" }, { "docid": "0649517d59697e49b6a59599de8f5752", "score": "0.5164923", "text": "function getHomePage() { \n const config = getYMLFile(ymlFile);\n return fs.readFileSync(`${__dirname}/${config.dest}/index.html`,'utf8')\n}", "title": "" }, { "docid": "031142e1592d28a563b99506d20d35d4", "score": "0.5162044", "text": "function getHtml(){\n\t\t\tfs.readdir(path, function(err, files){\n\t\t\t\tfiles.filter(function(file){ \n\t \t\treturn file.substr(-5) === '.html'; \n\t \t}).forEach(function(file){\n\t \t\tfs.readFile(path+'/'+file, 'utf-8', function(err,html){\n\t \t\t\thtmlarr.push(html);\n\t \t\t\t}); \n\t \t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f8e539e8dc122d1b992b78fd5b66a29d", "score": "0.5162017", "text": "function getInertElement() {\n\t if (inertElement)\n\t return inertElement;\n\t DOM = dom_adapter_1.getDOM();\n\t // Prefer using <template> element if supported.\n\t var templateEl = DOM.createElement('template');\n\t if ('content' in templateEl)\n\t return templateEl;\n\t var doc = DOM.createHtmlDocument();\n\t inertElement = DOM.querySelector(doc, 'body');\n\t if (inertElement == null) {\n\t // usually there should be only one body element in the document, but IE doesn't have any, so we\n\t // need to create one.\n\t var html = DOM.createElement('html', doc);\n\t inertElement = DOM.createElement('body', doc);\n\t DOM.appendChild(html, inertElement);\n\t DOM.appendChild(doc, html);\n\t }\n\t return inertElement;\n\t}", "title": "" }, { "docid": "7b1d560e483568d605ef0427969e06f8", "score": "0.5158134", "text": "function _html() {\n return '' +\n '<div class=\"markup\"></div>' +\n '';\n }", "title": "" }, { "docid": "1432bbbc265d3e389969301767748ffc", "score": "0.5129386", "text": "function blank() {\r\n\treturn \"<html></html>\"\r\n}", "title": "" }, { "docid": "1213a54d46140622fad19c850bbd42b4", "score": "0.5129178", "text": "function getHTML(data) {\n // Generate an HTML page from the contents of each <textarea>\n var pageData =\n`\n<!DOCTYPE html>\n<head>\n<style>\n${data[\"css\"]}\n</style>\n<script type=\"text/javascript\">\n${data[\"js\"]}\n</scr` +\n// This has to be broken up because otherwise it is recognized as the main\n// document's end script tag\n`ipt>\n</head>\n<body>\n${data[\"html\"]}\n</body>\n`;\n\n return pageData;\n}", "title": "" }, { "docid": "ae2f6aaea7360dd41928884a9c249af4", "score": "0.5124349", "text": "static getDocument() {\n const parser = new DOMParser();\n return parser.parseFromString(searchlocationsTemplate, 'text/html');\n }", "title": "" }, { "docid": "8cd7a698957f693cb0a2b3cf59dd229d", "score": "0.51173365", "text": "function html_document(title, description, body, favicon, stylesheets, scripts) {\n\tif (stylesheets === undefined) stylesheets = [];\n\tif (scripts === undefined) scripts = [];\n\tif (favicon !== undefined) {\n\t\tfavicon_type = { 'ico': 'image/x-icon', 'gif': 'image/gif', 'png': 'image/png' }[favicon.substring(favicon.length - 3)];\n\t}\n\t\n\treturn '<!DOCTYPE html>\\n<html lang=\"en\">\\n<head>\\n'\n\t\t+ '<meta charset=\"utf-8\">\\n'\n\t\t+ '<meta name=\"description\" content=\"' + description + '\">\\n'\n\t\t+ '<title>' + title + '</title>\\n'\n\t\t+ '<meta name=\"viewport\" content=\"width=device-width\">\\n'\n\t\t+ stylesheets.map(stylesheet_code).join(' ') + '\\n'\n\t\t+ scripts.map(script_code).join(' ') + '\\n'\n\t\t+ (favicon !== undefined ? '<link rel=\"shortcut icon\" type=\"' + favicon_type + '\" href=\"' + favicon + '\">\\n' : '')\n\t\t+ '</head>\\n<body>' + '\\n'\n\t\t+ body + '\\n'\n\t\t+ '</body>\\n</html>';\n}", "title": "" }, { "docid": "df4062c28ebc4161c5e8bc446764d2aa", "score": "0.51016", "text": "function makeHTML(lang, charset, title){\n var objectHTML = function(){\n var templateString = '<!DOCTYPE html>\\n<html lang=\"' + lang + '\">\\n<head>\\n<meta charset=\"' + charset + '\">\\n' +\n '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\\n<title>' + title + '</title>\\n</head>\\n<body>\\n</body>\\n</html>\\n';\n\n this.value = templateString;\n\n this.toString = function(){\n return this.value;\n };\n\n this.valueOf = function(){\n return this.value;\n };\n\n this.setBodyInnerHTML = function(innerHTML){\n var bodyReg = /<body>\\s*.*\\s*<\\/body>/gi;\n var sBodyStartTag = '<body>\\n',\n sBodyEndTag = '\\n</body>';\n\n this.value = this.value.replace(bodyReg, sBodyStartTag + innerHTML + sBodyEndTag);\n };\n\n this.appendCSS = function(url){\n var headEndReg = /<\\/head>/gi;\n var sBodyStartTag = '\\n<body>';\n var sCSSLinkTag = '<link rel=\"stylesheet\" href=\"' + url + '\">\\n</head>';\n\n this.value = this.value.replace(headEndReg, sCSSLinkTag);\n };\n\n this.removeCSS = function(url){\n var sCSSLinkTag = '\\n<link rel=\"stylesheet\" href=\"' + url + '\">';\n\n this.value = this.value.replace(sCSSLinkTag, '');\n };\n\n this.appendJS = function(url){\n var bodyEndReg = /<\\/body>/gi;\n var sJSScriptTag = '<script src=\"'+ url +'\">\\n</body>';\n\n this.value = this.value.replace(bodyEndReg, sJSScriptTag);\n };\n\n this.removeJS = function(url){\n var sJSScriptTag = '\\n<script src=\"'+ url +'\">';\n\n this.value = this.value.replace(sJSScriptTag, '');\n };\n };\n\n return new objectHTML(lang, charset, title);\n}", "title": "" }, { "docid": "d2c8bac56d8ec55102dd49dd5ab830e4", "score": "0.5084316", "text": "function getHTML() {\n\n //Gets the classes/weights/IDs from Chromse sync\n chrome.storage.sync.get(null, function(items) {\n allNames = items.allNames;\n allWeights = items.allWeights;\n allIDs = items.allIDs;\n analyzeGrades();\n });\n}", "title": "" }, { "docid": "e9521eb90d4dace66d23f258cf54f0e3", "score": "0.50666755", "text": "saveHtmlCache() {\n this.setStore(\"htmlCache\", document.documentElement.innerHTML);\n }", "title": "" }, { "docid": "387ebab42228f3e77e4ae760ab10ea60", "score": "0.5064278", "text": "rawHtml(html) {\n return new RawHtml({ html });\n }", "title": "" }, { "docid": "fe2446ae4cbea9245ac060dc632fff95", "score": "0.5062566", "text": "html() {\n return this.root ?? this.renderHtml();\n }", "title": "" }, { "docid": "fe2446ae4cbea9245ac060dc632fff95", "score": "0.5062566", "text": "html() {\n return this.root ?? this.renderHtml();\n }", "title": "" }, { "docid": "b21cd702c85a4dc4fb2b7ceed569c151", "score": "0.5061412", "text": "function buildhtml() { \n return gulp.src('src/html/index.html')\n .pipe(gulp.dest('app/'));\n}", "title": "" }, { "docid": "de6e839cf85933d0bc100e3a226c93e7", "score": "0.5059356", "text": "function getHTML(requestedURL, callback) {\n var xhttp = new XMLHttpRequest();\n var proxyURL = getProxyURL(requestedURL);\n\n xhttp.open(\"GET\", proxyURL, true);\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4 && xhttp.status == 200 && callback) {\n var httpDoc = domParse(xhttp.responseText);\n callback(httpDoc);\n }\n }\n xhttp.send();\n}", "title": "" }, { "docid": "38c63200b0a075eeb62c9722344d964e", "score": "0.5053405", "text": "function getHtml(url) {\n return new Promise((resolve, reject) => {\n rp(url).then(str => {\n resolve(str)\n }).catch(err => {\n console.error(err)\n reject(err)\n })\n });\n}", "title": "" }, { "docid": "1819cb8cba013e49deb6c8aef0e1bf82", "score": "0.5051335", "text": "function html() {\n\treturn gulp.src(config.app + 'app/**/*.html')\n\t\t.pipe(plumber({ errorHandler: handleErrors }))\n\t\t.pipe(htmlmin({ collapseWhitespace: true }))\n\t\t.pipe(templateCache('templates.js', {\n\t\t\tmodule: config.module,\n\t\t\troot: 'app'\n\t\t}))\n\t\t.pipe(gulp.dest(config.dist + 'js'));\n}", "title": "" }, { "docid": "5d407bde655aaec74a05392a71bc0791", "score": "0.5041234", "text": "function selectedHTML(editor) {\n restoreRange(editor);\n var range = getRange(editor);\n if (ie)\n return range.htmlText;\n var layer = $(\"<layer>\")[0];\n layer.appendChild(range.cloneContents());\n var html = layer.innerHTML;\n layer = null;\n return html;\n }", "title": "" }, { "docid": "ac4b850260cddafccf9dc2fe9518ef57", "score": "0.50323397", "text": "function includeHTML() {\n var z, i, elmnt, file, xhttp;\n /*loop through a collection of all HTML elements:*/\n z = document.getElementsByTagName(\"*\");\n for (i = 0; i < z.length; i++) {\n elmnt = z[i];\n /*search for elements with a certain atrribute:*/\n file = elmnt.getAttribute(\"include-html\");\n if (file) {\n /*make an HTTP request using the attribute value as the file name:*/\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4) {\n if (this.status == 200) {elmnt.innerHTML = this.responseText;}\n if (this.status == 404) {elmnt.innerHTML = \"Page not found.\";}\n /*remove the attribute, and call this function once more:*/\n elmnt.removeAttribute(\"include-html\");\n includeHTML();\n }\n }\n xhttp.open(\"GET\", file, true);\n xhttp.send();\n /*exit the function:*/\n return;\n }\n }\n}", "title": "" }, { "docid": "4022778c42edf12646fd0ce03a876a3c", "score": "0.50315946", "text": "function _view() {\n var view = $('body')[0];\n var view2 = $('html')[0];\n return {\n st: view2.scrollTop == 0 ? view.scrollTop : view2.scrollTop,\n sl: view2.scrollLeft == 0 ? view.scrollLeft : view2.scrollLeft,\n sw: view2.scrollWidth,\n sh: view2.scrollHeight,\n cw: view2.clientWidth,\n ch: view2.clientHeight\n };\n }", "title": "" }, { "docid": "8b5014dd00073090e547f94fa3b529cc", "score": "0.50311536", "text": "restoreHtmlFromCache() {\n const htmlCache = this.getStore(\"htmlCache\");\n if (htmlCache) {\n const targetNode = document.getElementsByTagName(\"html\")[0];\n targetNode.innerHTML = htmlCache;\n log(\"trace\", \"uibuilder.module.js:restoreHtmlFromCache\", \"Restored HTML from cache\")();\n } else {\n log(\"trace\", \"uibuilder.module.js:restoreHtmlFromCache\", \"No cache to restore\")();\n }\n }", "title": "" }, { "docid": "f762b1a031bc8f200fd8353c4ac6a355", "score": "0.5023081", "text": "function getCurrentDocumentBody() {\n service.setCurrentDocumentBody($rootScope.editor.getSession().getValue());\n return service.currentDocument.body;\n }", "title": "" }, { "docid": "1f12f09eda13a0e499a90a6a240719bb", "score": "0.5021488", "text": "function selectedHTML(editor) {\r\n restoreRange(editor);\r\n var range = getRange(editor);\r\n if (ie)\r\n return range.htmlText;\r\n var layer = $(\"<layer>\")[0];\r\n layer.appendChild(range.cloneContents());\r\n var html = layer.innerHTML;\r\n layer = null;\r\n return html;\r\n }", "title": "" }, { "docid": "447521fad6a7a3973277a130651a41fa", "score": "0.5016356", "text": "body() {\n return this.iframe.contents().find('body');\n }", "title": "" }, { "docid": "bfaf7a805ed40e116388ff2bf92e0236", "score": "0.5008503", "text": "function html () {\n return gulp.src([paths.src.indexHtml])\n .pipe(fileinclude({\n prefix: '@@',\n basepath:'./src/includes/',\n }))\n .pipe(gulp.dest([paths.dist.base]))\n // .pipe(browserSync.reload({ stream: true }))\n}", "title": "" }, { "docid": "7a40c3e5fa99f036f08b4a4afc5ae4d0", "score": "0.5003887", "text": "getHTML() {\n var html = '';\n html += `<h4 class=\"linkHeadline\"><a class=\"linkTitle\" href=\"${this.url}\">${this.title}</a> <span class=\"linkUrl\">${this.url}</span></h4>`;\n html += `<span class=\"linkAuthor\">Submitted by ${this.author}</span>`;\n return html;\n }", "title": "" }, { "docid": "c33a5438074b32f00d3345310d6fd21c", "score": "0.500284", "text": "async function requestStaticHtml() {\n\tconst init = {\n\t headers: {\n\t\t\"content-type\": \"text/html;charset=UTF-8\",\n\t },\n\t}\n\t// error handling could be done here by checking content type\n\tconst response = await fetch(htmlUrl, init)\n\treturn response;\n}", "title": "" }, { "docid": "4a01e0ad56e6c9c9f082091c7d319714", "score": "0.49946752", "text": "function htmlboilerplate(root) {\n const module = 'node_modules/html5-boilerplate/dist/'\n const loc = find_loc_1(module)\n if(!loc) throw 'Failed to find html5-boilerplate module'\n let html = read(path.join(loc, 'index.html'))\n if(root) copy_referenced_files_1(html, loc, root)\n return html\n\n\n /* outcome/\n * Look for the requested module up the directory tree\n */\n function find_loc_1(m) {\n let curr = __dirname\n let prev\n while(prev != curr) {\n let loc = path.join(curr, m)\n prev = curr\n curr = path.join(curr, '..')\n try {\n let si = fs.lstatSync(loc)\n if(si.isDirectory()) return loc\n } catch(e) {\n /* ignore */\n }\n }\n }\n\n\n function copy_referenced_files_1(html, src, dst) {\n let refs = find_refs_1(html)\n for(let i = 0;i < refs.length;i++) {\n let curr = refs[i].split('/')\n let name = curr.pop()\n let src_ = path.join(src, curr.join(path.sep), name)\n let dst_ = path.join(dst, curr.join(path.sep), name)\n if(fs.existsSync(dst_)) continue\n else copy(src_, dst_)\n }\n }\n\n /* outcome/\n * Find references that match 'href' or 'src' in the html\n */\n function find_refs_1(html) {\n return refs_1('href').concat(refs_1('src'))\n\n function refs_1(t) {\n let rx = new RegExp(`${t}=\"(.*)\"`,'g')\n return Array.from(html.matchAll(rx), m => m[1]).filter(match => !match.startsWith('http'))\n }\n }\n}", "title": "" }, { "docid": "994d0ba0929edd2ee8091cc40f94f836", "score": "0.49934205", "text": "function add_html()\n{\n\thtml_code+=\"<html>\\n<head>\";\n}", "title": "" }, { "docid": "f14b656d76ab20ec0383ad3a4c76f805", "score": "0.49897677", "text": "get outerHTML() {\n if (this.localName == \"#comment\") {\n return `<!--${this.innerHTML}-->`;\n }\n\n const attributes = this.attributes.reduce((previous, { name, value }) => {\n return previous + ` ${name}=\"${value}\"`;\n }, \"\");\n\n return `<${this.localName}${attributes}>${this.innerHTML}</${this.localName}>`;\n }", "title": "" }, { "docid": "a642d102c60403ba5fbba33eb6547e7d", "score": "0.49835417", "text": "async getHtml() {\n return `\n <h1>Welcome back</h1>\n <p> \n lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum \n </p>\n <p> \n <a href=\"/posts\" data-link>View recent posts</a>.\n </p>\n `;\n }", "title": "" }, { "docid": "8a6e856dd63120ea15de6d685243c30c", "score": "0.49795687", "text": "function html() {\n let json = JSON.parse(fs.readFileSync(config.directory.src + config.path.meta));\n\n return gulp.src([\n config.directory.src + config.path.ejs,\n '!' + config.directory.src + config.path.template,\n ])\n .pipe(gulpPlugins.ejs({json}))\n .pipe(gulpPlugins.rename({ extname: '.html' }))\n // .pipe(gulpPlugins.ejs().on('error', log))\n .pipe(gulp.dest(config.directory.temp))\n .pipe(gulp.dest(config.directory.build))\n .pipe(browserSync.stream())\n .pipe(gulpPlugins.size({\n title: 'html'\n }))\n}", "title": "" } ]
d739b3dc2add48de2fedd4c767fe8bc9
function to be called whenever the window is scrolled or resized
[ { "docid": "53560b1062756a83ae9a8222613723ba", "score": "0.0", "text": "function move(pos, height) {\n $this.css({'backgroundPosition': newPos(xpos, height, pos, adjuster, inertia)});\n }", "title": "" } ]
[ { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.7673486", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "4bfbfdfb546d3a1d070aa922697fc4aa", "score": "0.7586129", "text": "function windowResizeHandler() {\n // Check for the existence of the vertical scrollbar\n scrollbarExistenceCheck(), // Capture the height and width of the scrolling element in case it has changed\n innerHeight = scope.glSuperScroll.inner.height(), innerWidth = scope.glSuperScroll.inner.width();\n }", "title": "" }, { "docid": "9d41af5c91ba9280421dce01f0d97409", "score": "0.7495301", "text": "function edgtfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "aa5e70b5676588874a278bb5d55dc90b", "score": "0.74872565", "text": "function onWinSize(){jWindow.trigger('scrollSpy:winSize');}", "title": "" }, { "docid": "a45d8117a742a65fbba99c889cf5a4e9", "score": "0.7453045", "text": "function edgtfOnWindowScroll() {\n }", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "d2357980fbb37ecf41e166b79ed6d667", "score": "0.7451244", "text": "function onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}", "title": "" }, { "docid": "c1bfee64025541ad4bebd62558ac717d", "score": "0.74252504", "text": "function mkdfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "309f599e1dbf42e7a4850a26d4e18331", "score": "0.74235934", "text": "function edgtOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3102c291bab7626422f5f7bd2754c03e", "score": "0.7411333", "text": "function qodefOnWindowResize() {\n\n }", "title": "" }, { "docid": "f0bab2d5ec719973260c3c42f38b72c5", "score": "0.74110585", "text": "addListener() {\n window.addEventListener('scroll', this.handleScroll)\n window.addEventListener('resize', this.handleResize)\n }", "title": "" }, { "docid": "c0188ab9f14b271302aeabef79d9e22e", "score": "0.73620546", "text": "function onWinSize() {\n jWindow.trigger('scrollSpy:winSize');\n }", "title": "" }, { "docid": "a911c116d7a9a93630e4c8dc22f15976", "score": "0.7361825", "text": "onResize() {}", "title": "" }, { "docid": "eae806da91ee511ff9bb8eac688f7d70", "score": "0.73615074", "text": "windowResize() {\r\n this.updateTopPosition();\r\n }", "title": "" }, { "docid": "ec993a027f4f1c6d0ebbcaefc2fbd205", "score": "0.7338105", "text": "function onWinSize() {\r\n jWindow.trigger('scrollSpy:winSize');\r\n }", "title": "" }, { "docid": "ec993a027f4f1c6d0ebbcaefc2fbd205", "score": "0.7338105", "text": "function onWinSize() {\r\n jWindow.trigger('scrollSpy:winSize');\r\n }", "title": "" }, { "docid": "9c7d9d9c6d45d2bb491a92fcadd22691", "score": "0.7337116", "text": "onResize () {}", "title": "" }, { "docid": "09014186ccaca2fc61ebd9b9d79bb3b5", "score": "0.7335002", "text": "function edgtOnWindowResize() {\n\n }", "title": "" }, { "docid": "6d4533c9b62cde61e7fceed936e37d13", "score": "0.73332393", "text": "function mkdfOnWindowScroll() {\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.732638", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.732638", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.732638", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "fb6cba5b66628f3c47d2947b70d4c587", "score": "0.7315367", "text": "function mkdfOnWindowScroll() {\n\n\t}", "title": "" }, { "docid": "fb6cba5b66628f3c47d2947b70d4c587", "score": "0.7315367", "text": "function mkdfOnWindowScroll() {\n\n\t}", "title": "" }, { "docid": "64ddf6dcaa53d8bf519b19c16e31746c", "score": "0.72947973", "text": "didResize() {\n if (this.get('insideScroll') === true) {\n this._displayArrows();\n }\n }", "title": "" }, { "docid": "daee7d4b065931e66dfdabbd84340d82", "score": "0.7281871", "text": "function onResize() {\n\n // Check if header is disabled on mobile if not destroy on resize\n if ( ! $mobileSupport && ( self.config.viewportWidth < $brkPoint ) ) {\n destroySticky();\n } else {\n\n // Set correct width and top value\n if ( $isSticky ) {\n $stickyWrap.css( 'height', $stickyTopbar.outerHeight() );\n $stickyTopbar.css( {\n 'top' : getOffset(),\n 'width' : $stickyWrap.width()\n } );\n } else {\n onScroll();\n }\n\n }\n\n }", "title": "" }, { "docid": "935d7fb587a9048c11bffed311415de9", "score": "0.7253989", "text": "function edgtfOnWindowResize() {\n }", "title": "" }, { "docid": "ae1ca57a4a004b7919bc54c0de372b58", "score": "0.7244065", "text": "function qodefOnWindowResize() {\n qodefInitMobileNavigationScroll();\n }", "title": "" }, { "docid": "f571fa9ab2afc71efeb68f9003dd3995", "score": "0.7226678", "text": "function window_resize() {\n\n var responsive_viewport = $(window).width() + $.app.scrollbar_width;\n\n window_scroll();\n\n }", "title": "" }, { "docid": "e1d9ae0219b76f33f864dd56787b481e", "score": "0.7209643", "text": "onWindowResize() {\n }", "title": "" }, { "docid": "452e8a8273a99b3b1a43aae63eefe2ea", "score": "0.7171592", "text": "onWindowResize() {\n\t\tfor (const res in this.options.responsive) {\n\t\t\tif (window.innerWidth >= res) {\n\t\t\t\tthis.options.slidesToScroll = this.options.responsive[res].slidesToScroll;\n\t\t\t\tthis.options.slidesVisible = this.options.responsive[res].slidesVisible;\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.pagination) this.createPagination();\n\t\tthis.setStyle();\n\t\tthis.moveCallBacks.forEach((cb) => cb(this.currentItem));\n\t}", "title": "" }, { "docid": "e8385eaf429d3dfc639cce659f068ca6", "score": "0.7141793", "text": "function onScroll() {\n lastScrollY = window.scrollY;\n requestTick();\n }", "title": "" }, { "docid": "41125f73b28f46ad5c82364260f57f3b", "score": "0.712189", "text": "onResize() {\n const windowWidth =\n window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n const windowHeight =\n window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n\n this._listeners.forEach(listener => {\n listener({ windowWidth, windowHeight });\n });\n }", "title": "" }, { "docid": "6e82f037464d3d4b5c7d4fafe09e3ae8", "score": "0.71181184", "text": "function mkdfOnWindowResize() {\n\n\t}", "title": "" }, { "docid": "8ed25b7173bdb86f2ea6107d303f210c", "score": "0.7112341", "text": "function viewportResized() {\n window.addEventListener('resize', function () {\n setViewportWidth();\n setNavBar();\n });\n}", "title": "" }, { "docid": "787adeaf137ec09343b560966462a3f8", "score": "0.711018", "text": "function handleWindowResize(){\n $(window).bind('resize', setupHeight);\n }", "title": "" }, { "docid": "8849a71aebf507cb968871ebce187e70", "score": "0.7099218", "text": "function mkdfOnWindowResize() {\n\n }", "title": "" }, { "docid": "8849a71aebf507cb968871ebce187e70", "score": "0.7099218", "text": "function mkdfOnWindowResize() {\n\n }", "title": "" }, { "docid": "0748f2fe958af2a4c297d67c2f149873", "score": "0.709114", "text": "function mkdfOnWindowScroll() {\n mkdf.scroll = $(window).scrollTop();\n }", "title": "" }, { "docid": "d6d72cebefc1d87e150815009ab0624e", "score": "0.70868826", "text": "function windowResized(){\n UI();\n}", "title": "" }, { "docid": "a87a0568bb53044122fb2db055d6207b", "score": "0.70832264", "text": "function triggerBody(){\n $(window).scroll();\n $(window).resize();\n }", "title": "" }, { "docid": "2c0298cdbddea603160659fb686f7bd6", "score": "0.708227", "text": "function onResize() {\n asyncDigestDebounced.add(checkWindowForRebuild);\n }", "title": "" }, { "docid": "aac8096570376674069cfd861bf928c8", "score": "0.7074304", "text": "function onPageScroll() {\n // Fix the navigation lines.\n fixNavLines(window.scrollY);\n\n // Check if an element is in view\n checkIfInView(true);\n\n console.log(screen.availWidth);\n console.log($window.scrollTop());\n }", "title": "" }, { "docid": "a1239e98e91b79a85da298c3909aa373", "score": "0.7071462", "text": "function mkdfOnWindowResize() {\n }", "title": "" }, { "docid": "823d1e9f793d19b425f40aff3fe162e0", "score": "0.704118", "text": "function onWindowResize( event ) {\r\n layout();\r\n }", "title": "" }, { "docid": "0b28434fcdb754cee7f1af7633e63126", "score": "0.70304585", "text": "function windowResized(){\n setup();\n}", "title": "" }, { "docid": "97e289ae7bbd37a5b82c2fe9bc66eb20", "score": "0.7029117", "text": "_onWindowResize() {\n if (qxWeb.type.get(this.getConfig(\"step\")) == \"Array\") {\n this._getPixels();\n }\n this.__valueToPosition(this._value);\n }", "title": "" }, { "docid": "e963f336ceb359bb0be42c7254ed6186", "score": "0.7023207", "text": "function onWindowResize( event ) {\n\n layout();\n\n }", "title": "" }, { "docid": "fe44ec0fad64613b7017a6a5dc292c93", "score": "0.70174396", "text": "on_resize_started() {\n }", "title": "" }, { "docid": "44d16f37774c05351bbeb9b25d0d39f2", "score": "0.7010569", "text": "function onWindowResize( event ) {\n\n\t\tlayout();\n\n\t}", "title": "" }, { "docid": "44d16f37774c05351bbeb9b25d0d39f2", "score": "0.7010569", "text": "function onWindowResize( event ) {\n\n\t\tlayout();\n\n\t}", "title": "" }, { "docid": "44d16f37774c05351bbeb9b25d0d39f2", "score": "0.7010569", "text": "function onWindowResize( event ) {\n\n\t\tlayout();\n\n\t}", "title": "" }, { "docid": "0a1b59c53627b083ccae976339e866ef", "score": "0.70080554", "text": "function edgtfOnWindowScroll() {\n\t edgtfInitPortfolioPagination().scroll();\n }", "title": "" }, { "docid": "36d17a7ec2f7aa592e433b2a68223615", "score": "0.6998521", "text": "function onWindowResize()\n\t{\n\t\tresizeUpdate();\n\n\t\tmainView.resize(windowWidth, windowHeight);\n\t}", "title": "" }, { "docid": "dfd5da1730f53ee6ce34e11b265e8353", "score": "0.69907033", "text": "function onScroll() {\n\tpreviousScrollY = currentScrollY;\n\tcurrentScrollY = window.scrollY;\n\tfireIt();\n}", "title": "" }, { "docid": "fd16a0cfc7c2f238c6dc1c8745513078", "score": "0.69884086", "text": "function registerScreenResizeEvent() {\n $(window).on('ready, resize', positionSmallBubbles);\n }", "title": "" }, { "docid": "74074138f1010b4a5047135ec070dc63", "score": "0.69863933", "text": "function OnWindowResize(_width,_height)\n{\n\n}", "title": "" }, { "docid": "d89165eaae9e8e329a4bb0c5f70bda65", "score": "0.6982614", "text": "_onWindowResize() {\n const winWidth = this._$window.width();\n\n if (winWidth !== this._lastWindowWidth) {\n this._updateReviewersPos();\n }\n\n this._lastWindowWidth = winWidth;\n }", "title": "" }, { "docid": "4a2a9d5b6565730947db13ff1f6d0b6a", "score": "0.6977155", "text": "bindEvents() {\n window.addEventListener('resize', this.update.bind(this));\n }", "title": "" }, { "docid": "969fbcd85593db756230e2e74704909e", "score": "0.69759107", "text": "function windowIsResized()\r\n\t\t\t{\r\n\t\t\t\t// If the scrollable area is not hidden on start, reset and recalculate the\r\n\t\t\t\t// width of the scrollable area\r\n\t\t\t\tif(!(options.hiddenOnStart))\r\n\t\t\t\t{\r\n\t\t\t\t\t$mom.scrollableAreaWidth = 0;\r\n\t\t\t\t\t$mom.find(options.scrollableArea).children((options.countOnlyClass)).each(function() {\r\n\t\t\t\t\t\t$mom.scrollableAreaWidth = $mom.scrollableAreaWidth + $(this).outerWidth(true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t$mom.find(options.scrollableArea).css(\"width\", $mom.scrollableAreaWidth + 'px');\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Reset the left offset of the scroll wrapper\r\n\t\t\t\t$mom.find(options.scrollWrapper).scrollLeft(\"0\");\r\n\t\t\t\t\r\n\t\t\t\t// Get the width of the page (body)\r\n\t\t\t\tvar bodyWidth = $(\"body\").innerWidth();\r\n\t\t\t\t\r\n\t\t\t\t// If the scrollable area is shorter than the current\r\n\t\t\t\t// window width, both scroll hotspots should be hidden.\r\n\t\t\t\t// Otherwise, check which hotspots should be shown.\r\n\t\t\t\tif($mom.scrollableAreaWidth < bodyWidth)\r\n\t\t\t\t{\t\r\n\t\t\t\t\thideLeftHotSpot();\r\n\t\t\t\t\thideRightHotSpot();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tshowHideHotSpots();\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "68448826d34defdc3872bcaec998f709", "score": "0.69679016", "text": "_onresize_window() {\n this.showVisibleHighlights();\n }", "title": "" }, { "docid": "2e188ac9c518f72097837f843ffb172c", "score": "0.69672936", "text": "function windowOnScroll() {\n jQuery(window).on(\"scroll\", function(e){\n if (jQuery('.blog-sidebar').isInViewport() == true){\n infinitScroll();\n }\n });\n}", "title": "" }, { "docid": "a0dfcb511d6b55ae9059fb66a525ad17", "score": "0.69657147", "text": "function triggerBody() {\n $(window).scroll();\n $(window).resize();\n }", "title": "" }, { "docid": "40163b761bb55b2dc28827cc1700abbe", "score": "0.69650906", "text": "function mkdfOnWindowResize() {\n\t\tmkdfCustomFontResize();\n\t\tmkdfInitPortfolioListMasonry();\n\t\tmkdfInitPortfolioListPinterest();\n\t}", "title": "" }, { "docid": "07421134677f35f4bcd18a650d1bca3a", "score": "0.69614536", "text": "function resize() {\n\t\t\t\tif ($window.innerWidth >= 992) {\n\t\t\t\t\t$win.on('scroll', scroll);\n\t\t\t\t} else {\n\t\t\t\t\t$win.off('scroll');\n\t\t\t\t\telem[0].style.position = null;\n\t\t\t\t\telem[0].style.top = 0;\n\t\t\t\t\telem[0].style.bottom = null;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "a4f3d23dcf9fffc4b90a1b52f7b57e00", "score": "0.69574356", "text": "_listen() {\n window.addEventListener('scroll', this._onScroll);\n }", "title": "" }, { "docid": "ff1ccd54b92c3c5d829683be9c863090", "score": "0.69137895", "text": "function windowResized() {\n setup();\n}", "title": "" }, { "docid": "ff1ccd54b92c3c5d829683be9c863090", "score": "0.69137895", "text": "function windowResized() {\n setup();\n}", "title": "" }, { "docid": "14ab9bd826dd838b2180d22c0d078705", "score": "0.68794066", "text": "function windowScrollTriggers() {\n\t$(window).on(\"scroll\", function() {\n\t\t// console.log(\"scrollTop(): \" + $(window).scrollTop());\n\t\tshrinkLogo();\n\t\tfadeNavBackground();\n\t\tanimateScrollProgressBar();\n\t});\n}", "title": "" }, { "docid": "e3cb6670d3097f0f9f0d5afd5d44f6c8", "score": "0.6872471", "text": "function onWindowScroll(e) {\n\t\t\n\t\tif(_isScrolling !== true) {\n\n\t\t\t_isScrolling = true;\n\n\t\t\tangular.forEach(_onScrollStartCallbacks, function(callback) {\n\t\t\t\tcallback();\n\t\t\t});\n\n\t\t}\n\n\t\tif(_timeoutListener !== null) {\n\t\t\t$window.clearTimeout(_timeoutListener);\n\t\t}\n\n\t\t_timeoutListener = $window.setTimeout(function() {\n\t\t\n\t\t\t_isScrolling = false;\n\n\t\t\tangular.forEach(_onScrollEndCallbacks, function(callback) {\n\t\t\t\tcallback();\n\t\t\t});\n\n\t\t}, 150);\n\n\t}", "title": "" }, { "docid": "6b7f4c66c7c2a41342f0618be4081ed1", "score": "0.6871455", "text": "function handleWindowResize () {\n\t ctrl.lastSelectedIndex = ctrl.selectedIndex;\n\t ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n\t $mdUtil.nextTick(function () {\n\t ctrl.updateInkBarStyles();\n\t updatePagination();\n\t });\n\t }", "title": "" }, { "docid": "6b7f4c66c7c2a41342f0618be4081ed1", "score": "0.6871455", "text": "function handleWindowResize () {\n\t ctrl.lastSelectedIndex = ctrl.selectedIndex;\n\t ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n\t $mdUtil.nextTick(function () {\n\t ctrl.updateInkBarStyles();\n\t updatePagination();\n\t });\n\t }", "title": "" }, { "docid": "3fc17d720b22be9dc8781237652cc4c2", "score": "0.686054", "text": "listenerWindow() {\n window.addEventListener('resize', ()=> { this.updateView(); });\n }", "title": "" }, { "docid": "52b38f2637a5448d94871b56344110c8", "score": "0.6848569", "text": "function setResizeHandler() {\n if (!$header.hasClass('fixed')) {\n return\n }\n\n $(window).on('resize', function () {\n windowHeight = $(window).height();\n windowWidth = $(window).width();\n headerHeight = $globalHeader.innerHeight();\n hideDistance = calcInputDifference();\n\n if (windowWidth > headerVars.MOBILEWIDTH) {\n addFixed();\n setAskBarTop();\n\n } else {\n removeFixed();\n }\n setAskBarTop();\n });\n }", "title": "" }, { "docid": "aac7fe91e9bd0e37b0314ddfa6346eae", "score": "0.68378645", "text": "function handleWindowResize() {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function() {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "e7f2e1013422b98fc406de528ff5f878", "score": "0.6832619", "text": "addResizeListener() {\n window.addEventListener('resize', this.adjustProfilePositionBound);\n }", "title": "" }, { "docid": "7274c9e56f969a114a36d10b1b7eb925", "score": "0.6824785", "text": "handleWindowResize() {\n this._windowResize();\n }", "title": "" }, { "docid": "9cf61af98cdfdd69a16c3b5304f2a971", "score": "0.681285", "text": "function windowResized() {\n\tcanvas_resize();\n\tredraw();\n}", "title": "" }, { "docid": "d9d9a7cc39e5d3f8bb91082e64506948", "score": "0.6809639", "text": "onWindowResize() {\n this.repaint();\n }", "title": "" }, { "docid": "932a9ae33e28f407664bf96f5a713e83", "score": "0.6808127", "text": "events() {\n window.addEventListener(\"scroll\", this.scrollThrottle);\n window.addEventListener(\"resize\", debounce(() => {\n console.log(\"Resize just ran\");\n this.browserHeight = window.innerHeight;\n }, 300))\n }", "title": "" }, { "docid": "b0e9c22ce7d7eb881b321ef74caa57cc", "score": "0.6801333", "text": "function manageWindowSize() {\n window.addEventListener(\"resize\", displayWindowSize());\n}", "title": "" }, { "docid": "a85e796247d9d0569ef5157929730af6", "score": "0.67943686", "text": "function _onWindowResized() {\n\t\t\t\t_this.signals.appResized.dispatch();\n\t\t\t}", "title": "" }, { "docid": "ffd482008f437b5b1ad117dfc15b3388", "score": "0.67909837", "text": "function bindEvents(){\n\t$(window).bind(\"resize\", resize);\n}", "title": "" }, { "docid": "1d51a324a93ea9a325fd37b80eaed4de", "score": "0.67717534", "text": "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "title": "" }, { "docid": "d37bd7fb7b1213bf2cbd375826b10ebd", "score": "0.6767934", "text": "function onWindowResized(e) {\n\t\tif (!resizeTimer) {\n\t\t\tresizeTimer = setTimeout(function() {resize();}, 20);\n\t\t}\n\t}", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.6756617", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.6756617", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.6756617", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.6756617", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" } ]
c4a586f571405d7f0d08ef2361b136b8
Import config from file
[ { "docid": "9987949e716cf1b098a17590651be722", "score": "0.6451158", "text": "function importConfig() {\n return inquirer.prompt([{ type: \"input\", name: \"path\", message: \"Please enter the path of your config: \" }]).then((answers) => {\n const configObject = JSON.parse(fs.readFileSync(answers.path).toString());\n console.log(configObject);\n // Ask for user confirmation\n confirm(\"Here is the config file we parsed, please make sure nothing looks suspicious. Continue?\", () => writeConfig(configObject));\n });\n}", "title": "" } ]
[ { "docid": "18512bf1a001595548a06a8720deffa7", "score": "0.6543635", "text": "__loadConfigs() {\n\t\tvar configs = this.readFromFile(this.configFile, null);\n\n\t\tif (configs == null) {\n\t\t\tthrow new Error(\"Error in loading configuratons.\");\n\t\t}\n\n\t\tthis.configs = JSON.parse(configs);\n\t}", "title": "" }, { "docid": "b786bc9b953219abea556570173da495", "score": "0.6443608", "text": "function loadConfig() {\n config = require('../../shared/js/config');\n}", "title": "" }, { "docid": "6f9b66d8bb83018e1530cf9210c5c937", "score": "0.6400262", "text": "function loadConfig() {\n try {\n const configFile = require(\"./config.json\");\n for (const propertie in configFile) {\n if (configFile.hasOwnProperty(propertie)) {\n const value = configFile[propertie];\n //override config propertie\n if (typeof config[propertie] !== \"undefined\") {\n config[propertie] = value;\n }\n }\n }\n console.log(\"Config loaded\");\n } catch (error) {\n console.warn(\"Config file not found, using default...\");\n\n }\n}", "title": "" }, { "docid": "503635fccdb63f8ba25774ed2f3a5e44", "score": "0.6369955", "text": "loadConfig() {\n this.filename(this.configFile());\n this.loadSync();\n\n this.on(\"schema.invalid\" , (err) => {\n Logger.error(err);\n });\n\n if ( this.invalid() ) {\n throw new Error(`The config file ${ this.configFile() } isn't a valid Titan Config File`);\n }\n }", "title": "" }, { "docid": "4b88d7b83b425671930ae0ff7cbcfda9", "score": "0.63083744", "text": "function loadConfig(file){\n try{\n var config = require(file).confPrint;\n return config;\n } catch(e){\n console.log(e);\n return false;\n }\n}", "title": "" }, { "docid": "c208f34e82ce3a50591009ceb2d6d276", "score": "0.62762684", "text": "function load(baseDir, cliArgs) {\n cliArgs = cliArgs || {};\n\n var environment = process.env.NODE_ENV || KEY_DEVELOPMENT;\n var userName = process.env.USER || process.env.USERNAME || null;\n\n var pathDefault = path.join(baseDir, 'default');\n var pathEnvironment = path.join(baseDir, environment);\n var pathUser = path.join(baseDir, 'user.' + userName);\n\n //fail dramatically if default config is not found or the file is malformed. file name pattern: default.js\n var configuration = tryFileVariations(pathDefault);\n\n //checking if there's a config file named after the current environment. file name pattern: {environmentName}.js\n var pathEnvironmentExists = existsVariations(pathEnvironment);\n if (pathEnvironmentExists) {\n configuration = hoek.merge(configuration, require(pathEnvironmentExists));\n }\n\n //we're checking if there's a config file named after the current user, but only in development. file name pattern: user.{userName}.js\n if (environment === KEY_DEVELOPMENT) {\n var pathUserExists = existsVariations(pathUser);\n if (pathUserExists) {\n configuration = hoek.merge(configuration, require(pathUserExists));\n }\n }\n\n //we provide the possibility to assign the path to a external configuration file\n if (cliArgs[KEY_EXTERNAL_FILE]) {\n var externalConfigPath = cliArgs[KEY_EXTERNAL_FILE];\n\n if (fs.existsSync(externalConfigPath)) {\n configuration = hoek.merge(configuration, require(externalConfigPath));\n } else {\n throw new Error('supplied external config file could not be found: \"' + externalConfigPath + '\"');\n }\n\n delete cliArgs[KEY_EXTERNAL_FILE];\n }\n\n if (Object.keys(cliArgs).length > 0) {\n hoek.merge(configuration, cliArgs);\n }\n\n return hoek.clone(configuration);\n}", "title": "" }, { "docid": "90d08b7acb2c5d657b59e9482de3bcc7", "score": "0.62291014", "text": "loadConfig() {\n this.config = new config_1.Config(helpers.requireAll(this.configPath()));\n this.container.singleton('Adonis/Core/Config', () => this.config);\n }", "title": "" }, { "docid": "08e29f9db9de62b57e091615aaa75703", "score": "0.62046087", "text": "function loadConfig(path) {\n try {\n var configJSON = JSON.parse(fs.readFileSync(process.cwd() + \"/\" + path));\n console.log(\"Config file detected: \" + path)\n return configJSON;\n }\n catch(e) {\n console.log(\"Config file: \" + e.toString())\n }\n}", "title": "" }, { "docid": "5f227613c08fbaa7468cc5b2880b703c", "score": "0.614385", "text": "function getConfigFromFile(path) {\n\tif (fs.existsSync(path)) {\n\t\tconst configFileContents = fs.readFileSync(path, 'utf8')\n\t\tconst config = JSON.parse(configFileContents)\n\t\tlogger.log('info', `Parsed config from file: ${path}`, config)\n\t\treturn config\n\t} else {\n\t\tlogger.log('warn', `Using default config, no file avaialble at: ${path}`)\n\t\treturn {\n\t\t\t// TODO: create default config\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b4880f59f6c5317e7d25f0fb2e3efbfd", "score": "0.6125499", "text": "load() {\n\t\t\tconst content = fileSystem.readFileSync(filename, 'utf8');\n\t\t\tconst pkg = JSON.parse(content);\n\t\t\t// if we are in dev mode, merge the two configuration objects so we can override the default values inside config {} with configDev {}\n\t\t\t// otherwise use only the config {}\n\t\t\tconst configDev = inDev ? pkg.configDev : {};\n\t\t\t// extract config object from package.json and add version, and production\n\t\t\tconst production = env === 'production';\n\t\t\tstore = Object.assign({}, pkg.config, configDev, { version: pkg.version, production });\n\t\t\treturn this;\n\t\t}", "title": "" }, { "docid": "3306631a1e23270b2a94f0e4d59fb829", "score": "0.6118546", "text": "async open() {\n if(!fs.existsSync(this.path)) {\n this.init();\n return;\n }\n var buf = fs.readFileSync(this.path);\n this.config = JSON.parse(buf);\n }", "title": "" }, { "docid": "46ded3cf131303223d3c98fb2199a923", "score": "0.61043316", "text": "function load_config(filename) {\n config = YAML.load(filename);\n common_utils.logging_config(config.log_file);\n common_utils.write_log('info', 'load_config', 'SUCCESS', 'Main config loaded!');\n common_utils.write_console('controller.load_config','Main config loaded!');\n return config;\n}", "title": "" }, { "docid": "ffbbc58b4c82ed912a6c001242c2b6c1", "score": "0.6062383", "text": "_importConfig() {\n _userEvents.importConfig();\n }", "title": "" }, { "docid": "7739ed5a2b4c72117bc73fbc7c1fdff8", "score": "0.60438174", "text": "async function loadFromFile() {\n\n const result = await form.loadFileContent($$(`hhm-config-file`));\n\n try {\n // Indirect eval in global scope\n eval.call(null, result);\n } catch (e) {\n alert(`Unable to load config: ${e.message}`);\n return;\n }\n\n if (!HHM.hasOwnProperty(`config`)) {\n alert(`Unable to load config: Config not initialized by uploaded file`);\n return;\n }\n\n HHM.deferreds.configLoaded.resolve();\n}", "title": "" }, { "docid": "a2f50e094d6ab7b458df78d3c7b9c17a", "score": "0.60024375", "text": "function load_file(config, path) {\n\tif(!fs.sync.exists(path)) { return config; }\n\tvar obj = JSON.parse(fs.sync.readFile(path, {'encoding':'utf8'}));\n\treturn merge_config(config, obj);\n}", "title": "" }, { "docid": "b72edc4ee6e7313c91b245bf8024dbab", "score": "0.59663725", "text": "function loadUserConfig() {\n const args = program\n .version('1.0.0')\n .option('-c, --config-file <config-file>', 'Path to user supplied config file')\n .parse(process.argv);\n // Use the specified config, otherwise figure out a reasonable alternative\n if (!args.configFile) {\n // Use the user-config if it exists.\n try {\n fs.accessSync(path.resolve(rootDir, \"UserConfig.js\"));\n args.configFile = path.resolve(rootDir, \"UserConfig.js\");\n }\n catch (err) {\n args.configFile = path.resolve(rootDir, \"Config.js\");\n }\n }\n else {\n args.configFile = path.resolve(rootDir, args.configFile);\n }\n // We should have figured out the config file. See if it's accessible\n try {\n fs.accessSync(args.configFile);\n }\n catch (err) {\n console.log(`Can't access config file: file='${args.configFile}': reason=${err.message}`);\n throw gQuietExitError;\n }\n // And read it in. In this case we rethrow since the full exception is probably helpful\n try {\n return require(args.configFile);\n }\n catch (err) {\n console.log(`Problem loading the configuration: config='${args.configFile}': reason=${err.message}`);\n throw err;\n }\n}", "title": "" }, { "docid": "ba0b528d5dc436bf472e84d76acf0c59", "score": "0.59619623", "text": "function loadConfig(filename, callback) {\n fs.readFile(filename, 'utf-8', (err, data)=>{\n if (err) {\n logger.error('load config error: ', err);\n } else {\n let configs = JSON.parse(data);\n callback(null, configs);\n }\n });\n}", "title": "" }, { "docid": "ab6e49992d748ceda73aafe1f65d439c", "score": "0.5932069", "text": "function loadConfig() {\n\ttry {\n\t\tvar configArgument = argv.config || argv.c || argv._[0];\n\t\tvar configPath = path.resolve(process.cwd(), configArgument);\n\t\tapp.config = require(configPath);\n\t} catch(err) {\n\t\tconsole.error('! failed to load config [%s]', configPath);\n\t\tapp.errorHandler(err);\n\t\tprocess.exit(1);\n\t}\n\tlog.info('loaded config [' + configPath + ']');\n\treturn true;\n}", "title": "" }, { "docid": "9b74ea5c29ad6ba2234e3f00678f437f", "score": "0.5931817", "text": "function loadConfig(path) {\n var glob = require('glob');\n var object = {};\n var key;\n\n glob.sync('*', {cwd: path}).forEach(function(option) {\n key = option.replace(/\\.js$/,'');\n object[key] = require(path + option);\n });\n\n return object;\n}", "title": "" }, { "docid": "ad9a78ba121646f3c8bb6d1d195c3e51", "score": "0.5924912", "text": "function loadConfig() {\n let file = configFile();\n if (file === null)\n file = dirPath + path.sep + \"plip.ini\";\n configFileINI = new IniFile(null, file);\n\n // Automatically load our steps\n loadSteps();\n\n // And our formats\n loadFormats();\n\n // And our options\n let mob = gebi(\"mixOptions\");\n mob.onchange = null;\n let configMixOpt = configFileINI.getValue(\"\", \"gui\", \"mixoptions\");\n if (configMixOpt !== \"\")\n mob.innerText = configMixOpt;\n else\n mob.innerText = defOptions;\n mob.onchange = mixOptionsChange;\n }", "title": "" }, { "docid": "0d3e07e2ff15702aec70d324e3311ebc", "score": "0.59091365", "text": "initConfig() {\n nconf.argv()\n .env()\n .file({ file: './config/config.json' });\n }", "title": "" }, { "docid": "85d0c4ec38ef6f92392bc71ee2afbcb2", "score": "0.58836615", "text": "_populateConfiguration() {\n\n application.info(`_populateConfiguration invoked`);\n\n try {\n let _configFilePath = this._configFilePath;\n \n if(!fs.existsSync(_configFilePath)) {\n throw new Exception(\"Configuration file doesn't exist\");\n }\n\n this._config = JSON.parse(fs.readFileSync(this._configFilePath));\n }\n catch(e) {\n application.severe(`Exception occurred in Config._populateConfiguration() :: ${e}`);\n }\n }", "title": "" }, { "docid": "0f169b09951ca3a2e5c7ac437edd6af0", "score": "0.5871321", "text": "function configFromFile (fileName) {\n // Makse sure the file is a .yml file\n if (!fileName.name.endsWith('.yml')) {\n window.alert('Please select a .yml config file!')\n return\n }\n\n // Show the loader\n loaderVisible(true)\n\n // Read the file\n const fileReader = new FileReader()\n fileReader.onload = (e) => {\n handleConfigLoad(e.target.result)\n }\n fileReader.readAsText(fileName)\n}", "title": "" }, { "docid": "ae66005a81c8618377c3fd1e47e90554", "score": "0.5860734", "text": "function importConfigWeb() {\n return inquirer.prompt([{ type: \"input\", name: \"url\", message: \"Please enter the URL of your config: \" }]).then((answers) => {\n request(answers.url, (error, response, body) => {\n if (error) {\n throw new Error(error);\n }\n const configObject = JSON.parse(body);\n console.log(configObject);\n // Ask for user confirmation\n confirm(\"Here is the config file we parsed, please make sure nothing looks suspicious. Continue?\", () => writeConfig(configObject));\n });\n });\n}", "title": "" }, { "docid": "8d5d2e7057f1472ee6ca1d4dc5906421", "score": "0.58557415", "text": "function load_config_local() {\n try {\n // looking up config-local module using process.cwd() to allow pkg to find it\n // outside the binary package - see https://github.com/vercel/pkg#snapshot-filesystem\n // @ts-ignore\n // eslint-disable-next-line global-require\n const local_config = require(path.join(process.cwd(), 'config-local'));\n if (!local_config) return;\n console.warn('load_config_local: LOADED', local_config);\n if (typeof local_config === 'function') {\n const local_config_func = /** @type {function} */ (local_config);\n local_config_func(config);\n } else if (typeof local_config === 'object') {\n const local_config_obj = /** @type {object} */ (local_config);\n Object.assign(config, local_config_obj);\n } else {\n throw new Error(`Expected object or function to be exported from config-local - ${typeof local_config}`);\n }\n } catch (err) {\n if (err.code !== 'MODULE_NOT_FOUND') throw err;\n }\n}", "title": "" }, { "docid": "ea87a2610d6446fe8876daf95484bcea", "score": "0.58528906", "text": "static loadFileAndPrepare(configJsonFilePath) {\n const configObjectFullPath = path.resolve(configJsonFilePath);\n const configObject = ExtractorConfig.loadFile(configObjectFullPath);\n const packageJsonLookup = new node_core_library_1.PackageJsonLookup();\n const packageJsonFullPath = packageJsonLookup.tryGetPackageJsonFilePathFor(configObjectFullPath);\n const extractorConfig = ExtractorConfig.prepare({\n configObject,\n configObjectFullPath,\n packageJsonFullPath\n });\n return extractorConfig;\n }", "title": "" }, { "docid": "756b0198173a7feed574eefe4cb550bc", "score": "0.5840596", "text": "static readConfig (fileName, extName) {\n // declare\n let newExt = extName\n\n // use default extend name by .yml\n if (!newExt) newExt = '.yml'\n\n // read file stream and parse to a new instance of ConfigMap\n return aq.\n statFile(fileName).\n then(() => aq.readFile(fileName, { encoding: 'utf-8' })).\n then((data) => {\n if (newExt === '.json' || newExt === '.config') {\n return ConfigMap.parseJSON(data)\n }\n\n return ConfigMap.parseYAML(data)\n }).\n catch(() => null)\n }", "title": "" }, { "docid": "203703c76f930c74a386f75f0a80c24f", "score": "0.58381104", "text": "function loadConfig() {\n var config = JSON.parse(fs.readFileSync(__dirname+ '/config.json', 'utf-8'));\n for (var i in config) {\n config[i] = process.env[i.toUpperCase()] || config[i];\n }\n console.log('Configuration');\n console.log(config);\n return config;\n}", "title": "" }, { "docid": "52d8730b7b1719739f46a69f5545da62", "score": "0.5766364", "text": "function loadConfig( path ) {\n var glob = require( \"glob\" );\n var object = {};\n var key;\n\n glob.sync( \"*\", { cwd: path } ).forEach( function( option ) {\n key = option.replace( /\\.js$/, \"\" );\n object[ key ] = require( path + option );\n } );\n\n return object;\n }", "title": "" }, { "docid": "34a5c755374a3ced01f4a76ee5f54e5e", "score": "0.5756673", "text": "function readConfigFile(filename) {\n let data;\n try {\n data = fs.readFileSync(filename, 'utf8');\n } catch (err) {\n console.log(`Configuration file ${filename} not found. ` +\n 'Creating new file.');\n data = JSON.stringify(DEFAULT_CFG, null, 2) + '\\n';\n fs.writeFileSync(filename, data, 'utf8');\n }\n CFG = JSON.parse(data);\n if (!CFG.loginUrl || CFG.loginUrl === DEFAULT_CFG.loginUrl) {\n throw Error(\n `Configuration file ${filename} not configured. ` +\n 'Please edit this file.');\n }\n if (!CFG.loginUrl.endsWith('/')) CFG.loginUrl += '/';\n if (!CFG.staticUrl.endsWith('/')) CFG.staticUrl += '/';\n}", "title": "" }, { "docid": "3bd5f66aff2444e32ee04c8cc670398a", "score": "0.5727613", "text": "function readConfig() {\n return JSON.parse(fs.readFileSync(configPath, 'utf8'));\n }", "title": "" }, { "docid": "fb3ce1f8059ca34fd5e0941c9baf6907", "score": "0.5726227", "text": "function loadConfig(configFile) {\n try {\n return utils.loadYamlSync(configFile)\n } catch (err) {\n err.message = `can not load config file ${configFile}, ${err.message}`\n throw err\n }\n}", "title": "" }, { "docid": "79024912859b9b4851554c618d006b2f", "score": "0.571204", "text": "setConfigFilePath(configFilePath) {\n this._configFileUtil = new ConfigFileUtil(configFilePath);\n }", "title": "" }, { "docid": "b024c3bc911bcdecb8e7c256e48edb8a", "score": "0.5701642", "text": "function loadConfig( path, config ) {\n var glob = require( 'glob' )\n , object = {}\n , key;\n\n glob.sync('*', { cwd: path })\n .forEach(function( option ) {\n key = option.replace( /\\.js$/, '' );\n object[key] = require( path + option )( config );\n });\n\n return object;\n }", "title": "" }, { "docid": "412b08f438060c5c51ea8ab96ec9904e", "score": "0.56930214", "text": "function load() {\n if (!loaded) {\n nconf.file({ \"file\": file, \"search\": true });\n loaded = true;\n }\n}", "title": "" }, { "docid": "6912407c63645e9dc21697914aaaff32", "score": "0.56885874", "text": "static readConfigSync (fileName, extName) {\n let newExt = extName\n\n if (!newExt) newExt = '.yml'\n\n try {\n const fstat = fs.statSync(fileName)\n\n if (!fstat.isFile()) throw new Error(`the ${fileName} is not a file`)\n\n const data = fs.readFileSync(fileName, { encoding: 'utf-8' })\n\n if (newExt === '.json' || newExt === '.config') {\n return ConfigMap.parseJSON(data)\n }\n\n return ConfigMap.parseYAML(data)\n } catch (err) {\n return null\n }\n }", "title": "" }, { "docid": "613050256946b6361a71e6dd60dbd8b8", "score": "0.5687822", "text": "function importConfig(fileInput) {\n\tvar fileExt = fileInput.value.split(\".\").pop();\n\t\n\tif (fileExt.toLowerCase() != \"timer\") {\n\t\treturn alert(\"Unrecognised input. Please upload a valid .timer file.\");\n\t}\n\t\n\tfile = fileInput.files[0];\n\t\n\tconst reader = new FileReader();\n\treader.readAsText(file);\n\t\n\treader.onload = () => {\n\t\tvar config = JSON.parse(reader.result);\n\t\t\n\t\t// Set mode settings\n\t\tmode = config.mode;\n\t\tvar options = modeCtrl.querySelectorAll(\"option\");\n\t\toptions[0].selected = (mode == modes.INTERVIEW) ? true : false;\n\t\toptions[1].selected = (mode == modes.EXAM) ? true : false;\n\t\toptions[2].selected = (mode == modes.COUNTDOWN) ? true : false;\n\n\t\t// Set bell volume settings\n\t\tbell.volume = config.volume;\n\t\tvolumeCtrl.value = bell.volume;\n\t\tsetBubblePos(volumeCtrl, volumeCtrl.parentNode.querySelector(\".bubble\"));\n\t\t\n\t\t// Set interview interval settings\n\t\tinterval = config.interval;\n\t\tintervalCtrl.value = interval;\n\t\tsetBubblePos(intervalCtrl, intervalCtrl.parentNode.querySelector(\".bubble\"));\n\t\t\n\t\t// Set starting time settings\n\t\tstartingTime = config.startingTime;\n\t\tstartingTimeCtrl.value = startingTime;\n\t\t\n\t\t// Hide/show certain controls depending on the mode specified in the config file\n\t\tintervalCtrl.parentNode.parentNode.parentNode.style.display = (config.mode == modes.INTERVIEW ? \"inline-block\" : \"none\");\n\t\tblockCtrl.parentNode.parentNode.style.display = (config.mode == modes.EXAM ? \"inline-block\" : \"none\");\n\n\t\tif (mode == modes.EXAM) {\n\t\t\texamBlocks = config.examBlocks;\n\n\t\t\t// Delete all existing exam rows\n\t\t\tvar trs = document.querySelectorAll(\".examRow\");\n\t\t\ttrs.forEach(tr => tr.remove());\n\n\t\t\t// Construct new exam rows from data specified in the config file\n\t\t\tcreateExamBlockRows(examBlocks);\n\t\t\tupdateTotalExamTime();\n\t\t}\n\t\t\n\t\tif (mode == modes.COUNTDOWN) {\n\t\t\tstartingTimeCtrl.parentNode.parentNode.style.display = \"none\";\n\t\t\tdocument.querySelector(\"#countdownRow\").style.display = \"inline-block\";\n\n\t\t\tcdTitleCtrl.parentNode.parentNode.style.display = \"inline-block\";\n\t\t\tcdDescriptionCtrl.parentNode.parentNode.style.display = \"inline-block\";\n\t\t\t\n\t\t\tcdMins = config.cdMins;\n\t\t\tcdMinsCtrl.value = cdMins;\n\t\t\t\n\t\t\tcdSecs = config.cdSecs;\n\t\t\tcdSecsCtrl.value = cdSecs;\n\n\t\t\tcdTitle = config.cdTitle;\n\t\t\tcdTitleCtrl.value = cdTitle;\n\n\t\t\tcdDescription = config.cdDescription;\n\t\t\tcdDescriptionCtrl.value = cdDescription;\n\t\t}\n\n\t\t// Enable the START button\n\t\tdocument.querySelector(\"#startButton\").disabled = false;\n\t}\n\n\treader.onerror = () => {\n\t\t// TODO: more insightful error messages\n\t\talert(\"Error - please retry\")\n\t}\n}", "title": "" }, { "docid": "8d7c4aa70953f3539d1663adf3e2496a", "score": "0.5682352", "text": "function loadConfigFile() {\n var configFile = resource.resolve('conf', 'config.json');\n if (configFile) {\n try {\n /* jsonminify will remove comments from the string before it's parsed */\n return JSON.parse(jsonminify(fs.readFileSync(configFile).toString()));\n }\n catch (e) {\n log.error(TAG, \"failed to parse config file at\", resource.resolve('conf', 'config.json'),\n \"\\n\\nwhile config.json *does* allow for comments, please ensure that\\n (1) all keys are\",\n \"strings\\n (2) there are no trailing commas\\n (3) the value 'undefined' is not used.\",\n \"\\n\\nautom8 will not start until config.json is valid. exiting now.\");\n\n process.exit(1);\n }\n }\n\n return { };\n}", "title": "" }, { "docid": "113402172902a8e945f2733de1ef23c1", "score": "0.5664997", "text": "processConfig() {\n this.store.dispatch(\n importConfig(\n deepmerge(getConfigFromPlugins(this.plugins), this.config),\n ),\n );\n }", "title": "" }, { "docid": "81e5411685e21d4a4655c6fe32bc1515", "score": "0.56167597", "text": "function loadConfig(path) {\n\tvar object = {};\n\tvar key;\n\n\tgrunt.file.expand({ cwd: path + '/' }, '*.{js,txt}').forEach(function(filename) {\n\t\tkey = filename.replace(/\\.[^.]+$/,'');\n\n\t\tif (filename.indexOf('.txt') >= 0) {\n\t\t\tobject[key] = grunt.file.read(path + '/' + filename);\n\t\t}\n\t\telse {\n\t\t\tobject[key] = require(path + '/' + filename);\n\t\t}\n\t});\n\n\treturn object;\n}", "title": "" }, { "docid": "1f9b6f99d20030d8531df9eaa8f12806", "score": "0.55965835", "text": "function setConfig() {\n\n\n if (fs.existsSync('./package.json')) {\n config = JSON.parse(fs.readFileSync('./package.json')).config;\n } else {\n\n config = {};\n }\n}", "title": "" }, { "docid": "5a93fa6cb6a06fb433762a48c8cc2de3", "score": "0.5575585", "text": "function loadConfig() {\n log( 'Loading config file...' );\n\n if ( checkFileExists( 'config.yml' ) ) {\n // config.yml exists, load it\n log( colors.bold( colors.cyan( 'config.yml' ) ),'exists, loading',colors.bold( colors.cyan( 'config.yml' ) ) );\n let ymlFile = fs.readFileSync( 'config.yml','utf8' );\n return yaml.load( ymlFile );\n\n } else if ( checkFileExists( 'config-default.yml' ) ) {\n // config-default.yml exists, load it\n log( colors.bold( colors.cyan( 'config.yml' ) ),'does not exist, loading',colors.bold( colors.cyan( 'config-default.yml' ) ) );\n let ymlFile = fs.readFileSync( 'config-default.yml','utf8' );\n return yaml.load( ymlFile );\n\n } else {\n // Exit if config.yml & config-default.yml do not exist\n log( 'Exiting process, no config file exists.' );\n log( 'Error Code:',err.code );\n process.exit( 1 );\n }\n}", "title": "" }, { "docid": "ebc3bfe2d198b68ccf5edf7f41033b82", "score": "0.5561757", "text": "async load(path) {\n return new Promise((resolve, reject) => {\n fs.readFile(path, (err, data) => {\n if (err) {\n reject(err.message);\n } else {\n const configJson = JSON.parse(data.toString());\n if(configJson.websites) {\n _.forEach(configJson.websites, (website, url) => {\n this.setWebsite(url, website);\n });\n } else {\n reject('No `websites` field in config');\n }\n resolve();\n }\n });\n });\n }", "title": "" }, { "docid": "98f43c47d44d9915a6feb84e5dfbcc14", "score": "0.5556872", "text": "function loadConfigForEnv(baseDir, env) {\n\t\tvar globPattern = baseDir + '/**/*.' + env + '.js*';\n\t\tutils.getGlobbedFiles(globPattern).forEach(function (filePath) {\n\t\t\tdebug('loadConfigFrom: %s', filePath);\n\t\t\t_.merge(config, require(filePath));\n\t\t});\n\t}", "title": "" }, { "docid": "e6e403f5f0e2eb91d610db9536768cc6", "score": "0.5513149", "text": "read() {\n try {\n if (!fs.existsSync(this.file)) {\n console.warn(`Config file ${this.file} does not exist! Generating one...`)\n fs.writeFileSync(this.file, JSON.stringify({}))\n }\n\n const fileStr = fs.readFileSync(this.file)\n const fileData = JSON.parse(fileStr)\n\n if (fileData[this.set]) {\n this.conf = fileData[this.set]\n } else {\n console.warn(\n `Config file ${this.file} does not contain configuration set '${this.set}'! Generating one...`\n )\n this.conf = this.initParamSet()\n this.write()\n }\n } catch (err) {\n console.error(\"Failed to read config file \" + this.file, err)\n //throw new Error(err)\n }\n }", "title": "" }, { "docid": "690c4dad4042789792674a4303248b45", "score": "0.54974073", "text": "function prepareConfig() {\n\tconst rc = require('../.eslintrc');\n\n\t// Minor future-proofing: deal with array or string \"extends\" property.\n\n\tconst extendsArray = Array.isArray(rc.extends) ? rc.extends : [rc.extends];\n\n\trc.extends = extendsArray.map(config => {\n\t\tif (config === 'liferay') {\n\t\t\treturn path.join(__dirname, '../index.js');\n\t\t} else {\n\t\t\treturn config;\n\t\t}\n\t});\n\n\treturn rc;\n}", "title": "" }, { "docid": "6b6736f2cc14d3c07a96f1bb34216343", "score": "0.5493399", "text": "loadConfig() {\n this.loadPlugin();\n super.loadConfig();\n }", "title": "" }, { "docid": "a86aa9a755959b96bf4435407831d353", "score": "0.54885584", "text": "config () {\n let content = fs.readFileSync(path.join(projectPath(), 'dynappconfig.json'), 'utf8');\n return JSON.parse(content);\n }", "title": "" }, { "docid": "fa4d48ef4c9ec7486c180c31abc3bede", "score": "0.54675233", "text": "function readConfig(){\n\tconfigJson = JSON.parse(fs.readFileSync('./configs/config.json', 'utf8'));\t//read config.json and store it to var configJson\n\tinverterConfig= configJson.inverter;\t\t\t\t\t\t\t\t\t\t//read Inverter\t\n\tpowerMeterConfig= configJson.powerMeter;\t\t\t\t\t\t\t\t\t//read powerMeter\n\tdevicesConfig= configJson.devices;\t\t\t\t\t\t\t\t\t\t\t//read devices\n\tsolarmanagerConfig = configJson.solarmanager;\t\t\t\t\t\t\t\t//read basic Solarmanager configs\n}", "title": "" }, { "docid": "91cb4bd4784ec85bc5d1174940869afa", "score": "0.5462797", "text": "function loadAppSettings() {\n var settingsPath = path.join(__dirname, 'config', 'settings.json');\n if (!fs.existsSync(settingsPath)) {\n var msg = \"App settings file \\\"\" + settingsPath + \"\\\" not found.\";\n console.error(msg);\n throw new Error(msg);\n }\n try {\n var settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8') || '{}');\n var settingsOverrides = process.env['DATALAB_SETTINGS_OVERRIDES'];\n if (settingsOverrides) {\n // Allow overriding individual settings via JSON provided as an environment variable.\n var overrides = JSON.parse(settingsOverrides);\n Object.assign(settings, overrides);\n }\n return settings;\n }\n catch (e) {\n console.error(e);\n throw new Error(\"Error parsing settings overrides: \" + e);\n }\n}", "title": "" }, { "docid": "728e6ddac7e7e8acf8d2cbdf69ff0765", "score": "0.54603434", "text": "function loadConfig(configFileName) {\n\n var configFileExists = fs.existsSync(configFileName);\n\n if (! configFileExists) {\n var errorMsg = util.format(\"couldn't find log config file: %s\", configFileName);\n console.error(errorMsg);\n throw errorMsg;\n }\n\n var data = fs.readFileSync(configFileName, 'utf8');\n\n var candidateConfig = JSON.parse(data);\n\n //console.dir(candidateConfig);\n\n if (!isValidConfig(candidateConfig)) {\n var errorMsg = util.format('invalid config json: %s', candidateConfig);\n console.error(errorMsg);\n throw errorMsg;\n }\n\n _loggerConfig = candidateConfig;\n\n // use the config to recreate the real logger object\n _theRealLogger = createLogger();\n\n}", "title": "" }, { "docid": "8c08dbbd7751ec7a95eb37cca71d8bc4", "score": "0.545721", "text": "function load_config(){\n S.config = K.config.fetch();\n return S.config;\n }", "title": "" }, { "docid": "53f97ef7b99ef4a41579527308412adb", "score": "0.54395103", "text": "function load({\n path,\n overrides = {},\n reload = false,\n bail = false,\n print = false\n} = {}) {\n var _Array$from;\n\n // load cached config; when no path is specified, get the last config cached\n let config = path ? cache.get(path) : (_Array$from = Array.from(cache)[cache.size - 1]) === null || _Array$from === void 0 ? void 0 : _Array$from[1];\n let infoDebug = print ? 'info' : 'debug';\n let errorDebug = print ? 'error' : 'debug';\n let log = (0, _logger.default)('config'); // load config or reload cached config\n\n if (path !== false && (!config || reload)) {\n try {\n let result = search(path);\n\n if (result.config) {\n log[infoDebug](`Found config file: ${(0, _path.relative)('', result.filepath)}`);\n let version = parseInt(result.config.version, 10);\n\n if (Number.isNaN(version)) {\n log.warn('Ignoring config file - missing or invalid version');\n } else if (version > 2) {\n log.warn(`Ignoring config file - unsupported version \"${version}\"`);\n } else {\n if (version < 2) {\n log.warn('Found older config file version, please run ' + '`percy config:migrate` to update to the latest version');\n }\n\n config = (0, _migrate.default)(result.config);\n cache.set(path, config);\n }\n } else {\n log[infoDebug]('Config file not found');\n }\n } catch (error) {\n log[errorDebug](error);\n }\n } // merge found config with overrides and validate\n\n\n config = (0, _normalize.default)(config, {\n overrides\n });\n let validation = config && (0, _validate.default)(config);\n\n if (validation && !validation.result) {\n log.warn('Invalid config:');\n\n for (let {\n message,\n path\n } of validation.errors) {\n log.warn(`- ${path.join('.')}: ${message}`);\n let [k, t] = [path.pop(), path.reduce((d, p) => d[p], config)];\n if (t && k in t) delete t[k];\n }\n\n if (bail) return;\n } // normalize again to remove empty values for logging\n\n\n config = (0, _normalize.default)(config);\n if (config) log[infoDebug](`Using config:\\n${(0, _stringify.inspect)(config)}`); // merge with defaults\n\n return (0, _defaults.default)(config);\n}", "title": "" }, { "docid": "6995f031900e13428f9f7ffdeadc8dfb", "score": "0.5439412", "text": "function fnLoadConfig(){\n // if there's a \"/share/config.json\" file, try to read from it\n if (fs.existsSync(\"/share/config.json\")){\n try {\n const raw = fs.readFileSync(\"/share/config.json\", \"utf8\");\n const parsed = JSON.parse(raw);\n return { config: parsed, rawConfig: raw };\n }\n catch (error){\n return { config: false, rawConfig: false };\n }\n }\n // otherwise, try to read from \"/share/remote-api.config.json\",\n // in case \"/share/config.gen.js\" is missing and Remote API is running\n else if (fs.existsSync(\"/share/config.gen.js\") !== true && fs.existsSync(\"/startup/remote-api.started\")) {\n try {\n const raw = fs.readFileSync(\"/share/remote-api.config.json\", \"utf8\");\n const parsed = JSON.parse(raw);\n return { config: parsed, rawConfig: raw };\n }\n catch (error){\n return { config: false, rawConfig: false };\n }\n }\n\n return { config: false, rawConfig: false };\n}", "title": "" }, { "docid": "21bf504c384ff7d65a8396672c1238bc", "score": "0.5431052", "text": "getConfig(configName) {\n\t\tconst environment = process.env.ENVIROMENT;\n\t\treturn require(`../../configs/${environment.toLowerCase()}/${configName}.config.js`);\n\t}", "title": "" }, { "docid": "9c6727e4df2dd12f7970b3d10c165857", "score": "0.54124594", "text": "constructor() {\n this.config = configjson.config\n }", "title": "" }, { "docid": "7424c456a1ab3dbe59239cb4a25b0ade", "score": "0.54113716", "text": "static loadConfigObject(jsonConfigFile) {\r\n // Set to keep track of config files which have been processed.\r\n const pathSet = new Set();\r\n // Get absolute path of config file.\r\n let currentConfigFilePath = path.resolve(process.cwd(), jsonConfigFile);\r\n pathSet.add(currentConfigFilePath);\r\n const originalConfigFileFolder = path.dirname(currentConfigFilePath);\r\n let extractorConfig = node_core_library_1.JsonFile.load(jsonConfigFile);\r\n while (extractorConfig.extends) {\r\n if (extractorConfig.extends.match(/^\\./)) {\r\n // If extends has relative path.\r\n // Populate the api extractor config path defined in extends relative to current config path.\r\n currentConfigFilePath = path.resolve(originalConfigFileFolder, extractorConfig.extends);\r\n }\r\n else {\r\n // If extends has package path.\r\n currentConfigFilePath = resolve.sync(extractorConfig.extends, {\r\n basedir: originalConfigFileFolder\r\n });\r\n }\r\n // Check if this file was already processed.\r\n if (pathSet.has(currentConfigFilePath)) {\r\n throw new Error(`The API Extractor config files contain a cycle. \"${currentConfigFilePath}\"`\r\n + ` is included twice. Please check the \"extends\" values in config files.`);\r\n }\r\n pathSet.add(currentConfigFilePath);\r\n // Remove extends property from config for current config.\r\n delete extractorConfig.extends;\r\n // Load the extractor config defined in extends property.\r\n const baseConfig = node_core_library_1.JsonFile.load(currentConfigFilePath);\r\n lodash.merge(baseConfig, extractorConfig);\r\n extractorConfig = baseConfig;\r\n }\r\n // Validate if the extractor config generated adheres to schema.\r\n Extractor.jsonSchema.validateObject(extractorConfig, jsonConfigFile);\r\n return extractorConfig;\r\n }", "title": "" }, { "docid": "d43d61547b77908da3d9b06e6f7100cb", "score": "0.5405994", "text": "function parseConfig(filename, effects) {\n return readData(filename, effects.reader)\n .chain(parseJSON)\n .chain(parse);\n}", "title": "" }, { "docid": "06a0048f923a224df0b08e92a14acbb1", "score": "0.54024523", "text": "async open () {\n this.settings = JSON.parse(await this.config.fs.readFile(`${this.config.path}/settings.json`))\n return this\n }", "title": "" }, { "docid": "e3330dbca065c7f8f2fac1f482c3c67f", "score": "0.5343597", "text": "function _loadProjectConfig() {\n\n var projectRootEntry = ProjectManager.getProjectRoot(),\n result = new $.Deferred(),\n file,\n config;\n\n file = FileSystem.getFileForPath(projectRootEntry.fullPath + _configFileName);\n file.read(function (err, content) {\n if (!err) {\n var cfg = {};\n try {\n config = JSON.parse(content);\n } catch (e) {\n console.error(\"CSSLint: Error parsing \" + file.fullPath + \". Details: \" + e);\n result.reject(e);\n return;\n }\n cfg.options = config;\n result.resolve(cfg);\n } else {\n result.reject(err);\n }\n });\n return result.promise();\n }", "title": "" }, { "docid": "68e54de4c7f71acaccdfa57829706967", "score": "0.5335817", "text": "loadConfig() {\r\n let that = this,\r\n configFileDir,\r\n configFileName = 'config.ini'\r\n \r\n \r\n if (typeof cordova !== 'undefined') {\r\n configFileDir = cordova.file.externalDataDirectory\r\n \r\n console.log('----------- LOADING CONFIG -----------')\r\n console.log('loading config from ' + configFileDir + configFileName)\r\n \r\n window.resolveLocalFileSystemURL(configFileDir, function (directoryEntry) {\r\n File.directoryGetFile(directoryEntry, configFileName, function (file) {\r\n let reader = new FileReader()\r\n reader.onloadend = function (evt) {\r\n console.log('on load end')\r\n that.parseConfigFile(reader, function (context, dataDir, fileName) {\r\n console.log(dataDir)\r\n console.log(fileName)\r\n })\r\n }\r\n reader.readAsText(file)\r\n }, { create: false, exclusive: true })\r\n }, function (error) {\r\n console.log('Error - ', error)\r\n console.log(cordova.file.externalDataDirectory + 'data')\r\n })\r\n }\r\n }", "title": "" }, { "docid": "d9ff9a904d3e33f34b7381939d280286", "score": "0.53294456", "text": "loadConfiguration() {\r\n const Setting = require('service-lib-node').Setting; \r\n // create an array of settings and add to the config object\r\n // p, w, o, c parameters are already assigned in base object - see service-lib-node::config for these parameters\r\n\r\n let settings = [];\r\n /* ADD SETTINGS HERE\r\n settings.push(new Setting(\"srcEndpoint\", \"chatter.tsafe.io\", \"SOURCE_ENDPOINT\", \"e\"));\r\n */ \r\n\r\n\r\n //Audit Settings\r\n settings.push(new Setting(\"auditEndpoint\", \"localhost\", \"AUDIT_ENDPOINT\", \"e\"));\r\n settings.push(new Setting(\"auditPort\", \"14000\", \"AUDIT_PORT\", \"a\"));\r\n \r\n config.addSettings(settings);\r\n\r\n config.addSettings({\r\n \"auditConnectionString\": {\r\n get: () => {\r\n let returnVal = `http://${config.settings.auditEndpoint}:${config.settings.auditPort}`;\r\n debug(`auditConnectionString = ${returnVal}`);\r\n return returnVal;\r\n }\r\n }\r\n });\r\n \r\n // LIST SECRET ITEMS THAT SHOULD NOT BE EXPOSED SUCH AS PASSWORDS - this avoids passwords being displayed on the status page\r\n config.secureArray = _.union(config.secureArray, [/*\"srcPassword\", \"destPassword\"*/]);\r\n\r\n /*\r\n if exists, overwrite all settings with a configuration file\r\n the default config file path is \"./config.yaml\" relative to the ${workspace} directory\r\n consider using a different config file for each stack ie: config-dev.yaml, config-qa.yaml, config-staging.yaml, etc\r\n ths format is simply\r\n variable: value\r\n \r\n USING A CONFIG FILE IS THE PREFERRED METHOD FOR SETTING VARIABLES\r\n */\r\n config.loadConfigsFile(config.settings.configFile);\r\n \r\n }", "title": "" }, { "docid": "52451341ce2baa504fdd85d235fd7487", "score": "0.53231245", "text": "_read_config_file() {\n try {\n const file_config = yaml.readSync(this.config_file_path);\n\n if (file_config === undefined)\n return;\n\n for (const [flattened_key, value] of Object.entries(flatten_object(file_config))) {\n if (value === '')\n continue;\n\n this._set_option(flattened_key, value);\n }\n } catch (msg) {\n console.warn(msg);\n }\n }", "title": "" }, { "docid": "a40674c7d9fecfa56f8422419a424592", "score": "0.53160363", "text": "function loadDevConfig() {\n if(fs.existsSync(\"dev_config.json\")) {\n let json = fs.readFileSync(\"dev_config.json\");\n return JSON.parse(json);\n }\n return {};\n}", "title": "" }, { "docid": "116723136f5ba70a3e359b21a38d908f", "score": "0.5315255", "text": "function settingsImport() {\n parts.jsonParser.select.click();\n // select and import file\n let selected = setInterval(() => {\n if (parts.jsonParser.textarea.value != \"\") {\n clearInterval(selected);\n selected = null;\n parts.jsonParser.import.click();\n let imported = JSON.parse(imports[0]);\n // check serialization type and if it has the minimum required token\n if (imported.constructor === Object && imported.hasOwnProperty('userId')) {\n let needed = Object.keys(client);\n for (let property in imported) {\n // exclude unknown properties\n if (needed.includes(property)) {\n client[property] = imported[property]; \n localStorage.setItem(property, imported[property]);\n } else {\n console.warn('Unknown property in imported User Configuration: ' + property);\n }\n }\n THIS.notify(L10N.generic.clientCheck.user.settings.import.success[LANG]);\n } else return THIS.notify(L10N.generic.clientCheck.user.settings.import.error[LANG]);\n // always delete user config from imports after finishing processing it\n // to prevent unexpected error showing to the user from other component(s)\n imports.unshift();\n }\n }, 250);\n // clear the interval after 3m if the user didn't select any file or\n // clicked cancel, there isn't any way to know if the user hit cancel\n setTimeout(() => {\n if(selected != null) {\n clearInterval(selected);\n console.warn('Data could not be retrieved, fetching was canceled after 3 minutes.');\n }\n }, 18e+4);\n }", "title": "" }, { "docid": "f6382544aac0f0907f5a812137d83b0f", "score": "0.5309129", "text": "function requireConfig(path) {\n try {\n return require('../studio/sanity.json')\n } catch (e) {\n console.error('Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js')\n return {\n api: {\n projectId: process.env.SANITY_PROJECT_ID || 'gt1ynhdo',\n dataset: process.env.SANITY_DATASET || 'production',\n },\n }\n }\n}", "title": "" }, { "docid": "e769543762bc0b5914aad5135a8bfcc1", "score": "0.53057134", "text": "function requireConfig(path) {\n try {\n return require('../studio/sanity.json')\n } catch (e) {\n console.error(\n 'Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js'\n )\n return {\n api: {\n projectId: process.env.SANITY_PROJECT_ID || '',\n dataset: process.env.SANITY_DATASET || ''\n }\n }\n }\n}", "title": "" }, { "docid": "86ef8884c1a24345c12b94d75af0d092", "score": "0.5305184", "text": "_fromDirectory(directory) {\n debug('init from directory')\n const bases = this._requireDir(directory, { excludes: [this._envDir] })\n debug('config:', bases)\n Object.assign(this._store, bases)\n Object.assign(this._store, this._loadEnvDirectory(path.join(directory, this._envDir)))\n }", "title": "" }, { "docid": "1790ad3735709f1e37be2997d009bcac", "score": "0.529512", "text": "function readConfigData() {\n var file = fs.readFileSync(configFile, { encoding: 'utf-8' });\n configData = JSON.parse(stripJsonComments(file).replace(/\\s+/g, \" \"));\n configData.bundles = configData.bundles || [];\n configData.directories = configData.directories || {};\n configData.directories.assets = configData.directories.assets || [];\n configData.directories.cleanCss = configData.directories.cleanCss || [];\n configData.directories.cleanJs = configData.directories.cleanJs || [];\n configData.directories.watch = configData.directories.watch || [];\n configData.sass = configData.sass || {};\n configData.sass.main = configData.sass.main || \"\";\n configData.sass.filename = configData.sass.filename || \"null.css\";\n configData.sass.includePaths = configData.sass.includePaths || [];\n configData.packageManager = configData.packageManager || {};\n configData.packageManager.variables = configData.packageManager.variables || {};\n configData.packageManager.cssBundles = configData.packageManager.cssBundles || [];\n\n return configData;\n}", "title": "" }, { "docid": "9261bf3834fdcb5dc8aa42d9bf7d8211", "score": "0.52923405", "text": "function requireConfig(path) {\r\n try {\r\n return require('../studio/sanity.json')\r\n } catch (e) {\r\n console.error(\r\n 'Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js'\r\n )\r\n return {\r\n api: {\r\n projectId: process.env.GATSBY_SANITY_PROJECT_ID || '',\r\n dataset: process.env.GATSBY_SANITY_DATASET || ''\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9261bf3834fdcb5dc8aa42d9bf7d8211", "score": "0.52923405", "text": "function requireConfig(path) {\r\n try {\r\n return require('../studio/sanity.json')\r\n } catch (e) {\r\n console.error(\r\n 'Failed to require sanity.json. Fill in projectId and dataset name manually in gatsby-config.js'\r\n )\r\n return {\r\n api: {\r\n projectId: process.env.GATSBY_SANITY_PROJECT_ID || '',\r\n dataset: process.env.GATSBY_SANITY_DATASET || ''\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "13a6dbcd233883aaeccd99ff7d126a69", "score": "0.52882266", "text": "readFile(file, container, logger, seen) {\n if (seen.has(file)) {\n logger.error(`Tried to load the options file ${(0, paths_1.nicePath)(file)} multiple times.`);\n return;\n }\n seen.add(file);\n let fileContent;\n if (file.endsWith(\".json\")) {\n const readResult = typescript_1.default.readConfigFile((0, paths_1.normalizePath)(file), (path) => FS.readFileSync(path, \"utf-8\"));\n if (readResult.error) {\n logger.error(`Failed to parse ${(0, paths_1.nicePath)(file)}, ensure it exists and contains an object.`);\n return;\n }\n else {\n fileContent = readResult.config;\n }\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n fileContent = require(file);\n }\n if (typeof fileContent !== \"object\" || !fileContent) {\n logger.error(`The root value of ${(0, paths_1.nicePath)(file)} is not an object.`);\n return;\n }\n // clone option object to avoid of property changes in re-calling this file\n const data = { ...fileContent };\n delete data[\"$schema\"]; // Useful for better autocompletion, should not be read as a key.\n if (\"extends\" in data) {\n const resolver = (0, module_1.createRequire)(file);\n const extended = getStringArray(data[\"extends\"]);\n for (const extendedFile of extended) {\n let resolvedParent;\n try {\n resolvedParent = resolver.resolve(extendedFile);\n }\n catch {\n logger.error(`Failed to resolve ${extendedFile} to a file in ${(0, paths_1.nicePath)(file)}`);\n continue;\n }\n this.readFile(resolvedParent, container, logger, seen);\n }\n delete data[\"extends\"];\n }\n for (const [key, val] of Object.entries(data)) {\n try {\n container.setValue(key, val, (0, path_1.resolve)((0, path_1.dirname)(file)));\n }\n catch (error) {\n (0, assert_1.ok)(error instanceof Error);\n logger.error(error.message);\n }\n }\n }", "title": "" }, { "docid": "9dfc041d6e881a7a0a75cf91d7c45304", "score": "0.52805895", "text": "function initConfigFile () {\n if (fs.existsSync(configpath)) {\n errorExit('config file already exists')\n }\n\n var sample = {\n colors: {\n alisongreen: 'rgb(125,199,53)',\n js: 'orchid',\n html: 'gold',\n server: 'alisongreen',\n papayawhip: null\n }\n }\n\n writeJSON(configpath, sample)\n}", "title": "" }, { "docid": "ecebcf67146c0daf8a0cd706dbd029e2", "score": "0.5272441", "text": "function importConfigFile() {\n console.log(\"Opened file dialog to import configuration.\");\n input2.click();\n}", "title": "" }, { "docid": "b59ba62f5dcca42a5ad4562e2a34600b", "score": "0.52720976", "text": "function resolveConfig (file, callback) {\n\t\t\tdebug('resolve config data from file ' + file);\n\t\t\tfs.exists(file, function (exists){\n\t\t\t\tdebug('File ' + file + ' exists : ' + exists);\n\t\t\t\tif (exists) {\n\n\t\t\t\t\tvar jsonOut;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tjsonOut = JSON.parse(jsonminify(fs.readFileSync(file, 'utf8')));\n\t\t\t\t\t} catch (jsonErr) {\n\t\t\t\t\t\tcallback(jsonErr);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Shortstop Resolver.\n\t\t\t\t\tthat._resolver.resolve(jsonOut, function (err, data) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tdebug('resolver error ' + err);\n\t\t\t\t\t\t\tcallback(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdebug('resolved data: ' + JSON.stringify(data));\n\t\t\t\t\t\t\tthat._config.use(file, {\n\t\t\t\t\t\t\t\ttype: 'literal',\n\t\t\t\t\t\t\t\tstore: data\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\n\t\t\t\t} else {\n\t\t\t\t\tcallback(new Error(\"Config file \" + file + \" does not exists\"));\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "d67ed11fdc90c67ed00443340baec7b2", "score": "0.5269548", "text": "function db_import(config, src) {\n\n var cmd;\n\n // 1) Create cmd string from Lo-Dash template\n var tpl_mysql = grunt.template.process(tpls.mysql, {\n data: {\n host: config.host,\n user: config.user,\n pass: config.pass,\n database: config.database,\n path: src\n }\n });\n\n\n // 2) Test whether target MYSQL DB is local or whether requires remote access via SSH\n if (typeof config.ssh_host === \"undefined\") { // it's a local connection\n grunt.log.writeln(\"Importing into local database\");\n cmd = tpl_mysql + \" < \" + src;\n } else { // it's a remote connection\n var tpl_ssh = grunt.template.process(tpls.ssh, {\n data: {\n host: config.ssh_host\n }\n });\n\n grunt.log.writeln(\"Importing DUMP into remote database\");\n\n cmd = tpl_ssh + \" '\" + tpl_mysql + \"' < \" + src;\n }\n\n // Execute cmd\n shell.exec(cmd);\n\n grunt.log.oklns(\"Database imported succesfully\");\n }", "title": "" }, { "docid": "2f451e669b91d4397a23bd32e0e562fd", "score": "0.5260839", "text": "constructor() {\n // Sets settings directory as `~/.reguilded/settings`\n this.directory = join(__dirname, \"../../settings\");\n // Set its configuration\n this.config = require(join(this.directory, \"settings.json\"));\n }", "title": "" }, { "docid": "8eea3324f071f95b76896a199f213b8a", "score": "0.5247595", "text": "addConfig(loc) {\n if (this.resolvedConfigs.indexOf(loc) >= 0) return;\n\n var content = fs.readFileSync(loc, \"utf8\");\n var opts;\n\n try {\n opts = jsonCache[content] = jsonCache[content] || JSON.parse(stripJsonComments(content));\n } catch (err) {\n err.message = `${loc}: ${err.message}`;\n throw err;\n }\n\n this.mergeOptions(opts, loc);\n this.resolvedConfigs.push(loc);\n }", "title": "" }, { "docid": "41cda5048369d704f1d76301114835d8", "score": "0.5245838", "text": "function load (path, parserName) {\n var ext = null;\n parserName = parserName || '';\n if (path.indexOf('/') === -1) {\n path = defaultDir + '/' + path;\n }\n\n if (cache[path]) {\n return cache[path];\n }\n\n var lindex = path.lastIndexOf('.');\n if (lindex === -1) {\n ext = (parserName.length)\n ? parserName\n : null;\n } else {\n ext = path.substr(lindex + 1);\n }\n\n if (! ext || ! parsers[ext]) {\n throw new Error('Cannot read configuration: Unsupported file type');\n } else {\n try {\n var raw = fs.readFileSync(path, { encoding:'utf8' });\n cache[path] = parsers[ext](raw);\n deepfreeze(cache[path]);\n } catch (e) {\n throw new Error('Cannot read configuration file: ' + path)\n }\n }\n\n return cache[path];\n}", "title": "" }, { "docid": "e920eafee90221784538b9de90b6ca38", "score": "0.52386487", "text": "function createFromFile(_file, serviceName, options) {\n 'use strict';\n\n let file = _file;\n if (process.env.CONFIG_FILE) {\n file = process.env.CONFIG_FILE;\n }\n\n console.log('****Configuration File is:%s this can be changed using the CONFIG_FILE env', file);\n\n let configFile = fs.readFileSync(file).toString();\n\n return createFromYAML(configFile, serviceName, options);\n}", "title": "" }, { "docid": "b3163813e158d5a9164067861893985e", "score": "0.5234506", "text": "constructor () {\n // Read in the config details from the file system\n const configFile = path.join(rootDir, 'config.json')\n if (!fs.existsSync(configFile)) {\n const crypto = require('crypto')\n const handshake = crypto\n .createHash('md5')\n .update(`${Math.random()}`)\n .digest('hex')\n this.set('handshake', handshake)\n }\n\n // Read in the config file\n const configRaw = fs.readFileSync(configFile, 'utf-8')\n const configJSON = JSON.parse(configRaw)\n Object.assign(this, configJSON)\n }", "title": "" }, { "docid": "1b76370ace53ce9421d76c1885a0f486", "score": "0.5230308", "text": "constructor() {\n\t\trequire('dotenv').config();\n\t}", "title": "" }, { "docid": "77e09ec5e0322364e8e4cbbb2d7b67ec", "score": "0.5230224", "text": "_getConfiguration(path) {\n return __awaiter(this, void 0, void 0, function* () {\n const prettierConfig = yield this._getPrettierConfiguration(path);\n const localConfig = yield this._getLocalConfiguration(path);\n return lodash.defaultsDeep({\n importStringConfiguration: {\n quoteMark: prettierConfig.singleQuote ? 'single' : undefined,\n tabSize: prettierConfig.tabWidth,\n maximumNumberOfImportExpressionsPerLine: {\n count: prettierConfig.printWidth\n },\n trailingComma: prettierConfig.trailingComma\n ? prettierConfig.trailingComma\n : undefined,\n hasSemicolon: typeof prettierConfig.semi !== 'undefined' ? prettierConfig.semi : undefined\n }\n }, localConfig, this._getDefaultConfiguration());\n });\n }", "title": "" }, { "docid": "c6ad5adb776e6a712e40748d1d64c8ee", "score": "0.5219248", "text": "function loadConfig() {\n\t//Can be encapsulated in getInfo()\n\tvar data = getInfo('Config');\n\t\n\t//Remove imageDatabase\n\timageDatabase = data[\"imageDatabase\"];\n\tdatabaseLocation = data[\"databaseLocation\"];\n}", "title": "" }, { "docid": "776d37ba1156c7c085d4a3a2702d07fd", "score": "0.5208016", "text": "function readConfigurationFile(path) {\n try {\n if (fs.existsSync(path)) {\n const config = require(path);\n return config.BOARDGAMES_ID;\n } else {\n console.error(\"Configuration file does not exist.\");\n process.exit(1);\n }\n } catch (error) {\n console.error(\"Error while accessing the configuration file.\");\n console.error(error);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "50b81c8433e1c12635a4452048287698", "score": "0.5194263", "text": "function getPluginConfig (paths) {\n paths = paths + '/config.yml'\n var pluginData = readYml(paths)\n return pluginData\n}", "title": "" }, { "docid": "9f51777acf01701ba7744904952eb34f", "score": "0.51868844", "text": "function readConfig() {\r\n return new Promise(function(resolve, reject) {\r\n fs.readFile(dirConfig, \"utf8\", function(error, data) {\r\n if (error) throw error;\r\n resolve(JSON.parse(data));\r\n });\r\n })\r\n}", "title": "" }, { "docid": "98c3778d8bf27326d81b56d58ac66f18", "score": "0.51847947", "text": "function loadConfig () {\n console.log('Loading config...');\n $.get({\n url : 'config/config.json',\n async : false,\n success : function(configJson) {\n console.log('Loaded config: ' + JSON.stringify(configJson));\n config = configJson;\n },\n error : function(err) {\n console.error('Failed to load config. Error = ' + err);\n }\n });\n}", "title": "" }, { "docid": "b3f309f9dff310493d8fef7cd5be888f", "score": "0.5183301", "text": "function loadDpl(filename, callback) {\n fs.readFile(filename, 'utf-8', (err, data)=>{\n if (err) {\n logger.error('load dpl config error: ', err);\n } else {\n let dplConfigs = JSON.parse(data);\n processData(dplConfigs, callback);\n }\n });\n}", "title": "" }, { "docid": "a54f1d0cfe0fb7e39fde9868b749427c", "score": "0.51808524", "text": "function loadConfig(grunt, extend)\n{\n var config = fs.readdirSync('grunt_tasks')\n .filter(function(file){\n return /\\.js$/.test(file);\n }).map(function(file){\n\n var req = require('./grunt_tasks/' + file),\n task_name = req.taskName;\n\n return delete req.taskName, [task_name, req];\n\n })\n .reduce(function(r, c){\n return r[c[0]] = c[1], r;\n }, {});\n\n for (var i in extend) config[i] = extend[i];\n\n return grunt.initConfig(config);\n}", "title": "" }, { "docid": "85dbad5c2436bbcb091b0762ff44df1b", "score": "0.5172557", "text": "function readConfigFile(filename) {\n try {\n var parsedJSON\n if (fs.existsSync(filename)) {\n parsedJSON = JSON.parse(fs.readFileSync(filename, 'utf8'))\n } else {\n throw 'Config file ' + filename + ' does not exist!!!'\n }\n return parsedJSON\n } catch (err) {\n throw 'Error occurred reading config file ' + filename + ': ' + err\n }\n}", "title": "" }, { "docid": "539314285764d74dad0ed6714434473e", "score": "0.51696056", "text": "loadConfigFile() {\n let postcssrc = require('postcss-load-config');\n\n try {\n this.plugins = [...this.plugins, ...postcssrc.sync().plugins];\n } catch (e) {\n // No postcss.config.js file exists.\n }\n\n return this;\n }", "title": "" }, { "docid": "8b3a26a139ffae56f967e05260ae56a8", "score": "0.51657915", "text": "async load () {\n try {\n await this.settings.load()\n\n const { primary, secondary } = this.settings.get('hosts')\n\n await this.set(LOCAL_HOST, primary)\n if (secondary) this.set(LOCAL_HOST, secondary)\n } catch (error) {\n throw new Error(`Failed adding hosts file ${error.message}`)\n }\n }", "title": "" }, { "docid": "7906af847bd2f59dc8d7284d283ae852", "score": "0.5165686", "text": "function readConfigsMeta(path, fileName, includedIn, isRoot) {\n function isExcluded(currInclude) {\n return _.some(\n [\n \"{orion_server}\",\n \"extendedplugins\",\n \"ui5templates\",\n \"plugins/pluginrepository\",\n \"{innovation_config_path}\",\n \"w5g\",\n \"s8d\",\n \"uiadaptation\",\n ],\n (currExclude) => currInclude.indexOf(currExclude) !== -1\n )\n }\n\n const fullPath = pathUtils.join(path, fileName)\n const resolvedPath = pathUtils.resolve(__dirname, fullPath)\n assertFileExists(resolvedPath, includedIn)\n const config = utils.readJsonSync(fullPath)\n const configWithDefaults = assignConfigDefaults(config, fullPath)\n\n if (isRoot) {\n layers = configWithDefaults.layers\n }\n\n configsMeta.push(configWithDefaults)\n const allIncludes = _.values(configWithDefaults.bundledFeatures).concat(\n _.values(configWithDefaults.optionalBundledFeatures)\n )\n const localIncludes = _.reject(allIncludes, isExcluded)\n\n const localDeprecatedConfigIncludes = _.reject(\n configWithDefaults.deprecatedConfigIncludes,\n isExcluded\n )\n localDeprecatedConfigIncludes.forEach((configInclude) => {\n console.warn(\n `Deprecated config file ${configInclude} included in ${fullPath} is skipped`\n )\n })\n\n const localIncludesPathsAndFiles = _.map(localIncludes, (currInclude) => {\n const currIncludeNoPrefix = removeFilePrefix(currInclude)\n const currFullPath = pathUtils.join(path, currIncludeNoPrefix)\n const currPathOnly = pathUtils.dirname(currFullPath)\n const currFileOnly = pathUtils.basename(currFullPath)\n return { path: currPathOnly, file: currFileOnly }\n })\n\n // recursive calls for included configs\n _.forEach(localIncludesPathsAndFiles, (pathAndFile) => {\n readConfigsMeta(pathAndFile.path, pathAndFile.file, fullPath)\n })\n\n // reading the plugins sections\n readPlugins(\n _.values(configWithDefaults.bundledPlugins),\n pluginFileName,\n path,\n fullPath\n )\n const extPlugins = _.values(configWithDefaults.deprecatedPluginExtensions)\n readPlugins(extPlugins, extPluginFileName, path, fullPath)\n }", "title": "" }, { "docid": "48152e93298622eac3b945b0993255c3", "score": "0.51458776", "text": "reload() {\n var buf = fs.readFileSync(this.path).toString();\n var obj = JSON.parse(buf);\n //patch\n this.config = mergeOptions(this.confg, obj);\n }", "title": "" }, { "docid": "e85a6f0abb05a0e47aab4fbdb9fdb263", "score": "0.5145823", "text": "function loadDefaultConfigs() {\n // Include global configs\n var configFiles = ['config/admin', 'config/main', 'config/product', 'config/productSearch', 'config/devices', 'config/modelTests', 'config/ocapi', 'config/storefront', 'config/category', 'config/analytics', 'config/countries'];\n _.each(configFiles, function(configFile) {\n var configObj = require(configFile);\n _.extend(Alloy.CFG, configObj);\n });\n\n if (Ti.App.deployType === 'production') {\n Alloy.CFG.ocapi.validate_secure_cert = true;\n Alloy.CFG.storefront.validate_secure_cert = true;\n }\n\n // Add overridden properties from user.js\n applyUserProperties(require('config/user'), Alloy.CFG);\n}", "title": "" }, { "docid": "e6de8b0424c8df8f614d25cc3570971e", "score": "0.5136204", "text": "function loadCfg(fname, app) {\n\n console.log(`API-gw()->loading configuration...`);\n\n var cfg = undefined;\n var _cfg = undefined;\n\n try {\n _cfg = fs.readFileSync(fname);\n _cfg = JSON.parse(_cfg.toString());\n if (typeof _cfg.lambdas === 'undefined') {\n console.log(chalk.red(`altLambda->ERROR: no lambdas section in cfg file`));\n process.exit();\n }\n cfg = _cfg.lambdas;\n\n if (typeof _cfg.port !== 'undefined') {\n port = _cfg.port;\n }\n console.log(`altLambda()->Using port: ${_cfg.port}`);\n \n if (typeof _cfg.aws_profile !== 'undefined') {\n AWS_PROFILE = _cfg.aws_profile;\n }\n console.log(`altLambda()->Using AWS profile: ${AWS_PROFILE}`);\n \n } catch (e) {\n\n if (e.code === 'ENOENT') {\n console.log(`No cfg file found... writing base cfg`);\n fs.writeFileSync(fname, JSON.stringify(JSON.parse(CFG_BOILERPLATE), null, 2));\n console.log(`Sample config written to ${fname}`);\n console.log(chalk.green(`Please setup your cfg and run altLambda again`));\n process.exit();\n }\n\n console.log(chalk.red(`altLambda->ERROR: in configuration file`));\n console.log(chalk.red(e));\n }\n\n //\n // Configure express...\n try {\n\n for (var i=0; i < cfg.length; i++) {\n console.log(chalk.yellow(`\\t--------------------------------------------`));\n console.log(chalk.yellow(`\\tmethod: `, cfg[i].method));\n console.log(chalk.yellow(`\\tpath: `, cfg[i].apipath));\n console.log(chalk.yellow(`\\tlambda: `, cfg[i].lambda));\n if (typeof cfg[i].timeout !== 'undefined') {\n console.log(chalk.yellow(`\\ttimeout: ${cfg[i].timeout}`));\n }\n // Create a new APIgw object and map to route in express:\n let use_path = path.join(_cfg.base_path, cfg[i].lambda);\n console.log(chalk.yellow(`\\tfull path: ${use_path}`)); \n \n if (cfg[i].method === 'GET') {\n // The 'let' is crucial here:\n let api = new APIgw(cfg[i].lambda, cfg[i].method, cfg[i].apipath, use_path, cfg[i].timeout);\n app.get(cfg[i].apipath, (req, res) => { /* console.log(`${api.method} ${api.path} ${api.fullpath} ORG_PATH: ${req.originalUrl}`); */ api.functionHandler(req,res); } );\n\n } else if (cfg[i].method === 'POST') {\n console.log(`TODO: method '${cfg[i].method}' not supported by altLambda yet`);\n\n // The 'let' is crucial here:\n let api = new APIgw(cfg[i].lambda, cfg[i].method, cfg[i].apipath, use_path);\n app.post(cfg[i].apipath, (req, res) => { /* console.log(`${api.method} ${api.path} ${api.fullpath} ORG_PATH: ${req.originalUrl}`); */ api.functionHandler(req,res); } );\n\n } else if (cfg[i].method === 'PUT') {\n console.log(`TODO: method '${cfg[i].method}' not supported by altLambda yet`);\n\n // The 'let' is crucial here:\n let api = new APIgw(cfg[i].lambda, cfg[i].method, cfg[i].apipath, use_path);\n app.put(cfg[i].apipath, (req, res) => { /* console.log(`${api.method} ${api.path} ${api.fullpath} ORG_PATH: ${req.originalUrl}`); */ api.functionHandler(req,res); } );\n\n } else if (cfg[i].method === 'PATCH') {\n console.log(`TODO: method '${cfg[i].method}' not supported by altLambda yet`);\n\n // The 'let' is crucial here:\n let api = new APIgw(cfg[i].lambda, cfg[i].method, cfg[i].apipath, use_path);\n app.patch(cfg[i].apipath, (req, res) => { /* console.log(`${api.method} ${api.path} ${api.fullpath} ORG_PATH: ${req.originalUrl}`); */ api.functionHandler(req,res); } );\n } else if (cfg[i].method === 'DELETE') {\n console.log(`TODO: method '${cfg[i].method}' not supported by altLambda yet`);\n // The 'let' is crucial here:\n let api = new APIgw(cfg[i].lambda, cfg[i].method, cfg[i].apipath, use_path);\n app.delete(cfg[i].apipath, (req, res) => { /* console.log(`${api.method} ${api.path} ${api.fullpath} ORG_PATH: ${req.originalUrl}`); */ api.functionHandler(req,res); } );\n } else {\n console.log(`unsupported method: ${cfg[i].method}`);\n process.exit();\n }\n } // end for()\n\n console.log(`\\t--------------------------------------------`);\n \n } catch (e) {\n console.log(chalk.red(`altLambda->ERROR: with configuration for: ${cfg[i].path}`));\n console.log(chalk.red(e));\n }\n}", "title": "" }, { "docid": "9ecfa49fe6144fb181652dd52c59ebca", "score": "0.5130965", "text": "loadYAML() {\n // Load the config file\n return fs.readFile(\"dploy.yaml\", (error, data) => {\n let code;\n if (error) {\n return console.log(\"Error:\".bold.red, \"The file \\\"dploy.yaml\\\" could not be found.\");\n process.exit(code=0);\n }\n\n // Set the config file based on the arguments\n // If no arguments were found, use the first environment on the file\n const yaml = YAML.parse(data.toString());\n if (!this.server) {\n for (let key in yaml) {\n this.server = key;\n break;\n }\n }\n\n this.config = yaml[this.server];\n if (!this.config) {\n return console.log(\"Error:\".bold.red, `We couldn't find the settings for ${`${this.server}`.bold.red}`);\n process.exit(code=0);\n }\n\n if(this.config.parent && yaml[this.config.parent]) {\n this.config = Object.assign(yaml[this.config.parent], this.config);\n }\n\n return this.configLoaded();\n });\n }", "title": "" }, { "docid": "ad992ac5dba579a1fa5071214ef8304f", "score": "0.5130586", "text": "importConfigurations(zipFile) {\n return this.rest.upload(zipFile, `${this.baseUrl}/configurations/import`);\n }", "title": "" }, { "docid": "638aa7befea53ad2160ae4582ec0d10f", "score": "0.5113133", "text": "setConfigFromFile(filename) {\n internal(this).devOpsEnumBuilder.setConfigFromFile(filename);\n return this\n }", "title": "" } ]
398e6d031a94298c4117253b02b1b88b
Handles sitewide signup logs in user and sets currentUser in persisted Redux Store
[ { "docid": "65a6087aa5105ad5881794f7da8e6a55", "score": "0.0", "text": "async function signup(signupData) {\n try {\n let token = await backendAPI.signup(signupData);\n addUserToReduxStore(token)\n return { success: true };\n } catch (errors) {\n console.error(\"signup failed\", errors);\n return { success: false, errors };\n }\n }", "title": "" } ]
[ { "docid": "3532577ae4e18442e076afc05f464759", "score": "0.7258109", "text": "function handleSignUpOrLogin(){\n setAdmin(adminService.getUser()) // getting the user from localstorage decoding the jwt\n }", "title": "" }, { "docid": "afeaf6bc279dd8f17e9b6d0d143d58c7", "score": "0.70395786", "text": "function storeUser(user){\n currentUser = user;\n }", "title": "" }, { "docid": "b1e350f23bfba96b70c3fc784264e27b", "score": "0.70374656", "text": "async currentUser({ commit }, payload) {\n commit(\"POST_RESPONSE\");\n if (payload !== false) {\n // update user state values and redirect to dashboard\n commit(\"CURRENT_USER\", payload);\n router.push(\"/dashboard\");\n } else {\n // clear user state values and redirect to login\n commit(\"CURRENT_USER\", {});\n router.push(\"/login\");\n }\n }", "title": "" }, { "docid": "0b5f7ecf3482c372aef6175204955754", "score": "0.70362306", "text": "login(state, user) {\n return this.currentUser.set(state, user)\n }", "title": "" }, { "docid": "604c8812cb95a8c4ab3f0978674d0ea9", "score": "0.69323254", "text": "async signIn (store, data) {\n store.commit('user', data.user)\n setToken(data.token)\n router.replace('/')\n }", "title": "" }, { "docid": "c0fb50d75c24f6b39927f14a25fa72f3", "score": "0.6822083", "text": "storeUser ({commit, state}, userData) {\n if (!state.idToken) {\n return\n }\n globalAxios.post('/users.json' + '?auth=' + state.idToken, userData)\n .then(res => {\n console.log(res)\n alert(\"register success! now you can signin\")\n router.replace('/signin')\n })\n .catch(error => console.log(error))\n }", "title": "" }, { "docid": "4a1669eb333b9f25f64626078c70faf0", "score": "0.6821831", "text": "autoLogin({ commit }) {\n const user = auth.currentUser;\n\n //TODO: Inject data into App Store\n if (user) commit(\"SET_USER\", user.uid);\n console.log(\"Current user is \", user); //!\n }", "title": "" }, { "docid": "61e82bc69ab9a0bc665b3e97a3b30847", "score": "0.676312", "text": "signup(userInfo) {\n return service\n .post('/signup', userInfo)\n .then(res => {\n // If we have localStorage.getItem('user') saved, the application will consider we are loggedin\n localStorage.setItem('user', JSON.stringify(res.data));\n return res.data;\n })\n .catch(errHandler);\n }", "title": "" }, { "docid": "61f6b37a2ded5033c9d58b70e3e967e4", "score": "0.6753536", "text": "function signup() {\n var signupData = {\n email: authentication.signup.model.email,\n displayName: authentication.signup.model.displayName,\n password: authentication.signup.model.password\n };\n\n User.signup(signupData)\n .then(function(data) {\n if (data.get('_id')) {\n $rootScope.currentUser.id = data.get('_id');\n $rootScope.currentUser.name = data.get('displayName');\n $rootScope.currentUser.image = data.get('profileImg');\n\n // redirect the user\n $state.go('admin.menus');\n }\n });\n }", "title": "" }, { "docid": "68f9695311df31145890a794a52491ef", "score": "0.66938126", "text": "signUp(e){\n e.preventDefault(); // prevent default form action\n // make request to server to create a new user\n axios.post(`${this.props.url}/users`, this.state.inputs)\n .then(res => { // the response will be the user\n // set the user\n this.props.setUser(res.data);\n })\n }", "title": "" }, { "docid": "0c2b0036c450420c367b22a88b25f0a1", "score": "0.667454", "text": "handleLogin() {\n this.loadCurrentUser();\n return this.state.currentUser\n }", "title": "" }, { "docid": "c0ffd2821b35cc89ffe54c7c13fa18af", "score": "0.66360855", "text": "function handleSignUp() {\n setSidenavIsLoading(true);\n //Create User account server call\n postAuthSignUp(name, email, password).then((success) => {\n if (success === true) {\n //Sign-in using the newly created user account\n handleSignIn();\n } else {\n console.log('failed sign up', success);\n }\n });\n }", "title": "" }, { "docid": "d763ee4a98c7f820d9e7e39a253e532b", "score": "0.65913254", "text": "async signUpUser({ dispatch, commit }, payload) {\n // This will make sure that every time we \"press\" the logged in button\n // we are going to reset or clear the Error first so that the\n // Error Alert will show up again. Because if not you'll observe that after\n // clicking the Sign in button after error is shown it will not show again\n commit(\"clearError\");\n\n // Also needs to set the loading state when user press that sign in button\n commit(\"setLoading\", true);\n\n // Clear any Malformed Residue Token before signing in\n // localStorage.removeItem('token') //=>9.6 @08:07 - removing this clearing token\n\n try {\n const data = await apolloClient.mutate({\n mutation: SIGNUP_USER,\n variables: payload,\n });\n\n // COMMON PITFALL with \"apolloClient's return data\"\n // is that it contains \"data.data.signupUser\"\n // NOT the \"data.signinUser\" <-- console.log will be undefined\n // console.log(data)\n console.log(data.data.signupUser);\n\n const {\n data: { signupUser },\n } = data;\n // storing token in \"local Storage\"\n console.log(signupUser.token);\n localStorage.setItem(\"token\", signupUser.token);\n\n /**\n * My OWN modification because we are now using \"peristend data\" with the help of\n * createPersistedState npm module .\n * So now we are going to dispatch the \"getCurrentUser\" here in order to fill\n * that user state.\n *\n * Also prior to calling that \"router.go()\" which will refresh the current page\n * because of \"vuex-persistedstate\"\n */\n await dispatch(\"getCurrentUser\");\n\n // stop loading state\n commit(\"setLoading\", false);\n\n // To make sure \"created()\" lifecycle in \"main.js\" or run in main.js\n // after signing in is to use the \"routers\" \"go\" method to make\n // sure that the \"getCurrentUser\" will be triggered from main.js\n router.go();\n } catch (error) {\n commit(\"setLoading\", false);\n commit(\"setError\", error);\n console.error(\"Error Signing Up: \", error.message);\n }\n }", "title": "" }, { "docid": "facc1f784ccaa5f4057c1589ee2c2284", "score": "0.654167", "text": "getCurrentUser({ state }) {\n console.log(\"User Object\", state.GoTrueAuth.currentUser());\n }", "title": "" }, { "docid": "a5794f69eb8b0fcdf12502e78f9f4370", "score": "0.64859796", "text": "function postSigninRedirect(user) {\n console.log(\"postSigninRedirect\", user);\n storeUser(user);\n window.location.replace('/');\n}", "title": "" }, { "docid": "b8585e74e6af748cb4f1f8b6600462da", "score": "0.6480464", "text": "setCurrentUser(state, currentUser) {\n state.currentUser = currentUser;\n console.log('mutation - currentUser is set to ' + currentUser);\n }", "title": "" }, { "docid": "2548190c5b98b761912d1af83d12abd0", "score": "0.6455625", "text": "handleSignup(event) {\n event.preventDefault()\n const username = event.target.username.value\n const password = event.target.password.value\n\n const url = \"http://localhost:3001/api/v1/user/signup\"\n const fetchBody = {\n user: {\n username: username,\n password: password\n }}\n\n Adapter.fetchPost(url, fetchBody)\n .then(userData => {\n if (userData.username) {\n // Set the current user in Redux to returned user obj\n const action1 = setCurrentUser(userData.id, userData.username)\n // Set the current user's video list in Redux to videos sent from backend\n const action2 = setUserVideos([])\n // Dispatch both actions to Redux\n dispatch(action1);\n dispatch(action2);\n } else {\n alert(\"Username already taken\")\n }\n })\n .then(event.target.reset()) // Reset input fields\n }", "title": "" }, { "docid": "7b466f334b232a75da3c68f08b1bcf78", "score": "0.6453572", "text": "signup(e){\n let email = document.getElementById('login-email').value;\n let password = document.getElementById('login-password').value;\n Accounts.createUser({email: email, username: email, password: password}, (err) => {\n if(err){\n this.setState({\n error: err.reason\n });\n } else {\n this.props.history.push('/');\n }\n });\n\n }", "title": "" }, { "docid": "4dc71f12388619eae421408c3cdc5464", "score": "0.6448416", "text": "checkAuthentication() {\n\t\tapp.auth().onAuthStateChanged(user => {\n\t\t\tif (!user) {\n\t\t\t\tthis.props.history.push(\"/\");\n\t\t\t} else {\n\t\t\t\tthis.setState({ currentUser: user.email });\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5df626fc18df28eaedfd6bca6d8f08d7", "score": "0.64474535", "text": "function proceed(){\n // check if a user exist in the store\n if (store.getters.user) {\n next()\n }else {\n // if not, redirect to login page\n next('/auth/login?redirect=' + to.fullPath)\n }\n }", "title": "" }, { "docid": "fd2f78385438ba5f91983db0d8d1478c", "score": "0.64299524", "text": "async handleSubmissionEvent(event) {\n event.preventDefault();\n const {username, password, email} = this.state;\n try {\n let userId;\n const user = await signUpService({username, password, email});\n //this.props.changeAuthenticationStatus(user);\n this.props.loadUserInformation()\n .then(result => {\n userId = result._id;\n //After the promise is resolved, the result is the user that it was loaded. This way, after sign in it redirects to his profile.\n this.props.history.push(`/profile/${userId}`);\n })\n .catch(err => {\n console.log('couldnt get user id due to', err);\n });\n} catch(error) {\n console.log(error);\n //*******Create a redirect here, when the user can't sign up.**********\n}\n }", "title": "" }, { "docid": "c3a2e5dcedcc5f0605b461d8fb1762eb", "score": "0.64174026", "text": "STORE_USER(state, user) {\n state.user = user;\n }", "title": "" }, { "docid": "1b2da473d2c1896158e2640d804f47b4", "score": "0.6403353", "text": "onUserSignUp() {\n\t\t\tauth.signup();\n\t}", "title": "" }, { "docid": "29775d7b3689be7aa2148a2a6659bf17", "score": "0.63972926", "text": "function signupAndLogin() {\n const user = fakers.getUserPayload();\n return post('/api/v1/users', user)\n .then(() => post('/api/v1/signin', user).expect(200))\n .then(res => (res.body.data));\n }", "title": "" }, { "docid": "68ef07f9d5412ef423c987a69fad74f9", "score": "0.6363694", "text": "handleCreatedUser (error, authData) {\n console.log('in handleCreatedUser method; auth data is', authData);\n console.log('uid: ', authData.uid);\n this.props.setCurrentUser(authData);\n }", "title": "" }, { "docid": "4c52ecb01c846aea55e923fad936d489", "score": "0.63553226", "text": "function signUpUser(username, email, password) {\n $.post(\"/api/signup\", {\n username: username,\n email: email,\n password: password\n })\n .then(function (data) {\n console.log(\"Should be redirecting\");\n let signedIn = true;\n localStorage.setItem('signedIn', JSON.stringify(signedIn));\n localStorage.setItem('userSignedIn', JSON.stringify(username));\n\n window.location.replace(\"/\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "313294dbeeae13469da468635d098eee", "score": "0.634651", "text": "handleSignup() {\n var callbackAfterSignup = function(success) {\n if (!success) {\n console.log('There was an error');\n return this.setState({ error: true });\n } else {\n // successfully signed up\n this.props.history.push('/');\n }\n }.bind(this);\n\n auth.signup(this.state.email, this.state.password, this.state.passwordConfirmation, callbackAfterSignup);\n }", "title": "" }, { "docid": "e54db9d9fbae84d8332f63b9ee717c1e", "score": "0.6344412", "text": "setUser (state, payload) {\n state.user = payload\n }", "title": "" }, { "docid": "21297d2a6f193a9ba72690d67c12a6b8", "score": "0.63392013", "text": "signUp({ commit, dispatch }, authData) {\n // axiosAuth identifier which contains the isntance from axios-auth.js\n // posting the information required for signing up the user\n axiosAuth\n .post(\"accounts:signUp?key=AIzaSyBxb1DJ_JWyL8HuKVc6FY21g8GI4kn6NcA\", {\n email: authData.email,\n password: authData.password,\n returnSecureToken: true\n })\n .then(res => {\n console.log(res);\n // committing the AUTH_USER mutation to save the auth tokens to our state\n commit(\"AUTH_USER\", {\n token: res.data.idToken,\n userId: res.data.localId\n });\n\n // Calculate the date for expiring the token\n const now = new Date();\n const expirationDate = new Date(\n now.getTime() + res.data.expiresIn * 1000\n );\n // Store the token in local storage for auto login\n localStorage.setItem(\"token\", res.data.idToken);\n\n // store the expiration date calculated above\n localStorage.setItem(\"expirationDate\", expirationDate);\n // store userId in the local storage\n localStorage.setItem(\"userId\", res.data.localId);\n\n // save the user email in local sotrage for retrieving data\n localStorage.setItem(\"userEmail\", authData.email);\n\n // send user to dashboard\n router.push({\n name: \"dashboard\"\n });\n\n // Dispatch action to store the user in DB\n dispatch(\"storeUser\", authData);\n\n // set the logout timer in the end\n dispatch(\"setLogoutTimer\", res.data.expiresIn);\n })\n .catch(error => {\n // Error Handling\n // check if there is any error response coming back from the server\n if (error.response) {\n console.log(error.response.data.error.message);\n // commit mutation SET_ERROR for adding the error message to our state, we are displaying this error in out App.vue component\n commit(\"SET_ERROR\", error.response.data.error.message);\n }\n });\n }", "title": "" }, { "docid": "887ce2d17ad083e9dac856b4280a0a6e", "score": "0.63352656", "text": "function registerSignedInUser(data) {\n sharedProperties.setCurrentUser(data.externalId, data.userName);\n\n $rootScope.$emit('LOGGED_IN');\n if ($scope.signIn) {\n $scope.signIn.userName = null;\n $scope.signIn.password = null;\n }\n }", "title": "" }, { "docid": "7915700b3db6cd6d239c095e4a6e9ed8", "score": "0.63294446", "text": "action() {\n UserModel.getLogin().then((user) => {\n if (!user) {\n console.error('Server error');\n console.log(user);\n return;\n }\n if (Object.prototype.hasOwnProperty.call(user, 'uid')) {\n Router.redirectForward('/');\n return;\n }\n super.action();\n this.view.render();\n this.#initView();\n this.initHandlers([\n {\n attr: 'signup',\n events: [\n {type: 'submit', handler: this.#signUpSubmitHandler},\n ]\n },\n {\n attr: 'checkInput',\n many: true,\n events: [\n {type: 'focus', handler: this.removeErrorMessage},\n {type: 'blur', handler: this.#checkInputHandler},\n ]\n }\n ]);\n });\n }", "title": "" }, { "docid": "0f62b6de22ca3b9cda4dc4fc12bfeff9", "score": "0.6329316", "text": "createUser({ commit, dispatch, state }, payload) {\n auth.post('register', payload)\n .then(res => {\n commit('updateUser', res.data)\n swal({\n position: 'top-end',\n width: 300,\n type: 'success',\n title: 'Registration Successful',\n showConfirmButton: false,\n timer: 1000\n })\n router.push({ name: 'profile', params: { profileId: state.user._id } })\n })\n .catch(err => {\n console.error(err)\n swal({\n type: 'error',\n title: 'Oops...',\n text: 'Something went wrong!'\n })\n })\n }", "title": "" }, { "docid": "8940fada3d96b4b39509cf753130759c", "score": "0.63164705", "text": "async process({getState, action, fassets}, dispatch, done) {\n try {\n // signin via our authService\n const user = await fassets.authService.signIn(action.email, action.pass);\n\n // retain these credentials on our device (to streamline subsequent app launch)\n storeCredentials(action.email, action.pass);\n\n // communicate a new user is in town\n dispatch( _authAct.signIn.complete(user) );\n\n done();\n }\n catch(err) {\n discloseError({err,\n showUser: err.isUnexpected()}); // expected errors are shown to the user via the re-direction to the signIn screen (see next step)\n\n // re-direct to SignIn screen, prepopulated with appropriate msg\n dispatch( _authAct.signIn.open(action, err.formatUserMsg()) ); // NOTE: action is a cheap shortcut to domain (contains email/pass) ... pre-populating sign-in form with last user input\n\n done();\n }\n }", "title": "" }, { "docid": "166a858c6fbef84a9119961f3bacd65d", "score": "0.6308512", "text": "function handleSignUp(userEmail, userPass) {\n firebase.auth()\n .createUserWithEmailAndPassword(userEmail, userPass)\n .then(spaRouter.changeRoute({title:'spin', pageURL: '/spin'}))\n .catch(function(error) {\n // Handle Errors here.\n alert(`oops... ${error.cod}, ${error.message}`);\n })\n }", "title": "" }, { "docid": "67178d472e72313e45e442eb8b21b39f", "score": "0.6303772", "text": "signup(e) {\n e.preventDefault();\n signupUser(this.state.email, this.state.password);\n }", "title": "" }, { "docid": "19248e51d93798ef65e435f61a279853", "score": "0.6277222", "text": "async function signup(evt) {\n console.debug(\"signup\", evt);\n evt.preventDefault();\n\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n try {\n currentUser = await User.signup(username, password, name);\n \n } catch (err) {\n userNotAvailable.style.display = ''\n }\n\n if (currentUser) {\n userNotAvailable.style.display = 'none'\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n $signupForm.trigger(\"reset\");\n }\n\n}", "title": "" }, { "docid": "3ba48d3232e7e7913586accad308e29e", "score": "0.626209", "text": "runSignUp() {\n const { main, header } = this.views;\n const { user } = this;\n\n header.display(user, 'sign-up');\n main.display('sign-up');\n }", "title": "" }, { "docid": "3edfee507a7dbf544643d91be6507301", "score": "0.62576556", "text": "handleSubmit() {\n const { firstName, lastName, username, email, password, tags } = this.state;\n Accounts.createUser({ username, email, password }, (err) => {\n if (err) {\n this.setState({ error: err.reason });\n } else {\n this.setState({ error: '', redirectToHome: true });\n // browserHistory.push('/youraccount');\n }\n });\n UserInfo.insert({ firstName, lastName, username, email, tags }, this.insertCallback);\n }", "title": "" }, { "docid": "71e126ca7a31cd0d54810e35b21f2ff8", "score": "0.6233921", "text": "function signUpUser() {\n var userData = {\n email: emailInput.val().trim(),\n first_name: fname.val().trim(),\n last_name: lname.val().trim(),\n address: add.val().trim(),\n city: cty.val().trim(),\n state: st.val().trim(),\n zipcode: zcode.val().trim(),\n cell_phone: cphone.val().trim(),\n work_phone: wphone.val().trim(),\n house_phone: hphone.val().trim(),\n };\n $.post(\"/api/new_members\", userData)\n .then(function(data) {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "d08852d033707a203281e612764c22b1", "score": "0.62338823", "text": "function initState() {\n authStateStoreService\n .checkUser()\n .then((res) => AUTH_STORE.setUser(res.data.user))\n .catch(console.error);\n}", "title": "" }, { "docid": "5f7627ee7e3994f26034cc5c4a498da9", "score": "0.62338454", "text": "async function handleSignup(e) {\n // get username and password inputs\n e.preventDefault();\n let email = document.getElementById('email');\n let password = document.getElementById('password');\n let passwordConfirm = document.getElementById('password-confirm');\n let firstName = document.getElementById('first-name');\n let lastName = document.getElementById('last-name');\n let errorText = document.getElementById('error-text');\n\n if (password.value !== passwordConfirm.value) {\n errorText.textContent = \"passwords must be matching\";\n return;\n }\n let { response, msg } =\n await userAPI.register(\n email.value,\n password.value,\n firstName.value,\n lastName.value\n );\n\n if (response) {\n let loginResponse = await userAPI.login(email.value, password.value);\n if (loginResponse) {\n hide();\n // clear input values\n email.value = \"\";\n password.value = \"\";\n passwordConfirm.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n errorText.textContent = \"\";\n\n window.localStorage.setItem('currentSession', { token: loginResponse.token, ...loginResponse.user });\n } else {\n alert(\"user was created, please log in to access your account\");\n }\n } else {\n errorText.textContent = msg;\n }\n }", "title": "" }, { "docid": "3ff3d4ba9687790cb9d3622bf1d36f77", "score": "0.62277406", "text": "signIn({ commit, dispatch }, authData) {\n // making the API call with the required information\n axiosAuth\n .post(\n \"accounts:signInWithPassword?key=AIzaSyBxb1DJ_JWyL8HuKVc6FY21g8GI4kn6NcA\",\n {\n email: authData.email,\n password: authData.password,\n returnSecureToken: true\n }\n )\n .then(res => {\n console.log(res);\n // Committing the AUTH_USER mutation to add the authorization information to our state\n commit(\"AUTH_USER\", {\n token: res.data.idToken,\n userId: res.data.localId\n });\n\n // Calculate the date for expiring the token\n const now = new Date();\n const expirationDate = new Date(\n now.getTime() + res.data.expiresIn * 1000\n );\n // Store the token in local storage for auto login\n localStorage.setItem(\"token\", res.data.idToken);\n\n // store the expiration date calculated above\n localStorage.setItem(\"expirationDate\", expirationDate);\n // store userId in the local storage\n localStorage.setItem(\"userId\", res.data.localId);\n\n // send user to dashboard\n router.push({\n name: \"dashboard\"\n });\n\n // save the user email in local storage for retrieving data\n localStorage.setItem(\"userEmail\", authData.email);\n\n // set the logout timer to automatically call logout action when token expires\n dispatch(\"setLogoutTimer\", res.data.expiresIn);\n })\n .catch(error => {\n // Error Handling, same steps as signUp\n if (error.response) {\n console.log(error.response.data.error.message);\n commit(\"SET_ERROR\", error.response.data.error.message);\n }\n });\n }", "title": "" }, { "docid": "a0f188afc444678eeb2a4dbf611086b1", "score": "0.62189585", "text": "function registerUser() {\n let valid = validation();\n if (!valid) {\n return;\n }\n\n let url = store.getState().DefaultReducer[0].url + \"register\";\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(userdata),\n })\n .then((response) => response.json())\n .then((res) => {\n if (res.result === 'New user created') {\n signIn(userdata.email, userdata.password);\n } else {\n Alert.alert(res.result);\n console.log(res.result);\n }\n })\n .catch((err) => {\n console.error(err);\n });\n }", "title": "" }, { "docid": "49e23211babbb3e17908b478d4e0af85", "score": "0.62167305", "text": "function SignUp() {\n\tconst history = useHistory();\n\tconst [values, setValues] = useState({});\n\tconst [error, setError] = useState();\n\tconst { user, setUser } = useContext(UserContext);\n\n\tfunction handleChange(event) {\n\t\tevent.persist();\n\t\tconst { name, value } = event.target;\n\t\tsetValues({ ...values, [name]: value });\n\t}\n\n\tasync function handleSubmit(event) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tconst newUser = {\n\t\t\t\tname: values.firstName + \" \" + values.lastName,\n\t\t\t\temail: values.email,\n\t\t\t\tphone: values.phone,\n\t\t\t\tbusiness: values.business,\n\t\t\t\tusername: values.username,\n\t\t\t\tpassword: values.password,\n\t\t\t\tindustry: values.industry,\n\t\t\t};\n\t\t\tconsole.log(newUser);\n\t\t\tawait API.saveUser(newUser);\n\t\t\t//console.log(\"i am here\")\n\t\t\tconst loginRes = await API.loginUser({\n\t\t\t\tusername: newUser.username,\n\t\t\t\tpassword: newUser.password,\n\t\t\t});\n\t\t\tsetUser({\n\t\t\t\ttoken: loginRes.data.token,\n\t\t\t\tuser: loginRes.data.user,\n\t\t\t});\n\t\t\tconsole.log(user);\n\t\t\tlocalStorage.setItem(\"auth-token\", loginRes.data.token);\n\t\t\thistory.push(\"/inventory\");\n\t\t} catch (err) {\n\t\t\tif (err.response.data.msg) {\n\t\t\t\tsetError(err.response.data.msg);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (\n\t\t<div className=\"container-fluid\" id=\"background\">\n\t\t\t<div className=\"row\">\n\t\t\t\t<div className=\"col-12\">\n\t\t\t\t\t<form className=\"form-signup\" onSubmit={handleSubmit}>\n\t\t\t\t\t\t<h2 align=\"center\">Signup Today</h2>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\tWelcome! We're happy that you've decided to start you journey to\n\t\t\t\t\t\t\tinventory bliss with us. Fill out the form below to get started.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"form-row\">\n\t\t\t\t\t\t\t{error && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<div className=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t{error}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"close\"\n\t\t\t\t\t\t\t\t\t\tdata-dismiss=\"alert\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => setError(undefined)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span aria-hidden=\"true\">&times;</span>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<div className=\"col-md-12 divider\">\n\t\t\t\t\t\t\t\t<h4 align=\"center\">General Information</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputFirstName\">First Name</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"firstName\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tid=\"inputFirstName\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"First Name\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputLastName\">Last Name</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"lastName\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Last Name\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"form-row\">\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputEmail\">Email</label> */}\n\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"email\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Email Address\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputEmail\">Phone</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"phone\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Phone #\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputBusinessName\">Buisness Name</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"business\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Business Name\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputState\">Industry</label> */}\n\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\tname=\"industry\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<option defaultValue>Choose your industry...</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"advertising\">Advertising</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"education\">Education</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"electronics\">Electronics</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"fasion\">Fashion</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"food\">Food</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"printing\">Printing</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"publishing\">Publishing</option>\n\t\t\t\t\t\t\t\t\t<option data-value=\"other\">Other</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"col-md-12 divider\">\n\t\t\t\t\t\t\t\t<h4 align=\"center\">Create Your Account Credentials</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputBusinessName\">Username</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"username\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Username\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"form-group col-md-6\">\n\t\t\t\t\t\t\t\t{/* <label for=\"inputBusinessName\">Password</label> */}\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\tname=\"password\"\n\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Password\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"form-group\">\n\t\t\t\t\t\t\t<div className=\"form-check\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclassName=\"form-check-input\"\n\t\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t\tid=\"gridCheck\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<label className=\"form-check-label\" htmlFor=\"gridCheck\">\n\t\t\t\t\t\t\t\t\tBy checking this box, you agree to the{\" \"}\n\t\t\t\t\t\t\t\t\t<a href=\"*\">terms and service</a> of this site.\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button type=\"submit\" className=\"inverted\" id=\"signup-login-btn\">\n\t\t\t\t\t\t\tSign Up\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "aed606ef6af3df2ede473cd6662ad24a", "score": "0.6212462", "text": "async function signup() {\n // get vars from html forms\n const username = document.getElementById(\"username\").value;\n const email = document.getElementById(\"email\").value;\n const password = document.getElementById(\"password\").value;\n\n //create a user with these params\n await createUser(username, email, password).then(async (res) => {\n const userData = await getUserData(username);\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n if(res != \"0\"){\n \n //send them to homepage\n document.location = \"homepage.html\";\n }\n else{\n alert(\"Invalid!\");\n }\n });\n \n}", "title": "" }, { "docid": "bf0f396a961fdf8b545af96891dfe7c9", "score": "0.6198742", "text": "function authHandler() {\n if (user) {\n auth.signOut();\n dispatch({\n type: \"EMPTY_CART\",\n });\n history.push(\"/\");\n }\n }", "title": "" }, { "docid": "c8501b29825a5c98f7d444e299b54971", "score": "0.6192068", "text": "handleSignIn(event) {\n console.log(\"Signing in\");\n const { email, password } = this.state;\n event.preventDefault();\n this.props.firebase\n .SignInUser(email, password).then((authUser) => {\n this.setState({ ...INITIAL_STATE });\n console.log(authUser);\n this.props.history.push(\"/MainPage\");\n }).catch(error => {\n this.setState({ error });\n alert(this.state.error.message);\n });\n\n }", "title": "" }, { "docid": "0a2ddbc00fe934def454feea75372ab8", "score": "0.6188704", "text": "async signinUser({ dispatch, commit }, payload) {\n // This will make sure that every time we \"press\" the logged in button\n // we are going to reset or clear the Error first so that the\n // Error Alert will show up again. Because if not you'll observe that after\n // clicking the Sign in button after error is shown it will not show again\n commit(\"clearError\");\n\n // Also needs to set the loading state when user press that sign in button\n commit(\"setLoading\", true);\n\n // Clear any Malformed Residue Token before signing in\n localStorage.removeItem(\"token\");\n\n try {\n const data = await apolloClient.mutate({\n mutation: SIGNIN_USER,\n variables: payload,\n });\n\n // COMMON PITFALL with \"apolloClient's return data\"\n // is that it contains \"data.data.signinUser\"\n // NOT the \"data.signinUser\" <-- console.log will be undefined\n // console.log(data)\n console.log(data.data.signinUser);\n\n const {\n data: { signinUser },\n } = data;\n // storing token in \"local Storage\"\n console.log(signinUser.token);\n localStorage.setItem(\"token\", signinUser.token);\n\n /**\n * My OWN modification because we are now using \"peristend data\" with the help of\n * createPersistedState npm module .\n * So now we are going to dispatch the \"getCurrentUser\" here in order to fill\n * that user state.\n *\n * Also prior to calling that \"router.go()\" which will refresh the current page\n * because of \"vuex-persistedstate\"\n */\n await dispatch(\"getCurrentUser\");\n // !!VERY IMPORTANT!! use the \"await\" here in \"dispatch('getCurrentUser')\"\n // if NOT your app will proceed to the next code below while the user info is not yet fetched\n\n /**\n * For TESTING purpose and demo purpose only\n * COMMON PITFALL\n * To see why the \"await\" is important for the \"dispatch(getCurrentUser)\"\n * = Try to comment the code above and uncomment this one below\n */\n // dispatch('getCurrentUser')\n\n // stop loading state\n commit(\"setLoading\", false);\n\n // To make sure \"created()\" lifecycle in \"main.js\" or run in main.js\n // after signing in is to use the \"routers\" \"go\" method to make\n // sure that the \"getCurrentUser\" will be triggered from main.js\n router.go();\n } catch (error) {\n commit(\"setLoading\", false);\n commit(\"setError\", error);\n console.error(\"Error Signing In: \", error.message);\n }\n }", "title": "" }, { "docid": "a9259ba1cc5a79e8379502519439beaf", "score": "0.6188381", "text": "login(state, payload) {\n state.curtUser_uid = payload._id\n state.curtUser_email = payload.email\n state.curtUser_phone = payload.phone\n state.curtUser_userName = payload.userName\n state.curtUser_password = payload.password\n }", "title": "" }, { "docid": "940f4fc32e5b4d65bdb6fead575e10a9", "score": "0.61870515", "text": "function logInOrSignUp(username, password, isSignUp) {\n\n let formData = {\n user: {\n username: username.value,\n password: password.value\n }\n }\n\n let configObj = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(formData)\n }\n\n // Use isSignUp boolean to determine server endpoint and\n // flash message wording upon successful login/signup\n const fetchURL = isSignUp ? USERS_URL : `${BASE_URL}/login`;\n const myWording = isSignUp ? 'signed up' : 'logged in';\n\n fetch(fetchURL, configObj)\n .then(resp => resp.json())\n .then(response => {\n if (response.message) {\n username.value = '';\n password.value = '';\n alert(response.message);\n } else {\n // Store JWT, username, and user ID in sessionStorage\n window.sessionStorage.accessToken = response.jwt;\n window.sessionStorage.currentUsername = response.user.data.attributes.username;\n window.sessionStorage.currentUserId = response.user.data.id;\n alert(`Succesfully ${myWording} - welcome!`);\n\n // Hide the welcomeUsersSection and load the main\n // items to be displayed (events, comments, etc)\n welcomeUsersSection.remove();\n loadPageWithValidUser();\n }\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "e7aa1c3d62859b48e199b2e5ce9a267c", "score": "0.6173912", "text": "[SUCCESS_LOGIN_STORE] (state, payload) {\r\n\t\tstate.token = payload.token;\r\n\t\tstate.user = payload.user;\r\n\t\tlocalStorage.setItem('user', JSON.stringify(payload.user));\r\n\t\tlocalStorage.setItem('token', payload.token);\r\n\t}", "title": "" }, { "docid": "c0d626aba2ff10fca76f8e753f9b67ae", "score": "0.6156776", "text": "onSignedIn() {\r\n // There is currently no public event raised for signing in.\r\n if (this.hasPermission(\"readUserProfile\" /* readUserProfile */)) {\r\n this.session.user = liveshare_core_2.userAuthStateTracker.userInfo && {\r\n displayName: liveshare_core_2.userAuthStateTracker.userInfo.displayName,\r\n emailAddress: liveshare_core_2.userAuthStateTracker.userInfo.emailAddress,\r\n userName: liveshare_core_2.userAuthStateTracker.userInfo.userName,\r\n id: liveshare_core_2.userAuthStateTracker.userInfo.id,\r\n };\r\n }\r\n }", "title": "" }, { "docid": "f5f26cfd40796159ef75319e7ea1f0dc", "score": "0.6150938", "text": "register ({ email, password }) {\n // Create the user\n return store\n .dispatch('users/create', { email, password })\n // Then login\n .then(() => {\n return auth.login({ strategy: 'local', email, password })\n })\n }", "title": "" }, { "docid": "e491eb63caf070fbf41ebe860c2f4006", "score": "0.61470574", "text": "function signUpUser(auth){\n const email= signupModal['signup-email'].value;\n const password= signupModal['signup-password'].value;\n\n auth.createUserWithEmailAndPassword(email,password).then(cred=>{\n console.log(cred);\n console.log(cred.user.email+' created');\n container.children[0].classList.remove('noDisplay');\n container.children[1].classList.add('noDisplay');\n container.children[2].classList.add('noDisplay');\n }).catch(err=>{\n console.log('in catch');\n console.log(err);\n });\n}", "title": "" }, { "docid": "7f7ce068d1f647fc0f32d03b2d82ee3b", "score": "0.61422276", "text": "__handleSignInStatusChange(isSignedIn) {\n if (isSignedIn) {\n let currentUser = gapi.auth2.getAuthInstance().currentUser.get();\n this.set('user', {\n id: currentUser.getId(),\n email: currentUser.getBasicProfile().getEmail(),\n name: currentUser.getBasicProfile().getName(),\n image: currentUser.getBasicProfile().getImageUrl()\n });\n } else {\n this.set('user', null);\n }\n }", "title": "" }, { "docid": "c04efc89cb9ff1419bd79f94f67e97f4", "score": "0.6140652", "text": "function pushUserToDB() {\n database.ref(\"users/\"+currentUser).once(\"value\", function(snapshot){\n if (snapshot.exists()){\n console.log(\"exists!\" + currentUser);\n // navToApp();\n }\n else{\n // add an entry for the new user and set attributes to fname and lname\n database.ref(\"users/\" + currentUser).set({\n fname: fname,\n lname: lname,\n reviewCount: 1\n });\n }\n\n // Set the username in Session Storage\n if (currentUser !== \"\") {\n localStorage.clear();\n localStorage.setItem(\"username\", currentUser);\n }\n\n setAvatar();\n navToApp();\n });\n }", "title": "" }, { "docid": "67b8cad6308959977d55de4a475ac911", "score": "0.6127594", "text": "@action(constants.SIGN_IN)\n handleSignIn() {\n new ChromeIdentityAdapter().signIn().done(\n () => {\n this.authenticated = true;\n this.emit('change', this.getState());\n this.flux.actions.requestAssignments();\n this.flux.actions.signInSuccess();\n },\n () => {\n this.authenticated = false;\n this.emit('change', this.getState());\n });\n }", "title": "" }, { "docid": "91c73889ff3db62742a140e2f9f740ee", "score": "0.61271554", "text": "addNewUser() {\n const { navigation, users, loginDispatch, addUserDispatch } = this.props;\n const { username } = this.state;\n const existingId = this.existingUserId();\n // check if user already exists\n if (existingId != null) {\n // login with userId\n loginDispatch(existingId);\n } else {\n // assign proper id\n const newId = services.nextUserId(users);\n // add new user\n addUserDispatch(newId, username);\n }\n this.setState({ username: '' });\n navigation.navigate('Home');\n }", "title": "" }, { "docid": "5a565aae570ea853554da3f26f68df88", "score": "0.61267334", "text": "function App() {\n const dispatch = useDispatch();\n // const [token, setToken] = useState(null)\n\n function addUserToReduxStore(token) {\n let { username } = jwt.decode(token);\n dispatch(addCurrentUser(username))\n }\n\n // Handles site-wide signup\n // logs in user and sets currentUser in persisted Redux Store\n async function signup(signupData) {\n try {\n let token = await backendAPI.signup(signupData);\n addUserToReduxStore(token)\n return { success: true };\n } catch (errors) {\n console.error(\"signup failed\", errors);\n return { success: false, errors };\n }\n }\n\n\n // Handles site-wide login\n // logs in user and sets currentUser in persisted Redux Store\n async function login(loginData) {\n try {\n let token = await backendAPI.login(loginData);\n addUserToReduxStore(token)\n return { success: true };\n } catch (errors) {\n console.error(\"login failed\", errors);\n return { success: false, errors };\n }\n }\n \n return (\n <div className=\"App\">\n <div>\n <NavBar />\n <Routes login={login} signup={signup} />\n </div>\n </div>\n );\n\n}", "title": "" }, { "docid": "b6365e705c20ca858daeb3fcf01cc818", "score": "0.6114501", "text": "signup(e) {\n e.preventDefault();\n var myUser = this.user.current.value;\n var myPassword = this.password.current.value;\n\n fire\n .auth()\n .createUserWithEmailAndPassword(myUser, myPassword)\n .then(u => {})\n .catch(function(error){\n alert(error);\n });\n \n\n \n }", "title": "" }, { "docid": "045aaa8520d67b171c580b99e13ca78c", "score": "0.61110836", "text": "function signIn(values, history, fetchMenuFromRear) {\n const p = Auth.signIn(values.email, values.password);\n p.then((cognitoUser) => {\n notify('success', SIGNIN_SUCC_TITLE, '');\n console.log({ cognitoUser });\n const str = JSON.stringify(cognitoUser);\n window.localStorage.setItem('user', str);\n fetchMenuFromRear(cognitoUser.username);\n history.push('/welcome');\n },\n (result) => {\n notify('error', SIGNIN_FAIL_TITLE, result.message);\n console.log(result);\n }).catch((error) => {\n notify('error', SIGNIN_FAIL_TITLE, error);\n console.error(error);\n });\n}", "title": "" }, { "docid": "5acccea6b829b44b9a1e8aeec53d3533", "score": "0.61021674", "text": "async function signup(evt) {\n // console.debug(\"signup\", evt);\n evt.preventDefault();\n\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger(\"reset\");\n}", "title": "" }, { "docid": "7e893402ecdd3d7c402b36ebc52ee598", "score": "0.6098883", "text": "login() {\n auth.signInWithPopup(provider).then((result) => {\n var newUser = auth.currentUser;\n this.setState({\n user: newUser\n });\n this.checkIfFirstLogin(newUser);\n });\n }", "title": "" }, { "docid": "526be08e9031ae2dfa2f334edbd46ce9", "score": "0.6096218", "text": "function signUpUser(username, email, password) {\n signupLodingModal();\n $.post(\"/api/signup\", {\n username: username,\n email: email,\n password: password\n })\n .then(() => {\n getAndStoreUserDataThenLoadNewPage();\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "ce0df6ab2d3c6af994d0d07bf161ef6a", "score": "0.60858536", "text": "ADD_USER(state, payload) {\n\t\tstate.user = payload.name;\n\t}", "title": "" }, { "docid": "64ce4f3c0c0ea7cea284a667090bcb71", "score": "0.6076931", "text": "function currentUser(state = null, action) {\n switch (action.type) {\n case `${LOGIN}_FULFILLED`:\n case `${REGISTER}_FULFILLED`:\n case `${FETCH_CURRENT_USER}_FULFILLED`:\n // Set the local storage before setting user state\n const user = action.payload.body.user;\n localStorage.setItem('token', user.token);\n return user;\n case `${LOGIN}_REJECTED`:\n case `${REGISTER}_REJECTED`:\n return {\n errors: action.payload.body.errors\n }\n case LOGOUT:\n return null; // no user\n default:\n return state\n }\n}", "title": "" }, { "docid": "bdfc105ab0bbdd37975ac2a218e031d2", "score": "0.6071497", "text": "SAVE_USER(state, user) {\n state.user = user;\n console.log(\"holaaa\");\n }", "title": "" }, { "docid": "211b764929fa747a1bbbbab0b4166102", "score": "0.6057554", "text": "syncSpotifySignUpFlowWithBlockPartyOnBoard(user_data) {\n const URL = process.env.NODE_ENV === 'development' ? 'http://localhost:5000/users/signup' : 'https://block-party-server.herokuapp.com/users/signup'\n const _this = this\n Firebase.auth().createUserWithEmailAndPassword(user_data.email, user_data.accessToken)\n .then((response) => {\n _this.sendVerificationEmail(() => {\n Axios({\n method: 'post',\n url: URL,\n data: {\n platform: true,\n platform_user: user_data\n }\n }).then((response) => {\n localStorage.setItem('currentUserLoggedIn', true)\n localStorage.setItem('currentUser', JSON.stringify(response.data.new_user))\n const currentUser = JSON.parse(localStorage.getItem('currentUser'))\n\n console.log('sign in flow user')\n console.log(currentUser)\n\n this.addRecentlyStreamedData(currentUser)\n\n }).catch((error) => {\n console.log(error)\n })\n })\n })\n .catch((error) => {\n console.log(error)\n if (error.code === \"auth/email-already-in-use\") {\n\n }\n })\n }", "title": "" }, { "docid": "1c327a6fb46930e7500d6d8b48c2e41e", "score": "0.60553867", "text": "function signUpUser(email, password, firstName, lastName, age) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n firstName: firstName,\n lastName: lastName,\n age: age\n })\n .then(data => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "3c8ed675147afc37ae8c0a6da4012cbb", "score": "0.605", "text": "function signUpAction(e) {\n e.preventDefault();\n\n const username = usernameBox.value;\n const email = emailBox.value;\n const password = passwordBox.value;\n const passwordConfirm = passwordConfirmBox.value;\n\n // console.log(\"sign up\");\n\n if (!checkValidPassword(password, passwordConfirm)) {\n showMessage(\"Passwords do not match\");\n } else if (password.length < 6) {\n showMessage(\"Password too short\")\n } else {\n const url = '/user/sign_up';\n const request = new Request(url, {\n method: 'post',\n body: JSON.stringify({\n \"username\": username,\n \"email\": email,\n \"password\": password,\n \"password_confirm\": passwordConfirm,\n \"is_admin\": false\n }),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n },\n });\n fetch(request).then(function (res) {\n if (res.status === 200) {\n // console.log(res.body);\n // document.cookie = \"username=\"\n // loginSucceed()\n signUpSucceed(username, password)\n } else {\n // console.log(res.status);\n showMessage(res.statusText)\n }\n }).catch((error) => {\n console.log(error)\n });\n }\n\n}", "title": "" }, { "docid": "93647620b5f04b3cca6fb975147bf34c", "score": "0.6047746", "text": "async function check_for_user() {\n const user = await Auth.currentSession()\n .then(data => {console.log('user', data.idToken.payload); return data.idToken.payload})\n .catch(err => console.log(err));\n \n // if no user, redirect to signin\n \n user.name = user['cognito:username'];\n set_logged_in_user(user);\n \n // after login, check if there is a user entry for this user in the db\n // if not, create one. in the future, this should be done with lambda trigger\n API.graphql(graphqlOperation(listUsers, {filter: {owner: {eq: user.name}}}))\n .then(data => {\n // if length is greater than 1, merge. \n // if length is 1, do nothing, \n // if length is 0, make a new entry\n if (data.data.listUsers.items.length > 0)\n return;\n \n API.graphql(graphqlOperation(createUser, {input: {\n name: user.name,\n description: 'I\\'m here, let\\'s hang out!',\n }}))\n .then(new_user => console.log('new user', new_user));\n \n });\n }", "title": "" }, { "docid": "1d5f5b9a9799aa46f88eae5c21f036a1", "score": "0.60349596", "text": "async function init() {\n auth.onAuthStateChanged((user) => {\n if (user) {\n console.log(`User logged in as: ${user.email}`);\n // ------------- redirect a user --------------\n window.location.href = 'new-user.html';\n }\n });\n}", "title": "" }, { "docid": "7ef1aca5671d3b2673ab7761711c7255", "score": "0.60335803", "text": "signIn() {\n const { email, password } = this.state\n if (email !== '' && password !== '') {\n this.setState({ show: true })\n firebase.auth().signInWithEmailAndPassword(email, password)\n .then((succ) => {\n this.setState({ show: false })\n localStorage.setItem(\"uid\", succ.user.uid)\n if (succ.user.emailVerified === false) {\n swal({\n title: \"Oops\",\n text: \"Your email is not verified.We have sent a code to your email address. Please check it and then proceed further for more.\",\n icon: \"error\",\n });\n } else {\n firebase.database().ref(\"users/\" + succ.user.uid + \"/info\").on(\"value\", (data) => {\n let datas = data.val()\n if (datas.type === \"user\") {\n this.props.history.push(\"/User\")\n } else {\n this.props.history.push(\"/Restaurant\")\n }\n })\n }\n })\n .catch((error) => {\n var errorMessage = error.message;\n this.setState({ show: false })\n swal({\n title: \"Error Catched\",\n text: errorMessage,\n icon: \"error\",\n });\n });\n } else {\n swal({\n title: \"Error Catched\",\n text: \"Input fields can't be empty\",\n icon: \"error\",\n });\n }\n }", "title": "" }, { "docid": "48429cafe0406dfd51972558ca10af6b", "score": "0.6032059", "text": "function Signup(props)\n {\n const [username, setUsername] = useState();\n const [password, setPassword] = useState();\n const history = useHistory();\n\n const handleSubmit = e => {\n e.preventDefault();\n let data = {\n email: username,\n password: password\n };\n\n API.saveUser(data).then(results => {\n console.log(props, results);\n \n props.setUserId(results.data._id);\n // localstoreage for user\n localStorage.setItem(\"temp\", results.data._id);\n console.log(results.data._id);\n // what to do after user is created? \n history.push(\"/home\");\n })\n // e.target.value = null;\n \n // console.log(\"username is \" + username);\n // console.log(\"password is \" + password);\n };\n\n// getUser() {\n// this.setUserId = JSON.parse(localStorage.setUserId(\"id\"));\n\n// if (localStorage.setUserId(\"id\")) {\n// this.setState({\n// email: this.user\n// })\n// }\n// }\n\n return (\n <div className=\"container-2\">\n <div className=\"logincontainer\">\n <div className=\"mt-4\">\n <h4>New User Sign Up</h4>\n </div>\n <form onSubmit={handleSubmit}>\n <Container className=\"mt-3 px-5\">\n <Row className=\"mt-3 px-5\">\n <Col size=\"md-12\">\n <input\n className=\"form-control\"\n type=\"text\"\n placeholder=\"Email Here\"\n name=\"username\"\n value={username}\n onChange={e => setUsername(e.target.value)}\n />\n </Col>\n </Row>\n <Row className=\"form-group\">\n <Col size=\"md-12\">\n <input\n className=\"form-control\"\n type=\"password\"\n placeholder=\"Your Password\"\n name=\"password\"\n value={password}\n onChange={e => setPassword(e.target.value)}\n />\n </Col>\n </Row>\n <button className=\"btn enterbutton\" type=\"submit\">Enter</button><br />\n {/* <button className=\"btn createbutton\" type=\"submit\">Create New User</button> */}\n\n </Container>\n {/* <Container className=\"mt-4\">\n <h5>Username Test: {username}</h5>\n <h5>Password Test: {password}</h5>\n </Container> */}\n \n </form>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "ec2f93b172da50a0d9e90a746f1d33e7", "score": "0.60144883", "text": "login({ commit, dispatch }, credentials) {\n auth.setPersistence(persistencetype);\n return auth.signInWithEmailAndPassword(\n credentials.email,\n credentials.password\n );\n }", "title": "" }, { "docid": "c505354037d0959a2f7d0c68141ed657", "score": "0.6011401", "text": "function setVue() {\n if(!localStorage.getItem(\"currentUser\")) {\n loggedOut()\n } else {\n let user = JSON.parse(localStorage.getItem('currentUser'));\n loggedIn(user.username); \n }\n}", "title": "" }, { "docid": "d715f1cd22a3e48e3e9d2ef7b5e94274", "score": "0.5999032", "text": "async login(user) {\n let token;\n if (this.state.type === 'login') {\n // Log in user based on credentials\n try {\n token = await JoblyApi.login(user);\n this.props.triggerAlert('success', 'Successfully logged in!');\n } catch (err) {\n this.props.triggerAlert('danger', err[0]);\n }\n } else {\n // Register new user based on entered information\n try {\n token = await JoblyApi.register(user);\n this.props.triggerAlert('success', 'Successfully registered!');\n } catch (err) {\n this.props.triggerAlert('danger', err[0]);\n }\n }\n // If login or registration successful, set token in state and local storage, and fetch user to store in App's state\n if (token) {\n localStorage.setItem('token', JSON.stringify(token));\n this.props.fetchUser();\n // Redirect to companies after successful login/registration\n this.props.history.push('/companies');\n }\n }", "title": "" }, { "docid": "0744ba07cd0e17425b5747d7eb84f8ce", "score": "0.59970146", "text": "function upsertUser(userData) {\n $.post('/auth/register', userData)\n .done(function(resp) {\n window.location.assign(\"/\");\n })\n }", "title": "" }, { "docid": "51fabd9cb48908be82e4639d07314419", "score": "0.5994433", "text": "handleLogin() {\n\n\t\tif(this.state.email !== '' && this.state.password !== '' )\n {\n for (var val of this.state.users) {\n\n\t\t\t\tif(this.state.email === val.EmailID && this.state.password === val.Password)\n\t\t\t\t{\n\t\t\t\t\tlocalStorage.setItem('LoggedUser', JSON.stringify(val));\n alert(\"Successfully logged in\");\n browserHistory.push('/Dashboard')\n\t\t\t\t}\n\t\t\t {/*else\n {\n\t\t \t\talert(\"Oops! You are not providing valid crendentials\");\n\t\t \t}*/}\n\t\t } \n \t}\n else if(this.state.email === '' && this.state.password === '' ){\n alert(\"Oops! You are not providing crendentials, please enter email and password\");\n }\n }", "title": "" }, { "docid": "45df1aa8968e6797c48de8b296b5061a", "score": "0.59941286", "text": "setCurrentUser(user){\n if(user)\n {this.setState({\n currentUser:user,\n isAuthenticated:true\n })\n }\n else{this.setState({\n currentUser:null,\n isAuthenticated:false\n })\n }\n }", "title": "" }, { "docid": "d9247dcaf187d62afa47a12937cd5a73", "score": "0.59885216", "text": "handleSubmit() {\n\t\tvar email = this.state.formValues.email;\n\t\tvar password = this.state.formValues.password;\n\t\t//use this to redirect - this.props.history.push('/')\n\t\tvar history = this.props.history;\n\t\t//launch action\n\t\tthis.props.signinUser( email, password, history );\n\t}", "title": "" }, { "docid": "77a981db73d74572f84c77222b89925a", "score": "0.5986494", "text": "handleSubmit(user) {\n if (this.state.password === '' || this.state.username === ''\n || this.state.verifyPassword === '' || this.state.userType === '') {\n alert(\"Please fill out all fields\")\n } else if (this.state.password !== this.state.verifyPassword) {\n alert(\"Passwords don't match\");\n } else if (getIsUser(this.state.username)) {\n alert(\"Username already taken\")\n } else {\n addUser(user).then(newUser => this.props.history.push('/profile'))\n // addUser(user).then(newUser => console.log(newUser))\n }\n }", "title": "" }, { "docid": "d7681ac4688f6b986999851a91276129", "score": "0.5983977", "text": "function signup() {\n this.user = {};\n this.fName = $(\"#fname\").val();\n this.lName = $(\"#lname\").val();\n this.userName = $(\"#username\").val();\n this.email = $(\"#email\").val();\n this.password = $(\"#password\").val();\n this.cPassword = $(\"#cPassword\").val();\n\n // From Validation\n\n if (\n fName == \"\" ||\n lName == \"\" ||\n email == \"\" ||\n userName == \"\" ||\n password == \"\"\n ) {\n swal({\n title: \"Error\",\n text: \"Please Fill out all fields!\",\n icon: \"error\"\n });\n } else if (\n fName == \" \" ||\n lName == \" \" ||\n email == \" \" ||\n userName == \" \" ||\n password == \" \"\n ) {\n swal({\n title: \"Error\",\n text: \"Please fill a empty space with meaningful data\",\n icon: \"error\"\n });\n location.reload(false);\n } else if (cPassword != password) {\n swal({\n title: \"Error\",\n text: \"Password do not match!\",\n icon: \"error\"\n });\n } else {\n // To Firebase Authentication\n firebase\n .auth()\n .createUserWithEmailAndPassword(email, password)\n .then(function(resp) {\n myUid = resp.user.uid;\n localStorage.setItem(\"user\", \"true\");\n localStorage.setItem(\"myUid\", `${myUid}`);\n\n // Updates USER PROFILE\n var user = firebase.auth().currentUser;\n // return user.updateProfile({\n // displayName: userName\n // })\n // .then(updated => console.log(`profile updated`))\n // .catch(function(error) {\n // })\n\n // Send User's Details to DB\n var siteUsers = database.ref(\"Users/\").push();\n siteUsers.set({\n firstName: fName,\n lastName: lName,\n userName: userName,\n userEmail: email,\n userPassword: password,\n uniqueID: myUid\n });\n\n location.pathname = \"/index.html\";\n })\n .catch(function(err) {\n swal({\n title: \"Error\",\n text: err.message,\n icon: \"error\"\n });\n });\n }\n}", "title": "" }, { "docid": "c14401d6f84e55b3d8d1d3053241f4af", "score": "0.59835863", "text": "storeUser({ state }, userData) {\n // check if user is authenticated\n if (!state.idToken) {\n // if not then return\n return;\n }\n\n // importing axios instance\n globalAxios\n .post(\n \"https://chup0007-final.firebaseio.com/users.json\" +\n \"?auth=\" +\n state.idToken,\n userData\n )\n .then(res => console.log(res))\n .catch(error => console.log(error.message));\n }", "title": "" }, { "docid": "313cd5955feb32aeb8d751c86efea960", "score": "0.5982116", "text": "function handlePostLogin(state, action){\n AsyncStorage.setItem('user',action.payload);\n\treturn update(state, {\n\t\tusers:{\n\t\t\t$set:action.payload\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8162a41b5b057ff2b5b568e503175c0e", "score": "0.59810203", "text": "function submitUser() {\n\n //giving variable names to the user inputs in the newUser form\n var user = {\n firstName: $('#firstNameField').val(),\n lastName: $('#lastNameField').val(),\n email: $('#emailField').val(),\n password: $('#pinField').val(),\n weight: $('#weightField').val(),\n height: $('#heightField').val(),\n dob: $('#dateOfBirthField').val(),\n };\n\n //ensureing that the email & password are remembered for loginPage\n firebase.auth().createUserWithEmailAndPassword(user.email, user.password)\n .then(function(user){\n console.log(\"Successbully created user account with uid:\",\n user.uid);\n })\n .catch(function(error){\n console.log(\"Error creating user:\", error)\n });\n\n firebaseUsersCollection.push(user);\n\n //taking the user to the login page upon successful creation of a user account\n firebase.auth().onAuthStateChanged(user => {\n if(user) {\n window.location = 'loginPage.html';\n }\n })\n\n }", "title": "" }, { "docid": "d92eda4554a9cae62650dcfc0f64784a", "score": "0.59801203", "text": "AUTH_USER(state, userData) {\n state.idToken = userData.token;\n state.userId = userData.userId;\n }", "title": "" }, { "docid": "f01e51df0944d8124b5ac5c8f75f7d43", "score": "0.5978126", "text": "function setUser(data, dispatch) {\n const { token, user} = data;\n localStore.setToken(token);\n localStore.setClientId(user._id)\n // Decode token to get user data\n const decoded = jwt_decode(token);\n // Set current user\n dispatch(setCurrentUser(decoded));\n userKeys(user.keys, dispatch)\n}", "title": "" }, { "docid": "82b13b30a97e47d5774d567a91509539", "score": "0.596612", "text": "registerUser({\n dispatch,\n commit\n }, payload) {\n Loading.show()\n console.log(payload)\n firebaseAuth.createUserWithEmailAndPassword(payload.email, payload.password)\n .then(userAuth => {\n return Promise.all([userAuth, userAuth.user.updateProfile({\n displayName: payload.firstName\n })])\n })\n .then(userDetails => {\n let userAuth = userDetails[0]\n console.log(\"User Auth:\", userAuth)\n var user = userAuth.user\n // create user profile in firestor\n dispatch('userData/setUserNameAndEmail', {\n email: user.email,\n firstName: user.displayName\n }, {\n root: true\n }) // trigger action in different vuex module\n var userRef = firebaseDb.collection(\"users\").doc(user.uid)\n return userRef.set({\n email: user.email,\n firstName: user.displayName,\n onBoardingComplete: false,\n userId: user.uid\n })\n })\n .then(() => {\n commit('setLoggedIn', true);\n this.$router.push('/OB')\n })\n .catch(error => {\n console.error(error.message)\n })\n .finally(() => {\n Loading.hide()\n })\n }", "title": "" }, { "docid": "7e298c5c19e976f485f05acfebf26298", "score": "0.59652156", "text": "function handleLogin() {\n loginUser(email, password)\n .then(response => {\n if (response.status === 200) {\n dispatch(setUser(response.config.data))\n history.push('/dashboard')\n } else {\n alert(response.statusText)\n }\n })\n }", "title": "" }, { "docid": "23d9ebbe2abcf5353b7dc0637c961eea", "score": "0.5958333", "text": "handleSubmitRegister(event) {\n event.preventDefault();\n let user = {\n firstName: this.state.firstName,\n surname: this.state.surname,\n email: this.state.email,\n password: this.state.password,\n password2: this.state.password2\n };\n this.props.logIn(user, 'register');\n this.setState({\n firstName: \"\",\n surname: \"\",\n email: \"\",\n password: \"\",\n password2: \"\"\n })\n }", "title": "" }, { "docid": "be3647a05eff1222fe77b5dbf1e7b892", "score": "0.5955647", "text": "function redirectUser() {\n getCurrentUser() ? navigation.navigate(HOME) : navigation.navigate(AUTH);\n }", "title": "" }, { "docid": "8b46d5f7ea929ae5a53cb73a7dc6882d", "score": "0.5955173", "text": "function handleSignUp (e){\n e.preventDefault();\n if (fullname === \"\" || email === \"\" || password === \"\" || confirmPassword === \"\"){\n alert(\"Sign Up Unsuccessful\")\n return\n };\n\n if ( password !== confirmPassword){\n alert(\"Passwords doesn't match\")\n return\n };\n\n routeHistory.push('/dashboard')\n }", "title": "" }, { "docid": "9c2a9a6aaabbf6ac235ed8c8f19ccf9a", "score": "0.5948189", "text": "initNewUser(user) {\n firebase.database().ref(`/users/${user.uid}`).set({\n displayName: user.displayName,\n email: user.email,\n photoURL: user.photoURL,\n refreshToken: null,\n uid: user.uid\n // workspaceIds: {\n // '-KjCe70-kW2zC-B5DCcD': true\n // }\n });\n this.props.loginSuccess(user);\n }", "title": "" }, { "docid": "2e8d435388f50857218ef1d5ee24ca87", "score": "0.5945993", "text": "signIn(username, password) {\n\t\t// Calling setState to asign the username and password\n\t\tthis.setState({\n\t\t\tuser: {\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "a17d2a6642318396d3b9d521dc013f75", "score": "0.59455127", "text": "function signUpUser(name, email, password) {\n //console.log(name + \" \" + email + \" \" + password);\n $.post(\"/api/member\", {\n name: name,\n email: email,\n password: password\n })\n .then(function(data) {\n //console.log(data);\n // window.location.replace(data);\n })\n // If there's an error, handle it by throwing up a boostrap alert\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "4ea1e0720ca95e4e88a7ce1c253e362d", "score": "0.59387624", "text": "function signup() {\n var name = document.querySelector('#name').value;\n var email = document.querySelector('#email').value;\n var password = document.querySelector('#password').value;\n\n var payload = {\n 'name': name,\n 'email': email,\n 'password': password\n };\n\n net.post('/signup', payload).then(function(r) {\n state.current_user = {\n 'id': r.json.id,\n 'name': r.json.name,\n 'email': r.json.email\n };\n\n inject(\"#users_name_profile\", state.current_user.name);\n inject(\"#users_name_wave\", state.current_user.name);\n\n hide(\"#signup\").then(function() {\n show(\"#payment\");\n });\n\n growsumo.data.customer_key = state.current_user.id;\n growsumo.data.name = state.current_user.name;\n growsumo.data.email = state.current_user.email;\n growsumo.createSignup();\n\n });\n\n}", "title": "" }, { "docid": "ac3847b2a5626007b0a138005e2ac49d", "score": "0.5935787", "text": "async function handleLogin({ req, res }) {\n if (req.user) {\n let user = req.user;\n if (\n req.session.marketingIds &&\n req.session.marketingIds.length > 0 &&\n Moment.duration(Moment().diff(Moment(user.created_at))).minutes() < 5\n ) {\n await User.findByIdAndUpdate(user._id, {\n marketingIds: req.session.marketingIds\n });\n }\n user.mobile = user.mobile ? user.mobile.substring(0, 3) : \"\";\n req.session.user = user;\n\n await mergeCartAndUpdateTracking({ req });\n\n if (req.session.redirectUrl) {\n req.session.message[req.session.redirectUrl] = {\n message: \"Welcome to Tinkerer!\",\n type: \"success\"\n };\n res.redirect(\"/\" + req.session.redirectUrl);\n } else {\n res.redirect(\"/\");\n }\n } else {\n res.redirect(\"/login\");\n }\n}", "title": "" }, { "docid": "761316c179e7b77dada890ba4b68083d", "score": "0.5934535", "text": "postFirebasePerson() {\n const { user, password } = this.state\n //Register in FIREBASE\n this.setState({\n loaded: false,\n })\n firebase.auth().createUserWithEmailAndPassword(user, password)\n .then( (userReg) => {\n //Save userLogged & userUid\n Utils.PersistData.setUserLogged(userReg.user.email)\n Utils.PersistData.setUserUid(userReg.user.uid)\n //User registered OK. \n Alert.alert(\n this.language.userCreated, \n userReg.user.email,)\n })\n .catch( (error) => {\n if (this._isMounted) {\n this.setState({\n loaded: true,\n })\n }\n //If user is already in use, simply go to login in SignIn\n if (error.message === 'The email address is already in use by another account.') {\n Alert.alert(\n this.language.userAlreadyInUse, \n error.message,)\n this.login()\n } else {\n Alert.alert(\n this.language.userNotCreated, \n error.message,)\n }\n })\n }", "title": "" }, { "docid": "b0c5e18cec19b186206ab6486b4f7244", "score": "0.59329724", "text": "function allowSignupAccess(dispatch, nextState) {\n if(nextState.param && nextState.param.splat) {\n let splat = nextState.param.splat.toLowerCase();\n // if the page being visited is the signup page, then run a check\n if((splat === \"signup\") || (splat === \"signup/\")) {\n getUserCount(dispatch).then((count) => {\n if(count > 0) {\n dispatch(replace(\"/login\"));\n }\n }).catch((error) => {\n console.warn(\"Error: \", error)\n });\n }\n }\n}", "title": "" }, { "docid": "a3e9af4c91e1a2e2ac5c0a3ac03cf795", "score": "0.59268963", "text": "runSignIn() {\n const { main, header } = this.views;\n const { user } = this;\n\n header.display(user, 'sign-in');\n main.display('sign-in');\n }", "title": "" } ]
38cd877780c823d3f7cadae6d0b1892c
Returns a promise that fulfills iff this user id is valid.
[ { "docid": "da5873dfa1088666bf10ec3c408a5c45", "score": "0.49034187", "text": "function validateAuthData(authData) {\n return request('member/self', authData.access_token).then(data => {\n if (data && data.id == authData.id) {\n return;\n }\n throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Meetup auth is invalid for this user.');\n });\n}", "title": "" } ]
[ { "docid": "25f458378d033d0d9c8f999394872be3", "score": "0.6276901", "text": "validateUser(ctx) {\n return new Promise(function(resolve) {\n\n firebase.auth()\n .signInWithEmailAndPassword(ctx.params.username, ctx.params.password)\n .then(() => {\n resolve({ valid: true, userid: firebase.auth().currentUser.uid });\n }).catch((err) => {\n resolve({ valid: false });\n })\n\n\n\n });\n\n }", "title": "" }, { "docid": "3c86225a77ad322f6b39c04aed89881d", "score": "0.6119167", "text": "function validatedUser(userId) {\n return userModel.exists({ _id: userId });\n}", "title": "" }, { "docid": "94f5b9a43a0c3857dff5c56ce3971b68", "score": "0.5939791", "text": "exists(userId)\n {\n const promiseResult = UserModel.exists({userId});\n return promiseResult;\n }", "title": "" }, { "docid": "956e1f3ae9055f8b4e72dc2fa8cbef5e", "score": "0.58569044", "text": "acceptWaitingUser(userId)\n {\n const promiseResult = UserModel.acceptWaitingUser({_id:userId});\n return promiseResult;\n }", "title": "" }, { "docid": "b7941fa1be4210c515b91f74b3225eef", "score": "0.5774798", "text": "async function isIdValid(con, id = 0) {\n\n return new Promise(\n function (resolve, reject) {\n\n //Query to get userId from user table \n let q = `SELECT id FROM ${constants.DB.visitMasterTable} WHERE id='${id}' limit 1`;\n con.query(q, function (err, rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n }\n );\n}", "title": "" }, { "docid": "b7941fa1be4210c515b91f74b3225eef", "score": "0.5774798", "text": "async function isIdValid(con, id = 0) {\n\n return new Promise(\n function (resolve, reject) {\n\n //Query to get userId from user table \n let q = `SELECT id FROM ${constants.DB.visitMasterTable} WHERE id='${id}' limit 1`;\n con.query(q, function (err, rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n }\n );\n}", "title": "" }, { "docid": "f92dc711d9de1152005174e6bb9ae82f", "score": "0.571387", "text": "async function checkUserID(user){\n console.log(\"Inside check if user ID exists\");\n var usr = await users.find({userId: user.userid});\n console.log(usr);\n if(usr.length == 0){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "063c785469e7281f7614c7876bbcaf8f", "score": "0.5701508", "text": "async validateUser(ctx) {\n\t\t\treturn new Promise(function(resolve,reject){\n\t\t\t\t userModels.findOne({\n\t\t\t\t\temail:ctx.params.email,\n\t\t\t\t\tpassword: ctx.params.password,\n\t\t\t\t},function(err,account){\n\t\t\t\t\taccount === null ? resolve({Account:\"false\"}) : resolve({Account:\"true\"})\n\t\t\t\t})\n\t\t\t})\t\n\t\t}", "title": "" }, { "docid": "79efebfd8ad2ed1bf1150e46b7cb4e3d", "score": "0.56775033", "text": "function validate() {\n if (!blob) {\n return Promise.reject(new Error('Identity must be associated with a blob'));\n } else if (!blob.data) {\n return Promise.reject(new Error('Invalid Blob'));\n } else if (!blob.data[identityRoot]) {\n return blob.set(`/${identityRoot}`, {})\n .then((res) => {\n return Promise.resolve();\n });\n } else {\n return Promise.resolve();\n }\n }", "title": "" }, { "docid": "6f88b7f7e79dda5349325c8a99c47070", "score": "0.5593405", "text": "validate() {\n return new Promise((resolve,reject) => {\n connectDb(client =>{\n let db = client.db(dbName);\n db.collection('users').findOne({phone:this.phone}).then(res=>{\n if(res != null){\n if(res.password==this.password){\n resolve(true)\n } else {\n resolve(false)\n }\n } else {\n reject('no user found')\n }\n }).catch(err=>{\n console.log(err)\n })\n })\n })\n }", "title": "" }, { "docid": "35de9128d2291770b70f731d5f987d84", "score": "0.55811065", "text": "static getUserId() {\n return new Promise(resolve => {\n // Generate the user id if it has not been created already\n if (typeof this.userId === 'undefined') {\n let id = Utils.generateUserId();\n id.then(newId => {\n this.userId = newId;\n resolve(this.userId);\n });\n }\n else {\n resolve(this.userId);\n }\n });\n }", "title": "" }, { "docid": "a81558b25eeb6983888a1f830399ac4d", "score": "0.55276585", "text": "function validateUser(user) {\n var deferred = q.defer();\n if (user && user.name && user.email) {\n deferred.resolve(user);\n }\n else {\n deferred.reject(new Error('Not a valid user object!'));\n }\n return deferred.promise;\n}", "title": "" }, { "docid": "d2ca4cb3f7d5736212544e7be22e73ad", "score": "0.5496737", "text": "async _validate() {\n console.log('in validate');\n const buyerInfo = await Auth.getBuyer({ id: this.buyerId });\n\n if (!buyerInfo.id) {\n return Promise.reject({\n api_error_identifier: 's_o_c_v_1',\n error_msg: 'Invalid buyer id',\n buyer_id: this.buyerId\n }\n );\n }\n }", "title": "" }, { "docid": "7007b1f7d100fcd469a10ba8366db597", "score": "0.5488438", "text": "function validateAppId() {\n return Promise.resolve();\n}", "title": "" }, { "docid": "3316f0199b0783763ff998e71a88064b", "score": "0.547932", "text": "get isValid() {\n\t\treturn this.UID != -1\n\t}", "title": "" }, { "docid": "eb2eaca9cb072e4c912873a01f51287c", "score": "0.5466257", "text": "function validateUserId(req, res, next) {\n Users.getById(req.params.id)\n .then(user => {\n if (!user) {\n res.status(400).json({ message: 'Invalid user ID' });\n } else {\n req.user = req.params.id;\n next();\n }\n })\n .catch(err => {\n console.log(err);\n res.status(500).json({ message: 'Error validating user ID' });\n });\n // next();\n}", "title": "" }, { "docid": "1f7fcb73284d1985ec5acd369c45c585", "score": "0.5417491", "text": "static async validateTokenFakeAsync() {\n let response = await setTimeout(() => {}, 500);\n\n return {\n is_valid: true,\n user_id: 123098712,\n };\n }", "title": "" }, { "docid": "aba693e096f0876df363a354f332116d", "score": "0.540688", "text": "getIdToken () {\n let self = this\n return new Promise((resolve, reject) => {\n mgr.getUser().then(function (user) {\n if (user == null) {\n self.signIn()\n return resolve(null)\n } else {\n return resolve(user.id_token)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n })\n })\n }", "title": "" }, { "docid": "6766ac1877f344d0817238699316ad57", "score": "0.5391894", "text": "getSignedIn () {\n let self = this\n return new Promise((resolve, reject) => {\n mgr.getUser().then(function (user) {\n if (user == null) {\n self.signIn()\n return resolve(false)\n } else {\n return resolve(true)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n })\n })\n }", "title": "" }, { "docid": "cb2f4b1f79d70d6d1c7417472289c4d6", "score": "0.5384927", "text": "function verifyToken(idToken) {\n return new Promise(resolve => {\n admin\n .auth()\n .verifyIdToken(idToken)\n .then(decodedToken => {\n var uid = decodedToken.uid;\n console.log(\"uid er: \" + uid);\n resolve({ authenticated: true, userid: uid });\n })\n .catch(error => {\n console.log(\"Error authenticating user\", error);\n resolve({ authenticated: false, userid: \"\" });\n });\n });\n}", "title": "" }, { "docid": "ae41b652930a8d20fe923aa224290edc", "score": "0.53838265", "text": "async getUser(ID) {\n\t\ttry {\n\t\t\tconst user = await this.users.fetch(ID);\n\t\t\treturn user;\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "93e4a992c205ccb78d8ab867edfd6387", "score": "0.5348418", "text": "checkUser(stringParam, nameParam, isRequired) {\n logger.verbose('CheckService - checkUser', arguments);\n return new Promise((resolve, reject) => {\n if((typeof stringParam !== 'undefined' && typeof stringParam === 'string') ||\n (!isRequired && typeof stringParam === 'undefined')\n ) {\n resolve();\n } else {\n reject('Invalid param ' + stringParam + ' ' + nameParam);\n }\n });\n }", "title": "" }, { "docid": "0edf90b27d02462d636609914da79100", "score": "0.53321564", "text": "function validateUserId(req, res, next) {\n const id = req.params.id;\n db.getById(id)\n .then(user => {\n if (user) {\n req.user = user;\n next();\n }\n else {\n res.status(400).json({message: 'invalid user id'});\n }\n })\n .catch (err => {\n res.status(500).json({error: 'There was an error accessing that user from the database.'})\n })\n}", "title": "" }, { "docid": "351e12adc2c0f4174cba0e76c57d3cb8", "score": "0.5330227", "text": "static async exists(userId, rivalId) {\n try {\n var exists = false;\n const user = await database.select('*', 'users', `WHERE user_id = ${userId}`);\n const rival = await database.select('*', 'users', `WHERE user_id = ${rivalId}`);\n if (user.length && rival.length) {\n if (user[0].active && rival[0].active) {\n exists = true;\n }\n }\n return exists;\n } catch (e) {\n throw e;\n }\n }", "title": "" }, { "docid": "257ab286ff1934b64aeaf8167824ce8d", "score": "0.53089", "text": "function checkUserExists() {\n var pId \t= $(\"#personal-id\").val().toString();\n var exists = false;\n $.get( \"validateNewUser.do\", {personalId: pId}, \n\t\tfunction(isValidate) {\n \tif(!isValidate) { \n \t\ttoggleAlert(true, getLabel(\"lblAlertIdExists\"), \"alert-inputs\");\n \t\texists = true;\n \t}\n });\n return exists;\n}", "title": "" }, { "docid": "a934e0a2da162dc6dd6a3dae94b2a0e6", "score": "0.53053343", "text": "checkUsername(username)\n {\n const promiseResult = UserModel.checkUsername({username});\n return promiseResult;\n }", "title": "" }, { "docid": "27cbf267e80ead50a6d53effc8953994", "score": "0.5280796", "text": "function validateToken(token, username, userID) {\n return new Promise(async (resolve, reject) => {\n\n if (!token || (!username && !userID)) {\n reject();\n return;\n }\n\n let sql;\n let data = [token];\n \n // Send SQL command with the information they gave us either username or userID\n if (username) {\n sql = 'SELECT expire expiredDate FROM Users WHERE token = ? AND username = ?';\n data.push(username);\n } else {\n sql = 'SELECT expire expiredDate FROM Users WHERE token = ? AND userID = ?';\n data.push(userID);\n }\n\n let row;\n // Check database for a matching row\n // If row not found in database reject the promise\n try {\n row = await getRowDB(sql, data)\n } catch (err) {\n reject();\n return;\n }\n\n // If token is in our database check if the token expired\n let response = checkExpired(row.expiredDate);\n if (response) {\n resolve();\n } else {\n reject();\n }\n });\n}", "title": "" }, { "docid": "bf27e0195eee749a2de5a439a256864f", "score": "0.5267806", "text": "function checkUserEmail(){\n\t\t\t\t\tdf = Q.defer()\n\t\t\t\t\tquery = \"SELECT * from users where userEmail = '\" + req.body.email + \"'\";\n\t\t\t\t\tconnection.query(query ,function(err,userRow) {\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\terror = new Error();\n\t\t\t\t\t\t\terror.status = \"500\";\n\t\t\t\t\t\t\terror.message = \"Error Selecting : %s \" + err;\n\t\t\t\t\t\t\tdf.reject(error);\n\t\t\t\t\t\t} else if(userRow.length > 0 && userRow[0].userId != req.user.userId){\n\t\t\t\t\t\t\terror = new Error();\n\t\t\t\t\t\t\terror.status = \"200\";\n\t\t\t\t\t\t\terror.message = \"User Email already exists. Please try another\";\n\t\t\t\t\t\t\tdf.reject(error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdf.resolve(\"Email accepted\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn df.promise;\n\t\t\t\t}", "title": "" }, { "docid": "b7ff6b6ce05903c7aa38403d36f6c770", "score": "0.52557766", "text": "function validateUserId(req, res, next) {\n const id = req.params.id;\n\n userDb.getById(id)\n .then(user => {\n if (user) {\n next();\n } else {\n res.status(400).json({ message: \"invalid user id\" })\n }\n })\n .catch(err => {\n console.log(`error on GET /api/users/${id}`, err);\n res.status(500).json({ error: \"The user information could not be retrieved.\" })\n });\n}", "title": "" }, { "docid": "5d1e673f294ce496d67c2360f5103978", "score": "0.5227026", "text": "function conIsAnyUserID(_val) {\n if (!Match.test(_val, String)) {\n return false;\n }\n\n return (!!Meteor.users.findOne(_val));\n}", "title": "" }, { "docid": "db6a8fb637152ecd8faeefd0fcb8ff5a", "score": "0.5214867", "text": "async function checkUser(number) {\n let count = await User.count({\n where: {\n phoneNumber: number\n }\n })\n if (count != 0) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "5cf92cdd2471edb25377bc89a0b8f9d6", "score": "0.52130497", "text": "async enforceAuth() {\n\t\tif (!this.user) throw Error('The user must be signed-in to use this method.');\n\t\treturn this.refreshIdToken(); // Won't do anything if the token is valid.\n\t}", "title": "" }, { "docid": "311d5acab10fc9625ea99f2161fd29bc", "score": "0.5205797", "text": "function validateMemberId(cb_err, done) {\n if (typeof this.memberId !== 'undefined') {\n var self = this;\n PasswordRecovery.getApp(function(err, app) {\n // check existence by id\n app.models.Member.exists(self.memberId, function(err, isExist) {\n if (!isExist || err) {\n cb_err();\n }\n done();\n });\n });\n }else{\n // definition in .json will handle the 'required' case, so here, just done()\n done();\n }\n }", "title": "" }, { "docid": "096d862c184369aaaad7c223e83bc220", "score": "0.5198208", "text": "verifyUser() {\n return request.get(config.crn.url + 'users/self', {})\n }", "title": "" }, { "docid": "1151be6ca61b03c6ea46012b5c9709c7", "score": "0.5191456", "text": "checkAuthenticatedUser(shouldValidate) {\n const spid = this;\n return function *spidCheckAuthenticatedUser(next) {\n const ctx = this;\n if (shouldValidate || !ctx.session.user) {\n if (ctx.session.spidData &&\n ctx.session.spidData.user &&\n ctx.session.spidData.accessToken) {\n // TODO: Detect access token expiration and use refresh token, instead.\n try {\n let userData = yield _spidRequest(spid, {\n method: 'GET',\n uri: spidEndpoints.me,\n qs: { 'oauth_token': ctx.session.spidData.accessToken }\n });\n\n if (userData.data.userId !== ctx.session.spidData.user) {\n // Can this even happen?!\n throw new SpidError(spidEndpoints.me, 'Unexpected user ID mismatch', {\n expected: { userId: ctx.session.spidData.user },\n got: userData.data\n });\n }\n\n ctx.session.user = userData.data;\n\n console.log('[SpidClient] Authenticated user validated: ' + userData.data.userId);\n } catch (e) {\n console.log('[SpidClient] Unable to obtain user info: ' + e.message);\n delete ctx.session.user;\n }\n } else {\n delete ctx.session.user;\n }\n }\n\n yield next;\n };\n }", "title": "" }, { "docid": "073e106768dd2345b39c8d7acc6fad9f", "score": "0.5185622", "text": "async function checkUser(uberUUDI, dbUUID) {\n\n}", "title": "" }, { "docid": "234a5dce2ca439c06138e8615aa8e5c5", "score": "0.51837873", "text": "async function checkUserInDB(uid) {\n\n const check = await UserTable.query().findOne({ uid: uid });\n\n if (check) {\n return true;\n }\n else {\n return false;\n }\n} // end function checkUserInDB", "title": "" }, { "docid": "bea024c6d2a22e500580a17f4426e3d8", "score": "0.5176218", "text": "function validate(data){\n return new Promise(function(res, rej){\n res(data);\n });\n }", "title": "" }, { "docid": "a780d5e3eaf593762cadd8d11194d2b0", "score": "0.5172798", "text": "function isUserExist(id, next){\n\tpool.query(\"SELECT * FROM user WHERE user_id =?\", [id], (err,results,fields)=>{\n\t\t\tlet isExist = results.length < 1 ? false:true;\n\t\t\tnext(isExist);\n\t});\n}", "title": "" }, { "docid": "62b9db2509f2ae512218cf046a990860", "score": "0.5172545", "text": "async function validateOwnership(commentId, username) {\n const comment = await commentRepo.byId(commentId);\n return comment && comment.username === username;\n }", "title": "" }, { "docid": "e5ced52e1483aa9f5c17ca76b788b3f9", "score": "0.51604563", "text": "function getUser() {\n let user = { id: 1, name: 'ram' };\n if (user) {\n return new Promise((resolve, reject) => {\n setTimeout(resolve, 5000, user);\n });\n } else {\n return new Promise((resolve, reject) => {\n setTimeout(resolve, 5000, { message: 'User not found' });\n });\n }\n}", "title": "" }, { "docid": "248e245eff2c8c7cd7eafb9a5fb66f85", "score": "0.51594925", "text": "async function validateId(id){\n let entities = ['user','chirp','replay'];\n for ( var i in entities )\n if ( id.indexOf(entities[i]) == 0 )\n return getObject( id, entities[i] ).time.read()\n .then( time => {\n if ( time && time > 0 )\n return id;\n else throw \"Invalid \"+entities[i]+\" id \"+id\n })\n .then( resolveId )\n throw \"Invalid id \"+id;\n}", "title": "" }, { "docid": "e26561dd6187d0524ec0b0b3719f5757", "score": "0.51481414", "text": "async function getUser(id){\n const e = await api.getUserById (id).then(res=>{\n if(res.data.success){\n const user = res.data.data\n return user\n }else{\n return false\n }\n \n })\n return e\n }", "title": "" }, { "docid": "8396d1d1e3fd65cfcdc393288d73818a", "score": "0.51419824", "text": "function userid_validation(userid)\n{\n\tif(userid!=\"\")\n\t{\n\t\tvar match=userid.match(/[a-z0-9]*/i);\n\t\t//console.log(match);\n\t\tif(match[0].length!=userid.length)\n\t\t{\n\t\t\tdocument.getElementById(\"userid_validation\").innerHTML=\"The UserId is invalid, it can only contain alpha-numeric characters\";\n\t\t\tdocument.getElementById(\"userid_validation\").value=\"incorrect\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tajax_json(server_root+\"/ajax/verify_id.php\",{userid:userid},function(response_object)\n\t\t\t{\n\t\t\t\tif(response_object.status==\"match\")\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"userid_validation\").innerHTML=\"This ID already exists, choose a different ID.\";\n\t\t\t\t\tdocument.getElementById(\"userid_validation\").value=\"incorrect\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"userid_validation\").innerHTML=\"User ID is available.\";\n\t\t\t\t\tdocument.getElementById(\"userid_validation\").value=\"correct\";\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b314410cd592a08a3c08e9a9e786a7f3", "score": "0.51410985", "text": "roomValidate(roomId) {\n return __awaiter(this, void 0, void 0, function* () {\n config_1.log.silly('Puppet', 'roomValidate(%s) base class just return `true`', roomId);\n return true;\n });\n }", "title": "" }, { "docid": "6abaee72b8d29c801aa5293984aa5fb3", "score": "0.5125621", "text": "async isExistByUserId(userId){\n const ret = await db('user').where('user_id',userId);\n\n if(ret.length === 0){\n \n\n return null;\n }\n return ret[0];\n }", "title": "" }, { "docid": "15f996f62fe14e058601eaee8f9a0496", "score": "0.5101261", "text": "function checkIfUsersExist () {\n\treturn new Promise(function (resolve, reject) {\n\t\tUser.count({}, (err, count) => {\n\t\t\tif(err)\n\t\t\t\treject(err);\n\t\t\tresolve(count);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "abeb4d07e1249caf7aa6581c536cc86c", "score": "0.5100093", "text": "async function hasValidSession() {\n const email = getSessionItem(\"email\");\n if (email === false) return false;\n const response = await communication.hasValidSession(email);\n if (!(\"success\" in response)) return false;\n return response.success;\n}", "title": "" }, { "docid": "a090137701eda0c29787a718fb37cb40", "score": "0.5091031", "text": "async function isVisitIdValid(con, vid = 0) {\n\n return new Promise(\n function (resolve, reject) {\n\n //Query to get visitId from Visit table \n let q = `SELECT id FROM ${constants.DB.visitTable} WHERE id='${vid}' limit 1`;\n\n con.query(q, function (err, rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n }\n );\n}", "title": "" }, { "docid": "a090137701eda0c29787a718fb37cb40", "score": "0.5091031", "text": "async function isVisitIdValid(con, vid = 0) {\n\n return new Promise(\n function (resolve, reject) {\n\n //Query to get visitId from Visit table \n let q = `SELECT id FROM ${constants.DB.visitTable} WHERE id='${vid}' limit 1`;\n\n con.query(q, function (err, rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n }\n );\n}", "title": "" }, { "docid": "06c83344c67c42653ad826c1ad15ad48", "score": "0.50866467", "text": "isUserRegistered(userid, callback) {\n AsyncStorage.getItem('@BEN:LastAuthToken', function(error, value) {\n if(error != undefined && error != null) {\n callback(false);\n } else {\n return (value == userid);\n }\n })\n }", "title": "" }, { "docid": "873592fd7716b87e0effe008a24f17b8", "score": "0.50834006", "text": "async getByUserId(inputData) {\n try {\n const { userId } = inputData;\n\n // Get user from DB\n const userResult = await this.UserSchema.findOne({\n attributes: this.sqlSelectFields,\n where: { userId, status: 'A' }\n });\n // Send error message\n if(!userResult || !(userResult instanceof this.UserSchema) || !userResult.userId) {\n return { error: true, errorCode: this.dataNotFoundErrorCode, message: this.dataNotFoundMsg };\n }\n\n // User present\n return { error: false, message: 'User found', data: { user: [userResult] } };\n }\n catch(e) {\n logger.error(`sequelize:user getByUserId() function => Error = `, e);\n throw e;\n }\n }", "title": "" }, { "docid": "1d1c4f249df508410c2ef7045cf976ab", "score": "0.5067503", "text": "function validateUser(value, callback) {\n mongoose.model('User').findOne({ _id: ObjectId(value) }).exec(function(err, user) {\n if (err || !user) {\n return next(err);\n }\n callback();\n });\n}", "title": "" }, { "docid": "1739cd10ac1ff7cf335c7761b722c6d9", "score": "0.5060738", "text": "checkEmail(email)\n {\n const promiseResult = UserModel.checkEmail({email});\n return promiseResult;\n }", "title": "" }, { "docid": "b3e4cda3c4a2e59c3467da94ba872a02", "score": "0.5046849", "text": "async function DoesUserExist(email) {\n //1,2,10 are error codes\n try {\n return await db.collection('users').doc({\n email: email\n }).get().then(document => {\n if (document == undefined) {\n return false;\n //User doesnot exist\n } else {\n return true;\n //User does exist\n }\n })\n\n } catch (error) {\n return true;\n }\n}", "title": "" }, { "docid": "79de8379b871c72db1f1b9b473377e68", "score": "0.5040869", "text": "function identifyUser(req) {\n return new Promise((resolve, reject) => {\n query.user(req.body.username).then((result) => {\n if (result.length === 0) {\n reject('Username does not exist.');\n } else {\n comparePassword(result, req)\n .then((result) => {\n resolve(result);\n })\n .catch((result) => {\n reject(result);\n });\n }\n })\n })\n }", "title": "" }, { "docid": "6d91706aa3948df27609ba8af65b8373", "score": "0.5035954", "text": "function userid_validation(uid, mx, my) {\n //Declaring a variable to store length of user_id\n var uid_len = uid.value.length;\n //Checks for whether the user_id.length is between mx & my or == 0\n if (uid_len == 0 || uid_len >= my || uid_len < mx) {\n //If false alert user with a pop-up message\n alert(\n \"User Id should not be empty / length be between \" + mx + \" to \" + my\n );\n //And focus on the input field\n uid.focus();\n //Returns false\n return false;\n }\n //Returns false\n return true;\n}", "title": "" }, { "docid": "bc69988fb7418dc0f319ca77ad31095b", "score": "0.5032078", "text": "function userCheck(email) {\n return new Promise((resolve, reject) => {\n db.pool.query(\"SELECT * FROM users WHERE email = ?\", [email], (error, results, fields) => {\n if(error) throw error;\n\n if(results.length > 0) {\n reject('Account already exists');\n } else {\n resolve();\n }\n });\n });\n}", "title": "" }, { "docid": "9cb3af1e1ba00d8b9fc33b678551aeca", "score": "0.501344", "text": "function validateUserId(req, res, next) {\n const id = req.params.id\n if (id) {\n const user = getById(req.params.id)\n req.user = user;\n next();\n } else {\n res.sendStatus(400).json({message: \"invalid user id\"})\n }\n next();\n}", "title": "" }, { "docid": "8d5a775909b7d6493334dbcab17898b4", "score": "0.5009051", "text": "static validateId(requestId) {\n return localDataStore.has(requestId);\n }", "title": "" }, { "docid": "e194c8d344a746cb07afd854478db527", "score": "0.50009894", "text": "async authCheck() {\n var response = await fetch(this.objectUrl(\"check\"),{\n method: \"GET\",\n mode: \"cors\",\n cache: \"no-cache\",\n headers: {\n \"Authorization\": `Bearer ${this.state.refreshToken}`\n }\n });\n response = await response.json();\n \n return (response.success === true) ? response.userId: null;\n }", "title": "" }, { "docid": "b9ee69e5766e8cec5c72dbf031871ae3", "score": "0.49984366", "text": "idFieldIsValid(value){\n\t\tconst LONGUEUR_MIN_ID = 4;\n\t\t/*change hexaId required length by changing this part: '^([A-Fa-f0-9]{1}){minValue,maxvalue}$', leave a value empty for not setting a limit*/\n\t\tconst isHexa = new RegExp('^([A-Fa-f0-9]{1}){4,}$');\n\t\tif(value.length >= LONGUEUR_MIN_ID){ \n\t\t\tif(isHexa.test(value)===false){\n\t\t\t\tthis.setState({idError: true});\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tthis.setState({idError: false});\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\tthis.setState({idError: true});\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "77e9958ad0e3c59ed3dd0ac5d52a41de", "score": "0.49984202", "text": "async function checkForUser() {\n try {\n await Auth.currentSession();\n authenticateLogin();\n return true;\n }\n catch (e) {\n console.log(e)\n return false;\n }\n }", "title": "" }, { "docid": "448aa7a851f054fa253daadc76e473e1", "score": "0.49966994", "text": "function checkGoogleUser(googleId,email,nome,cognome,propicUrl) { //? Controlla l'account google dell'utente rispetto al nostro DB\n\n return new Promise(function(resolve,reject) {\n\n database.getUser(email.split(\"@\")[0]).then((returned) => {\n let user = returned;\n switch (user) {\n case false: //? Utente non presente nel DB: creazione\n createGoogleUser(googleId,email,nome,cognome,propicUrl).then((returned) => {\n resolve([\"created\",returned]);\n }).catch((err) => {\n console.log(\"DATABASE ERROR: \"+err);\n reject([-1]);\n }); \n break; \n \n case -1: //? Errore\n resolve([-1]); \n \n default: \n \n if(user.googleId == googleId) { //? Utente presente nel DB: verifica \n verifyGoogleUser(email,googleId).then((returned) => {\n resolve([\"verified\",returned]);\n }).catch((err) => {\n console.log(\"DATABASE ERROR: \"+err);\n reject([-1]);\n });\n break;\n }\n \n else { //? Utente presente nel DB ma senza googleID: associazione\n associateGoogleUser(email,googleId).then((returned) => {\n resolve([\"associated\",returned]);\n }).catch((err) => {\n console.log(\"DATABASE ERROR: \"+err);\n reject([-1]);\n });\n break;\n }\n \n }\n }).catch((err) => {\n console.log(\"DATABASE ERROR: \"+err);\n reject([-1]);\n });\n\n });\n\n}", "title": "" }, { "docid": "3030a94400b12691da61a2ae02dc752a", "score": "0.4991433", "text": "function validateUser(){\n\t//send request to make sure that username is unique\n}", "title": "" }, { "docid": "89d4f9d8adc93d74666fdc78ba7e9409", "score": "0.49883768", "text": "async function userConstraint(userId) {\n\n const violation = \"Invalid user ID:\\nThis user can not submit a review on this plan.\";\n\n try {\n\n const sql = \"SELECT * FROM User WHERE email=?;\";\n const results = await pool.query(sql, userId);\n\n if (results[0].length === 0) {\n throw ConstraintViolation(violation, 403);\n } else if (results[0][0].role === 0) {\n throw ConstraintViolation(violation, 403);\n } else {\n return results[0][0].role.toString(10);\n }\n\n } catch (err) {\n console.log(\"Error checking user constraint\\n\");\n throw err;\n }\n\n}", "title": "" }, { "docid": "760978a703e4aafe6cc2f042df2394f5", "score": "0.4987736", "text": "checkIfWhitelisted(userId, repoId){\n let client = this.connectToDatabase()\n let key = repoId +\":whitelist\" //key for whitelist\n\n return client.sismemberAsync(key, userId)\n .then(function(response){\n client.quit()\n return !!response //convert 0 and 1 to boolean\n })\n }", "title": "" }, { "docid": "b4688512d8329548ef77d3f052b21ed7", "score": "0.49842077", "text": "async function checkUsername(id) {\n\tlet username = document.getElementById('input_' + id).value;\n\n\t// Clear username's error, enable 'Register' button, show 'Loader' icon\n\tclearError('error_' + id);\n\tenableButton('info_submit');\n\tshowLoader('loader_' + id);\n\n\t// Fetch post request for checking if such username exists in the database\n\tconst usrnm_response = await fetchPost('/FpCerpd9Z7SIbjmN81Jy/username', {\n\t\tusername: username\n\t});\n\n\t// Hide 'Loader' icon\n\thideLoader('loader_' + id);\n\n\t// Check for possible error\n\tif(!usrnm_response.success) {\n\t\tdisplayError(('error_' + id), usrnm_response.message);\n\t\tdisableButton('info_submit');\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "4d6bf2ee9dd62e6a0758613ac21495ef", "score": "0.4982392", "text": "function usernameValidator(username) {\n return User.findOne({ Username: username })\n .then(user => {\n return user ? false : true;\n })\n .catch(err => {\n console.error(err);\n });\n}", "title": "" }, { "docid": "ce0bf1a714053be9d210fe4cf141f0a0", "score": "0.4980362", "text": "function isValidID(id) {return id != null }", "title": "" }, { "docid": "4dbe308ed06d55920a09a1516a2433b1", "score": "0.4964092", "text": "async function checkUsernamePresent(name) {\n var valid = await db.getPlayer(name);\n if (valid === null)\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "e8bea22c023874b6d487827081fa2617", "score": "0.495732", "text": "function checkUserName(){\n \tdf = Q.defer();\n \tquery = \"SELECT * from users where userName = '\" + req.body.userName + \"'\";\n \tconnection.query(query ,function(err,userRow) {\n \t\tif(err) {\n \t\t\terror = new Error();\n \t\t\terror.status = \"500\";\n \t\t\terror.message = \"Error Selecting user name for duplicates: %s \" + err ;\n \t\t\tdf.reject(error);\n \t\t} else if(userRow.length > 0 && userRow[0].userId != req.user.userId){\n \t\t\terror = new Error();\n \t\t\terror.status = \"200\";\n \t\t\terror.message = \"User Name already exists. Please try another.\";\n \t\t\tdf.reject(error);\n \t\t} else {\n \t\t\tdf.resolve(\"User name accepted\");\n \t\t}\n \t});\n \treturn df.promise;\n }", "title": "" }, { "docid": "69f99c9d7f791c440748a76fac515664", "score": "0.49564344", "text": "function usernameCheck(username){\n return new Promise((resolve,reject) => {\n userModel.exists({username: username}, (err,docs) => {\n if (err){\n return reject(err)\n }\n else{\n resolve(docs)\n }\n })\n })\n}", "title": "" }, { "docid": "2d9b8cb49e136fc50b9589fde8d5cf41", "score": "0.49518704", "text": "verifyUser (callback) {\n request.get(config.crn.url + 'users/self', {}, callback);\n }", "title": "" }, { "docid": "04745670f0972f08106acbdd03d7dab8", "score": "0.49476734", "text": "validate() {\n var values = [];\n\n for (var idx = 0; idx < this.fields.length; idx++) {\n var value = this._deepValue(this.model, this.fields[idx]);\n values.push(value);\n }\n\n var valid = this._evalFunc.apply(this, values);\n if (!valid) {\n this.fire('oe-validator-error', this.error);\n } else {\n this.fire('oe-validator-ok');\n }\n return Promise.resolve({\n valid: valid,\n message: this.error\n });\n }", "title": "" }, { "docid": "4f0ca94cc14e1ade6c56513b4f650aec", "score": "0.49447483", "text": "function validate(emailObj) {\n return new Promise((resolve) => resolve(emailObj));\n}", "title": "" }, { "docid": "fe6dcf14500cf805143c24c06b7a479e", "score": "0.49430278", "text": "async getValidAccessToken() {\n // prevent multiple parallel refresh processes\n if (this._getValidAccessTokenPromise) {\n return await this._getValidAccessTokenPromise\n } else {\n this._getValidAccessTokenPromise = this._getValidAccessToken()\n const result = await this._getValidAccessTokenPromise\n this._getValidAccessTokenPromise = null\n return result\n }\n }", "title": "" }, { "docid": "4c33140a161de0770b249170738934a7", "score": "0.494254", "text": "function handleAlwaysThen(UserId) {\n\treturn new Promise((resolve, reject) => {\n\t\tgetUserData(UserId)\n\t\t.then((data) => {\n\t\t\tif (data.Item.UserId == UserId) {\n\t\t\t\tresolve({success: true, checkFirst: \"returning\"});\n\t\t\t} else {\n\t\t\t\tresolve({success: false, checkFirst: \"UserId not matched\"});\n\t\t\t}\n\t\t})\n\t\t.catch((err) => {\n\t\t\tresolve({success: false, checkFirst: \"firstSession\"});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c02aa66a196901c6775ca95664f7a29f", "score": "0.49366614", "text": "function userExists(id){\n return getUserIndex(id) != -1\n}", "title": "" }, { "docid": "31366ff7050aea1daec4b05d31c30cf9", "score": "0.49323046", "text": "isAuthenticated() {\n return __awaiter(this, void 0, void 0, function* () {\n const user = yield this.getUser();\n return !!user;\n });\n }", "title": "" }, { "docid": "40f67cd1cdeeb053e00cd3e1f975f549", "score": "0.4929434", "text": "function _getUserById(userId, callback) {\n validate.valID(userId, function (data) {\n if (data) {\n User.getUserById(userId, function (data2) {\n callback(data2)\n })\n } else callback(false)\n })\n}", "title": "" }, { "docid": "951d438455905ecbbfbac7f5ccd98156", "score": "0.49225965", "text": "async validateEmail({ email }) {\n if (!this.isAnEmailString(email)) {\n throw new Error(\n `Cannot call validateEmail without a valid email address`\n );\n }\n\n const foundUser = await this.readOne(\n { _id: email },\n { registration_expires: 1 }\n );\n\n if (!foundUser) return false;\n\n // check if this is during registration workflow\n if (\n foundUser?.registration_expires &&\n this.registrationExpired(foundUser.registration_expires)\n ) {\n return 'expired';\n }\n return true;\n }", "title": "" }, { "docid": "c885eebf1ff33d8862d94740bc0f81a4", "score": "0.49223936", "text": "static async checkTIdAsId(tid) {\n let validationResult = BobaTea.checkTId( tid);\n if ((validationResult instanceof NoConstraintViolation)) {\n if (!tid) {\n validationResult = new MandatoryValueConstraintViolation(\n \"A value for the ID must be provided!\");\n } else {\n let DocSn = await db.collection(\"BobaTea\").doc( tid).get();\n if (DocSn.exists) {\n validationResult = new UniquenessConstraintViolation(\n \"There is already a bobatea with this ID!\");\n } else {\n validationResult = new NoConstraintViolation();\n }\n }\n }\n return validationResult;\n }", "title": "" }, { "docid": "1a84fb4ac11a15d3aee7498ac3e51a63", "score": "0.49220577", "text": "function isUser(userName) {\n debug(`checking user exists \"${userName}\"`);\n return new Promise(function(resolve, reject) {\n redisClient.hexists(USERKEY, userName, function (err, data) {\n if (err) reject(err);\n debug(`user \"${userName}\" hexist with response ${data}`);\n resolve(data);\n })\n });\n}", "title": "" }, { "docid": "7d4e6d8ccfee20cfa5bf7578b5f9d75a", "score": "0.49156895", "text": "async function checkUserIsValid(req, res, next) {\n let query =\n \" SELECT * FROM emoji_db.users where email = '\" + req.body.email + \"'\";\n // await db.execute(query, (err, res) => {\n // console.log(query);\n // if (err) throw err;\n // let userIsValid;\n // let errorMsg;\n // if(res.length > 0){\n // console.log(\"res.length > 0\");\n // userIsValid = 0;\n // errorMsg = 'the user exists';\n // }else{\n // console.log(\"res.length == 0\");\n // userIsValid = 1;\n // }\n // req.userIsValid = userIsValid;\n // req.errorMsg = errorMsg;\n // req.class_id = req.body.classID;\n // next();\n // });\n try {\n const [res, err] = await db.execute(query);\n let userIsValid;\n let errorMsg;\n if (res.length > 0) {\n // console.log(\"res.length > 0\");\n userIsValid = 0;\n errorMsg = \"the user exists\";\n } else {\n // console.log(\"res.length == 0\");\n userIsValid = 1;\n }\n req.userIsValid = userIsValid;\n req.errorMsg = errorMsg;\n req.class_id = req.body.classID;\n next();\n } catch (e) {\n console.log(\"Catch an error: \", e);\n }\n}", "title": "" }, { "docid": "db933fb9578b6d53947d555309137904", "score": "0.49131304", "text": "function checkUserExists(req, res, next) {\n var project = BuscaProjetoPorId(req.params.id);\n if (!project) {\n return res.status(400).json({error: 'This user id does not exists'})\n }\n return next();\n}", "title": "" }, { "docid": "08bb7a6310084a7685b172445c830784", "score": "0.4912764", "text": "function usernameExists(){\n\t\tvar deferred = Q.defer();\n\t\tpgClient.query(\"SELECT username FROM users WHERE username = $1\", [username], function(err, result){\n\t\t\tif (result.rowCount > 0){\n\t\t\t\terrors.push( { name: \"username\", message: \"Username already in use\" } );\n\t\t\t\tdeferred.reject(new Error(\"Username already in use\"));\n\t\t\t}else{\n\t\t\t\tdeferred.resolve();\n\t\t\t}\n\t\t});\n\t\treturn deferred.promise;\n\t}", "title": "" }, { "docid": "cdbfaa51d18d1f64515a21a4df18bf6d", "score": "0.4912194", "text": "static async checkIdAsId(did) {\n let validationResult = Drink.checkDId( did);\n if ((validationResult instanceof NoConstraintViolation)) {\n if (!did) {\n validationResult = new MandatoryValueConstraintViolation(\n \"A value for the ID must be provided!\");\n } else {\n let DocSn = await db.collection(\"Drink\").doc( did).get();\n if (DocSn.exists) {\n validationResult = new UniquenessConstraintViolation(\n \"There is already a drink with this ID!\");\n } else {\n validationResult = new NoConstraintViolation();\n }\n }\n }\n return validationResult;\n }", "title": "" }, { "docid": "a7a78a72d4c5306a62e4d99bde9114f0", "score": "0.4911171", "text": "function isUserValid(bool) {\n return bool;\n}", "title": "" }, { "docid": "866485825f89b32bd59cda16af8e5839", "score": "0.4908899", "text": "function isUserValid(bool) {\n return bool;\n}", "title": "" }, { "docid": "88921067d4a6c320207758deaf0d8b34", "score": "0.48991498", "text": "authorizeUser() {\n\n return new Promise(function (resolve, reject) {\n\n //\n // First, set the api key. Wait for it to stick.\n //\n gapi.client.setApiKey(apiKey);\n window.setTimeout(_ => {\n authorizeUser();\n }, 1);\n\n //\n // Then, authorize the user (OAuth login, get the user to accept, etc.)\n //\n var authorizeUser = () => {\n gapi.auth.authorize({\n client_id: clientId,\n scope: scopes,\n immediate: true\n }, handleAuthResult);\n }\n\n //\n // Now, Google has authenticated the user or not. If there was an error, the user must log in\n // via a popup hosted by Google..\n //\n var handleAuthResult = (authResult) => {\n if (authResult && !authResult.error) {\n console.log('you are authorized');\n accessToken = authResult.access_token;\n loadGmailApi();\n } else {\n //\n // We have a problem! The user will need to log in using the GMail popup dialog.\n //\n reject();\n }\n }\n\n var loadGmailApi = () => {\n gapi.client.load('gmail', 'v1', _ => {\n resolve(true);\n });\n }\n });\n }", "title": "" }, { "docid": "a58bed1670003fa2203d8f5eb3770d12", "score": "0.48987147", "text": "async isValidUserCredentials(params) {\n const enteredValue = params.username.toLowerCase();\n const user = await UserModel.findOne({ $or: [{ username: enteredValue }, { email: enteredValue }] }).lean();\n if (user === null) { return Promise.reject('No user found with that username or email.') }\n return bcrypt.compare(params.password, user.password).then(res => {\n if (res) {\n return user;\n } else {\n return false;\n }\n });\n }", "title": "" }, { "docid": "097f02e4a6ea09a4b32e50d417afd080", "score": "0.48885354", "text": "function verifyAdmin(user_id) {\n return new Promise((resolve, reject) => {\n let results = db.pgQuery('SELECT id FROM admin;')\n results.then(value => {\n if(value.rowCount === 0) {\n reject('Workspace needs init first!')\n } else {\n if(user_id !== value.rows[0]['id']) {\n reject('Only Admin can use this command!')\n } else {\n resolve('')\n }\n }\n }).catch(err => {\n reject(err.message||err)\n })\n })\n}", "title": "" }, { "docid": "38ec1c6e9003354acadd96fea4a0a420", "score": "0.48848334", "text": "async function is_registered() {\n const openid = login();\n const db = wx.cloud.database();\n const lkup = db.collection(\"users\").where({\n _id: openid\n });\n return lkup.count()\n .then(count => count.total == 0 ? false : lkup.get())\n .then(datas => datas ? datas.data[0] : false);\n}", "title": "" }, { "docid": "2c95f2264755672ae36a0b5de89f39af", "score": "0.48834157", "text": "static userIdGET({ id }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "title": "" }, { "docid": "46d955cb0e48f153b975ceb9521b69aa", "score": "0.48814017", "text": "getUserById(userId)\n {\n const promiseResult = UserModel.findUserById({userId});\n return promiseResult;\n }", "title": "" }, { "docid": "678bc3bb9cf0d66046f5f3f5d8200934", "score": "0.48770005", "text": "async function findUser(username) {\n const userExits = await database.checkIfUserExits(username);\n if (!userExits) { \n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "c9a23cb3176ac3f709bba81f84216d99", "score": "0.48743677", "text": "function checkUserAuth(req) {\n\tconst {token} = req.headers\n\n\treturn auth\n\t\t.verifyIdToken(token)\n\t\t.then((decodedToken) => {\n\t\t\t// returns userID\n\t\t\treturn decodedToken.uid\n\t\t})\n\t\t.catch((error) => {\n\t\t\tthrow error\n\t\t})\n}", "title": "" }, { "docid": "e567bbba17fcd4dc521436e0fb8425f6", "score": "0.48525217", "text": "checkUser() {\n return Meteor.userId() ? true : false;\n }", "title": "" }, { "docid": "dc1a5e684df251b4e60f14f210a17d29", "score": "0.484185", "text": "async isValidRFToken(user_id, refreshToken){\n const user = await db('user').where('user_id',user_id);\n if(user.length === 0){\n return false;\n }\n return user[0].refresh_token === refreshToken;\n }", "title": "" } ]
16d32b18f7138a69986022ab56578514
function to store the state of the game, move the postions of the player
[ { "docid": "57d2d02dd877f9266ecf436e5fa0fcdb", "score": "0.66401803", "text": "function move(playerNo) {\n let dice;\n toggleTurn(playerNo);\n dice = rollDice();\n\tdocument.querySelector(\".player\"+playerNo).innerHTML = dice;\n players[playerNo].position += dice;\n postionCheck(playerNo);\n\tlocalStorage.setItem('playerPositions', JSON.stringify(players));\n}", "title": "" } ]
[ { "docid": "b8a22a9d441629bb58cf8804633076e6", "score": "0.66398376", "text": "SavePosition() {\n saveGame({ currentMap: this.scene.key, playerX: this.player.x, playerY: this.player.y, readyToEnter: this.readyToEnter });\n }", "title": "" }, { "docid": "d15326584d288c7869fae957ce352997", "score": "0.6620293", "text": "postPlay(move) {\n this.pmoves.push(this.getPmove(move));\n }", "title": "" }, { "docid": "fde4ea91d0fc2a137547baf4c0056587", "score": "0.6602841", "text": "function handleGameState(state){\n // Latency checking\n var currentUpdate = new Date();\n //console.log(\"Last update \"+(currentUpdate - lastUpdate) + \"ms ago\");\n lastUpdate = currentUpdate;\n\n if (window.player.role === ROLE_JAILER){\n for(var player in state.players){\n switch(state.players[player].role){\n case ROLE_APE:\n var xPos = state.players[player].state.x;\n var yPos = state.players[player].state.y;\n var scale = state.players[player].state.scale;\n\n remoteApe.x = xPos;\n remoteApe.y = yPos;\n remoteApe.scale = scale;\n remoteApe.frame = state.players[player].state.frame;\n remoteApe.name = state.players[player].name;\n\n if(apeName){\n apeName.text = state.players[player].name;\n var nameXPos = Math.floor(xPos + ape.width / 2) - ((scale.x === 1) ? ape.width : 0);\n apeName.x = nameXPos;\n apeName.y = yPos - 65;\n }\n\n\n //TWEEN DAT\n if(ape.currentTween){\n game.tweens.remove(ape.currentTween);\n }\n\n ape.currentTween = game.add.tween(ape).to({\n x: [xPos],\n y: [yPos]\n },30).interpolation(Phaser.Math.bezierInterpolation).start();\n\n ape.scale = scale;\n ape.frame = state.players[player].state.frame;\n break;\n case ROLE_JAILER:\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "28cd416f0bf3e1b16996aea5485693d2", "score": "0.6570028", "text": "function savedState() {\n players = JSON.parse(localStorage.getItem('playerPositions')) || [{position: 0},{position: 0}]\n if(players[0].position && players[1].position) {\n\t\tdisplayPlayer(0, players[0].position);\n\t\tdisplayPlayer(1, players[1].position);\n\t}\n}", "title": "" }, { "docid": "2e464ed72ea13c96b51f10b01bbb659f", "score": "0.6443647", "text": "function updateState(state) {\n\n //draw a white background\n background(255, 255, 255);\n\n //iterate through the players\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n\n //in this case I don't have to draw the pointer at my own position\n if (playerId != socket.id) {\n var playerState = state.players[playerId];\n let img = pointer;\n if (playerState.alt) img = pointerAlt;\n //draw a pointer image for each player except for myself\n if (playerState.d==0) image(img, playerState.x, playerState.y);\n }\n }\n }\n let img = pointer;\n if (showAlt) img = pointerAlt;\n //draw a pointer image for each player except for myself\n if (state.players[socket.id].d==0) image(img, mouseX, mouseY);\n else {\n text(\"YOU ARE DECEASED\",width/2,height/2);\n }\n\n}", "title": "" }, { "docid": "bc6e83ff5411381c37581e2f10a0c175", "score": "0.6424925", "text": "setPlayer(props) {\n let {\n playerNumber,\n playerPosition,\n prevPlayerPos,\n boardHeight,\n boardWidth,\n areaHeight,\n areaWidth,\n gameOver\n } = props\n let {\n board,\n vanish,\n entityStates\n } = this.state\n let px, py, nx, ny, vanishNum = boardHeight + boardWidth - 2\n for (let i = 0; i < playerNumber; i++) {\n px = prevPlayerPos[i].x\n py = prevPlayerPos[i].y\n board[Math.floor(py / areaHeight)][Math.floor(px / areaWidth)][py % areaHeight][px % areaWidth] = entityStates.empty\n }\n for (let i = 0; i < playerNumber; i++) {\n nx = playerPosition[i].x\n ny = playerPosition[i].y\n board[Math.floor(ny / areaHeight)][Math.floor(nx / areaWidth)][ny % areaHeight][nx % areaWidth] = entityStates.player + i\n if (Math.floor(ny / areaHeight) + Math.floor(nx / areaWidth) - 1 < vanishNum) vanishNum = Math.floor(ny / areaHeight) + Math.floor(nx / areaWidth) - 1\n }\n if (gameOver) vanishNum = boardHeight + boardWidth - 2\n for (let i = 0; i <= vanishNum; i++) vanish[i] = true\n this.setState({\n board: board,\n playerPosition\n })\n }", "title": "" }, { "docid": "2ef4858da329cc4a9815ac00b029f197", "score": "0.6378412", "text": "function GameState() {\n 'use strict';\n var state = {\n OppMonsterZones: [],\n AIMonsterZones: [],\n OppSpellTrapZones: [],\n AISpellTrapZones: [],\n OppGraveyard: [],\n AIGraveyard: [],\n OppBanished: [],\n AIBanished: [],\n OppHand: [],\n AIHand: [],\n OppExtraDeck: [],\n AIExtraDeck: [],\n OppMainDeck: [],\n AIMainDeck: []\n };\n\n function move() {\n\n }\n\n function loadDeck(player, deck, cardList) {\n\n }\n return {\n move: move,\n GetOppMonsterZones: function () {\n return state.OppMonsterZones;\n },\n GetAIMonsterZones: function () {\n return state.AIMonsterZones;\n },\n GetOppSpellTrapZones: function () {\n return state.OppSpellTrapZones;\n },\n\n GetAISpellTrapZones: function () {\n return state.AISpellTrapZones;\n },\n GetOppGraveyard: function () {\n return state.OppGraveyard;\n },\n GetAIGraveyard: function () {\n return state.AIGraveyard;\n },\n GetOppBanished: function () {\n return state.OppBanished;\n },\n GetAIBanished: function () {\n return state.AIBanished;\n },\n GetOppHand: function () {\n return state.OppHand;\n },\n GetAIHand: function () {\n return state.AIHand;\n },\n GetOppExtraDeck: function () {\n return state.OppExtraDeck;\n },\n GetAIExtraDeck: function () {\n return state.AIExtraDeck;\n },\n GetOppMainDeck: function () {\n return state.OppMainDeck;\n },\n GetAIMainDeck: function () {\n return state.AIMainDeck;\n },\n loadDeck: loadDeck\n };\n\n}", "title": "" }, { "docid": "658f033e846d56641c733264965f58de", "score": "0.6344964", "text": "function StorePvMove(move) {\n\tvar index = Board.posKey % PVENTRIES;\n\t// Overwrites the position key in the index of the PvTable and the move string in the index of the PvTable\n\tBoard.PvTable[index].posKey = Board.posKey;\n\tBoard.PvTable[index].move = move;\n}", "title": "" }, { "docid": "ebbb0c6855fc06227a84b0b6e075319e", "score": "0.62972736", "text": "function move(state) {\n for(var t = 0; t < state.team.length; t++) {\n for(var i = 0; i < state.team[t].length; i++) {\n // Dont move the controlling player\n // if(t == state.controlling_team && i == state.controlling_player) { continue; }\n // Randomly move players to a section based on the PDF\n var n = Math.random();\n for(var k = state.team[t][i].move.length-1; k >= 0 ; k--) {\n\t if(n >= state.team[t][i].move[k] && (Math.max(k, state.team[t][i].section) - Math.min(k, state.team[t][i].section)) < 2) {\n // Assign new locations\n state.team[t][i].section = k;\n state.team[t][i].x = gen_x(k);\n state.team[t][i].y = gen_y();\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ee90910bbfbb00361d672b63936d6c6f", "score": "0.62891537", "text": "function saveState() {\n\tvar stackMaxPlusOne = 4;\n\tif(gameType == 'creator') {\n\t\tstackMaxPlusOne = 11;\n\t}\n\tstate = {\n\t\t'level': level,\n\t\t'dimensions': level.dimensions,\n\t\t'row': row,\n\t\t'col': col,\n\t\t'moves': moves,\n\t\t'tiles': tiles,\n\t\t'curColumnsRight': curColumnsRight,\n\t\t'curColumnsLeft': curColumnsLeft,\n\t\t'curRowsTop': curRowsTop,\n\t\t'curRowsBottom': curRowsBottom,\n\t\t'flippedColumnsRight': flippedColumnsRight,\n\t\t'flippedColumnsLeft': flippedColumnsLeft,\n\t\t'flippedRowsTop': flippedRowsTop,\n\t\t'flippedRowsBottom': flippedRowsBottom,\n\t\t'actionStack': actionStack.toString(),\n\t\t'matrix': []\n\t};\n\tfor(var i = 0; i < level.dimensions; i++) {\n\t\tstate.matrix[i] = matrix[i].slice();\n\t}\n\t// add as first element of the stack\n\t// note the first element of the stack matches the current state\n\tundoStack.unshift(state);\n\tif(undoStack.length > stackMaxPlusOne) {\n\t\tundoStack.splice(stackMaxPlusOne, 1);\n\t}\n}", "title": "" }, { "docid": "4bff6746dbad463057d86c6a800c48d2", "score": "0.6281223", "text": "function GameState() { }", "title": "" }, { "docid": "e817c2a43920f93438c6a07cd139fbd4", "score": "0.62788206", "text": "handlePostMove() {\n //Stop plane movement\n this.loop.updatables.pop();\n\n //if successfull move\n console.log(\"CurrentMove:\", this.currentMove, \",CurrentPuzzle\", this.puzzle);\n if (this.currentMove == this.puzzle) {\n this.updateScore();\n this.updateLevel();\n if (this.finished) {\n this.replayMessage = \"Congratulations! You Are Now A Tiny-Heli Master!\";\n this.setState(\"GAME-OVER\");\n\n this.sceneKeeper.removeAll(scene);\n this.updateGUI();\n console.log(this.replayMessage, \"Level-Score;\", this.level, \"-\", this.points);\n }\n else {\n if (this.levelChanged) {\n if (this.gestureSet === \"GFT\") {\n this.replayMessage = \"Congrats! Try Next Level Puzzle: GLOBE ◯, FORTRESS ▢, TREE △\";\n }\n else if (this.gestureSet === \"PRT\") {\n this.replayMessage = \"Congrats! Try Next Level Puzzle: PETALS α, RAINBOW β, TORNADO γ\";\n }\n\n this.sceneKeeper.removeAll(scene);\n this.updateGUI();\n\n console.log(this.replayMessage, \"Level-Score;\", this.level, \"-\", this.points);\n this.levelChanged = false;\n this.setupPuzzle(this.level);\n this.setState(\"WAITING-FOR-MOVE\");\n this.updateGUI();\n\n\n } else {\n\n if (this.gestureSet === \"GFT\") {\n this.replayMessage = \"Congrats! Try Next Puzzle: GLOBE ◯, FORTRESS ▢, TREE △\";\n }\n else if (this.gestureSet === \"PRT\") {\n this.replayMessage = \"Congrats! Try Next Puzzle: PETALS α, RAINBOW β, TORNADO γ\";\n }\n\n\n this.sceneKeeper.removeAll(scene);\n this.updateGUI();\n\n console.log(this.replayMessage, \"Level-Score;\", this.level, \"-\", this.points);\n this.setupPuzzle(this.level);\n this.setState(\"WAITING-FOR-MOVE\");\n this.updateGUI();\n }\n\n }\n\n } else {\n this.mistakes += 1;\n if (this.mistakes > 3) {\n this.replayMessage = \"Sorry, Too Many Mistakes!\";\n console.log(this.replayMessage, \"Level-Score;\", this.level, \"-\", this.points);\n this.setState(\"GAME-OVER\")\n\n this.sceneKeeper.removeAll(scene);\n\n this.updateGUI();\n }\n else {\n if (this.gestureSet === \"GFT\") {\n this.replayMessage = \"Sorry, Wrong Move: Try Again: GLOBE ◯, FORTRESS ▢, TREE △\";\n }\n else if (this.gestureSet === \"PRT\") {\n this.replayMessage = \"Sorry, Wrong Move! Try Again: PETALS α, RAINBOW β, TORNADO γ\"\n\n }\n\n\n this.sceneKeeper.removeLast(scene);\n\n this.updateGUI();\n console.log(this.replayMessage, \"Level-Score;\", this.level, \"-\", this.points);\n this.setState(\"WAITING-FOR-MOVE\", \"Level-Score;\", this.level, \"-\", this.points);\n this.updateGUI();\n\n }\n\n }\n\n }", "title": "" }, { "docid": "876740a42c90adfc56ea4c96de2b42aa", "score": "0.6270756", "text": "function game_playermove(pos) {\r\n helper_log_write(\"Player selects position \" + pos);\r\n game_board[pos] = human_player;\r\n game_nextturn();\r\n}", "title": "" }, { "docid": "814132ac083fa87b98410fd93fd33712", "score": "0.6269658", "text": "move(direction) {\r\n if (\r\n this.currentPlayer.move === true &&\r\n this.currentPlayer.movementCount > 0\r\n ) {\r\n let newCoordonate = this.calculateNewCoordonate(direction)\r\n let oldCoordonate = this.currentPlayer.movementOfplayer()\r\n if (this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].checkIfCellExist(newCoordonate.x, newCoordonate.y)) {\r\n if (this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].checkIfCellHasobstacle(newCoordonate.x, newCoordonate.y)) {\r\n this.mapGame.cells[newCoordonate.x][newCoordonate.y].transferObjetCells(newCoordonate)\r\n this.currentPlayer.initCoordonate(oldCoordonate)\r\n this.currentPlayer.updateCoordonate(newCoordonate)\r\n if (this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].checkIfCellHasWeapon(newCoordonate.x, newCoordonate.y)) {\r\n this.swapWeapon(this.currentPlayer.x, this.currentPlayer.y);\r\n }\r\n if (this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].checkIfCellContainFighter(this.currentPlayer.x, this.currentPlayer.y)) {\r\n this.fight()\r\n }\r\n this.updateBoard(oldCoordonate.x, oldCoordonate.y);\r\n this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].unsetlightAccessibleCells();\r\n this.mapGame.cells[this.currentPlayer.x][this.currentPlayer.y].lightAccessibleCells(this.currentPlayer.x, this.currentPlayer.y)\r\n this.currentPlayer.movementCount--;\r\n }\r\n }\r\n }\r\n if (\r\n this.currentPlayer.movementCount === 0 &&\r\n this.currentPlayer.move === true\r\n ) {\r\n this.currentPlayer.movementCount = 3;\r\n this.nextToPlay();\r\n }\r\n }", "title": "" }, { "docid": "96b672c55d8ad5b62acdef9a01047bab", "score": "0.6259052", "text": "function sendMove(gameState, selected) {\n function takeBeans(side, pointer, boardState) {\n let temp;\n if (side === 1) {\n temp = boardState['player1'].villages[pointer]\n boardState['player1'].villages[pointer] = 0\n } else if (side === 2) {\n temp = boardState['player2'].villages[6-pointer]\n boardState['player2'].villages[6-pointer] = 0\n }\n\n return temp;\n }\n\n function putBeanToHome(turn, boardState) {\n if (turn === 1) {\n boardState['player1'].home += 1;\n } else if (turn === 2) {\n boardState['player2'].home += 1;\n }\n }\n\n function putBean(side, pointer, boardState) {\n if (side === 1) {\n boardState['player1'].villages[pointer] += 1;\n } else if (side === 2) {\n boardState['player2'].villages[6-pointer] += 1;\n }\n }\n\n function isDead(side, pointer, turn, round, boardState) {\n if (side == 1) {\n return (boardState['player1'].villages[pointer] === 1)\n } else if (side == 2) {\n return (boardState['player2'].villages[6-pointer] === 1)\n }\n }\n\n function getBeansInOppositeVillage(side, pointer, boardState) {\n let temp;\n if (side === 1) {\n temp = boardState['player2'].villages[6-pointer];\n boardState['player2'].villages[6-pointer] = 0;\n } else if (side === 2) {\n temp = boardState['player1'].villages[6-pointer];\n boardState['player1'].villages[6-pointer] = 0;\n }\n return temp;\n }\n\n function anyBeansInOppositeVillage(side, pointer, boardState) {\n if (side === 1) {\n return (boardState['player2'].villages[6-pointer] > 0);\n } else if (side === 2) {\n return (boardState['player1'].villages[6-pointer] > 0);\n }\n }\n\n let turn = gameState.turn;\n let pointer = (turn === 2) ? (6-selected) : selected;\n let side = turn;\n let round = false;\n let hand = takeBeans(side, pointer, this.state);\n let inHome = false;\n\n // Board representation\n // 2 | 6 ... 0\n // 1 | 0 ... 6\n\n let nIntervId = setInterval(() => {\n this.updateCongkakDisplay(inHome ? -1: pointer, inHome ? -1 : side, hand, turn)\n this.viewport.render();\n // move CW\n if (inHome) {\n if (turn === 1) {\n side = 2;\n } else if (turn === 2) {\n side = 1;\n }\n inHome = false;\n } else {\n if (side === 1 && pointer === 0) {\n if (turn === 1) { // put to home\n inHome = true;\n } else if (turn === 2) {\n side = 2;\n round = true;\n }\n } else if (side === 2 && pointer === 6) {\n if (turn === 1) {\n side = 1;\n round = true;\n } else if (turn === 2) { // put to home\n inHome = true;\n }\n } else {\n if (side === 1) {\n pointer--;\n } else {\n pointer++;\n }\n }\n }\n\n // put 1\n hand -= 1;\n if (inHome) {\n putBeanToHome(turn, this.state);\n } else {\n putBean(side, pointer, this.state);\n }\n\n // check if dead\n if (hand === 0 && (inHome || isDead(side, pointer, turn, round, this.state))) {\n if (!inHome) {\n if (turn === 1 && side === 1) { // check kemungkinan nembak\n if (round && anyBeansInOppositeVillage(side, pointer, this.state)) {\n this.state['player1'].home += getBeansInOppositeVillage(side, pointer, this.state);\n this.state['player1'].home += this.state['player1'].villages[pointer];\n this.state['player1'].villages[pointer] = 0;\n hand = 0;\n }\n } else if (turn === 2 && side === 2) {\n if (round && anyBeansInOppositeVillage(side, pointer, this.state)) {\n this.state['player2'].home += getBeansInOppositeVillage(side, pointer, this.state);\n this.state['player2'].home += this.state['player2'].villages[pointer];\n this.state['player2'].villages[pointer] = 0;\n hand = 0;\n }\n }\n }\n } else if (hand === 0){\n hand += takeBeans(side, pointer, this.state);\n }\n\n if (hand <= 0) {\n gameState.turn = (gameState.turn === 1) ? 2 : 1\n if (this.isTerminalState(gameState.congkakState)) {\n gameState.isEndGame = true;\n lock = true;\n } else {\n lock = false;\n }\n this.updateCongkakDisplay(inHome ? -1: pointer , inHome ? -1 : side, hand, gameState.turn)\n this.viewport.render();\n clearInterval(nIntervId);\n }\n }, 600);\n}", "title": "" }, { "docid": "caddb2b264d4d2c1ed3a182667f215e3", "score": "0.6255497", "text": "function move() {\n\tmovingPlayer = true;\n}", "title": "" }, { "docid": "702b4c5312f151836d75eaa865f1412b", "score": "0.62377137", "text": "function updateState(x, y) {\n\n //updates the spot where the player placed their game piece\n board[x][y] = currentPlayer;\n\n //updates the pieces that are 'overtaken' in each direction\n if (horizontal1 > 0) {\n for (var i = 0; i<= horizontal1; i++) {\n board[x][y+i] = currentPlayer;\n }\n }\n if (horizontal2 > 0) {\n for (var i = 0; i<= horizontal2; i++) {\n board[x][y-i] = currentPlayer;\n }\n }\n if (vertical1 > 0) {\n for (var i = 0; i<= vertical1; i++) {\n board[x+i][y] = currentPlayer;\n }\n }\n if (vertical2 > 0) {\n for(var i = 0; i<= vertical2; i++){\n board[x-i][y] = currentPlayer;\n }\n }\n if (diag1>0) {\n for(var i = 0; i<= diag1; i++){\n board[x+i][y+i] = currentPlayer;\n }\n }\n if (diag2>0) {\n for(var i = 0; i<= diag2; i++){\n board[x+i][y-i] = currentPlayer;\n }\n }\n if (diag3>0) {\n for(var i = 0; i<= diag3; i++){\n board[x-i][y-i] = currentPlayer;\n }\n }\n if (diag4>0) {\n for(var i = 0; i<= diag4; i++){\n board[x-i][y+i] = currentPlayer;\n }\n }\n}", "title": "" }, { "docid": "bc15161c741d94b4e134efd62b2b7563", "score": "0.6235513", "text": "function playerHandler(){\n for (let p of players){ //this function iterates over all players and updates them if they need updating\n if(!p.update){continue;}//only update the player if the player has performed an action\n if(p.isMoving){console.log(\"not moving!\");continue;}//skip this player's turn if the player is still moving from before\n p.update = false;//then mark that we have handled this action\n let update_pos = false;//whether to update the player position at the end of this turn.\n if(p.ability == \"dig\" || p.ability == \"slime\"){p.use_ability = true;}//if the player's ability is digging or sliming, then try to dig/slime at every step\n let curtile = getTile(p.x + p.dx, p.y+p.dy);\n let prevtile = getTile(p.x, p.y);\n let slimed = isSlimed(p.x, p.y) || isSlimed(p.x + p.dx, p.y + p.dy);\n \n let pview = d3players.select(\".\"+p.id);\n let pw = Number(pview.attr(\"width\").replace(\"%\", \"\"));\n let ph = Number(pview.attr(\"height\").replace(\"%\", \"\"));\n \n if(curtile){\n switch(curtile.attr(\"class\")){\n //Do not do anything if the current tile's state is unnavigable\n case \"B\":\n update_pos = false;\n break;\n\n //If we are moving back a tile, unmark/unnavigate the previous tile\n case \"F\":\n //prevtile.attr(\"class\", prevtile.attr(\"class\").replace(\"F\",\"W\"));\n update_pos = true;\n break;\n\n //If we are moving into a new, unnavigated tile, then set the previous tile to the new tile and navigate to it.\n case \"W\":\n //curtile.attr(\"class\", curtile.attr(\"class\").replace(\"W\",\"F\"));\n update_pos = true;\n break;\n default:\n console.log(\"UNKNOWN TILE TYPE/CLASS - MUST BE ONE OF 'B'/'W'/'F'\");\n break;\n } \n }\n //console.log(player);\n abilityHandler(p);\n if(update_pos){\n p.isMoving = true;\n pview.transition()\n .duration(PLAYER_MOVE_SPEED + SLIME_PENALTY*slimed)\n //.attr(\"x\", randbetween(curtile.datum().x * w + pw/2, (curtile.datum().x+1)*w - pw/2)+\"%\")\n //.attr(\"y\", randbetween(curtile.datum().y * h + ph/2, (curtile.datum().y+1)*h - ph/2)+\"%\")\n .attr(\"transform\", function(d){\n const me = pview.node().getBBox();\n const svgbox = svg.node().getBBox();\n const x1 = me.x + me.width/2;//the center x about which you want to rotate\n const y1 = me.y + me.height/2;//the center y about which you want to rotate\n return `translate(${randbetween(curtile.datum().x * svgbox.width/16 + svgbox.width*pw/100, (curtile.datum().x+1)* svgbox.width/16 - svgbox.width* pw/100)},\n ${randbetween(curtile.datum().y * svgbox.height/16 + svgbox.height*ph/100, (curtile.datum().y+1)*svgbox.height/16 - svgbox.height* ph/100)}\n )rotate(${randbetween(0,360)}, ${x1}, ${y1})`;//rotate 180 degrees about x and y\n })\n .on(\"end\", function(d){p.isMoving = false;});\n\n p.x += player.dx;//finish the move by updating the player's location/movement states for the next turn IFF the player made a valid move\n p.dx = 0;\n p.y += player.dy;\n p.dy = 0;\n }\n }\n }", "title": "" }, { "docid": "66b2482ffaba7d99737e98afcc271c40", "score": "0.62295", "text": "function movPlayer() {\n // 0 = up, 3 = right, 6 = down, 9 = left\n var tpActivado = false\n //depende de la posicion del personaje se mueve si no esta en borde \n if (personaje.dir === 0) { personaje.x === 0 ? personaje.x : personaje.x-- }\n if (personaje.dir === 3) { personaje.y === mapaColm -1 ? personaje.y : personaje.y++ }\n if (personaje.dir === 6) { personaje.x === mapaRow -1 ? personaje.x : personaje.x++ }\n if (personaje.dir === 9) { personaje.y === 0 ? personaje.y : personaje.y-- }\n if (personaje.x === tp.x && personaje.y === tp.y && tpActivado === false){\n personaje.x = tp.xtp\n personaje.y = tp.ytp\n tpActivado = true\n }\n if (personaje.x === tp.xtp && personaje.y === tp.ytp && tpActivado === false){\n personaje.x = tp.x\n personaje.y = tp.y\n tpActivado = true\n }\n}", "title": "" }, { "docid": "00a2bbc1a26b6531e655877b40e8e4a9", "score": "0.6224922", "text": "async updateGameState() {\n const accountInfo = await this.connection.getAccountInfo(this.gamePublicKey);\n\n const {userdata} = accountInfo;\n const length = userdata.readUInt8(0);\n if (length + 1 >= userdata.length) {\n throw new Error(`Invalid game state`);\n }\n const rawGameState = cbor.decode(userdata.slice(1));\n\n // TODO: Use joi or superstruct for better input validation\n if (typeof rawGameState.game !== 'object') {\n console.log(`Invalid game state: JSON.stringify(rawGameState)`);\n throw new Error('Invalid game state');\n }\n\n // Map rawGameState into `this.state`\n const {game} = rawGameState;\n const xKey = bs58.encode(game.players[0]);\n const oKey = bs58.encode(game.players[1]);\n\n // Render the board\n const boardItems = game.grid.map(i => i === 'Free' ? ' ' : i);\n const board = [\n boardItems.slice(0,3).join('|'),\n '-+-+-',\n boardItems.slice(3,6).join('|'),\n '-+-+-',\n boardItems.slice(6,9).join('|'),\n ].join('\\n');\n\n this.state = {\n inProgress: false,\n myTurn: false,\n draw: false,\n winner: false,\n board,\n };\n\n if (game.state === 'XMove') {\n this.state.inProgress = true;\n if (this.playerAccount.publicKey === xKey) {\n this.state.myTurn = true;\n }\n } else if (game.state === 'OMove') {\n this.state.inProgress = true;\n if (this.playerAccount.publicKey === oKey) {\n this.state.myTurn = true;\n }\n } else {\n if (game.state === 'Draw') {\n this.state.draw = true;\n }\n if (game.state === 'XWon' && this.playerAccount.publicKey === xKey) {\n this.state.winner = true;\n }\n if (game.state === 'OWon' && this.playerAccount.publicKey === oKey) {\n this.state.winner = true;\n }\n }\n }", "title": "" }, { "docid": "d1b592b62a7fd96641b81c2a99e22bed", "score": "0.6196294", "text": "function setupGame(pNumber, playerMissions, tikiOrder)\n{\n // console.log(\"This is setupGame function!\");\n state = new State();\n playerScores = null;\n playersNumber = pNumber;\n allMissions = new Array();\n for(var i = 0 ; i < playersNumber ; i++)\n allMissions[i] = playerMissions[i].slice(0);\n\n\n initialAction = [0 , 0 , 1 , 2 , 3 , 4 ,4];\n\n state.playersAction = new Array();\n for(var i = 0 ; i < playersNumber ; i++) {\n state.playersAction[i] = initialAction.slice(0);\n state.record[i] = [];\n state.record[i][0] = -1;\n allRecord[i] = [];\n }\n\n //initialTikiOrder = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n state.tikiOrder = tikiOrder;//initialTikiOrder.slice(0);\n gameEnd = 0;\n\n\n}", "title": "" }, { "docid": "af75c6cfe674a218dd2ae2b0d7786f03", "score": "0.61849624", "text": "handleClick(x, y){\n\n //If you are placing stones, then \n if(this.state.phase === 0){\n const positionBounds = this.state.player === 'W' ? {'min' : 6, 'max' : 9} : {'min' : 0, 'max' : 3};\n if( x >= positionBounds.min && x <= positionBounds.max){\n let newGrid = this.state.grid;\n\n if(newGrid[x][y].player === undefined){\n newGrid[x][y] = this.state.player === 'W' ? {'player' : 'W', 'piece': this.state.whitePieces.pop()} : {'player' : 'B', 'piece': this.state.blackPieces.pop()}\n this.setState({'grid': newGrid});\n \n if(this.state.whitePieces === undefined || this.state.whitePieces.length === 0){\n Modal.info({\n title: 'Second player is setting up his board',\n onOk() {},\n })\n this.setState({'player' : 'B'})\n }\n if(this.state.blackPieces === undefined || this.state.blackPieces.length === 0){\n Modal.info({\n title: 'Good luck with playing',\n onOk() {},\n })\n this.setState({'phase' : 1, 'player' : 'W'})\n }\n }\n \n }\n \n }\n if(this.state.phase === 1){\n\n if(localStorage.getItem('from') === undefined ||localStorage.getItem('from') === \"\" ){\n if(!this.isMoveAble(x,y))\n return\n console.log('FROM')\n localStorage.setItem('from', JSON.stringify({'x' : x , 'y': y}) );\n this.setState({'selected': {x: x,y: y} })\n }else{\n console.log('TO') \n \n let from = JSON.parse(localStorage.getItem('from'))\n if(this.isWater(x,y)){\n this.setState({'selected': {x: \"A\",y: \"A\"} }) \n return\n }\n if(x === from.x && y === from.y){\n localStorage.setItem('from', \"\" ) \n this.setState({'selected': {x: \"A\",y: \"A\"} }) \n return;\n }\n\n this.movePiece({'x': from.x, 'y': from.y}, {'x': x, 'y': y})\n localStorage.setItem('from', \"\" ) \n this.setState({'selected': {x: \"A\",y: \"A\"} })\n \n }\n }\n }", "title": "" }, { "docid": "f44f402c22e146aab0b68c3e441f0bf5", "score": "0.61639667", "text": "function updateGame(){\n setOp();\n\n if(locations[gameKey].p1 === name){\n p1 = name;\n p2 = opponent;\n myChips = locations[gameKey].p1Chips;\n opChips = locations[gameKey].p2Chips;\n turn = locations[gameKey].turn;\n winner = locations[gameKey].winner;\n }else{\n p2 = name;\n p1 = opponent;\n myChips = locations[gameKey].p2Chips;\n opChips = locations[gameKey].p1Chips;\n turn = locations[gameKey].turn;\n winner = locations[gameKey].winner;\n }\n}", "title": "" }, { "docid": "33bbcb8b374da04e10bd6fc5adeefbf5", "score": "0.61460066", "text": "function GameState (state) {\n // Storage class that is passed to all players at end of turn\n this.Players = [] ;//Ordered array of players in game\n this.Name = \"\" ;// Game name\n this.id = \"\";\n this.Started = false\n this.GameOwner = 0; //Index into players array of player that owns game\n this.CurrentPlayer = 0; //Index into players array of current player\n // History is array of TurnStates keeping a detailed history of each turn.\n // Note first TurnState is only interesting in terms of initial bag state and each\n //player's tray state\n this.History = [];\n if (state) {\n this.Players = state.Players\n this.Name = state.Name\n this.id = state.id\n this.Started = state.Started \n if (state.GameOwner) this.GameOwner = state.GameOwner;\n if (state.CurrentPlayer) this.CurrentPlayer = state.CurrentPlayer;\n if (state.History ){\n var history = []\n for(var i=0;i<state.History.length;i++){\n var bag = new Bag(true, state.History[i].Bag.letters)\n var boardState = new BoardState(state.History[i].BoardState.letters)\n var turn = null;\n if (state.History[i].Turn) {\n turn = new Turn(state.History[i].Turn.Type, state.History[i].Turn.LettersIn, state.History[i].Turn.LettersOut, \n state.History[i].Turn.TurnNumber, state.History[i].Turn.Player, state.History[i].Turn.NextPlayer)\n }\n var trayStates = [];\n for(var j=0;j<state.History[i].TrayStates.length;j++){ \n trayStates.push( new TrayState(state.History[i].TrayStates[j].player, state.History[i].TrayStates[j].letters, state.History[i].TrayStates[j].score));\n }\n history.push( new TurnState(bag, boardState, trayStates, state.History[i].End, turn))\n }\n this.History = history ;\n }\n }\n this.GetNextPlayer = function() {\n var next = this.CurrentPlayer +1;\n if (next >= this.Players.length){\n next =0;\n }\n return next;\n }\n this.GetPlayers = function(){\n return this.Players;\n }\n this.GetCurrentPlayerIndex = function(){\n return this.CurrentPlayer\n }\n this.GetNumberOfPlayers = function(){\n return this.Players.length;\n }\n this.IsPlayer = function(playerName){\n for (var i=0;i<Players.length;i++){\n if (playerName == Players[i]) return true;\n }\n return false;\n }\n this.GetBoardState = function(){\n var boardState = null;\n var lastTurn = this.GetLastTurn();\n if (lastTurn){\n boardState = lastTurn.GetBoardState();\n }\n return boardState;\n }\n this.CloneLastTurnState =function(){\n var last = this.GetLastTurnState();\n return last.Clone();\n }\n this.GetLastTurnState = function(){\n var lastTurnState = null;\n if (this.History.length >0 ) {\n lastTurnState = this.History[this.History.length-1]\n }\n return lastTurnState;\n }\n this.HasGameEnded = function(){\n var ended = false;\n var lastTurnState = this.GetLastTurnState();\n if (lastTurnState){\n ended = lastTurnState.End;\n }\n return ended;\n }\n \n this.GetLastTurn = function(){\n //Actually only gets last proper turn because there is no turn object in first turnState\n var lastTurn = null;\n if (this.History.length >=1 ) {\n lastTurn = this.History[this.History.length-1].Turn;\n }\n return lastTurn;\n }\n this.GetMyTrayState =function (playerName) {\n var trayState = null;\n if (this.History.length >=1 ) {\n var trays = this.History[this.History.length-1].GetTrayStates();\n if (trays) {\n for (var i=0;i<trays.length;i++){\n if (trays[i].GetPlayer() == playerName){\n trayState = trays[i]\n break;\n }\n }\n }\n }\n return trayState;\n }\n this.AddTurnState = function(turnState){\n this.History.push(turnState);\n }\n this.HasScores = function(){\n return (this.History.length > 0);\n }\n this.GetBagSize = function(){\n var count = 0;\n if (this.History.length >=1 )\n {\n count = this.History[this.History.length-1].GetBagSize();\n }\n return count;\n }\n this.GetPlayerScore = function (playerName){\n var lastTurnState = this.History[this.History.length-1];\n return lastTurnState.GetPlayerScore(playerName);\n }\n this.GetGameOwner = function(){\n return this.Players[ this.GameOwner];\n }\n this.RemoveLastState = function(){\n var lastTurnState = this.History.pop();\n var newLastTurn = this.GetLastTurn();\n if (newLastTurn){\n this.CurrentPlayer = newLastTurn.NextPlayer;\n }else{\n //This is same code at start game first player is first tray state\n this.SetCurrentPlayerByName(lastTurnState.GetTrayState(0).GetPlayer());\n }\n }\n this.SetCurrentPlayerByName = function(playerName){\n this.CurrentPlayer = 0\n for (var i=0;i<this.Players.length;i++){\n if (this.Players[i] == playerName){\n this.CurrentPlayer = i;\n break;\n }\n }\n }\n this.SetCurrentPlayer = function(index){\n this.CurrentPlayer = index; \n }\n this.GetCurrentPlayer = function(){\n var player = \"\";\n if (this.CurrentPlayer <= (this.Players.length -1) ){\n player = this.Players[this.CurrentPlayer];\n }\n return player\n }\n}", "title": "" }, { "docid": "1bdf1cdc2eb82ef04013e02172fdba01", "score": "0.6143503", "text": "movePlayer(btnIndex) {\n if (this.state.player1Move) {\n this.state.winningPlayer = this.state.Board\n .setPlayerPosition(btnIndex, this.state.Player1);\n } else {\n this.state.winningPlayer = this.state.Board\n .setPlayerPosition(btnIndex, this.state.Player2);\n }\n this.state.totalMoves++;\n }", "title": "" }, { "docid": "2897afc4a9d22a16fade41ea03d5dc00", "score": "0.6110342", "text": "prepareNextState() {\n this.setGameBoard();\n this.gameOrchestrator.changeState(new ChoosingPieceState(this.gameOrchestrator));\n }", "title": "" }, { "docid": "9e698e20c30c3a7c90f75b6b13553d29", "score": "0.6109636", "text": "handleUpdate(gameState){\n this.setBoard(gameState)\n this.setTurn(gameState.turn)\n this.setMessage()\n }", "title": "" }, { "docid": "177da61c832f0bd536e5e6094ce13136", "score": "0.6108966", "text": "function moveOn() {\n // clear all the commands from annyang\n annyang.removeCommands();\n // load the current state of the game\n switch (currentState) {\n // if it is in the general questions state\n case \"generalQuestions\":\n //first check to see if we have asked all the available questions\n if (questionPos > generalQuestions.length - 1) {\n // if so, reset the question index\n questionPos = 0;\n // parse the score of the user\n parseScore();\n // if we havent reached the end, one second later, ask the next question in the\n // general interestArray\n } else {\n setTimeout(queryUser, 1000, generalQuestions, generalResponses);\n }\n // break out of the switch case\n break;\n // if the game is in the interest portion of the questions...\n case \"interests\":\n // first check to see if we have asked about all of the things the object (human)\n //is interested in\n if (questionPos > Object.keys(user[\"interests\"]).length - 1) {\n // if so, reset the question index\n questionPos = 0;\n // let the user know we have reached the end, and we will be finding them some content\n // when done speaking, run the parseInterests function\n responsiveVoice.speak(`${stockResponse(\"positive\")}, let me pull up your idealized content`, voiceType, {\n onend: parseInterests\n });\n // if we havent reached the end, one second later, ask the next question in the\n // general interestArray\n } else {\n setTimeout(queryUser, 1000, interestQuestions, interestResponses);\n }\n // break out of the switch case\n break;\n }\n}", "title": "" }, { "docid": "0c0b4db88746e3b6de8a52151b1c7421", "score": "0.6095808", "text": "function GameState() {\n this._state = {\n board: {\n width: 100,\n height: 100,\n orientation: 0\n },\n score: {\n playerOne: 0,\n playerTwo: 0\n }\n };\n this._touches = {\n playerOne: [],\n playerTwo: []\n };\n this._lastTap = {\n playerOne: 0,\n playerTwo: 0\n };\n this.resetBall();\n}", "title": "" }, { "docid": "a075c31b6e13b2c3edd8493637dd031b", "score": "0.6092976", "text": "function move(direction){\n\tif(player.hitPoint > 0 && !(player.Goal && player.price.length == 2)){ \n\n\tplayer.Goal = false;\n\tvar oldx = player.CurrentLoc.x;\n\tvar oldy = player.CurrentLoc.y;\n\tdocument.getElementById(\"print\").innerHTML = \" \";\n\t\n\t\tswitch(direction){\n\t\t\tcase \"up\":\n\t\t\t\tplayer.CurrentLoc.y -= 1;\n\t\t\t\tbreak;\n\t\t\tcase \"down\":\n\t\t\t\tplayer.CurrentLoc.y += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"left\":\n\t\t\t\tplayer.CurrentLoc.x -= 1;\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tplayer.CurrentLoc.x += 1; \n\t\t\t\tbreak;\n\t\t\tcase \"yes\":\n\t\t\t\tmapArray[player.CurrentLoc.x][player.CurrentLoc.y].runHazard();\n\t\t\t\tbreak;\n\t\t\tcase \"no\":\n\t\t\t\tplayer.CurrentLoc.x = oldx;\n\t\t\t\tplayer.CurrentLoc.y = oldy;\n\t\t}\n\t\t\n\t//Handles the Goal\n\tif(mapArray[player.CurrentLoc.x][player.CurrentLoc.y].nameGoal){\n\t\tdocument.getElementById(\"print\").innerHTML = \"You have found the Goal!!!\";\n\t\tmapArray[player.CurrentLoc.x][player.CurrentLoc.y].runToGoal();\n\t\t\n\t}\n\t\n\t//Handles the prices\n\tif(mapArray[player.CurrentLoc.x][player.CurrentLoc.y].namePrice){\n\t\tdocument.getElementById(\"print\").innerHTML = \"You have found a Prize!!!\";\n\t\tmapArray[player.CurrentLoc.x][player.CurrentLoc.y].price();\n\t\t\n\t}\n\t\n\t//Handles the Hazard\n\tif(mapArray[player.CurrentLoc.x][player.CurrentLoc.y].runHazard){ //checking the existing of it \n\tdocument.getElementById(\"print\").innerHTML = \"Would you like to face the Hazard?(Challenge?) Click YES or NO Button\";\n\tdocument.getElementById(\"yes\").disabled = false;\n\tdocument.getElementById(\"no\").disabled = false;\n\t}\n\t\n\t//Handles the wall\n\tif(mapArray[player.CurrentLoc.x][player.CurrentLoc.y].nameWall){\n\t\tdocument.getElementById(\"print\").innerHTML = \"There is a wall\";\n\t\t\tplayer.CurrentLoc.x = oldx;\n\t\t\tplayer.CurrentLoc.y = oldy;\n\t}\n\t\n\t//Print it to the page if all life is lost\n\tif(player.hitPoint <= 0){\n\t\tdocument.getElementById(\"hitpoint\").innerHTML = \"You lost all the life. Game Over!!\";\n\t\tdisable();\n\t\t\n\t}\n\t\n\t//Print it to the page if the player gain two price and one goal\n\tif((player.Goal && player.price.length == 2)){\n\t\tdocument.getElementById(\"win\").innerHTML = \"Congratulation You have won the game!!\";\n\t\tdisable();\n\t}\n\t\n\tdocument.getElementById(\"info1\").innerHTML = \"Player Current Location X: \" + player.CurrentLoc.x\n\tdocument.getElementById(\"info2\").innerHTML = \"Player Current Location Y: \" + player.CurrentLoc.y\n\tdocument.getElementById(\"info3\").innerHTML = \"Player Hitpoint: \" + player.hitPoint\n\tdocument.getElementById(\"info4\").innerHTML = \"Player price: \" + player.price.length\n\tdocument.getElementById(\"info5\").innerHTML = \"player Goal: \" + player.Goal\n\t\n\t}\n}", "title": "" }, { "docid": "f88afc082a3c7a9e0fa0cfbe57c5e070", "score": "0.60844386", "text": "function setPlayer(player){\n gameState.playerTurn = player;\n}", "title": "" }, { "docid": "bf9db636c8b1cefd6e66e24470e0e54b", "score": "0.6077487", "text": "preformMove(move) {\n\n if (move === 0) this.board = this.swipeLeft(this.board)\n else if (move === 1) this.board = this.swipeUp(this.board)\n else if (move === 2) this.board = this.swipeRight(this.board)\n else if (move === 3) this.board = this.swipeDown(this.board)\n\n this.board = this.isGameOver(this.board)\n this.props.updateGame(this.board)\n }", "title": "" }, { "docid": "0910f1da5def51df3ee5416c9ac2167e", "score": "0.60752547", "text": "constructor() {\n super();\n\n this.pressed = this.pressed.bind(this);\n this.state = {\n tracker: [[\"\", \"\", \"\"], [\"\", \"\", \"\"], [\"\", \"\", \"\"]], //Array that tracks current board state\n moves: 0,\n isOver: false,\n playerType: \"\", //Tracks whether user is an X or an O\n isTurn: false, //keeps track of whos turn it is\n isReady: false, //Checks if both users have entered a game\n\n }\n }", "title": "" }, { "docid": "d07a1876abf38fd734221388bc2486c0", "score": "0.6074291", "text": "function State() {\n this.playersAction = new Array();\n this.tikiOrder = new Array();\n this.record = new Array();\n this.round = 0;\n}", "title": "" }, { "docid": "50d1f499c35b869b39a0c6371a145c07", "score": "0.6068392", "text": "move(direction){\r\n let pre = [...this.gameState.board];\r\n if(direction === 'left'){\r\n this.rows = new Array(this.size);\r\n let index = 0;\r\n for(let i = 0; i < this.size; i++){\r\n this.rows[i] = [];\r\n for(let j = 0; j < this.size; j++){\r\n this.rows[i][j] = this.gameState.board[index];\r\n index++;\r\n \r\n }\r\n }\r\n \r\n this.rows = this.slideLeft(this.rows);\r\n this.rows = this.combineLeft(this.rows);\r\n this.rows = this.slideLeft(this.rows);\r\n\r\n this.gameState.board = this.rows.flat();\r\n\r\n let changed;\r\n for(let i = 0; i < this.gameState.board.length; i++){\r\n if(pre[i] !== this.gameState.board[i]){\r\n changed = true;\r\n }\r\n }\r\n if(changed){\r\n this.addTile();\r\n }\r\n\r\n if(this.gameWon() === true){\r\n this.gameState.gameWon = true;\r\n this.winArr.forEach(element =>{\r\n element(this.getGameState());\r\n });\r\n }\r\n \r\n if(this.moveArr.length > 0){\r\n for(let i = 0; i < this.moveArr.length; i++){\r\n this.moveArr[i](this.getGameState());\r\n }\r\n }\r\n \r\n if(this.availableMove() === false){\r\n this.gameState.over = true;\r\n this.loseArr.forEach(element => {\r\n element(this.getGameState());\r\n });\r\n }\r\n }\r\n else if(direction === 'right'){\r\n let pre = [...this.gameState.board];\r\n this.rows = new Array(this.size);\r\n let index = 0;\r\n for(let i = 0; i < this.size; i++){\r\n this.rows[i] = [];\r\n for(let j = 0; j < this.size; j++){\r\n this.rows[i][j] = this.gameState.board[index];\r\n index++;\r\n \r\n }\r\n }\r\n \r\n this.rows = this.slideRight(this.rows);\r\n this.rows = this.combineRight(this.rows);\r\n this.rows = this.slideRight(this.rows);\r\n\r\n this.gameState.board = this.rows.flat();\r\n \r\n let changed;\r\n for(let i = 0; i < this.gameState.board.length; i++){\r\n if(pre[i] !== this.gameState.board[i]){\r\n changed = true;\r\n }\r\n }\r\n \r\n if(changed){\r\n this.addTile();\r\n }\r\n\r\n if(this.gameWon() === true){\r\n this.winArr.forEach(element =>{\r\n element(this.getGameState());\r\n });\r\n }\r\n \r\n if(this.moveArr.length > 0){\r\n for(let i = 0; i < this.moveArr.length; i++){\r\n this.moveArr[i](this.getGameState());\r\n }\r\n }\r\n \r\n if(this.availableMove() === false){\r\n this.gameState.over = true;\r\n this.loseArr.forEach(element => {\r\n element(this.getGameState());\r\n });\r\n }\r\n }\r\n else if(direction === 'up'){\r\n let pre = [...this.gameState.board];\r\n this.cols = new Array(this.size);\r\n for(let i = 0; i < this.size; i++){\r\n let index = i;\r\n this.cols[i] = [];\r\n for(let j = 0; j < this.size; j++){\r\n this.cols[i][j] = this.gameState.board[index];\r\n index += this.size;\r\n }\r\n }\r\n \r\n this.cols = this.slideLeft(this.cols);\r\n this.cols = this.combineLeft(this.cols);\r\n this.cols = this.slideLeft(this.cols);\r\n\r\n let index = 0;\r\n for(let i = 0; i < this.size; i++){\r\n for(let j = 0; j < this.size; j++){\r\n this.gameState.board[index] = this.cols[j][i];\r\n index++;\r\n }\r\n }\r\n \r\n let changed;\r\n for(let i = 0; i < this.gameState.board.length; i++){\r\n if(pre[i] !== this.gameState.board[i]){\r\n changed = true;\r\n }\r\n }\r\n if(changed){\r\n this.addTile();\r\n }\r\n \r\n if(this.gameWon() === true){\r\n this.winArr.forEach(element =>{\r\n element(this.getGameState());\r\n });\r\n }\r\n\r\n if(this.moveArr.length > 0){\r\n for(let i = 0; i < this.moveArr.length; i++){\r\n this.moveArr[i](this.getGameState());\r\n }\r\n }\r\n\r\n if(this.availableMove() === false){\r\n this.gameState.over = true;\r\n this.loseArr.forEach(element => {\r\n element(this.getGameState());\r\n });\r\n }\r\n }\r\n else if(direction === 'down'){\r\n let pre = [...this.gameState.board];\r\n this.cols = new Array(this.size);\r\n for(let i = 0; i < this.size; i++){\r\n let index = i;\r\n this.cols[i] = [];\r\n for(let j = 0; j < this.size; j++){\r\n this.cols[i][j] = this.gameState.board[index];\r\n index += this.size;\r\n }\r\n }\r\n \r\n this.cols = this.slideRight(this.cols);\r\n this.cols = this.combineRight(this.cols);\r\n this.cols = this.slideRight(this.cols);\r\n\r\n let index = 0;\r\n for(let i = 0; i < this.size; i++){\r\n for(let j = 0; j < this.size; j++){\r\n this.gameState.board[index] = this.cols[j][i];\r\n index++;\r\n }\r\n }\r\n\r\n let changed;\r\n for(let i = 0; i < this.gameState.board.length; i++){\r\n if(pre[i] !== this.gameState.board[i]){\r\n changed = true;\r\n }\r\n }\r\n if(changed){\r\n this.addTile();\r\n }\r\n \r\n if(this.gameWon() === true){\r\n this.winArr.forEach(element =>{\r\n element(this.getGameState());\r\n });\r\n }\r\n\r\n if(this.moveArr.length > 0){\r\n for(let i = 0; i < this.moveArr.length; i++){\r\n this.moveArr[i](this.getGameState());\r\n }\r\n }\r\n if(this.availableMove() === false){\r\n this.gameState.over = true;\r\n this.loseArr.forEach(element => {\r\n element(this.getGameState());\r\n });\r\n }\r\n }\r\n }", "title": "" }, { "docid": "20f9663eb28a9f30ea7906fb9efd8da6", "score": "0.60612005", "text": "function setGameState(state) {\n //0 - title screen;\n //1 - how to play\n //2 - game\n //3 - pause\n //4 - endgame\n\n // Handle anything that needs to run while transitioning between states\n switch (state) {\n case gameState:\n if (currentState != pauseState) {\n hexPath = [];\n isGameOver = false;\n hexFallAnimationTime = -1;\n hexBreakAnimationTime = -1;\n for (let textItem of gameControlTextValues) {\n textItem.visible = false;\n }\n gameControlTextValues[4].visible = false;\n gameControlTextValues[0].visible = true;\n for (let i = 0; i < challengeShapes.length; i++) {\n challengeSprites[i].visible = false;\n }\n pickChallenge1();\n pickChallenge2();\n if (!isGameOver) {\n setScore(0);\n }\n countdownTimer = countdownTimeMax;\n textValueIndex = 0;\n isInCountdown = true;\n recolorHexGrid();\n\n timeTracker.style = whiteText;\n\n if (currentMode == endlessMode) {\n timeTracker.x = 862;\n timeTracker.anchor.x = .5;\n setTime(0);\n } else {\n timeTracker.x = 862;\n timeTracker.anchor.x = .5;\n setTime(startTimeInSec);\n }\n\n if (timeAddIndicator != null) {\n gameScene.removeChild(timeAddIndicator);\n timeAddIndicator = null;\n }\n\n\n for (let i = 0; i < columnWaitAmount.length; i++) {\n columnWaitAmount[i] = 0;\n }\n\n //make sure all the hexes fall\n while (scanBoardForFallableHexes()) {\n scanBoardForFallableHexes();\n }\n\n for (let i = 0; i < hexArray.length; i++) {\n hexArray[i].x = getScreenSpaceX(hexArray[i].posX);\n hexArray[i].y = getScreenSpaceY(hexArray[i].posY);\n }\n\n setHexInteractive(false);\n }\n passChildren(gameState);\n backgroundRefractionGraphic.alpha = .02;\n if (!isGameOver)\n gameStarted = true;\n break;\n case pauseState:\n backgroundRefractionGraphic.alpha = .1;\n break;\n case modeState:\n backgroundRefractionGraphic.alpha = .1;\n isInCountdown = false;\n currentTimeInSec = startTimeInSec;\n recolorHexGrid();\n break;\n case howToPlayState:\n isInCountdown = false;\n passChildren(howToPlayState);\n demoHexArray[0].setColorsAndRotation(3, 1, 2, 0);\n demoHexArray[1].setColorsAndRotation(2, 4, 1, 0);\n demoHexArray[2].setColorsAndRotation(3, 2, 4, 0);\n howToPlayTextPopup1.alpha = 0;\n howToPlayTextPopup2.alpha = 0;\n backgroundRefractionGraphic.alpha = 0;\n break;\n default:\n isInCountdown = false;\n backgroundRefractionGraphic.alpha = .1;\n break;\n }\n\n //store our new state\n currentState = state;\n\n //hide all HUD containers\n for (let scene of scenes) {\n scene.visible = false;\n }\n //and unhide the one for the state we are switching to\n scenes[state].visible = true;\n}", "title": "" }, { "docid": "41108f76754c1a148ed07e5973b60042", "score": "0.60594726", "text": "exec_state(state)\r\n {\r\n if(state == undefined)\r\n {\r\n this.current_state = this.next_state;\r\n state = this.current_state;\r\n }\r\n\r\n if(state != 'start_game')\r\n {\r\n this.check_win_or_dead();\r\n }\r\n\r\n switch(state)\r\n {\r\n //Initializes the state machine for the game -S17\r\n case 'start_game':\r\n this.next_state = 'turn_0';\r\n var player_color_array = ['padding', 'white', 'red', 'green', 'blue', 'orange', 'purple', 'yellow', 'black'];\r\n //For graphics\r\n var players_playing_colors = new Array(this.num_of_players);\r\n for(var i = 1; i <= this.num_of_players; i++)\r\n {\r\n this.player_array[i].player_color = player_color_array[i];\r\n players_playing_colors.push(player_color_array[i]);\r\n }\r\n for(var i = 1; i <= 8; i++)\r\n {\r\n var color_string = 'player_' + i + '_color_box';\r\n if(i > this.num_of_players)\r\n document.getElementById(color_string).style.display = \"none\";\r\n }\r\n setDamage(players_playing_colors);\r\n game_screen_setup();\r\n\t board_pieces_setup();\r\n //testing game\r\n //this.player_array[2].character = Daniel;\r\n //this.player_array[2].alive = true;\r\n //this.player_array[2].hp = this.player_array[2].character.hp;\r\n\r\n this.exec_state();\r\n break;\r\n\r\n //The beginning of the game and state machine that sets up the player's screen -S17\r\n case 'turn_0':\r\n if(this.player_array[this.current_turn].alive == false)\r\n this.exec_state('turn_4');\r\n\t this.last_state=state;\r\n this.switch_player(this.current_turn);\r\n document.getElementById('current_player_id').innerHTML = this.current_player;\r\n document.getElementById('current_player_box_color').style.color = this.player_array[this.current_turn].player_color;\r\n document.getElementById('current_player_box_color').innerHTML = this.player_array[this.current_turn].player_color.toUpperCase();\r\n this.check_win_or_dead();\r\n this.has_attacked = 0;\r\n this.current_player_can_be_attacked = false;\r\n this.add_info_message(this.current_turn, 'Starting your turn.');\r\n \tif(this.player_array[this.current_player].character.char_name == 'CIA Charlie' && this.player_array[this.current_player].used_special == 1) {\r\n \t\tthis.show_charlie_special_move_btn();\r\n \t\tthis.add_info_message(this.current_turn, 'Click \"ROLL\" to roll and move your player or \"ADJACENT\" to move to an adjacent zone.');\r\n \t}\r\n \telse\r\n {\r\n \t\tthis.show_roll_btn();\r\n \t\tthis.add_info_message(this.current_turn, 'Click \"ROLL\" to roll and move your player.');\r\n \t\tthis.next_state = 'turn_1';\r\n \t}\r\n\r\n if(this.player_array[this.current_turn].hand.length > 0)\r\n this.add_info_message(this.current_turn, 'You can change your equipment card before you roll.');\r\n \t//end guardian angel once the players turn starts again.\r\n \tif(this.player_array[this.current_turn].character.char_name == this.guardian_angel)\r\n \t{\r\n \t\tthis.guardian_angel = \"none\";\r\n \t}\r\n break;\r\n\r\n //Allows the player to roll the dice to move -S17\r\n //From here the state machine can take many paths depending on what the player's dice roll is -S17\r\n case 'turn_1':\r\n\r\n \tthis.last_state=state;\r\n \trollWhiteDice(this.player_array[this.current_turn].player_color);\r\n \tthis.player_array[this.current_turn].current_region = dice1Value + dice2Value;\r\n\r\n this.add_info_message(this.current_player, 'You rolled a ' + this.player_array[this.current_turn].current_region + '!');\r\n \tvar r = this.player_array[this.current_player].current_region;\r\n\r\n \tif(r == 2 || r == 3 || r == 4 || r == 5 || r == 6 || r == 8)\r\n \t{\r\n \t this.next_state = 'draw_card_0';\r\n \t this.show_draw_btn();\r\n \t this.add_info_message(this.current_turn, 'Click \"DRAW\" to choose a card.');\r\n \t}\r\n \telse if(r == 11 || r == 12)\r\n \t{\r\n \t var anyone_have_cards = false;\r\n \t for(var i = 1; i <= this.num_of_players; i++)\r\n \t {\r\n \t\t if(this.player_array[i].hand.length > 0)\r\n \t\t anyone_have_cards = true;\r\n }\r\n if(anyone_have_cards == true)\r\n {\r\n this.next_state='steal_region_0';\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_turn, 'No one has any cards.');\r\n this.next_state = 'turn_2';\r\n }\r\n this.exec_state();\r\n \t}\r\n \telse if(r == 9 || r == 10)\r\n \t{\r\n \t this.exec_state('damage_region_0');\r\n \t}\r\n \telse if(r == 7)\r\n \t{\r\n \t this.next_state = 'turn_3';\r\n \t this.show_safe_house_ability_btn();\r\n \t}\r\n \telse\r\n \t{\r\n \t \tthis.next_state = 'turn_3';\r\n \t \tthis.exec_state();\r\n \t}\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Most state machine deviations lead back to here -S17\r\n case 'turn_2':\r\n this.next_state = 'turn_3';\r\n\t this.show_general_btn(this.last_state);\r\n \t this.last_state=state;\r\n this.exec_state();\r\n break;\r\n\r\n //Allows any last actions for the player to take -S17\r\n case 'turn_3':\r\n /*if(this.player_array[this.current_player].equipped.card_title == 'Duffle Bag')\r\n {\r\n this.check_win_or_dead();\r\n }*/\r\n \tif(this.last_state==\"turn_1\")\r\n \t{\r\n \t\tthis.show_general_btn(this.last_state);\r\n \t}\r\n \tthis.add_info_message(this.current_turn, 'You can now attack a player, select a card to equip, use your special, or end your turn.');\r\n this.next_state = 'turn_4';\r\n \t this.last_state=state;\r\n break;\r\n\r\n //Finished up the player's turn and sets up for the next player's -S17\r\n case 'turn_4':\r\n this.next_state = 'turn_0';\r\n if(this.player_array[this.current_turn].alive == true)\r\n\t{\r\n this.add_info_message(this.current_turn, 'Ended your turn.<br><br>');\r\n\t}\r\n if(this.current_turn == this.num_of_players && this.extra_turn == false)\r\n {\r\n this.current_turn = 1;\r\n this.num_of_rotations++;\r\n }\r\n else if (this.extra_turn == false)\r\n\t{\r\n this.current_turn++;\r\n\t}\r\n \tthis.extra_turn = false;\r\n this.current_player = this.current_turn;\r\n this.check_win_or_dead();\r\n\tthis.last_state=state;\r\n this.exec_state();\r\n break;\r\n\r\n\t//Special state for Charlie's movement\r\n case 'charlie_movement_0':\r\n\tthis.last_state = state;\r\n\tshow_select_zone_screen(\"adjacent\"); // shows charlie the options of the adjacent zones and sets this.selected_zone to choice\r\n\tthis.next_state = 'charlie_movement_1';\r\n \tthis.check_win_or_dead();\r\n\tbreak;\r\n\r\n case 'charlie_movement_1':\r\n\tthis.last_state = state;\r\n\tthis.player_array[this.current_turn].current_region = this.selected_zone;\r\n \tvar new_region = this.selected_zone;\r\n\tturnValue = this.selected_zone;\r\n\tmovePiece(this.player_array[this.current_turn].player_color);\r\n\r\n\tthis.add_info_message(this.current_turn, 'You picked Zone ' + this.selected_zone +'.');\r\n\r\n\tif(new_region == 2 || new_region == 3 || new_region == 4 || new_region == 5 || new_region == 6 || new_region == 8)\r\n\t{\r\n\t \tthis.next_state = 'draw_card_0';\r\n\t \tthis.show_draw_btn();\r\n\t \tthis.add_info_message(this.current_turn, 'Click \"DRAW\" to choose a card.');\r\n\t}\r\n\telse if(r == 11 || r == 12)\r\n\t{\r\n\t var anyone_have_cards = false;\r\n\t for(var i = 1; i <= this.num_of_players; i++)\r\n\t {\r\n\t\t if(this.player_array[i].hand.length > 0)\r\n\t\t anyone_have_cards = true;\r\n\t }\r\n\t if(anyone_have_cards == true)\r\n\t {\r\n\t\t this.next_state='steal_region_0';\r\n\t }\r\n\t else\r\n\t {\r\n\t\t this.add_info_message(this.current_turn, 'No one has any cards.');\r\n this.next_state = 'turn_2';\r\n }\r\n this.exec_state();\r\n\t}\r\n\telse if(new_region == 9 || new_region == 10)\r\n\t{\r\n\t \tthis.exec_state('damage_region_0');\r\n\t}\r\n \telse if(new_region == 7)\r\n\t{\r\n\t\tthis.next_state = 'turn_3';\r\n\t \tthis.show_safe_house_ability_btn();\r\n\t}\r\n\telse\r\n\t{\r\n\t \tthis.next_state = 'turn_3';\r\n\t \tthis.exec_state();\r\n\t}\r\n \tthis.check_win_or_dead();\r\n\tbreak;\r\n\r\n //Draw\r\n case 'draw_card_0':\r\n this.next_state = 'draw_card_1';\r\n if(this.player_array[this.current_turn].current_region == 2 || this.player_array[this.current_turn].current_region == 3)\r\n {\r\n \t\tdraw_card_screen_overlay(1,1,1); // all cards can be drawn\r\n }\r\n\r\n else if(this.player_array[this.current_turn].current_region == 4 || this.player_array[this.current_turn].current_region == 5)\r\n\t{\r\n\t\tdraw_card_screen_overlay(1,0,0); // investigation only\r\n\t}\r\n\r\n else if(this.player_array[this.current_turn].current_region == 6)\r\n {\r\n \tdraw_card_screen_overlay(0,1,0); // defense only\r\n }\r\n\r\n else if(this.player_array[this.current_turn].current_region == 8)\r\n\t{\r\n \tdraw_card_screen_overlay(0,0,1); // offense only\r\n\t}\r\n\tthis.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n case 'draw_card_1':\r\n this.next_state = 'turn_2';\r\n hide_draw_card_screen_overlay();\r\n this.check_win_or_dead();\r\n \tthis.last_state=state;\r\n this.exec_state();\r\n break;\r\n\r\n //Draw invest card only\r\n case 'draw_invest_card_only':\r\n this.next_state = 'draw_card_1';\r\n draw_card_screen_overlay(1,0,0);\r\n \tthis.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Steal card from another player when player lands in 11/12 zone\r\n case 'steal_region_0':\r\n //Commented out for implementation of stealing cards -S17\r\n // this.next_state = 'steal_region_1';\r\n show_select_player_screen('region_stealing');\r\n this.add_info_message(this.current_turn, 'Select which player to steal card from.');\r\n this.check_win_or_dead();\r\n break;\r\n case 'steal_region_1':\r\n \t this.last_state=state;\r\n this.next_state = 'turn_2';\r\n //Commented out for implementation of stealing cards -S17\r\n //this.steal_equip_card();\r\n this.check_win_or_dead();\r\n \tthis.last_state=state;\r\n //this.add_info_message(this.current_turn, 'Select which player to steal card from.');\r\n this.exec_state();\r\n break;\r\n\r\n case 'move_region_0':\r\n\t this.last_state=state;\r\n \tthis.next_state = 'move_region_1';\r\n \tthis.add_info_message(this.current_turn, 'Move to any region');\r\n \tshow_select_zone_screen(\"all\");\r\n \tthis.check_win_or_dead();\r\n\tbreak;\r\n\r\n case 'move_region_1':\r\n \tthis.last_state = state;\r\n \tthis.next_state = 'turn_2';\r\n\t this.player_array[this.current_turn].current_region = this.selected_zone;\r\n \t var new_region = this.selected_zone;\r\n\t turnValue = this.selected_zone;\r\n\t movePiece(this.player_array[this.current_turn].player_color);\r\n\t this.add_info_message(this.current_turn, 'You picked Zone ' + this.selected_zone +'.');\r\n \tthis.check_win_or_dead();\r\n \tthis.exec_state();\r\n \tbreak;\r\n\r\n //When you land in zone 9/10 and choose to damage -S17\r\n case 'damage_region_0':\r\n this.next_state = 'damage_region_1';\r\n show_select_options_screen(\"DAMAGE OR HEAL A PLAYER?\", \"HEAL\", \"DAMAGE\");\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n case 'damage_region_1':\r\n this.next_state = 'damage_region_2';\r\n hide_select_options_screen();\r\n if(this.selected_option == 1)\r\n {\r\n this.add_info_message(this.current_turn, 'Select player to heal.');\r\n show_select_player_screen('all');\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_turn, 'Select player to damage.');\r\n show_select_player_screen();\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'damage_region_2':\r\n \t this.last_state=state;\r\n this.next_state = 'damage_region_3';\r\n hide_select_player_screen();\r\n if(this.selected_option == 1)\r\n {\r\n if(this.player_array[this.selected_player].hp != 0)\r\n {\r\n moveDamage(this.player_array[this.selected_player].player_color, -1);\r\n }\r\n }\r\n else\r\n {\r\n\t if(this.player_array[this.selected_player].equipped.card_title == 'Good Luck Charm')\r\n\t {\r\n \tthis.add_info_message(this.selected_player, 'You have \"Good Luck Charm\" equipped! You took no damage from zone 9/10!');\r\n \t\t this.add_info_message(this.current_turn, 'That player has the Good Luck Charm and took no damage!');\r\n }\r\n else\r\n \t {\r\n \t moveDamage(this.player_array[this.selected_player].player_color, 2);\r\n \t }\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n case 'damage_region_3':\r\n \t this.last_state=state;\r\n this.next_state = 'turn_2';\r\n this.exec_state();\r\n break;\r\n\r\n\r\n //Attacking\r\n case'attack_0': // After Attack is pressed - prevent attacks while in Safe House\r\n if(this.player_array[this.current_turn].current_region == 7)\r\n {\r\n this.add_info_message(this.current_turn, 'You cannot attack while in the Safe House.');\r\n }\r\n //otherwise if they havent attacked already\r\n else if(this.has_attacked == 0)\r\n {\r\n this.next_state = 'attack_1';\r\n this.add_info_message(this.current_turn, 'Select which player to attack.');\r\n //show_attack_select_player_screen();\r\n show_select_player_screen('attacking');\r\n if(this.current_player_can_be_attacked == true)\r\n this.has_attacked = 1;\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, 'You cannot attack. You\\'re already attacking, being attacked, or already attacked.');\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'attack_1': //Roll for attacker damage\r\n this.next_state = 'attack_2';\r\n rollOneRedDice();\r\n this.show_defense_pass_btn();\r\n this.current_attacking_player_pts = dice1Value;\r\n this.current_attacking_player = this.current_turn;\r\n this.current_defending_player = this.selected_player;\r\n this.add_info_message(this.current_player, 'You rolled a ' + this.current_attacking_player_pts + '!');\r\n this.add_info_message(this.current_turn, 'Press \"PASS TO DEFENSE\" and pass to defending player.');\r\n //ADD WAIT FOR DICE ROLL!!!\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'attack_2': //Transition to Defender\r\n this.next_state = 'attack_3';\r\n this.switch_player(this.selected_player);\r\n this.show_roll_btn();\r\n this.add_info_message(this.current_player, 'You are being attacked by Player ' + this.current_turn + '! They rolled a ' + this.current_attacking_player_pts + '. \\rRoll to defend!.');\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'attack_3': // Roll for Defense\r\n this.next_state = 'attack_4';\r\n rollOneGreenDice();\r\n this.current_defending_player_pts = dice1Value;\r\n this.add_info_message(this.current_player, 'You rolled a ' + this.current_defending_player_pts + '!');\r\n \t this.add_info_message(this.current_turn, 'They rolled a ' + this.current_defending_player_pts + '!'); //informs the attacker what the defender rolled\r\n var damage = 0;\r\n\r\n //Check if Balance Suit is equipped\r\n if(this.player_array[this.current_defending_player].equipped.card_title == 'Balance Suit' || this.player_array[this.current_attacking_player].equipped.card_title == 'Balance Suit')\r\n damage = (this.current_attacking_player_pts - this.current_defending_player_pts) - 1;\r\n else\r\n damage = (this.current_attacking_player_pts - this.current_defending_player_pts);\r\n\r\n //Check if guardin angel is active S17\r\n if(this.guardian_angel == this.player_array[this.current_defending_player].character.char_name)\r\n {\r\n this.add_info_message(this.current_player, 'You are being protected by a Guardian Angel! You take no damage!');\r\n }\r\n else\r\n {\r\n if(this.current_attacking_player_pts > this.current_defending_player_pts)\r\n {\r\n //Check if Garrote or Blow Gun is equipped\r\n if(this.player_array[this.current_turn].equipped.card_title == 'Garrote' || this.player_array[this.current_turn].equipped.card_title == 'Blow Gun')\r\n damage=damage+1;\r\n\r\n //Check if Hand Gun or Sniper Rifle is equipped\r\n if(this.player_array[this.current_turn].equipped.card_title == 'Sniper Rifle' || this.player_array[this.current_turn].equipped.card_title == 'Handgun')\r\n damage=damage+1;\r\n\r\n this.double_damage = damage; //Used for sam's special\r\n moveDamage(this.player_array[this.current_player].player_color, damage);\r\n this.add_info_message(this.current_player, 'You lost the attack! You took ' + damage + ' point(s) of damage.');\r\n this.add_info_message(this.current_turn, 'You won the attack! You gave ' + damage + ' damage to Player ' + this.current_player + '.');\r\n\r\n var total_hp = this.player_array[this.current_player].character.hp;\r\n document.getElementById(\"player_hp\").innerHTML = total_hp - this.player_array[this.current_player].hp;\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, 'You won the attack! You lost 0 point(s) of health.');\r\n this.add_info_message(this.current_turn, 'You lost the attack! You gave 0 damage to Player ' + this.current_player + '.');\r\n }\r\n\r\n }\r\n \t this.last_state=state;\r\n\t if (this.player_array[this.current_player].character.char_name != \"Osama Bin Laden\")\r\n {\r\n\t\t this.show_offense_pass_btn();\r\n\t }\r\n \t else\r\n {\r\n\t\t this.show_osama_special_attack_btn();\r\n\t }\r\n this.check_win_or_dead();\r\n\r\n this.add_info_message(this.current_player, 'Press \"PASS TO OFFENSE\" and pass to attacking player.');\r\n //ADD WAIT FOR DICE ROLL!!!\r\n break;\r\n case 'attack_4': // Transition back to attacker and continue turn\r\n \t this.last_state=state;\r\n this.next_state = 'turn_2';\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state();\r\n break;\r\n\r\n case 'osama_attack_0': //These states should happen between attack_3 and attack_4 S17\r\n\t // Shows roll button\r\n\t this.next_state = 'osama_attack_1';\r\n\t this.last_state=state;\r\n \t this.show_roll_btn();\t//calls this.exec_State() on click\r\n \t break;\r\n\r\n case 'osama_attack_1':\r\n \t//Rolls attack die, sets attack value and shows pass to defense button\r\n \tthis.last_state = state;\r\n \tthis.next_state = 'osama_attack_2';\r\n \trollOneRedDice();\r\n this.current_attacking_player_pts = dice1Value;\r\n this.current_attacking_player = this.selected_player;\r\n this.current_defending_player = this.current_turn;\r\n this.add_info_message(this.current_player, 'You rolled a ' + this.current_attacking_player_pts + ' for your counter!');\r\n this.add_info_message(this.current_turn, 'Press \"PASS TO DEFENSE\" and pass to defending player.');\r\n \tthis.show_defense_pass_btn();\r\n \tthis.check_win_or_dead();\r\n break;\r\n\r\n case 'osama_attack_2': // Switches to defending player, informs player of counter attack and shows roll button. Allows defender to use special before rolling\r\n\t this.last_state=state;\r\n \t this.next_state='osama_attack_3';\r\n \t this.switch_player(this.current_turn);\r\n \t //allow players with Attack Modyfing specials to use their special before the counter attack.\r\n this.show_roll_btn();\r\n this.add_info_message(this.current_player, 'You are being counter-attacked by Osama! They rolled a ' + this.current_attacking_player_pts + '. \\rRoll to defend!.');\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'osama_attack_3':\r\n \t this.next_state = 'turn_2';\r\n\t rollOneGreenDice();\r\n this.current_defending_player_pts = dice1Value;\r\n this.add_info_message(this.current_player, 'You rolled a ' + this.current_defending_player_pts + ' for the counter!');\r\n var counter_attack_damage = 0;\r\n\r\n\t//Check if Balance Suit is equipped\r\n if(this.player_array[this.current_defending_player].equipped.card_title == 'Balance Suit' || this.player_array[this.current_attacking_player].equipped.card_title == 'Balance Suit')\r\n counter_attack_damage = (this.current_attacking_player_pts - this.current_defending_player_pts) - 1;\r\n else\r\n counter_attack_damage = (this.current_attacking_player_pts - this.current_defending_player_pts);\r\n\r\n \t//Check to see if guardian angel is active\r\n if(this.guardian_angel == this.player_array[this.current_defending_player].character.char_name)\r\n {\r\n this.add_info_message(this.current_player, 'You are being protected by a Guardian Angel! You take no damage!');\r\n }\r\n else\r\n {\r\n if(this.current_attacking_player_pts > this.current_defending_player_pts)\r\n {\r\n //Check if Garrote or Blow Gun is equipped\r\n if(this.player_array[this.selected_player].equipped.card_title == 'Garrote' || this.player_array[this.selected_player].equipped.card_title == 'Blow Gun')\r\n counter_attack_damage=counter_attack_damage+1;\r\n\r\n //Check if Hand Gun or Sniper Rifle is equipped\r\n if(this.player_array[this.selected_player].equipped.card_title == 'Sniper Rifle' || this.player_array[this.selected_player].equipped.card_title == 'Handgun')\r\n counter_attack_damage=counter_attack_damage+1;\r\n\r\n moveDamage(this.player_array[this.current_player].player_color, counter_attack_damage);\r\n this.add_info_message(this.current_player, 'You lost the counter-attack! You took ' + counter_attack_damage + ' point(s) of damage.');\r\n this.add_info_message(this.selected_player, 'You won the counter-attack! You gave ' + counter_attack_damage + ' damage to Player ' + this.current_player + '.'); //selected player is still osama\r\n\r\n var total_hp = this.player_array[this.current_player].character.hp;\r\n document.getElementById(\"player_hp\").innerHTML = total_hp - this.player_array[this.current_player].hp;\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, 'You won the counter-attack! You lost 0 point(s) of health.');\r\n this.add_info_message(this.selected_player, 'You lost the counter-attack! You gave 0 damage to Player ' + this.current_player + '.');\r\n }\r\n\r\n }\r\n \tthis.check_win_or_dead();\r\n\t this.exec_state();\r\n \tbreak;\r\n\r\n //Specials\r\n case 'special_0':\r\n switch(this.player_array[this.current_player].character.char_name)\r\n {\r\n case 'Ayman al-Zawahiri':\r\n this.next_state = 'ayman_special_0';\r\n break;\r\n case 'Hassan Nasrallah':\r\n this.next_state = 'hassan_special_0';\r\n break;\r\n case 'Osama Bin Laden':\r\n this.next_state = 'osama_special_0';\r\n break;\r\n case 'Sam Seal':\r\n this.next_state = 'sam_special_0';\r\n break;\r\n case 'CIA Charlie':\r\n this.next_state = 'charlie_special_0';\r\n break;\r\n case 'FBI Fred':\r\n this.next_state = 'fred_special_0';\r\n break;\r\n case 'Daniel Doomsday':\r\n this.next_state = 'daniel_special_0';\r\n break;\r\n case 'Gatherin\\' George':\r\n this.next_state = 'george_special_0';\r\n break;\r\n case 'Totally Tori':\r\n this.next_state = 'tori_special_0';\r\n break;\r\n case 'Billy-Bob Badass':\r\n this.next_state = 'billy_special_0';\r\n break;\r\n }\r\n\t this.last_state=state;\r\n this.exec_state();\r\n break;\r\n\r\n case 'osama_special_0':\r\n \tthis.next_state = 'turn_3';\r\n\r\n \tif(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.current_player == this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special when being attacked!\");\r\n }\r\n \telse {\r\n \t this.next_state = 'osama_attack_0';\r\n \t this.reveal_player();\r\n \t this.player_array[this.current_player].used_special = 1;\r\n \t this.add_info_message(this.current_player, \"You've used your special!\");\r\n \t}\r\n this.last_state = state;\r\n \tthis.check_win_or_dead();\r\n \tthis.exec_state();\r\n \t break;\r\n\r\n case 'ayman_special_0':\r\n this.next_state = 'turn_3';\r\n\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.has_attacked == 0)\r\n {\r\n this.add_info_message(this.current_player, \"You must attack first\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else if((this.current_attacking_player_pts - this.current_defending_player_pts) < 3)\r\n {\r\n this.add_info_message(this.current_player, \"You must inflict 3 or more damage to use this special\");\r\n }\r\n else\r\n {\r\n this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -2); // Heals Ayman 2 damage points\r\n this.add_info_message(this.current_player, \"You've used your special!\");\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'hassan_special_0':\r\n this.next_state = 'turn_3';\r\n this.add_info_message(this.current_player, \"You can only use your special when you see the 'LIE' button. You have no limit on your special.\");\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'sam_special_0':\r\n this.next_state = 'turn_3';\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.has_attacked == 0)\r\n {\r\n this.add_info_message(this.current_player, \"You must attack first\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else if(this.current_attacking_player_pts <= this.current_defending_player_pts)\r\n {\r\n this.add_info_message(this.current_player, \"You must win the attack to use this special\");\r\n }\r\n else\r\n {\r\n\t this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n moveDamage(this.player_array[this.current_defending_player].player_color, this.double_damage);\r\n this.add_info_message(this.current_player, \"You've used your special!\");\r\n\t this.double_damage = 0; // reset double damage to 0\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'fred_special_0':\r\n\t this.last_state=state;\r\n this.next_state = 'fred_special_1';\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n this.next_state = 'turn_3';\r\n this.exec_state();\r\n }\r\n else if(this.has_attacked != 0)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special before an attack\");\r\n this.next_state = 'turn_3';\r\n this.exec_state();\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n this.next_state = 'turn_3';\r\n this.exec_state();\r\n }\r\n else\r\n {\r\n show_select_player_screen();\r\n }\r\n break;\r\n case 'fred_special_1':\r\n this.next_state = 'turn_3';\r\n hide_select_player_screen();\r\n var damage = (Math.floor(Math.random() * 6) + 1);\r\n moveDamage(this.player_array[this.selected_player].player_color, damage);\r\n\t this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n this.add_info_message(this.current_player, \"You used your special!\");\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'daniel_special_0':\r\n this.next_state = 'turn_3';\r\n\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.has_attacked == 0)\r\n {\r\n this.add_info_message(this.current_player, \"You must attack first\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else if(this.current_attacking_player_pts > this.current_defending_player_pts)\r\n {\r\n this.add_info_message(this.current_player, \"You must win the attack to use this special\");\r\n }\r\n else if(this.player_array[this.current_defending_player].revealed == false)\r\n {\r\n this.add_info_message(this.current_player, \"Player must be revealed\");\r\n }\r\n else if(this.player_array[this.current_defending_player].character.affiliation == \"Counter-Terrorist\" || this.player_array[this.current_defending_player].character.affiliation == \"Neutral\")\r\n {\r\n this.add_info_message(this.current_player, \"Player must be a Terrorist\");\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].hp > 0)\r\n {\r\n this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n this.add_info_message(this.current_player, \"You've used your special!\");\r\n }\r\n else{\r\n this.add_info_message(this.current_player, \"Player has full health!\");\r\n }\r\n\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'george_special_0':\r\n\r\n this.current_state=state;\r\n\t //Commented out since state is no longer implemented -S17\r\n //this.next_state = 'george_special_1';\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.has_attacked == 0)\r\n {\r\n this.add_info_message(this.current_player, \"You must attack first\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else if((this.current_attacking_player_pts - this.current_defending_player_pts) < 2)\r\n {\r\n this.add_info_message(this.current_player, \"You must inflict 2 or more damage to use this special\");\r\n }\r\n \telse if(this.player_array[this.current_defending_player].hand.length < 1)\r\n \t{\r\n \t this.add_info_message(this.current_player, \"The defending player has no equipment cards!\");\r\n }\r\n else\r\n {\r\n this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n document.getElementById(\"george_steal_options_container\").style.display = \"initial\";\r\n //Commented out for implementation of stealing -S17\r\n //this.steal_equip_card();\r\n this.add_info_message(this.current_player, \"You've used your special!\");\r\n }\r\n\t\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'billy_special_0':\r\n //this.next_state = 'ayman_special_1';\r\n this.next_state = 'turn_3';\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.has_attacked == 0)\r\n {\r\n this.add_info_message(this.current_player, \"You must attack first\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else\r\n {\r\n this.reveal_player();\r\n this.player_array[this.current_player].used_special = 1;\r\n this.has_attacked = 0;\r\n this.current_player_can_be_attacked = false;\r\n\t moveDamage(this.player_array[this.selected_player].player_color, 2); // billy takes 2 damage to use special\r\n\r\n this.add_info_message(this.current_player, \"You may now attack again!\");\r\n this.add_info_message(this.current_player, \"You've used your special!\");\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'charlie_special_0':\t// reveal and allows charlie to move to an adjacent zone instead of rolling\r\n \tthis.next_state = 'turn_3';\r\n \tif(this.player_array[this.current_player].used_special == 1)\r\n \t{\r\n \t this.add_info_message(this.current_player, \"You've already used your special\");\r\n \t}\r\n else if (this.current_player != this.current_turn)\r\n \t{\r\n \t this.add_info_message(this.current_player, \"You've can only use this special during your turn\");\r\n \t}\r\n \telse\r\n \t{\r\n \t this.reveal_player();\r\n \t this.player_array[this.current_player].used_special = 1;\r\n \t this.add_info_message(this.current_player, \"You've used your special!\");\r\n \t}\r\n \tthis.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'tori_special_0':\r\n //this.next_state = 'ayman_special_1';\r\n this.next_state = 'turn_3';\r\n if(this.player_array[this.current_player].used_special == 1)\r\n {\r\n this.add_info_message(this.current_player, \"You've already used your special\");\r\n }\r\n else if(this.current_player != this.current_turn)\r\n {\r\n this.add_info_message(this.current_player, \"You can only use this special during your turn\");\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].hp > 0)\r\n {\r\n this.reveal_player();\r\n // for(var i = 0; i < this.player_array[this.current_player].hp; i++)\r\n // moveDamage(this.player_array[this.current_player].player_color, -1);\r\n resetDamage(this.player_array[this.current_player].player_color);\r\n this.player_array[this.current_player].hp = 0;\r\n this.player_array[this.current_player].used_special = 1;\r\n this.add_info_message(this.current_player, \"You used your special!\");\r\n }\r\n else{\r\n this.add_info_message(this.current_player, \"Your health is full!\");\r\n }\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'equip_or_action_offense_0': // This state checks to see if the card drawn is equipment or one time action S17\r\n \tthis.last_state=state;\r\n \t hide_draw_card_screen_overlay();\r\n \tvar is_equipment_card = false; // set flag\r\n \tthis.offense_or_defense = \"offense\";\r\n\r\n \t//if the offense deck is empty, shuffle all the one time action cards back into a new deck\r\n \tif(offenseArray.length == 0) {\r\n \t offenseArray = newDeckOffenseArray;\r\n array_shuffle(offenseArray);\r\n \t }\r\n\r\n \tfor (var i = 0; i < equipmentArray.length; i++) {\r\n \t\tif (offenseArray[0] == equipmentArray[i]) {\r\n \t\t\tis_equipment_card = true;\r\n \t\t}\r\n \t}\r\n \tif (is_equipment_card) {\r\n \t\tthis.next_state = 'equip_0';\r\n \t}\r\n \telse {\r\n \t\tthis.next_state = 'action_0';\r\n \t}\r\n \tthis.exec_state();\r\n \t break;\r\n\r\n case 'equip_or_action_defense_0': // This state checks to see if the card drawn is equipment or one time action S17\r\n \tthis.last_state=state;\r\n hide_draw_card_screen_overlay();\r\n \tvar is_equipment_card = false; // set flag\r\n \tthis.offense_or_defense = \"defense\";\r\n\r\n \t//if the defense deck is empty, shuffle all the one time action cards back into a new deck\r\n \tif(defenseArray.length == 0) {\r\n \t defenseArray = newDeckDefenseArray;\r\n array_shuffle(defenseArray);\r\n \t}\r\n\r\n \tfor (var i = 0; i < equipmentArray.length; i++) {\r\n \t\tif (defenseArray[0] == equipmentArray[i]) {\r\n \t\t\tis_equipment_card = true;\r\n \t\t}\r\n \t}\r\n \tif (is_equipment_card) {\r\n \t\tthis.next_state = 'equip_0';\r\n \t}\r\n \telse {\r\n \t\tthis.next_state = 'action_0';\r\n \t}\r\n \tthis.exec_state();\r\n \tbreak;\r\n\r\n //Investigation\r\n case 'invest_0':\r\n hide_draw_card_screen_overlay();\r\n if(investigationArray.length > 0)\r\n {\r\n this.drawn_invest_card = investigationArray[0];\r\n investigationArray.shift();\r\n }\r\n else\r\n {\r\n investigationArray = new_deck_investigationArray;\r\n array_shuffle(investigationArray);\r\n this.drawn_invest_card = investigationArray[0];\r\n investigationArray.shift();\r\n }\r\n switch(this.drawn_invest_card.card_title)\r\n {\r\n case 'accuse1':\r\n this.next_state = 'accuse1_0';\r\n break;\r\n case 'accuse2':\r\n this.next_state = 'accuse1_0';\r\n break;\r\n case 'accuse3':\r\n this.next_state = 'accuse3_0';\r\n break;\r\n case 'accuse4':\r\n this.next_state = 'accuse4_0';\r\n break;\r\n case 'accuse5':\r\n this.next_state = 'accuse5_0';\r\n break;\r\n case 'accuse6':\r\n this.next_state = 'accuse6_0';\r\n break;\r\n case 'accuse7':\r\n this.next_state = 'accuse7_0';\r\n break;\r\n case 'accuse8':\r\n this.next_state = 'accuse8_0';\r\n break;\r\n case 'accuse9':\r\n this.next_state = 'accuse9_0';\r\n break;\r\n case 'accuse10':\r\n this.next_state = 'accuse10_0';\r\n break;\r\n case 'accuse11':\r\n this.next_state = 'accuse11_0';\r\n break;\r\n case 'accuse12':\r\n this.next_state = 'accuse12_0';\r\n break;\r\n case 'accuse13':\r\n this.next_state = 'accuse11_0';\r\n break;\r\n case 'accuse14':\r\n this.next_state = 'accuse14_0';\r\n break;\r\n case 'accuse15':\r\n this.next_state = 'accuse10_0';\r\n break;\r\n case 'reveal1':\r\n this.next_state = 'reveal1_0';\r\n break;\r\n case 'reveal2':\r\n this.next_state = 'reveal2_0';\r\n break;\r\n default:\r\n this.next_state = 'draw_card_1';\r\n break;\r\n }\r\n \tthis.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'invest_1':\r\n \t this.last_state=state;\r\n if((this.player_array[this.current_player].equipped.card_title == 'Water Board' || this.player_array[this.current_player].equipped.card_title == 'Cattle Prod') && this.used_equip_card == 0)\r\n {\r\n this.used_equip_card = 1;\r\n this.exec_state('invest_2');\r\n }\r\n else\r\n {\r\n this.used_equip_card = 0;\r\n this.exec_state('turn_2');\r\n }\r\n break;\r\n\r\n case 'invest_2':\r\n this.next_state = 'draw_invest_card_only';\r\n \tthis.last_state=state;\r\n this.show_draw_btn();\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //One Time Action\r\n case 'one_time_0':\r\n \tthis.last_state=state;\r\n break;\r\n\r\n //Equipment\r\n case 'equip_0':\r\n this.next_state = 'equip_1';\r\n \tif(this.offense_or_defense == \"defense\") {\r\n \t\tthis.drawn_equip_card = defenseArray[0];\r\n \t\tdefenseArray.shift();\r\n \t}\r\n \telse if(this.offense_or_defense == \"offense\") {\r\n \t\tthis.drawn_equip_card = offenseArray[0];\r\n \t\toffenseArray.shift();\r\n \t}\r\n\r\n /*switch(this.drawn_equip_card.card_title)\r\n {\r\n case 'Compass':\r\n this.next_state = 'equip_1';\r\n this.drawn_invest_card =\r\n this.add_card_to_hand()\r\n break;\r\n default:\r\n this.next_state = 'draw_card_1';\r\n break;\r\n }*/\r\n show_zoomed_card(this.drawn_equip_card);\r\n this.add_card_to_hand();\r\n //this.exec_state();\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'equip_1':\r\n hide_zoomed_card();\r\n\t this.last_state=state;\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n case 'equip_card_to_player':\r\n\t this.last_state=state;\r\n show_view_card(game.drawn_equip_card);\r\n //Do equip stuff\r\n break;\r\n\r\n case 'select_option_1':\r\n this.selected_option = 1;\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'select_option_2':\r\n this.selected_option = 2;\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n case 'select_option_3':\r\n this.selected_option = 3;\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n //Investigation accuse card - I bet you are a Terrorist. If so, you receive 1 damage\r\n //Show card and wait for user to click card\r\n case 'accuse1_0':\r\n this.next_state = 'accuse1_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse1_1':\r\n this.next_state = 'accuse1_2';\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n show_select_player_screen();\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Switch to the player selected. If player can lie, show lie btn.\r\n case 'accuse1_2':\r\n this.next_state = 'accuse1_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n this.add_info_message(this.current_player, \"You can lie! Press 'TAKE 1 DAMAGE' or 'LIE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A TERRORIST! SELECT AN OPTION.\", 'TAKE ONE DAMAGE', 'LIE');\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Terrorist')\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A TERRORIST!\", \"TAKE 1 DAMAGE\");\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie but you're not a Terrorist! Press 'OK'.\")\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A TERRORIST!\", \"OK\");\r\n }\r\n }\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n //Calculate damage then switch back to current turn player.\r\n case 'accuse1_3':\r\n hide_select_options_screen();\r\n if(this.selected_option == 2)\r\n this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Terrorist')\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card\r\n //\"I bet you are Neutral.\r\n //If so, you heal 1 damage\r\n //(If you have no damage - take one damage instead)\r\n //Show card and wait for user to click card\r\n case 'accuse3_0':\r\n this.next_state = 'accuse3_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse3_1':\r\n this.next_state = 'accuse3_2';\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n \t this.last_state=state;\r\n show_select_player_screen();\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'accuse3_2':\r\n this.next_state = 'accuse3_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\"){\r\n this.add_info_message(this.current_player, \"You can lie! Press 'HEAL/TAKE 1 DAMAGE' or 'LIE'\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A NEUTRAL! SELECT AN OPTION. (YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE)\", 'HEAL/TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else{\r\n if(this.player_array[this.current_player].character.affiliation == 'Neutral'){\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'HEAL/TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A NEUTRAL! (YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE)\", \"HEAL/TAKE 1 DAMAGE\");\r\n }\r\n else{\r\n this.add_info_message(this.current_player, \"You cannot lie, but you are not Neutral. Press 'OK'.\")\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS BEING A NEUTRAL!\", \"OK\");\r\n }\r\n }\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'accuse3_3':\r\n hide_select_options_screen();\r\n if(this.selected_option == 2){\r\n if(this.player_array[this.current_player].hp == 0){\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else{\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n }\r\n }\r\n else{\r\n if(this.player_array[this.current_player].character.affiliation == 'Neutral'){\r\n if(this.player_array[this.current_player].hp == 0){\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else{\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n }\r\n }\r\n }\r\n \t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card\r\n //\"I bet you are Terrorist.\r\n //If so, you heal 1 damage\r\n //(If you have no damage - take one damage instead)\r\n //Show card and wait for user to click card\r\n case 'accuse4_0':\r\n this.next_state = 'accuse4_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse4_1':\r\n this.next_state = 'accuse4_2';\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n\t this.last_state=state;\r\n show_select_player_screen();\r\n break;\r\n\r\n case 'accuse4_2':\r\n this.next_state = 'accuse4_3';\r\n this.last_state=state;\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\"){\r\n this.add_info_message(this.current_player, \"You can lie! Press 'OK' or 'Lie'\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST! SELECT AN OPTION.(YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE)\", 'HEAL/TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else{\r\n if(this.player_array[this.current_player].character.affiliation == 'Terrorist'){\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'HEAL/TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST! (YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE).\", \"HEAL/TAKE 1 DAMAGE\");\r\n }\r\n else{\r\n this.add_info_message(this.current_player, \"You cannot lie, but you are not Terrorist. Press 'OK'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST!\", \"OK\");\r\n }\r\n }\r\n break;\r\n\r\n case 'accuse4_3':\r\n hide_select_options_screen();\r\n if(this.selected_option == 2){\r\n this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n }\r\n else{\r\n if(this.player_array[this.current_player].character.affiliation == 'Terrorist'){\r\n if(this.player_array[this.current_player].hp == 0){\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else{\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n }\r\n }\r\n }\r\n this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card - I bet you are either Neutral or a Terrorist. If so, you must either give me an equipment card or receive 1 damage\r\n //Show card and wait for user to click card\r\n case 'accuse5_0':\r\n this.next_state = 'accuse5_1';\r\n\t this.last_state=state;\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse5_1':\r\n this.next_state = 'accuse5_2';\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n this.last_state=state;\r\n show_select_player_screen();\r\n break;\r\n\r\n //Switch to the player selected. If player can lie, show lie btn.\r\n case 'accuse5_2':\r\n this.next_state = 'accuse5_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n this.add_info_message(this.current_player, \"You can lie! Select an option or press 'LIE'.\");\r\n //Check if players hand is empty\r\n //If empty, then only show take 1 damage and lie buttons\r\n if(this.player_array[this.current_player].hand.length != 0)\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST OR NEUTRAL! SELECT AN OPTION.\", 'TAKE 1 DAMAGE', 'LIE', 'GIVE EQUIPMENT CARD');\r\n else\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST OR NEUTRAL! SELECT AN OPTION.\", 'TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Terrorist' || this.player_array[this.current_player].character.affiliation == 'Neutral')\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie! Select an option.\");\r\n //Check if players hand is empty\r\n //If empty, then only show take 1 damage and lie buttons\r\n if(this.player_array[this.current_player].hand.length != 0)\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST OR NEUTRAL! SELECT AN OPTION.\", 'TAKE 1 DAMAGE', 'GIVE EQUIPMENT CARD');\r\n else\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST OR NEUTRAL! SELECT OPTION.\", 'TAKE 1 DAMAGE');\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie, but you don't need to! Press 'OK'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A TERRORIST OR NEUTRAL! SELECT OPTION.\", 'OK');\r\n }\r\n }\r\n\t this.last_state=state;\r\n break;\r\n\r\n //Calculate damage then switch back to current turn player.\r\n case 'accuse5_3':\r\n hide_select_options_screen();\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n if(this.selected_option == 1){\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else if(this.selected_option == 2)\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n //moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else\r\n this.select_options(this.current_turn);\r\n //Commented out for accuse 5 testing S17\r\n // this.steal_equip_card();\r\n }\r\n else if(this.player_array[this.current_player].character.affiliation == 'Terrorist' || this.player_array[this.current_player].character.affiliation == 'Neutral')\r\n {\r\n if (this.selected_option == 1)\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n else\r\n this.select_options(this.current_turn);\r\n //Commented out for accuse 5 testing S17\r\n // this.steal_equip_card();\r\n }\r\n else\r\n this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n //this.last_state=state;\r\n // this.check_win_or_dead();\r\n //this.switch_player(this.current_turn);\r\n //this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card\r\n //\"I bet you are Counter-Terrorist.\r\n //If so, you heal 1 damage\r\n //(If you have no damage - take one damage instead)\r\n //Show card and wait for user to click card\r\n case 'accuse6_0':\r\n this.next_state = 'accuse6_1';\r\n\t this.last_state=state;\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse6_1':\r\n this.next_state = 'accuse6_2';\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n\t this.last_state=state;\r\n show_select_player_screen();\r\n break;\r\n\r\n case 'accuse6_2':\r\n this.next_state = 'accuse6_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\"){\r\n this.add_info_message(this.current_player, \"You can lie! Press 'HEAL/TAKE 1 DAMAGE' or 'LIE'\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST! SELECT AN OPTION.(YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE)\", 'HEAL/TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else{\r\n if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist'){\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'HEAL/TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST! (YOU TAKE DAMAGE INSTEAD OF HEAL IF YOU HAVE NO DAMAGE)\", \"HEAL/TAKE 1 DAMAGE\");\r\n }\r\n else{\r\n this.add_info_message(this.current_player, \"You cannot lie, but you are not Counter-Terrorist. Press 'OK'.\")\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST!\", \"OK\");\r\n }\r\n }\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'accuse6_3':\r\n hide_select_options_screen();\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n if(this.selected_option == 2)\r\n {\r\n if(this.player_array[this.current_player].hp != 0)\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n else\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n //moveDamage(this.player_array[this.current_player].player_color, -1);\r\n }\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist')\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n if(this.player_array[this.current_player].hp != 0)\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n else\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n // if(this.selected_option == 2){\r\n // this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n // }\r\n // else{\r\n // if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist'){\r\n // if(this.player_array[this.current_player].hp == 0){\r\n // //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n // moveDamage(this.player_array[this.current_player].player_color, 1);\r\n // }\r\n // else{\r\n // //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 1;\r\n // moveDamage(this.player_array[this.current_player].player_color, -1);\r\n // }\r\n // }\r\n // }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card - I bet you are a Counter-Terrorist. If so, you receive 1 damage\r\n //Show card and wait for user to click card\r\n case 'accuse10_0':\r\n this.next_state = 'accuse10_1';\r\n\t this.last_state=state;\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n break;\r\n\r\n //Let player select who to investigate.\r\n case 'accuse10_1':\r\n this.next_state = 'accuse10_2';\r\n\t this.last_state=state;\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n show_select_player_screen();\r\n break;\r\n\r\n //Switch to the player selected. If player can lie, show lie btn.\r\n case 'accuse10_2':\r\n this.next_state = 'accuse10_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n this.add_info_message(this.current_player, \"You can lie! Press 'TAKE 1 DAMAGE' or 'LIE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST! SELECT AN OPTION.\", 'TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist')\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST!\", \"TAKE 1 DAMAGE\");\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie, but you're not a Counter-Terrorist! Press 'OK'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A COUNTER-TERRORIST!\", \"OK\");\r\n }\r\n }\r\n\t this.last_state=state;\r\n break;\r\n\r\n //Calculate damage then switch back to current turn player.\r\n case 'accuse10_3':\r\n hide_select_options_screen();\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n if(this.selected_option == 2)\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist')\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation accuse card - I bet you are a Neutral. If so, you receive 1 damage\r\n //Show card and wait for user to click card\r\n case 'accuse11_0':\r\n this.next_state = 'accuse11_1';\r\n\t this.last_state=state;\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_invest_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n break;\r\n\r\n\r\n //Let player select who to investigate.\r\n case 'accuse11_1':\r\n this.next_state = 'accuse11_2';\r\n\t this.last_state=state;\r\n hide_zoomed_card();\r\n this.add_info_message(this.current_player, 'Select player to investigate.');\r\n show_select_player_screen();\r\n break;\r\n\r\n //Switch to the player selected. If player can lie, show lie btn.\r\n case 'accuse11_2':\r\n\t this.last_state=state;\r\n this.next_state = 'accuse11_3';\r\n this.switch_player(this.selected_player);\r\n this.add_info_message(this.current_player, \"Player \" + this.current_turn + \": \" + this.drawn_invest_card.card_text);\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n this.add_info_message(this.current_player, \"You can lie! Press 'TAKE 1 DAMAGE' or 'LIE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A NEUTRAL! SELECT AN OPTION.\", 'TAKE 1 DAMAGE', 'LIE');\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Neutral')\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie! Press 'TAKE 1 DAMAGE'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A NEUTRAL!\", \"TAKE 1 DAMAGE\");\r\n }\r\n else\r\n {\r\n this.add_info_message(this.current_player, \"You cannot lie but you're not a Neutral! Press 'OK'.\");\r\n show_select_options_screen(\"YOU'RE BEING INVESTIGATED AS A NEUTRAL!\", \"OK\");\r\n }\r\n }\r\n break;\r\n\r\n //Calculate damage then switch back to current turn player.\r\n case 'accuse11_3':\r\n hide_select_options_screen();\r\n if(this.player_array[this.current_player].character.char_name == \"Hassan Nasrallah\")\r\n {\r\n if(this.selected_option == 2)\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 0;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n else\r\n {\r\n if(this.player_array[this.current_player].character.affiliation == 'Neutral')\r\n {\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp + 1;\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.switch_player(this.current_turn);\r\n this.exec_state('invest_1');\r\n break;\r\n\r\n //Investigation\r\n case 'action_0':\r\n \t if (this.offense_or_defense == \"defense\")\r\n {\r\n \t\t this.drawn_action_card = defenseArray[0];\r\n \t \tdefenseArray.shift();\r\n \t }\r\n \t else if (this.offense_or_defense == \"offense\")\r\n {\r\n \t \tthis.drawn_action_card = offenseArray[0];\r\n \t\t offenseArray.shift();\r\n \t }\r\n\r\n switch(this.drawn_action_card.card_title)\r\n {\r\n case 'R&R':\r\n this.next_state = 'action_rnr_0';\r\n break;\r\n case 'I\\'ll Help!':\r\n this.next_state = 'action_illhelp_0';\r\n break;\r\n case 'Guardian Angel':\r\n this.next_state = 'action_guardianangel_0';\r\n break;\r\n case 'It\\'s your lucky day!':\r\n this.next_state = 'action_luckyday_0';\r\n break;\r\n case 'Spotted!':\r\n this.next_state = 'action_spotted_0';\r\n break;\r\n case 'First Aid':\r\n this.next_state = 'action_firstaid_0';\r\n break;\r\n case 'Judgement Day':\r\n this.next_state = 'action_judgementday_0';\r\n break;\r\n case 'Energy Boost':\r\n this.next_state = 'action_energyboost_0';\r\n break;\r\n case 'Doctor\\'s Visit':\r\n this.next_state = 'action_doctorsvisit_0';\r\n break;\r\n case 'Dynamite':\r\n this.next_state = 'action_dynamite_0';\r\n break;\r\n case 'Jihad!':\r\n this.next_state = 'action_jihad_0';\r\n break;\r\n case 'Deadly Surprise':\r\n this.next_state = 'action_deadlysurprise_0';\r\n break;\r\n //NOT IMPLEMENTED S17\r\n /* case 'That\\'s Not Good':\r\n this.next_state = 'action_thatsnotgood_0';\r\n break;*/\r\n case 'That\\'s Mine':\r\n this.next_state = 'action_thatsmine_0';\r\n break;\r\n case 'Deadly Game':\r\n this.next_state = 'action_deadlygame_0';\r\n break;\r\n case 'Jihad! Jihad!':\r\n this.next_state = 'action_jihadjihad_0';\r\n break;\r\n default:\r\n this.next_state = 'draw_card_1';\r\n break;\r\n }\r\n\t this.last_state=state;\r\n this.exec_state()\r\n break;\r\n\r\n\t//Action Card\r\n\t\t//Choose a character and restore their health to 4\r\n\t case 'action_doctorsvisit_0':\r\n\t\tthis.next_state = 'action_doctorsvisit_1';\r\n\t\tthis.last_state = state;\r\n\t\thide_draw_card_screen_overlay();\r\n\t\tshow_view_card(this.drawn_action_card);\r\n\t\tthis.add_info_message(this.current_player, 'Click card to use it.');\r\n\t\tbreak;\r\n\t \r\n\t case 'action_doctorsvisit_1':\r\n\t\tthis.next_state = 'action_doctorsvisit_2';\r\n\t\thide_zoomed_card();\r\n\t\tthis.last_state = state;\r\n\t\tshow_select_player_screen();\r\n\t\tbreak;\r\n\t\t\r\n\t case 'action_doctorsvisit_2':\r\n\t\tthis.next_state = 'turn_2';\r\n\t\tthis.last_state = state;\r\n\t\thide_select_player_screen('all');\t \r\n\t\tvar damage_taken = this.player_array[this.selected_player].hp;\r\n\t\tvar heal_amount = 0;\r\n\t\tif (damage_taken > 4)\r\n\t\t{\r\n\t\t\theal_amount = damage_taken - 4;\r\n\t\t}\r\n\t\tmoveDamage(this.player_array[this.selected_player].player_color, -heal_amount);\t\r\n\t\tthis.check_win_or_dead();\r\n\t\tthis.exec_state();\r\n\t\tbreak;\r\n\t\t\r\n\t//Action Card\r\n \t// You take no damage from attacks until your next turn\r\n\r\n \t case 'action_guardianangel_0':\r\n \t this.next_state = 'action_guardianangel_1';\r\n \t this.last_state = state;\r\n \t hide_draw_card_screen_overlay();\r\n \t show_view_card(this.drawn_action_card);\r\n \t this.add_info_message(this.current_player, 'Click card to use it.');\r\n \t this.exec_state();\r\n \t break;\r\n\r\n \t case 'action_guardianangel_1':\r\n \t this.next_state = 'turn_2';\r\n \t this.guardian_angel = this.player_array[this.current_player].character.char_name;\r\n \t hide_zoomed_card();\r\n \t this.last_state = state;\r\n \t this.exec_state();\r\n \t break;\r\n\r\n //Action Card\r\n // You take and extra turn after your current turn is over\r\n \t case 'action_energyboost_0':\r\n \t this.next_state = 'action_energyboost_1';\r\n \t this.last_state=state;\r\n \t hide_draw_card_screen_overlay();\r\n \t show_view_card(this.drawn_action_card);\r\n \t this.add_info_message(this.current_player, 'Click card to use it.');\r\n \t this.exec_state();\r\n break;\r\n\r\n \t case 'action_energyboost_1':\r\n \t this.next_state = 'turn_2';\r\n \t this.extra_turn = true;\r\n \t hide_zoomed_card();\r\n \t this.last_state = state;\r\n \t this.exec_state();\r\n \t break;\r\n\r\n \t //Action card\r\n //If you are a Counter-Terrorist, you may reveal your identity. If you do, or if you are already revealed, you heal fully(0 damage).\r\n \t case 'action_rnr_0':\r\n\r\n this.next_state = 'action_rnr_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n \t this.last_state=state;\r\n break;\r\n\r\n case 'action_rnr_1':\r\n this.next_state = 'action_rnr_2';\r\n hide_zoomed_card();\r\n\t this.last_state=state;\r\n if(this.player_array[this.current_player].character.affiliation == 'Counter-Terrorist' && this.player_array[this.current_player].revealed == false)\r\n show_select_options_screen(\"REVEAL YOUR IDENTITY?\", 'REVEAL', 'NO');\r\n else if(this.player_array[this.current_player].character.affiliation != 'Counter-Terrorist')\r\n {\r\n this.add_info_message(this.current_player, 'Sorry, you\\'re not a Counter-Terrorist.');\r\n this.exec_state('turn_2');\r\n }\r\n else\r\n this.exec_state();\r\n break;\r\n\r\n case 'action_rnr_2':\r\n hide_select_options_screen();\r\n\t this.last_state=state;\r\n if(this.selected_option == 1 || this.player_array[this.current_player].revealed == true)\r\n {\r\n this.reveal_player();\r\n this.add_info_message(this.current_player, 'You have healed fully.');\r\n // for(var i = 0; i < this.player_array[this.current_player].hp; i++)\r\n // moveDamage(this.player_array[this.current_player].player_color, -1);\r\n resetDamage(this.player_array[this.current_player].player_color);\r\n this.player_array[this.current_player].hp = 0;\r\n }\r\n this.check_win_or_dead();\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n //Action Card\r\n //Pick a character (other than you) - Heal random 1-6 points of damage.\r\n case 'action_illhelp_0':\r\n this.next_state = 'action_illhelp_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'action_illhelp_1':\r\n this.next_state = 'action_illhelp_2';\r\n hide_zoomed_card();\r\n show_select_player_screen();\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'action_illhelp_2':\r\n this.next_state = 'turn_2';\r\n hide_select_player_screen();\r\n var damage = (Math.floor(Math.random() * 6) + 1);\r\n //this.player_array[this.selected_player].hp = this.player_array[this.selected_player].hp - damage;\r\n moveDamage(this.player_array[this.selected_player].player_color, (-1 * damage));\r\n var message_string = \"You healed Player \" + this.selected_player + \".\";\r\n this.add_info_message(this.current_player, message_string);\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n //Action card\r\n //If you are Tori, Charlie, or Hassan, you may reveal yourself. If you do (or you are already revealed) you fully heal (0 damage).\r\n case 'action_luckyday_0':\r\n this.next_state = 'action_luckyday_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'action_luckyday_1':\r\n this.next_state = 'action_luckyday_2';\r\n hide_zoomed_card();\r\n\t this.last_state=state;\r\n var name = this.player_array[this.current_player].character.char_name;\r\n if((name == 'Totally Tori' || name == 'CIA Charlie' || name == 'Hassan Nasrallah') && this.player_array[this.current_player].revealed == false)\r\n show_select_options_screen(\"REVEAL YOUR IDENTITY?\", 'REVEAL', 'NO');\r\n else if(name != 'Totally Tori' || name != 'CIA Charlie' || name != 'Hassan Nasrallah')\r\n {\r\n this.add_info_message(this.current_player, 'Sorry, you can\\'t use this card.');\r\n this.exec_state('turn_2');\r\n }\r\n else\r\n this.exec_state();\r\n this.check_win_or_dead();\r\n break;\r\n\r\n case 'action_luckyday_2':\r\n hide_select_options_screen();\r\n if(this.selected_option == 1 || this.player_array[this.current_player].revealed == true)\r\n {\r\n this.reveal_player();\r\n this.add_info_message(this.current_player, 'You have healed fully.');\r\n // for(var i = 0; i < this.player_array[this.current_player].hp; i++)\r\n // moveDamage(this.player_array[this.current_player].player_color, -1);\r\n resetDamage(this.player_array[this.current_player].player_color);\r\n this.player_array[this.current_player].hp = 0;\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n //Action card\r\n //If you are Osama or Ayman, you must reveal yourself!\r\n case 'action_spotted_0':\r\n this.next_state = 'action_spotted_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n break;\r\n case 'action_spotted_1':\r\n hide_zoomed_card();\r\n var name = this.player_array[this.current_player].character.char_name;\r\n if(name == 'Ayman al-Zawahiri' || name == 'Osama Bin Laden')\r\n this.reveal_player();\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n //Action card\r\n //Heal two points of your damage.\r\n case 'action_firstaid_0':\r\n this.next_state = 'action_firstaid_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'action_firstaid_1':\r\n hide_zoomed_card();\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 2;\r\n moveDamage(this.player_array[this.current_player].player_color, -2);\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n //Action card\r\n //All character's except for you receive 2 points of damage\r\n case 'action_judgementday_0':\r\n this.next_state = 'action_judgementday_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n\t this.last_state=state;\r\n break;\r\n\r\n case 'action_judgementday_1':\r\n hide_zoomed_card();\r\n for(var i = 1; i <= this.num_of_players; i++)\r\n {\r\n if(this.player_array[this.current_player].character.char_name != this.player_array[i].character.char_name)\r\n {\r\n //this.player_array[i].hp = this.player_array[i].hp + 2;\r\n moveDamage(this.player_array[i].player_color, 2);\r\n }\r\n }\r\n\t this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state('turn_2');\r\n break;\r\n\r\n\r\n //Action Card\r\n //You steal an equipment card from any character.\r\n case 'action_thatsmine_0':\r\n this.next_state = 'action_thatsmine_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n this.last_state=state;\r\n break;\r\n\r\n case 'action_thatsmine_1':\r\n this.next_state = 'action_thatsmine_2';\r\n hide_zoomed_card();\r\n this.last_state=state;\r\n show_select_player_screen();\r\n break;\r\n\r\n case 'action_thatsmine_2':\r\n this.next_state = 'turn_2';\r\n hide_select_player_screen();\r\n if(this.player_array[this.selected_player].hand.length > 0)\r\n {\r\n document.getElementById(\"select_player_steal_container\").style.display = \"initial\";\r\n //this.steal_equip_card();\r\n var message_string = \"You stole a card from Player \" + this.selected_player + \".\";\r\n this.add_info_message(this.current_player, message_string);\r\n }\r\n else{\r\n var message_string = \"Player \" + this.selected_player + \" has no cards.\";\r\n this.add_info_message(this.current_player, message_string);\r\n }\r\n this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n //Action Card\r\n //You give 2 points of damage to any character and heal 1 point of your own damage.\r\n case 'action_deadlysurprise_0':\r\n this.next_state = 'action_deadlysurprise_1';\r\n hide_draw_card_screen_overlay();\r\n show_zoomed_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n this.last_state=state;\r\n break;\r\n\r\n case 'action_deadlysurprise_1':\r\n this.next_state = 'action_deadlysurprise_2';\r\n hide_zoomed_card();\r\n this.last_state=state;\r\n show_select_player_screen();\r\n break;\r\n\r\n case 'action_deadlysurprise_2':\r\n this.next_state = 'turn_2';\r\n hide_select_player_screen();\r\n //this.player_array[this.selected_player].hp = this.player_array[this.selected_player].hp + 2;\r\n moveDamage(this.player_array[this.selected_player].player_color, 2);\r\n //this.player_array[this.current_player].hp = this.player_array[this.current_player].hp - 1;\r\n moveDamage(this.player_array[this.current_player].player_color, -1);\r\n this.last_state=state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;\r\n\r\n //NOT IMPLEMENTED S17\r\n //Action Card\r\n // You give one of your equipment cards to another player. If you have no equipment cards you receive 1 damage\r\n /* case 'action_thatsnotgood_0':\r\n this.next_state = 'action_thatsnotgood_1';\r\n this.last_state = state;\r\n hide_draw_card_screen_overlay();\r\n show_view_card(this.drawn_action_card);\r\n this.add_info_message(this.current_player, 'Click card to use it.');\r\n break;\r\n\r\n case 'action_thatsnotgood_1':\r\n this.next_state = 'action_thatsnotgood_2';\r\n hide_zoomed_card();\r\n this.last_state = state;\r\n break;\r\n\r\n case 'action_thatsnotgood_2':\r\n this.next_state = 'action_thatsnotgood_3';\r\n if(this.player_array[this.current_player].hand.length >0)\r\n {\r\n show_select_player_screen();\r\n }\r\n else\r\n {\r\n moveDamage(this.player_array[this.current_player].player_color, 1);\r\n }\r\n this.last_state = state;\r\n break;\r\n\r\n case 'action_thatsnotgood_3':\r\n this.next_state = 'turn_2';\r\n hide_select_player_screen();\r\n this.last_state = state;\r\n this.check_win_or_dead();\r\n this.exec_state();\r\n break;*/\r\n\r\n }\r\n }", "title": "" }, { "docid": "f95a0f702ff9c25f248a0d9e60bea70f", "score": "0.605523", "text": "function updateMove(){\n movesCounter++;\n moveManager();\n}", "title": "" }, { "docid": "e80c2c4d6e38f80e48ce2600681aced8", "score": "0.603593", "text": "function Winstate() {\n let d = dist(player.x, player.y, mazeEnd.x, mazeEnd.y);\n if (d < player.size / 4 + mazeEnd.size / 4) {\n state = `win`;\n }\n}", "title": "" }, { "docid": "4e6857343a10fa61e4028c0dae0bb4f6", "score": "0.60280406", "text": "function setGameState(newGameState) {\n gameState = newGameState;\n}", "title": "" }, { "docid": "ad56678d5e3e7f515dd249ae010e9d1d", "score": "0.601253", "text": "function cellPlayed(clickedCell, clickedCellIndex) {\n //this will update gameState with player move & update UI\n gameState[clickedCellIndex] = currentPlayer;\n clickedCell.innerHTML = currentPlayer;\n }", "title": "" }, { "docid": "52f5272167135e05194c8b15c19d0b17", "score": "0.601029", "text": "function Modify(index){//set the variable to make a move\n //modify the boolean array, to say this position is not available anymore\n newGame.availableMoveBoolean[index] = false;\n newGame.moves[index] = newGame.counter;\n newGame.counter++;//changing the player\n}", "title": "" }, { "docid": "4540a0171733c7620551edd02cd7fdf6", "score": "0.6005758", "text": "function MovePlayer()\n{\n\t//Key States for moving player\n\tif(keyState[37]) //down\n\t{\n\t\tintPlayerX-=PlayerSpeed;\n\t\tif(intPlayerX < 0)\n\t\t{\n\t\t\tintPlayerX = 0;\n\t\t}\n\t}\n\t\n\tif(keyState[39]) //up\n\t{\n\t\tintPlayerX+=PlayerSpeed;\n\t\tif(intPlayerX > 780)\t\t\n\t\t{\n\t\t\tintPlayerX = 780;\n\t\t}\n\t}\n\tif(keyState[38]) //left\n\t{\n\t\tintPlayerY-=PlayerSpeed;\n\t\tif(intPlayerY < 0)\n\t\t{\n\t\t\tintPlayerY = 0;\n\t\t}\n\t}\n\tif(keyState[40]) //right \n\t{\n\t\tintPlayerY+=PlayerSpeed;\n\t\tif(intPlayerY > 580)\n\t\t{\n\t\t\tintPlayerY = 580;\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "56d4b17f91e401852de4f98979a1c22e", "score": "0.5997668", "text": "function stepState(state) {\n if (state.gravity < 500) {\n state.gravityIncreaseTicks--;\n if (state.gravityIncreaseTicks <= 0) {\n state.gravity += 10;\n state.gravityIncreaseTicks = state.gravityIncreaseTime;\n }\n }\n\n for (i = 0; i <= 1; i++) {\n if (state.players[i].leftHeld > 0) {\n if (state.players[i].leftHeld > 1) {\n state.players[i].leftHeld--;\n } else {\n tryMovePlacePiece(state, state.players[i].piece, -1, 0);\n }\n } else if (state.players[i].rightHeld > 0) {\n if (state.players[i].rightHeld > 1) {\n state.players[i].rightHeld--;\n } else {\n tryMovePlacePiece(state, state.players[i].piece, 1, 0);\n }\n }\n }\n\n let endGame = false;\n for (i = 0; i <= 1; i++) {\n state.players[i].gravityTicks -= state.gravity;\n if (state.players[i].drop || state.players[i].gravityTicks <= 0) {\n state.players[i].gravityTicks = MaxGravityTicks;\n if (!tryMovePlacePiece(state, state.players[i].piece, 0, 1)) {\n endGame |= lockPiece(state, i);\n }\n }\n }\n return endGame;\n}", "title": "" }, { "docid": "6d4a94395d5c96d5e501a57b963d2ad4", "score": "0.5994801", "text": "get gameState() {\n\t\t//check if O has won\n\t\tlet p = 1;\n\t\tif ((this.tiles[0] == p && this.tiles[1] == p && this.tiles[2] == p) ||\n\t\t\t(this.tiles[3] == p && this.tiles[4] == p && this.tiles[5] == p) ||\n\t\t\t(this.tiles[6] == p && this.tiles[7] == p && this.tiles[8] == p) ||\n\t\t\t(this.tiles[0] == p && this.tiles[3] == p && this.tiles[6] == p) ||\n\t\t\t(this.tiles[1] == p && this.tiles[4] == p && this.tiles[7] == p) ||\n\t\t\t(this.tiles[2] == p && this.tiles[5] == p && this.tiles[8] == p) ||\n\t\t\t(this.tiles[2] == p && this.tiles[4] == p && this.tiles[6] == p) ||\n\t\t\t(this.tiles[0] == p && this.tiles[4] == p && this.tiles[8] == p))\n\t\t\treturn 1;\n\n\t\t//check if X has won\n\t\tp = -1;\n\t\tif ((this.tiles[0] == p && this.tiles[1] == p && this.tiles[2] == p) ||\n\t\t\t(this.tiles[3] == p && this.tiles[4] == p && this.tiles[5] == p) ||\n\t\t\t(this.tiles[6] == p && this.tiles[7] == p && this.tiles[8] == p) ||\n\t\t\t(this.tiles[0] == p && this.tiles[3] == p && this.tiles[6] == p) ||\n\t\t\t(this.tiles[1] == p && this.tiles[4] == p && this.tiles[7] == p) ||\n\t\t\t(this.tiles[2] == p && this.tiles[5] == p && this.tiles[8] == p) ||\n\t\t\t(this.tiles[2] == p && this.tiles[4] == p && this.tiles[6] == p) ||\n\t\t\t(this.tiles[0] == p && this.tiles[4] == p && this.tiles[8] == p))\n\t\t\treturn 2;\n\n\t\t//check if there are any open spots left, if there are, the game is in progress\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tif (this.tiles[i] == 0) return 0;\n\n\t\t//otherwise the game is over as a draw\n\t\treturn 3;\n\t}", "title": "" }, { "docid": "5119143a3d2ad7c01962f9a440370e60", "score": "0.5987259", "text": "updateGameState() {\n //in ML model make prediction here\n this.makeRandomMove();\n }", "title": "" }, { "docid": "3c752a6f96c33d8a09332bcf944f55ed", "score": "0.5982338", "text": "function Game(gameState) {\n // Game attributes\n this.bigBlind = gameState.bigBlind;\n this.maxPlayer = gameState.maxPlayer;\n this.minAmount = gameState.minAmount;\n this.maxAmount = gameState.maxAmount;\n this.maxSitOutTime = gameState.maxSitOutTime || 30;\n this.annyomousGame = gameState.annyomousGame;\n this.runTimeType = gameState.runTimeType;\n this.rakeX = gameState.rakeX;\n this.rakeY = gameState.rakeY;\n this.rakeZ = gameState.rakeZ;\n this.rakeMax = gameState.rakeMax || 10 * gameState.bigBlind || 10000;\n this.gameType = gameState.gameType; \n this.actionTime = gameState.actionTime || 25;\n this.parentType = gameState.parentType; //The type of Game it is holdem or omaha.\n this.startNewGameAfter = gameState.startNewGameAfter || 2000;\n this.startWhenPlayerCount = gameState.startWhenPlayerCount || 2; \n\n // attributes needed post game\n this.currentGameId = gameState.currentGameId;\n this.tableId = gameState.tableId;\n this.lastTurnAt = gameState.lastTurnAt;\n\n this.debugMode = true || gameState.debugMode;\n\n this.players = gameState.players || []; // Array of Player object, represents all players in this game\n this.waitingPlayers = gameState.waitingPlayers || []; // Array of all the players who will be there in the waiting list\n this.oldPlayers = gameState.oldPlayers || []; // Array of all the players who all have lastly Played the game. \n this.round = gameState.round || 'idle'; // current round in a game ['idle', 'deal', 'flop' , 'turn', 'river']\n this.dealerPos = gameState.dealerPos || -1; // to determine the dealer position for each game, incremented by 1 for each end game\n if(gameState.turnPos === undefined ){\n this.turnPos = -1;\n } else{\n this.turnPos = gameState.turnPos;\n }\n if(gameState.dealerPos === undefined ){\n this.dealerPos = -1;\n } else{\n this.dealerPos = gameState.dealerPos;\n }\n this.totalPot = gameState.totalPot || 0; // accumulated chips in center of the table after each Game\n this.currentPot = gameState.currentPot || 0; // Current Pot at any point of time. \n this.minRaise = gameState.minRaise || 0; // Minimum raise to be have\n this.maxRaise = gameState.maxRaise || 0; // Maximum raise for the next player\n this.callValue = gameState.callValue || 0; // Call Value to be stored for next Player\n this.currentTotalPlayer = gameState.currentTotalPlayer || 0;// Total players on the table\n this.communityCards = gameState.communityCards || []; // array of Card object, five cards in center of the table\n this.deck = new Deck(gameState.deck); // deck of playing cards\n this.gamePots = gameState.gamePots || []; // The Vairable to store all the game pots \n this.lastRaise = gameState.lastRaise || 0; // Maintaing what was the last raise. \n this.rakeEarning = gameState.rakeEarning || 0; // Options for the rake earning per For Game\n\n if(this.players.length == 0){\n this.initPlayers();\n }\n}", "title": "" }, { "docid": "68a4f0e5fa07ff77e2fea4a29d9a887b", "score": "0.5978518", "text": "function move() { \n\t\n\t\n\t\n\t//Increment the click counter\n\tclicks++;\n\t\n\t//If the board is solved, go to the end state\n\tif (isSolved())\n\t\tend();\n}", "title": "" }, { "docid": "d2ce3fc1fd97ae499ee6db7cfeb41069", "score": "0.59704244", "text": "function create_move() {\r\n safepeek();\r\n idealtick();\r\n accuracy();\r\n breaker();\r\n override();\r\n predict_doubletap_damage();\r\n damage_override();\r\n}", "title": "" }, { "docid": "7acc6e3f6951eaf81f4374e7a18053f7", "score": "0.5966311", "text": "function PlayerPreUpdate(p)\r\n{\r\n p.prev_vdir = p.vdir;\r\n p.prev_hdir = p.hdir;\r\n\r\n\tp.pts = p.ts;\r\n // default STANDING\r\n p.ts = 1;\r\n\r\n if( p.joy_up )\r\n {\r\n p.vdir = false;\r\n p.ts = 2;\r\n\r\n p.zpos -= p.walkspeed;\r\n }\r\n else if( p.joy_down )\r\n {\r\n p.vdir = true;\r\n p.ts = 2;\r\n\r\n p.zpos += p.walkspeed;\r\n }\r\n \r\n if( p.joy_left )\r\n {\r\n p.hdir = false;\r\n p.ts = 2;\r\n\r\n p.xpos -= p.walkspeed;\r\n }\r\n else if( p.joy_right )\r\n {\r\n p.hdir = true;\r\n p.ts = 2;\r\n\r\n p.xpos += p.walkspeed;\r\n } \r\n\r\n UpdateFocus(p);\r\n ProcessState(p);\r\n}", "title": "" }, { "docid": "ee62895ebfdaea2532db9e4558f65eca", "score": "0.5962442", "text": "makeMove(pos, player) {\n let piecePlaced = false;\n this.state[pos].forEach((occupant, i) => {\n if (!piecePlaced) {\n if (occupant === 1 || occupant === 2) {\n if (i > 0 && this.state[pos][i-1] === 0) {\n this.state[pos][i-1] = player;\n piecePlaced = true;\n }\n } else if (i === 5 && occupant === 0) {\n this.state[pos][i] = player;\n piecePlaced = true;\n }\n }\n });\n }", "title": "" }, { "docid": "74d97046a9a1bad2c0de0371db9196a1", "score": "0.595469", "text": "function moveSomething(e) {\n\t\t\tfunction moveLeftRight(xVal){\n\t\t\t\tvar newX = xVal;\n\t\t\t\tboard.player.xPrev = board.player.x;\n\t\t\t\tboard.player.yPrev = board.player.y;\n\t\t\t\tboard.player.x = newX;\n\t\t\t\tboard.player.y = board.player.y;\n\t\t\t\tboard.position[newX][board.player.y] = 4;\n\t\t\t\tboard.position[board.player.xPrev][board.player.yPrev] = 0;\n\t\t\t\tboard.player.erasePrevious();\n\t\t\t\tboard.player.render();\n\t\t\t}\n\t\t\tfunction moveUpDown(yVal){\n\t\t\t\tvar newY = yVal;\n\t\t\t\tboard.player.xPrev = board.player.x;\n\t\t\t\tboard.player.yPrev = board.player.y;\n\t\t\t\tboard.player.x = board.player.x;\n\t\t\t\tboard.player.y = newY;\n\t\t\t\tboard.position[board.player.x][newY] = 4;\n\t\t\t\tboard.position[board.player.xPrev][board.player.yPrev] = 0;\n\t\t\t\tboard.player.erasePrevious();\n\t\t\t\tboard.player.render();\n\t\t\t}\n\t\t\tfunction enemiesMove(){\n\t\t\t\tif (!board.enemy1.enemyDead)\n\t\t\t\t\tenemy1Move.makeMove();\n\t\t\t\tif (!board.enemy2.enemyDead)\n\t\t\t\t\tenemy2Move.makeMove();\n\t\t\t\tif (!board.enemy3.enemyDead)\n\t\t\t\t\tenemy3Move.makeMove();\n\t\t\t}\n\t\t\tfunction checkForWin(){\n\t\t\t\tif (board.enemy1.enemyDead && board.enemy2.enemyDead && board.enemy3.enemyDead){\n\t\t\t\t\tconsole.log(\"You Win!!!!! *airhorn*\" )\n\t\t\t\t\tboard.player.eraseThis();\n\t\t\t\t\t//board.potion1.eraseThis();\n\t\t\t\t\t//board.potion2.eraseThis();\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.font = \"128px Georgia\";\n\t\t\t\t\tctx.fillStyle = \"#00F\";\n\t\t\t\t\tctx.fillText(\"You Win!!\", 40, 320);\n\t\t\t}\n\t\t\t}\n\t\t\tfunction restoreHealth(xVal,yVal){\n\t\t\t\tvar x = xVal;\n\t\t\t\tvar y = yVal;\n\t\t\t\tif (board.position[x][y] == 5){\n\t\t\t\t\tboard.player.restoreHealth();\n\t\t\t\t\tif(board.potion1.x == x && board.potion1.y == y)\n\t\t\t\t\t\tboard.potion1.eraseThis()\n\t\t\t\t\telse \n\t\t\t\t\t\tboard.potion2.eraseThis();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!board.player.playerDead || board.enemy1.enemyDead && board.enemy2.enemyDead && board.enemy3.enemyDead){\n\t\t\tswitch(e.keyCode) {\n\t\t\t\tcase 37:\n\t\t\t\t\t// left key pressed\n\t\t\t\t\tvar newX = board.player.x - 1;\n\t\t\t\t\tif(board.player.x == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[newX][board.player.y] == 0 || board.position[newX][board.player.y] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Left was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(newX,board.player.y);\n\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[newX][board.player.y] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\tif(board.enemy1.x == newX && board.enemy1.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == newX && board.enemy2.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy2.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == newX && board.enemy3.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy3.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 38:\n\t\t\t\t\t// up key \n\t\t\t\t\tvar newY = board.player.y - 1;\n\t\t\t\t\tif(board.player.y == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[board.player.x][newY] == 0 || board.position[board.player.x][newY] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t console.log(\"Up was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(board.player.x,newY);\n\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[board.player.x][newY] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\tif(board.enemy1.x == board.player.x && board.enemy1.y == newY){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == board.player.x && board.enemy2.y == newY){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == board.player.x && board.enemy3.y == newY){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 39:\n\t\t\t\t\t// right key pressed\n\t\t\t\t\tvar newX = board.player.x + 1;\n\t\t\t\t\tif(board.player.x == 9)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[newX][board.player.y] == 0 || board.position[newX][board.player.y] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Right was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(newX,board.player.y);\n\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[newX][board.player.y] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\t\tif(board.enemy1.x == newX && board.enemy1.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == newX && board.enemy2.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == newX && board.enemy3.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40:\n\t\t\t\t\t// down key pressed\n\t\t\t\t\tvar newY = board.player.y + 1;\n\t\t\t\t\tif(board.player.y == 9)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[board.player.x][newY] == 0 || board.position[board.player.x][newY] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Down was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(board.player.x,newY);\n\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[board.player.x][newY] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\t\tif(board.enemy1.x == board.player.x && board.enemy1.y == newY){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == board.player.x && board.enemy2.y == newY){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == board.player.x && board.enemy3.y == newY){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak; \n\t\t\t}\n\t\t\t//console.log(\"heres our current player position in moveSomething \"+board.player.x + board.player.y);\n\t\t\t}\t//console.log(\"heres our previous player position in moveSomething \"+board.player.xPrev + board.player.yPrev);\t\t\n\t\t}", "title": "" }, { "docid": "cadca1f2ce74e26f25433e75c4b5fd06", "score": "0.5953815", "text": "function gameLoop(state){\n if(!state){\n return\n }\n\n //Move the player position forward using the current verlocity \n const playerOne = state.players[0];\n const playerTwo = state.players[1];\n\n playerOne.pos.x += playerOne.vel.x;\n playerOne.pos.y += playerOne.vel.y;\n\n playerTwo.pos.x += playerTwo.vel.x;\n playerTwo.pos.y += playerTwo.vel.y;\n\n //Check if the player hits and edge and if so quit\n if(playerOne.pos.x < 0 || playerOne.pos.x > gridSize || playerOne.pos.y < 0 || playerOne.pos.y > gridSize){\n return 2;\n }\n if(playerTwo.pos.x < 0 || playerTwo.pos.x > gridSize || playerTwo.pos.y < 0 || playerTwo.pos.y > gridSize){\n return 1;\n }\n\n\n //Check if the player hits food and if so increase the snake size and move the player forward\n if(state.food.x === playerOne.pos.x && state.food.y === playerOne.pos.y){\n playerOne.snake.push({ ...playerOne.pos });\n playerOne.pos.x += playerOne.vel.x;\n playerOne.pos.y += playerOne.vel.y;\n randomFood(state); //Call random food function to generate new food\n }\n\n if(state.food.x === playerTwo.pos.x && state.food.y === playerTwo.pos.y){\n playerTwo.snake.push({ ...playerTwo.pos });\n playerTwo.pos.x += playerTwo.vel.x;\n playerTwo.pos.y += playerTwo.vel.y;\n randomFood(state); //Call random food function to generate new food\n }\n\n //Check if the player is moving and then move all seagemnts of the snake forward\n if(playerOne.vel.x || playerOne.vel.y){\n //Check if the player is touching itself and if so quit\n for(let cell of playerOne.snake){\n if(cell.x === playerOne.pos.x && cell.y === playerOne.pos.y){\n return 2;\n }\n }\n //Else move the player forward one \n playerOne.snake.push({ ...playerOne.pos });\n playerOne.snake.shift();\n }\n\n if(playerTwo.vel.x || playerTwo.vel.y){\n //Check if the player is touching itself and if so quit\n for(let cell of playerTwo.snake){\n if(cell.x === playerTwo.pos.x && cell.y === playerTwo.pos.y){\n return 1;\n }\n }\n //Else move the player forward one \n playerTwo.snake.push({ ...playerTwo.pos });\n playerTwo.snake.shift();\n }\n\n return false;\n}", "title": "" }, { "docid": "945b9047ac859682d289aef0f478b9c9", "score": "0.5951291", "text": "function gameStart(){\n //the difficulty changes the framerate\n frameRate(difficulty);\n\n if(firstIteration&&gameType===\"Points\"){\n gameTimeStarted = frameCount;\n time = 101;\n points=50;\n }\n\n \n orbitControl();\n strokeWeight(2);\n stroke(0);\n \n \n //food function makes the food\n food();\n if(gameMode!==\"Two Player\"){\n //arr is the memory of the moves\n //push0 through push3 tells the array which of 6 directions to move\n arr.push(push0);\n arr.push(push1);\n arr.push(push2);\n arr.push(push3);\n //moves the snake\n moveSnake();\n }else{\n push();\n arr.push(push0);\n arr.push(push1);\n arr.push(push2);\n arr.push(push3);\n moveSnake();\n pop();\n arrP2.push(push0P2);\n arrP2.push(push1P2);\n arrP2.push(push2P2);\n arrP2.push(push3P2);\n moveSnakeP2();\n if(gameType===\"Points\"){\n timer();\n firstIteration=false;\n }\n }\n}", "title": "" }, { "docid": "42ddff93203da8c84426071a4a43aa4c", "score": "0.5932676", "text": "function movementLogic()\n{\nswitch(spots[posx][posy])\n\t{\n\tcase \"C1\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 1\";\n\t\tgenericChallenge(C1,heroine);\n\t\tbreak;\n\t}\n\tcase \"C2\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 2\";\n\t\tgenericChallenge(C2,heroine);\n\t\tbreak;\n\t} \n\tcase \"C3\":\n\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 3\";\n\t\tgenericChallenge(C3, heroine);\n\t\tbreak;\n\t} \n\tcase \"C4\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY]=\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 4\";\n\t\tgenericChallenge(C4,heroine);\n\t\tbreak;\n\t} \n\tcase \"P1\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through a prize! you get a lollipop\";\n\t\tpcount = pcount+1;\n\t\theroine.items[pcount] = \"lollipop\";\n\t\tbreak;\n\t} \n\tcase \"P2\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through a prize! You get a kazoo\";\n\t\tpcount = pcount +1;\n\t\theroine.items[pcount] = \"kazoo\";\n\t\tbreak;\n\t} \n\tcase \"W\":\n\t{\n\t\tposy = prevY;\n\t\tposx = prevX;\n\t\tgameMoveText+=\"<br>You hit a wall, try again\";\n\t\tbreak;\n\t}\n\tcase \"G\":\n\t{\n\t\tif(pcount == 2)\n\t\t{\n\t\t\tgameMoveText+=\"Lucina carefully places the \" + heroine.items[0] + \"and \" +heroine.items[1]+\"into the box. you wont believe what happens next. The end.\";\n\t\t\twincondition = 1;\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\tposy = prevY;\n\t\tposx = prevX;\n\t\tgameMoveText+=\"<br>cant finish game yet, get more prizes then try again\" + \"current prizes:\"+ pcount;\n\t\t}\n\t\tbreak;\n\t} \n\tcase \"+\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you already passed through here\";\n\t\tbreak;\n\t} \n\tcase \"---\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] = \"+\";\n\t\tgameMoveText+=\"<br> empty space\";\n\t\tbreak;\n\t}\n\tcase \"S\":\n\t{\n\t\tgameMoveText+=\"<br> printed map\";\n\t\tbreak;\n\t}\n\tdefault:\n\t\t{\n\t\t\tgameMoveText+=\"<br>something went wrong\";\n\t\t\tbreak;\n\t\t}\n\t}\n\nvar cStatus = \"<br>current location: y: \" + posx + \"x: \" + posy;\n cStatus += \"<br> Lucina - HP: \" + heroine.HP + \"prizes: \"+heroine.items[0] +\", \"+heroine.items[1] + \"<br>\";\ndocument.getElementById(\"gametext\").innerHTML = gameMoveText;\ndocument.getElementById(\"status\").innerHTML = cStatus;\n\nprintMap();\n}", "title": "" }, { "docid": "b2ae1f4f5c30d83fc5aafc98340beb49", "score": "0.5930368", "text": "defaultGameState(state) {\n state.gameState = true;\n }", "title": "" }, { "docid": "f6c07b5501c1c327ea07c4baa25266b2", "score": "0.5917876", "text": "movePlayer() {\n const { moving } = this.state;\n const {\n hero: {\n position: { x, y },\n },\n } = this.props;\n\n let newX = x;\n let newY = y;\n\n const useCharacter = this.getCharacterWithDimensions();\n\n for (let m = 0; m < moving.length; m += 1) {\n switch (moving[m]) {\n case 'up':\n // Move player up on the Y axis\n newY = moveEntityBack(useCharacter, 'y', newX, newY, moving[m], moving.length > 1).value;\n break;\n case 'down':\n // Move player down on the Y axis\n newY = moveEntityForward(useCharacter, 'y', newX, newY, moving[m], moving.length > 1).value;\n break;\n case 'left':\n // Move player left on the X axis\n newX = moveEntityBack(useCharacter, 'x', newX, newY, moving[m], moving.length > 1).value;\n break;\n case 'right':\n default:\n // Move player right on the X axis\n newX = moveEntityForward(useCharacter, 'x', newX, newY, moving[m], moving.length > 1).value;\n break;\n }\n }\n\n updateHeroPosition({ x: newX, y: newY });\n\n // Keep moving the player for as long as the direction keys are pressed\n this.movingTimeout = setTimeout(this.movePlayer, 120);\n }", "title": "" }, { "docid": "a148796264260b63895eba04df8da824", "score": "0.5914612", "text": "detectPressedKeys() {\n // move either up (Up) or down (DOWN)\n if (this.keyPressedStates[38 /* UP */]) {\n this._playerB.moveUp();\n }\n else if (this.keyPressedStates[40 /* DOWN */]) {\n this._playerB.moveDown();\n }\n // move either left (LEFT) or right (RIGHT)\n if (this.keyPressedStates[37 /* LEFT */]) {\n this._playerB.moveLeft();\n }\n else if (this.keyPressedStates[39 /* RIGHT */]) {\n this._playerB.moveRight();\n }\n // move either up (W) or down (S)\n if (this.keyPressedStates[87 /* W */]) {\n this._playerA.moveUp();\n }\n else if (this.keyPressedStates[83 /* S */]) {\n this._playerA.moveDown();\n }\n // move either left (A) or right (D)\n if (this.keyPressedStates[65 /* A */]) {\n this._playerA.moveLeft();\n }\n else if (this.keyPressedStates[68 /* D */]) {\n this._playerA.moveRight();\n }\n }", "title": "" }, { "docid": "116f3a3f5ba6048c4f0211bb38ef7a65", "score": "0.59078217", "text": "function onMovePlayer(data) {\r\n //Now it's your turn!\r\n myTurn = true;\r\n document.getElementById(\"whoseTurn\").innerHTML = 'YOUR TURN!';\r\n //to make the board inverted:\r\n movePiece((MAX_TILES-1)-data.x1,(MAX_TILES-1)-data.y1,(MAX_TILES-1)-data.x2,(MAX_TILES-1)-data.y2);\r\n}", "title": "" }, { "docid": "9ce512de9069d73406b31fa2bab8a9be", "score": "0.59039986", "text": "processEngineStep(state, action) {\n let stateDelta = []; // Holds an array of objects marking all x, y coordinate updated\n\n // The change in the coordinates of the head, based on the direction facing\n let deltaX = SnakeEngine.DIRECTIONS[state.direction].x;\n let deltaY = SnakeEngine.DIRECTIONS[state.direction].y;\n\n let newHeadX = state.headX + deltaX;\n let newHeadY = state.headY + deltaY;\n\n let utilities = [0];\n\n state = state.clone();\n\n if (this.isGameOverPos(newHeadX, newHeadY, state)) {\n state.terminalState = true;\n\n } else {\n if (state.getTile(newHeadX, newHeadY) == SnakeState.FOOD) {\n utilities = [1]; // Get 1 utility if food was eaten\n\n let {foodX, foodY} = state.addFood();\n stateDelta.push({x: foodX, y: foodY});\n\n } else {\n let {tailX, tailY} = state.removeTail();\n stateDelta.push({x: tailX, y:tailY});\n }\n\n // Update the head position last to avoid overwriting the food position too early\n state.updateHead(newHeadX, newHeadY);\n stateDelta.push({x: newHeadX, y: newHeadY});\n }\n\n return this.makeProcessedActionOutcome(utilities, state, stateDelta);\n }", "title": "" }, { "docid": "43330e9a4291820278312c92e5c32b92", "score": "0.59011054", "text": "function PlayerStateToEntityState(ps, es) {\n\tif (ps.pm_type === PM.INTERMISSION || ps.pm_type === PM.SPECTATOR) {\n\t\tes.eType = ET.INVISIBLE;\n\t} else if (ps.stats[STAT.HEALTH] <= GIB_HEALTH) {\n\t\tes.eType = ET.INVISIBLE;\n\t} else {\n\t\tes.eType = ET.PLAYER;\n\t}\n\n\tes.number = ps.clientNum;\n\tes.arenaNum = ps.arenaNum;\n\n\tes.pos.trType = QS.TR.INTERPOLATE;\n\tvec3.set(ps.origin, es.pos.trBase);\n\tvec3.set(ps.velocity, es.pos.trDelta);\n\n\tes.apos.trType = QS.TR.INTERPOLATE;\n\tvec3.set(ps.viewangles, es.apos.trBase);\n\n\tes.angles2[QMath.YAW] = ps.movementDir;\n\tes.legsAnim = ps.legsAnim;\n\tes.torsoAnim = ps.torsoAnim;\n\tes.clientNum = ps.clientNum; // ET_PLAYER looks here instead of at number\n\t // so corpses can also reference the proper config\n\tes.eFlags = ps.eFlags;\n\tif (ps.stats[STAT.HEALTH] <= 0) {\n\t\tes.eFlags |= EF.DEAD;\n\t} else {\n\t\tes.eFlags &= ~EF.DEAD;\n\t}\n\n\tif (ps.externalEvent) {\n\t\tes.event = ps.externalEvent;\n\t\tes.eventParm = ps.externalEventParm;\n\t} else if (ps.entityEventSequence < ps.eventSequence) {\n\t\tif (ps.entityEventSequence < ps.eventSequence - QS.MAX_PS_EVENTS) {\n\t\t\tps.entityEventSequence = ps.eventSequence - QS.MAX_PS_EVENTS;\n\t\t}\n\t\tvar seq = ps.entityEventSequence % QS.MAX_PS_EVENTS;\n\t\tes.event = ps.events[seq] | ((ps.entityEventSequence & 3) << 8);\n\t\tes.eventParm = ps.eventParms[seq];\n\t\tps.entityEventSequence++;\n\t}\n\n\tes.weapon = ps.weapon;\n\tes.groundEntityNum = ps.groundEntityNum;\n\n\tes.powerups = 0;\n\tfor (var i = 0; i < QS.MAX_POWERUPS; i++) {\n\t\tif (ps.powerups[i]) {\n\t\t\tes.powerups |= 1 << i;\n\t\t}\n\t}\n\n\tes.loopSound = ps.loopSound;\n\tes.generic1 = ps.generic1;\n}", "title": "" }, { "docid": "65a742c53efd89bd38df3161eb9fdad6", "score": "0.5888254", "text": "function initPlayerState() {\n const startCell = gameState.maze.getStartCell();\n const startCellBBox = gameState.maze.getCellBoundingBox(startCell.row, startCell.col);\n gameState.player.position.x = startCellBBox.left + Math.floor((startCellBBox.right - startCellBBox.left) / 2);\n gameState.player.position.y = startCellBBox.top + Math.floor((startCellBBox.bottom - startCellBBox.top) / 2);\n gameState.player.heading = 0;\n\n const cellDims = gameState.maze.getCellDimensions();\n gameState.player.size.width = Math.floor(cellDims.width * 0.8);\n gameState.player.size.height = Math.floor(cellDims.height * 0.8);\n}", "title": "" }, { "docid": "42eb72e6e33c8ffc473356eefdbb1f71", "score": "0.58836514", "text": "function move() {\n //en función del tamaño establecemos su velocidad\n var speed;\n if (player.size > 150){\n speed = 1;\n } else if (player.size > 75){\n speed = 2;\n } else {\n speed = 3;\n }\n\n //en función de la dirección se establece la nueva posición\n if (player.left) {\n player.posX = player.posX + speed;\n } else {\n player.posX = player.posX - speed;\n }\n if (player.top) {\n player.posY = player.posY + speed;\n } else {\n player.posY = player.posY - speed;\n }\n\n //limites de la pantalla para que rebote\n if (player.posX > (window.innerWidth - (player.size / 2))) {\n player.left = false;\n }\n if (player.posX < 0 + (player.size / 2)) {\n player.left = true;\n }\n if (player.posY > (window.innerHeight - (player.size / 2))) {\n player.top = false;\n }\n if (player.posY < 0 + (player.size / 2)) {\n player.top = true;\n ;\n }\n //salvamos la nueva posición\n Save(player);\n //repetimos el ciclo\n endGame = setTimeout(move, 50);\n}", "title": "" }, { "docid": "8fd58828836a56c228c8413ac615972e", "score": "0.58811575", "text": "function handleCellPlayed(clickedCell,clickedCellIndex){\n // console.log(\"Before \",gameState);\n gameState[clickedCellIndex]=currentPlayer;\n // console.log(\"After \",gameState);\n clickedCell.innerHTML=currentPlayer;\n}", "title": "" }, { "docid": "45efc3dbe795720c0f6e7053ae2663fd", "score": "0.588041", "text": "function playerSwitch () {\n jugador=jugador*(-1);\n saveGame();\n saveScore();\n}", "title": "" }, { "docid": "c36a7b1615436548a05e510cf4e30dfe", "score": "0.5873488", "text": "function switchState(name,from) {\n game = name;\n if(mainC.hp <= 0 && name != \"gameover\" && from != \"fight\"){\n mainC.performDeath(\" you died\")\n }\n else if (name == \"explore\") {\n //\"newgame\"\n //\"look\"\n //\"escape\"\n //\"back\"\n //\"streets\"\n //\"withdrawal\"\n //\"room\"\n //\"win\"\n setDialog(\"you are in \" + currentRoom.name)\n if(([\"streets\",\"room\",\"escape\",\"win\"]).includes(from)){\n withdrawal_prob += withdrawal_increment\n withdrawal_increment += 0.02\n rng = Math.random()\n\n //console.log(\"withdrawal probability: \"+withdrawal_prob+\" withdrawal increment: \"+withdrawal_increment+\" rng: \"+rng)\n if(rng < withdrawal_prob){\n withdrawal_prob = 0\n withdrawal_increment = 0.05\n eventQ.insert(function(){\n mainC.sanity -= 15\n },\"internet withdrawal kicks in...\")\n eventQ.insert(function(){\n switchState(\"explore\",\"withdrawal\")\n },null)\n\n }\n if(boozedCounter > 0) boozedCounter--\n if(toughnessCounter > 0) {\n toughnessCounter--\n console.log(\"thoughness counter: \"+toughnessCounter)\n }else{\n if(enemyArray.memberArray[0].p >25){\n console.log(\"making it tougher\")\n enemyArray.memberArray[0].p -= 15\n enemyArray.memberArray[1].p += 8\n enemyArray.memberArray[2].p += 7\n enemyArray.init()\n }\n toughnessCounter = 12\n }\n if(mainC.sanity < 20 && enemyArray.memberArray[3].p < 100){\n enemyArray.memberArray[3].p = 100\n enemyArray.init()\n }else{\n enemyArray.memberArray[3].p = 0\n enemyArray.init()\n }\n if(hungerCounter == 0){\n mainC.hunger -= 10\n hungerCounter = 10\n }else{\n hungerCounter--\n }\n if(mainC.hunger <= 0){\n eventQ.insert(function(){\n mainC.hp -= Math.ceil(mainC.totalHp/2)\n setDmgAnim(\"you are starving!\",\"starving\")\n },null)\n }\n }\n }\n else if (name == \"items\") {\n //\"items\"\n dialog = null;\n refreshGlobalDraw()\n }\n else if (name == \"fight\") {\n //\"encounter\"\n //\"attack\"\n //\"defend\"\n //\"escape\"\n setDialog(\"you are fighting \"+enemy.name)\n if(mainC.defMod > 0) mainC.defMod = 0\n if(mainC.atkMod > 0) mainC.atkMod = 0\n }\n else if (name == \"gameover\") {\n //\"fight\"\n //\"explore\"\n eventQ.queue = []\n dialog = null\n standby = true\n refreshGlobalDraw()\n }\n}", "title": "" }, { "docid": "f10d6f670fe2882cfb9325027ce5e9d3", "score": "0.5872563", "text": "function NPCMovement()\n{\n\t\n\t// Player x co-ord follow player code\n\tif(gameobjects[2].x < gameobjects[0].x)\n\t{\n\t\tgameobjects[2].x ++;\n\t}\n\telse\n\tif(gameobjects[2].x > gameobjects[0].x)\n\t{\n\t\tgameobjects[2].x --;\n\t}\n\t\n\t// Player y co-ord follow player code\n\tif(gameobjects[2].y < gameobjects[0].y)\n\t{\n\t\tgameobjects[2].y ++;\n\t}\n\telse\n\tif(gameobjects[2].y > gameobjects[0].y)\n\t{\n\t\tgameobjects[2].y --;\n\t}\n}", "title": "" }, { "docid": "55e13987ac42e17c760f4f84732314e8", "score": "0.58684844", "text": "function UpdatePosition() {\n\tboard[shape.i][shape.j] = 0;\n\tvar x = GetKeyPressed();\n\tif (x == 1) {\n\t\tif (shape.j > 0 && board[shape.i][shape.j - 1] != 1) {\n\t\t\tshape.j--;\n\t\t\tdirPacman = \"up\";\n\t\t}\n\t}\n\tif (x == 2) {\n\t\tif (shape.j < 9 && board[shape.i][shape.j + 1] != 1) {\n\t\t\tshape.j++;\n\t\t\tdirPacman = \"down\";\n\t\t}\n\t}\n\tif (x == 3) {\n\t\tif (shape.i > 0 && board[shape.i - 1][shape.j] != 1) {\n\t\t\tshape.i--;\n\t\t\tdirPacman = \"left\";\n\t\t}\n\t}\n\tif (x == 4) {\n\t\tif (shape.i < 9 && board[shape.i + 1][shape.j] != 1) {\n\t\t\tshape.i++;\n\t\t\tdirPacman = \"right\";\n\t\t}\n\t}\n\tif (board[shape.i][shape.j] == 5) {\n\t\tscore += 5;\n\t\tballsCount--;\n\t}\n\telse if(board[shape.i][shape.j] == 15){\n\t\tscore += 15;\n\t\tballsCount--;\n\t}\n\n\telse if(board[shape.i][shape.j] == 25){\n\t\tscore += 25;\n\t\tballsCount--;\n\t}\n\n\tboard[shape.i][shape.j] = 2;\n\n\t//make the movement of monsters and movingScore slower\n\tif (moveIterator % 5 == 0){\n\t\tupdateMonstersPosition();\n\t\tupdateMovingScorePosition();\n\t}\n\t++moveIterator;\n}", "title": "" }, { "docid": "4e2a05f75cda0964a0fb5e0f161ce13a", "score": "0.5863479", "text": "function handleMove(position){\n\nif (gameOver){ \n return;} // Caso o gameOver for verdadeiro, não continuará a função e o clique no board nao surtirá efeito;\n\n//Para impedir que o playertime seja modificado mesmo com o square preenchido - > if antes da condicional principal;\n\nif (gameDraw){ //Verificar se há empate\n return gameOver = true;\n}\n\nif (board[position]==''){\nboard[position] = symbols[playerTime];\n\n gameOver = isWin(); //Para verificar se houve jogador na rodada;\n\n// Só posso passar a vez pro proximo jogador caso o gameOver ter valor FALSE, por isso verifico:\nif (gameOver == false){ \n \n touch.play();\n playerTime = (playerTime == 0)? 1 : 0; //If ternário para definir de quem é a vez.\n\n }\n}\n\nreturn gameOver;\n\n}", "title": "" }, { "docid": "15903cbbeec8359538158d17887e8a2a", "score": "0.585893", "text": "function stateGame()\n{\n if(currentState == states.duringGame){ \n playerJump();\n }else if(currentState == states.splashScreen){ \n startGame(); \n }\n}", "title": "" }, { "docid": "d7a2568d97b554e844e660ae782d8f64", "score": "0.58588487", "text": "function move(event){\n player.elem.innerHTML =\"Gold Digger\";\n //change x or y position acordingly\n //left arrow\n if(event.keyCode===37 && player.xpos>0){\n player.xpos--;\n } //right arrow\n if(event.keyCode===39 && player.xpos<4 ){\n player.xpos++;\n }//up arrow\n if(event.keyCode===38 && player.ypos>0){\n player.ypos--;\n } //down arrow\n if(event.keyCode===40 && player.ypos<4){\n player.ypos++ \n }\n \n //make it dissapear\n player.elem.parentNode.removeChild(player.elem);\n \n \n //makes it apear \n document.getElementById(\"spot\" + player.xpos + player.ypos).appendChild(player.elem);\n \n position1();\n position2();\n position3(); \n}", "title": "" }, { "docid": "94eff2d167f0a754233ac7da0c39e953", "score": "0.5858528", "text": "function gameOver(){\n if (grid[playerTwoY][playerTwoX] === \"explosion\"){\n state = \"P1W\";\n }\n if (grid[playerOneY][playerOneX] === \"explosion\"){\n state = \"P2W\";\n }\n}", "title": "" }, { "docid": "5e1bf8edf7ef737cb03b67c601eecba0", "score": "0.58437437", "text": "switchTurn(state, player) {\n\n state.test+=\"enter switchTurn,\"\n player.guess = null;\n if (state.i == state.activePlayers.length - 1) {\n console.log(\"Enter if inside switchTurn with player.id: \"+player.id);\n state.activePlayers[state.i].isMyTurn = !state.activePlayers[state.i].isMyTurn;\n state.activePlayers[0].isMyTurn = !state.activePlayers[0].isMyTurn;\n state.i=0;\n state.round++;\n state.toggleInputButton=!state.toggleInputButton;\n\n\n } else {\n console.log(\"Enter else inside switchTurn with player.id: \"+player.id);\n state.activePlayers[state.i].isMyTurn = !state.activePlayers[state.i].isMyTurn;\n state.activePlayers[state.i+1].isMyTurn = !state.activePlayers[state.i + 1].isMyTurn;\n state.i++;\n }\n state.guessNumber=null;\n\n\n }", "title": "" }, { "docid": "6e47ea0f4ffafdff47b420b7b0e54079", "score": "0.5835594", "text": "parar() {\r\n postMessage({message:\"move\",v:0,w:0,h:0});\r\n }", "title": "" }, { "docid": "9d4d1a0b48ce2451c8edd9a371e79977", "score": "0.58328587", "text": "setupNewGame(){\r\n this.gameState.won = false;\r\n this.gameState.over = false;\r\n this.gameState.score = 0;\r\n this.gameState.board = new Array(this.fullSize).fill(0);\r\n this.addTile();\r\n this.addTile();\r\n }", "title": "" }, { "docid": "164740f8bf08e1205309ae500d579c15", "score": "0.5825826", "text": "function updateState( state, move ) {\n\tif ( typeof move.updates == \"undefined\" )\n\t\treturn state;\n\n\tmove.updates.forEach( function( update ) {\n\t\tvar player = move.player;\n\t\tswitch ( update.type ) {\n\t\t\tcase \"move\":\n\t\t\t\tstate = makeMove( state, update );\n\t\t\t\tbreak;\n\t\t\tcase \"attack\":\n\t\t\t\tstate = attack( state, update );\n\t\t\t\tbreak;\n\t\t\tcase \"train\":\n\t\t\t\tstate = train( state, update );\n\t\t\t\tbreak;\n\t\t\tcase \"build\":\n\t\t\t\tstate = build( state, update );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstate.players[move.player].errors++;\n\t\t}\n\t} );\n\n\t// Check for game over\n\tstate = gameOver( state );\n\n\t// Reset 'canMove' for each unit\n\tfor ( var i = 0; i < state.players.length; i++ ) {\n\t\tfor ( var j = 0; j < state.players[i].units.length; j++ ) {\n\t\t\tif ( state.players[i].units[j].class != \"dead\" )\n\t\t\t\tstate.players[i].units[j].canMove = true;\n\t\t}\n\t}\n\n\t// Update wall styles on map\n\tvar pathmap = [];\n\tfor ( var row = 0; row < MAP_SIZE; row++ ) {\n\t\tpathmap[row] = new Array( MAP_SIZE );\n\t\tfor ( var col = 0; col < MAP_SIZE; col++ ) {\n\t\t\tif ( state.map[row][col].type == \"wall\" ){\n\t\t\t\tpathmap[row][col] = 1;\n\t\t\t} else {\n\t\t\t\tpathmap[row][col] = 0;\n\t\t\t}\n\t\t}\n\t}\n\tstate.map = setPathStyles( state.map, pathmap, \"wall\" );\n\n\treturn state;\n}", "title": "" }, { "docid": "9f4376c4d7b3648e71875ac5d112af35", "score": "0.58229274", "text": "function updateGameArea() {\n if (estado != 2 && estado != 0) {\n pong.clear();\n //Pinta vidas\n pintaCorazones();\n pintaGolpes();\n\n //Barra\n barra.choca();\n barra.nuevaPosicion();\n barra.update();\n\n // pelota\n pelota.muevePelota();\n pelota.chocaBarra();\n pelota.chocaPared();\n pelota.fuera();\n pelota.update();\n }\n}", "title": "" }, { "docid": "b6ae9257c0b0a233372c891fd2cfd180", "score": "0.58219874", "text": "moveOpponent() {\n if (this.winner) {\n return\n }\n\n let availablePos = [];\n\n this.board.forEach((player, idx) => {\n if (player === null) {\n availablePos.push(idx)\n }\n });\n\n let nextPos;\n\n switch(this.level) {\n case 0:\n for (let winPos of EASY_MODE_POSITIONS) {\n if (!!~availablePos.indexOf(winPos)) {\n nextPos = winPos;\n break;\n }\n }\n\n break;\n\n case 1:\n let possibleWin = this.isAboutToWin();\n\n if (possibleWin.willWin) {\n let ins = possibleWin.instance\n\n for (let pos of ins) {\n if (this.board[pos] !== null)\n continue;\n\n nextPos = pos\n }\n } else {\n for (let winPos of WINNING_POSITIONS) {\n if (!!~availablePos.indexOf(winPos)) {\n nextPos = winPos;\n break;\n }\n }\n }\n }\n\n this.setState(nextPos, this.opponent)\n this.checkResult()\n this.setTurn(this.player)\n }", "title": "" }, { "docid": "fd09aa2d4c9b0c567b81b09fa66a455d", "score": "0.58210075", "text": "mover() {\n\n if (this.poner == false && this.coger == false) {\n switch (this.idPlayer) {\n\n case \"Uno\":\n\n if (this.app.keyIsDown(68) && this.aplastado == false) {\n this.perspectiva = \"der\";\n this.der = true;\n this.izq = false;\n } else this.der = false;\n\n if (this.app.keyIsDown(65) && this.aplastado == false) {\n this.perspectiva = \"izq\";\n this.izq = true;\n this.der = false;\n } else this.izq = false;\n\n\n if (this.app.keyIsDown(83) && this.arrastra == false && this.gano == false) {\n this.agachado = true;\n this.izq = false;\n this.der = false;\n } else this.agachado = false;\n\n\n if (this.app.keyIsDown(87) && this.gano == false) {\n\n if (this.puedeSaltar && this.cayendo == false && this.aplastado == false) {\n if (this.agachado == false) this.vel.y = -10;\n if (this.agachado) this.vel.y = -8;\n this.puedeSaltar = false;\n this.cayendo = true;\n this.parado = false;\n this.arrastra = false;\n }\n\n if (this.arrastra && this.cayendo == false) {\n this.vel.y = -8;\n this.vel.x = this.rebotePared;\n this.arrastra = false;\n this.cayendo = true;\n this.parado = false;\n }\n } else this.cayendo = false;\n\n break;\n\n case \"Dos\":\n\n if (this.app.keyIsDown(this.app.RIGHT_ARROW) && this.aplastado == false) {\n this.perspectiva = \"der\";\n this.der = true;\n this.izq = false;\n } else this.der = false;\n\n if (this.app.keyIsDown(this.app.LEFT_ARROW) && this.aplastado == false) {\n this.perspectiva = \"izq\";\n this.izq = true;\n this.der = false;\n } else this.izq = false;\n\n\n if (this.app.keyIsDown(this.app.DOWN_ARROW) && this.arrastra == false && this.gano == false) {\n this.agachado = true;\n this.izq = false;\n this.der = false;\n } else this.agachado = false;\n\n\n if (this.app.keyIsDown(this.app.UP_ARROW) && this.gano == false) {\n\n if (this.puedeSaltar && this.cayendo == false && this.aplastado == false) {\n if (this.agachado == false) this.vel.y = -10;\n if (this.agachado) this.vel.y = -8;\n this.puedeSaltar = false;\n this.cayendo = true;\n this.parado = false;\n this.arrastra = false;\n }\n\n if (this.arrastra && this.cayendo == false) {\n this.vel.y = -8;\n this.vel.x = this.rebotePared;\n this.arrastra = false;\n this.cayendo = true;\n this.parado = false;\n\n }\n } else this.cayendo = false;\n\n break;\n } //cierra el switch de player\n }\n }", "title": "" }, { "docid": "f53d6a6fdbaf469eb3126f74142a1c6f", "score": "0.58181655", "text": "function updatePosition() {\n let dif = Date.now() - lst\n lst = Date.now()\n step = pixs * dif / 1000\n cardsToMove.forEach(el => {\n cards[el.index].x += el.xs * step\n cards[el.index].y += el.ys * step\n })\n mainCard.x += takeCardToMove.xs * step\n mainCard.y += takeCardToMove.ys * step\n let mov = window.requestAnimationFrame(updatePosition)\n\n if ( cards[cardsToMove[0].index].y > fpoint.y ) {\n window.cancelAnimationFrame(mov)\n rectToDraw = []\n let takenToGive = {\n takenCard: null,\n takedCards: []\n }\n clickedCardIndex.forEach(index => {\n cards[index].state = 'taked'\n })\n takenToGive.takedCards = cards.filter(el =>{\n return el.state == 'taked'\n })\n table.cards = table.cards.filter(el => {\n return el.state == 'table'\n })\n takenToGive.takenCard = table.cardTakePosition.splice(0, 1)[0]\n\n // passo la presa al giocatore\n player.taken.push(takenToGive)\n console.log(player)\n }\n }", "title": "" }, { "docid": "fa44ec4a4343afefa0379cba789a3038", "score": "0.5812636", "text": "function playerMovement(key){\n var xPlayer = getXPosition(\"player\");\n var yPlayer = getYPosition(\"player\");\n if (key == \"Up\") {\n setPosition(\"player\", xPlayer, (yPlayer - playerStepSize) - boost);\n if (obstacleCollision()) {\n setPosition(\"player\", xPlayer, yPlayer + playerStepSize + boost);\n } else {\n setText(\"scoreNumLabel\", moveCount);\n moveCount++;\n }\n if (yPlayer < 0) {\n setProperty(\"player\", \"y\", 410);\n stopTimedLoop();\n levelCount++;\n boost = 0;\n setText(\"levelLabel\", levelCount);\n moveEnemy(\"cartEnemy\", \"truckEnemy\", \"motorcycleEnemy\");\n \n }\n } else if (key == \"Right\") {\n setPosition(\"player\", xPlayer + 25, yPlayer);\n if (xPlayer > 290) {\n setProperty(\"player\", \"x\", 0);\n }\n } else if (key == \"Left\") {\n setPosition(\"player\", xPlayer - 25, yPlayer);\n if (xPlayer < -10) {\n setProperty(\"player\", \"x\", 280);\n }\n } else if (key == \"Down\") {\n setText(\"scoreNumLabel\", moveCount);\n setPosition(\"player\", xPlayer, yPlayer + playerStepSize - boost);\n if (obstacleCollision()) {\n setPosition(\"player\", xPlayer, yPlayer - playerStepSize - boost);\n moveCount++;\n }\n moveCount--;\n if (yPlayer > 430) {\n setProperty(\"player\", \"y\", 410);\n }\n } else if (key == \"Shift\") {\n boost = 20;\n boostCount--;\n hideElement(\"boost\" + (3 - boostCount));\n setPosition(\"obstacle1Image\", -250, -250);\n setPosition(\"obstacle2Image\", -200, -200);\n setPosition(\"obstacle3Image\", -250, -250);\n }\n checkForBonus();\n}", "title": "" }, { "docid": "126aaf9085db24fec493fbe72fe25db3", "score": "0.581223", "text": "function move(id) {\n moves += 1;\n //If the space clicked is empty\n if (array[id[0]][id[1]] === \"v\") {\n //Update \"logical\" board\n loadLogicalBoard(id);\n //Update visual board according to logical board\n loadVisualBoard(id);\n //Did the player win?\n checkWin();\n //Change turns\n changeTurn();\n //Disable the space clicked\n disableDiv(id);\n }\n myStorage.setItem('Turn', JSON.stringify(turn));\n myStorage.setItem('Moves', JSON.stringify(moves));\n myStorage.setItem('GamesX', JSON.stringify(playerX));\n myStorage.setItem('GamesO', JSON.stringify(playerO));\n myStorage.setItem('Board', JSON.stringify(array));\n}", "title": "" }, { "docid": "c7b9387f2421b35ec1c3bd64535e368c", "score": "0.5811945", "text": "function moveAround(evt) {\n if (evt.code === \"ArrowUp\") {\n if (map[playerRow - 1][playerColumn] !== \"W\") {\n playerTop -= 20;\n player.style.top = playerTop + \"px\";\n playerRow -= 1;\n }\n } else if (evt.code === \"ArrowDown\") {\n if (map[playerRow + 1][playerColumn] !== \"W\") {\n playerTop += 20;\n player.style.top = playerTop + \"px\";\n playerRow += 1;\n }\n } else if (evt.code === \"ArrowLeft\") {\n if (playerRow <= 9 && playerColumn <= 0) {\n return;\n } else if (map[playerRow][playerColumn - 1] !== \"W\") {\n playerLeft -= 20;\n player.style.left = playerLeft + \"px\";\n playerColumn -= 1;\n }\n } else if (evt.code === \"ArrowRight\") {\n if (map[playerRow][playerColumn + 1] !== \"W\") {\n playerLeft += 20;\n player.style.left = playerLeft + \"px\";\n playerColumn += 1;\n }\n madeIt();\n }\n\n\n function madeIt() {\n if (map[playerRow][playerColumn] === 'F') {\n let winMsg = document.createElement('div')\n winMsg.classList.add('win')\n document.body.appendChild(winMsg)\n winMsg.innerHTML = 'YOU MADE IT!!!!'\n }\n }\n}", "title": "" }, { "docid": "3b54c1585261001cb4f4994c4af673e8", "score": "0.58109564", "text": "function playerMovement(){\n\t// move right\n\tif(Key.isDown(Key.D)){\n\t\t// if paddle is not at edge\n\t\tif(paddle_a.position.y > -fieldHeight * 0.45){\n\t\t\tpaddle_aDirY = -paddleSpeed * 0.5;\n\t\t}\n\t\t// else don't move\n\t\telse{\n\t\t\tpaddle_aDirY = 0;\n\t\t}\n\t}\n\t// move left\n\telse if(Key.isDown(Key.A)){\n\t\t// if paddle is not at edge\n\t\tif(paddle_a.position.y < fieldHeight * 0.45){\n\t\t\tpaddle_aDirY = paddleSpeed * 0.5;\n\t\t}\n\t\t// else don't move\n\t\telse{\n\t\t\tpaddle_aDirY = 0;\n\t\t}\n\t}\n\t// don't move\n\telse{\n\t\tpaddle_aDirY = 0;\n\t}\n\n\tpaddle_a.scale.y += (1 - paddle_a.scale.y) * 0.2;\n\tpaddle_a.scale.z += (1 - paddle_a.scale.y) * 0.2;\n\tpaddle_a.position.y += paddle_aDirY;\n}", "title": "" }, { "docid": "928a1758af16ca11ff7504ce54801ff1", "score": "0.5810095", "text": "processPlayerAction(state, action) {\n state = state.clone();\n\n state.direction = action.repr;\n\n let utilities = [0]; // No utility for changing direction\n\n return this.makeProcessedActionOutcome(utilities, state, undefined); // No state delta for player moving\n }", "title": "" }, { "docid": "ad7c8a14e7e85dd9a0ca7c8dcae831ab", "score": "0.5802039", "text": "LocalPlayerOnMove() {\n\n }", "title": "" }, { "docid": "677a391e7752081073a69032012cc010", "score": "0.5798983", "text": "function iteratePlayerState() {\n for (let i = 0; i < params.gridSize; i++)\n for (let j = 0; j < params.gridSize; j++)\n if (tailArray[i][j].type === CellTypes.Bomb)\n tailArray[i][j].type = CellTypes.None;\n\n players.forEach(function (p, i) {\n if(testingModeEnabled){if(i!==0)return;} //In testing mode just move player 0.\n if (p.enabled && p.alive) {\n //increment bomb and sprint counters\n if (gameModes.bombModeEnabled && p.bombCharge < params.bombRechargeTime)\n p.bombCharge += 1000 / params.maxFps;\n\n if (gameModes.sprintModeEnabled && p.sprintCharge < params.sprintRechargeTime)\n p.sprintCharge += 1000 / params.maxFps;\n \n //HANDLE BOMB ENABLED MODE\n if (gameModes.bombModeEnabled && keysPressed[p.keyMapping[\"bomb\"]] && p.bombCharge >= params.bombRechargeTime) \n {\n p.bombCharge = 0;\n triggerBomb(p.pos.x, p.pos.y);\n }\n if(getCellTypeFromPos(p.pos) === CellTypes.FastZone){\n movePlayerInDirection(p, !gameModes.holeySprintMode); //Do an extra movement for being in a fast zone. Happens before normal movement. Leaving tail depends on holeySprintMode.\n }\n movePlayerInDirection(p, true); //The standard MOVE. leaves a tail block.\n\n //HANDLE SPRINT ENABLED MODE\n if (gameModes.sprintModeEnabled && keysPressed[p.keyMapping[\"sprint\"]] && p.sprintCharge > 0.1 * params.sprintRechargeTime) \n {\n if(getCellTypeFromPos(p.pos) === CellTypes.FastZone){\n movePlayerInDirection(p, !gameModes.holeySprintMode); //Do an extra movement for being in a fast zone. Happens before normal movement. Leaving tail depends on holeySprintMode.\n }\n movePlayerInDirection(p, !gameModes.holeySprintMode); //The standard MOVE. leaves a tail block.\n\n p.sprintCharge -= deltaTime * params.sprintRechargeTime / params.sprintLength;\n }\n \n //HANDLE WRAP ENABLED MODE\n if (gameModes.wrapEnabled) \n { \n clampPos(p.pos);\n }\n }\n });\n}", "title": "" }, { "docid": "52b756bd8a2fbd061378b8f5aeddb4af", "score": "0.5793202", "text": "function setGameState(tileNr,gameState,triesNr,timeNr){\n GameBoard.numberOfTiles = tileNr;\n GameBoard.gameActive = gameState;\n GameBoard.triesLeft = triesNr;\n CountDownTimer.time = timeNr;\n}", "title": "" }, { "docid": "f7fe0c1e961720978dfd9209b7156c98", "score": "0.57927597", "text": "function gamePlay() {\r\n movePlatform();\r\n\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n \r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n \r\n moveBullets();\r\n collisionDetection();\r\n moveMonster();\r\n moveMonsterBullet();\r\n updateScreen();\r\n \r\n}", "title": "" }, { "docid": "7844998f8d14b128006b98829395711d", "score": "0.57832295", "text": "function saveGameState() {\n localStorage.setItem('deck', deck.innerHTML);\n localStorage.setItem('openCards', JSON.stringify(openCards));\n localStorage.setItem('matched', matched);\n}", "title": "" }, { "docid": "85fdb84f4977e73c856c8419fd70e021", "score": "0.5782903", "text": "gamePrepare() {\n // changing state to 'play'\n this.state = \"play\";\n\n // generating word list (later key can affect word list)\n this.freshWords = generateWords();\n\n // preparing storage for explained words\n this.usedWords = {};\n\n // setting number of turn\n this.numberOfTurn = 0;\n\n const numberOfPlayers = this.users.length;\n this.speaker = numberOfPlayers - 1;\n this.listener = numberOfPlayers - 2;\n\n this.roundPrepare()\n }", "title": "" }, { "docid": "243f9bcb604e8143307e26a82d4ce1df", "score": "0.57804585", "text": "function shipMoves() {\n if(lastArrowPressed === 38) {\n ship.y++;\n currentShipDirection = 38;\n gameOn = true;\n } else if(lastArrowPressed === 40) {\n ship.y--;\n currentShipDirection = 40;\n gameOn = true;\n } else if(lastArrowPressed === 37) {\n ship.x--;\n currentShipDirection = 37;\n gameOn = true;\n } else if(lastArrowPressed === 39) {\n ship.x++;\n currentShipDirection = 39;\n gameOn = true;\n }\n ship.render();\n}", "title": "" }, { "docid": "4f189b188dfbdf19ba61d3eddb3c6847", "score": "0.5779372", "text": "onPlayerMove(diceNumber){\n let nextPosition = this.currentPlayer.position + diceNumber;\n if (nextPosition > 15) {\n nextPosition -= 16\n this.currentPlayer.cash += 500\n }\n this.currentPlayer.position = nextPosition \n this.props.onPlayerMove({isPlayer1:this.state.isPlayer1, position:this.currentPlayer.position});\n }", "title": "" }, { "docid": "c33527c878c50d38304a2ed684198621", "score": "0.57778734", "text": "function move(e) {\n\tsquares[pacmanCurrentPosition].classList.remove('pacman');\n\n\tswitch(event.keyCode) {\n\t\tcase 37: //left\n\t\tif ( \n\t\t!squares[pacmanCurrentPosition - 1].classList.contains('wall') && \n\t\tpacmanCurrentPosition % boardWidth !== 0 ) \n\t\tpacmanCurrentPosition -= 1\n\t\tsquares[pacmanCurrentPosition].classList.add('faceleft')\n\n\t\tif (pacmanCurrentPosition === 364 )\n\t\t{pacmanCurrentPosition = 391}\t\n\t\tbreak\n\n\t\tcase 38: //up\n\t\tif ( \n\t !squares[pacmanCurrentPosition - boardWidth].classList.contains('wall') && \n\t\tpacmanCurrentPosition - boardWidth >= 0 ) \n\t\tpacmanCurrentPosition -= boardWidth\n\t\tsquares[pacmanCurrentPosition].classList.add('faceup')\n\t\tbreak\n\t\t\n\t\tcase 39: //right\n\t\tif ( \n\t\t!squares[pacmanCurrentPosition + 1].classList.contains('wall') && \n\t\tpacmanCurrentPosition % boardWidth < 27 )\n\t\tpacmanCurrentPosition += 1\n\t\tsquares[pacmanCurrentPosition].classList.remove('faceleft')\n\t\tsquares[pacmanCurrentPosition].classList.remove('faceup')\n\t\tsquares[pacmanCurrentPosition].classList.remove('facedown')\n\n\t\tif (pacmanCurrentPosition === 391 )\n\t\t{pacmanCurrentPosition = 364}\n\n\t\tbreak\n\n\t\tcase 40: //down\n\t\tif ( \n\t\t!squares[pacmanCurrentPosition + boardWidth].classList.contains('ghosthome') && \n\t\t!squares[pacmanCurrentPosition + boardWidth].classList.contains('wall') && \n\t\tpacmanCurrentPosition + boardWidth < boardWidth * boardWidth ) \n\t\tpacmanCurrentPosition += boardWidth\n\t\tsquares[pacmanCurrentPosition].classList.add('facedown')\n\t\tbreak\n\t}\n\n\t squares[pacmanCurrentPosition].classList.add('pacman')\n\t pacdotEaten()\n\t powerPelletEaten()\n\t checkForGameOver()\n\t checkForWin() \n}", "title": "" }, { "docid": "88765034c6d0d4ed95c32a890af34a2e", "score": "0.5773067", "text": "function roverMovement(s,p){\n grid[rover.x][rover.y] = null;\n s === \"addition\" ? p === \"x\" ? rover.x += 1 : rover.y += 1 : p === \"x\" ? rover.x -= 1 : rover.y -= 1;\n grid[rover.x][rover.y] = rover.mark;\n }", "title": "" }, { "docid": "0cc85a2dc6bc1a495ea3d2efe77fdf0a", "score": "0.5764342", "text": "function trackerMove(char) {\n 'use strict';\n var nextX = camera.centerX;\n var nextY = camera.centerY;\n\n var directionX = 0;\n var directionY = 0;\n\n if (!char.moving && curMapVar.movesLeft > 0) {\n\n if (userInputStatus.holdLeft) {\n\n if (!checkCollision(nextX - TILE_W, nextY)) {\n directionX = -5;\n char.moving = true;\n char.currentDirection = 'left';\n curMapVar.movementTracker[curMapVar.moveCount-1] = 'left';\n }\n }\n else if (userInputStatus.holdRight) {\n\n if (!checkCollision(nextX + TILE_W, nextY)) {\n directionX = 5;\n char.moving = true;\n char.currentDirection = 'right';\n curMapVar.movementTracker[curMapVar.moveCount-1] = 'right';\n }\n }\n else if (userInputStatus.holdUp) {\n\n if (!checkCollision(nextX, nextY - TILE_H)) {\n directionY = -5;\n char.moving = true;\n char.currentDirection = 'up';\n curMapVar.movementTracker[curMapVar.moveCount-1] = 'up';\n }\n }\n else if (userInputStatus.holdDown) {\n\n if (!checkCollision(nextX, nextY + TILE_H)) {\n directionY = 5;\n char.moving = true;\n char.currentDirection = 'down';\n curMapVar.movementTracker[curMapVar.moveCount-1] = 'down';\n }\n }\n }\n if (char.moving && !char.animMove) {\n\n if (!isMobile) {\n\n if (assets.walkingSound.playing(curMapVar.walkId)) {\n clearTimeout(curMapVar.pauseId);\n }\n else {\n curMapVar.walkId = assets.walkingSound.play();\n }\n }\n else {\n if (assets.spriteSound.playing(curMapVar.walkId)) {\n try {\n clearTimeout(curMapVar.pauseId);\n }\n catch (err) {\n curMapVar.walkId = assets.spriteSound.play('walking');\n }\n }\n else {\n curMapVar.walkId = assets.spriteSound.play('walking');\n }\n }\n char.animMove = true;\n var stepsMoved = 0;\n\n var frameMove = function () {\n if (stepsMoved === 100) {\n clearInterval(moveId);\n updateInfo();\n stepCounter(char);\n\n if (!isMobile) {\n curMapVar.pauseId = setTimeout(function () {\n assets.walkingSound.pause(curMapVar.walkId)\n }, 250);\n } else {\n curMapVar.pauseId = setTimeout(function () {\n assets.spriteSound.pause(curMapVar.walkId)\n }, 350);\n }\n\n } else {\n nextX += directionX;\n nextY += directionY;\n camera.centerX = nextX;\n camera.centerY = nextY;\n stepsMoved += 5;\n }\n };\n var moveId = setInterval(frameMove, 30);\n }\n}", "title": "" }, { "docid": "3190eb282f2d671f44ecd23e231002e7", "score": "0.5761867", "text": "function playState() {\n // Setting the cave background\n image(playBackground, 0, 0, windowWidth, windowHeight);\n\n // Handle input for the thief\n thief.handleInput();\n\n // Move all the non-array characters\n thief.move();\n healer.move();\n\n // Handle the healing\n thief.handleHealing(healer);\n\n // Display all the non-array characters\n thief.display();\n healer.display();\n\n // Moving and displaying the arrays\n // The prey\n for (let i = 0; i < preyArray.length; i++) {\n preyArray[i].display();\n thief.handleEating(preyArray[i]);\n }\n\n // The dangers\n for (let i = 0; i < dangerArray.length; i++) {\n dangerArray[i].move();\n dangerArray[i].display();\n dangerArray[i].damage(thief);\n // Handling the cage array for eating\n for (let j = 0; j < cageArray.length; j++) {\n cageArray[j].handleEating(dangerArray[i]);\n }\n }\n\n // The mini dangers\n for (let i = 0; i < miniArray.length; i++) {\n miniArray[i].move();\n miniArray[i].display();\n miniArray[i].damage(thief);\n // Handling the cage array for eating\n for (let j = 0; j < cageArray.length; j++) {\n cageArray[j].changedEating(miniArray[i]);\n }\n }\n\n // The cage\n for (let i = 0; i < cageArray.length; i++) {\n cageArray[i].handleInput();\n cageArray[i].move();\n cageArray[i].display();\n cageArray[i].damage(thief);\n }\n\n // The snow\n for (let i = 0; i < snowArray.length; i++) {\n snowArray[i].move();\n snowArray[i].display();\n }\n\n // The game is over when health reaches 0\n if (thief.health <= 0 && state !== \"GAMEOVER\") {\n state = \"GAMEOVER\";\n }\n\n // The ending displays once the predator finds enough prey\n if (thief.preyEaten === 30 && state !== \"ENDING\") {\n state = \"STARTENDING\";\n }\n\n // Display the score\n displayScore();\n\n // Display the goal\n displayGoal();\n\n // Displaying the milestone messages\n milestoneMessage();\n}", "title": "" }, { "docid": "daf654599a21cec71e91ae6ca2d8f4af", "score": "0.57606894", "text": "function main() {\n $('body').keydown(function(e) {\n\n\n if (e.which === 39) {\n p1moveright();\n } //end of right key\n\n\n if (e.which === 37) {\n p1moveleft();\n } //end of left key\n\n if (e.which === 74 && opCnt >= 190) {\n p2moveleft();\n } //end j key\n\n\n if (e.which === 76 && opCnt <= 1293) {\n p2moveright();\n } //end L key\n\n var dist = opCnt - use;\n if (dist < 170) {\n use = 600;\n opCnt = 850;\n }\n\n if (e.which === 65 && dist <= 313) {\n p1punch();\n p1wincondition();\n\n\n } //end a\n\n\n if (e.which === 68 && dist <= 313) {\n p1kick();\n p1wincondition();\n\n } //end d\n\n\n //2nd player controls\n if (e.which === 79 && dist <= 233) {\n //o key 2nd player punch\n p2punch();\n p2wincondition();\n\n }\n\n if (e.which === 73 && dist <= 233) { //i key 2nd plyer kick\n p2kick();\n p2wincondition();\n\n }\n\n\n\n })\n //end of keydown event\n\n //start the function keyup\n $('body').keyup(function(ev) {\n if (ev.which === 65) {\n $(p1).removeClass('vp');\n $(p2).removeClass('ch');\n }\n if (ev.which === 68) {\n $(p1).removeClass('vk');\n $(p2).removeClass('ch');\n }\n if (ev.which === 76) {\n $(p2).removeClass('cb')\n }\n if (ev.which === 39) {\n $(p1).removeClass('vr')\n }\n if (ev.which === 37) {\n $(p1).removeClass('vb')\n }\n if (ev.which === 73) {\n $(p2).removeClass('ck');\n $(p1).removeClass('vh');\n }\n if (ev.which === 79) {\n $(p2).removeClass('cp');\n $(p1).removeClass('vh')\n }\n if (ev.which === 74) {\n $(p2).removeClass('cr')\n }\n\n\n })\n //end the function keyup\n\n }", "title": "" }, { "docid": "233a77a341b347742abf5918ed7dd1e2", "score": "0.5754327", "text": "movePawn(pos) {\n console.log('Pawn');\n let newBoard = this.state.board.slice();\n\n if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white' && pos[0] === this.state.moveFrom[0]-1 && pos[1] === this.state.moveFrom[1] && this.state.board[pos[0]][pos[1]].color !== 'black') {\n this.updateBoard(pos);\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black' && pos[0] === this.state.moveFrom[0]+1 && pos[1] === this.state.moveFrom[1] && this.state.board[pos[0]][pos[1]].color !== 'white') {\n\n this.updateBoard(pos);\n //first move. two spaces up\n } else if (this.state.moveFrom[0] === 6 && this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white' && pos[0] === this.state.moveFrom[0]-2 && pos[1] === this.state.moveFrom[1] && this.state.board[this.state.moveFrom[0]-1][this.state.moveFrom[1]].occupied === null && this.state.board[pos[0]][pos[1]].color !== 'black') {\n this.updateBoard(pos);\n } else if (this.state.moveFrom[0] === 1 && this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black' && pos[0] === this.state.moveFrom[0]+2 && pos[1] === this.state.moveFrom[1] && this.state.board[this.state.moveFrom[0]+1][this.state.moveFrom[1]].occupied === null && this.state.board[pos[0]][pos[1]].color !== 'white') {\n this.updateBoard(pos);\n //piece detection. can't take a piece moving forward\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white'\n && this.state.board[pos[0]][pos[1]].color === 'black' && ((this.state.moveFrom[0]-1 === pos[0] && this.state.moveFrom[1]-1 === pos[1])\n || (this.state.moveFrom[0]-1 === pos[0] && this.state.moveFrom[1]+1 === pos[1]))) {\n this.updateBoard(pos);\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black'\n && this.state.board[pos[0]][pos[1]].color === 'white' && ((this.state.moveFrom[0]+1 === pos[0] && this.state.moveFrom[1]-1 === pos[1])\n || (this.state.moveFrom[0]+1 === pos[0] && this.state.moveFrom[1]+1 === pos[1]))) {\n this.updateBoard(pos);\n }\n }", "title": "" }, { "docid": "56c3b25644f288833f0a17abe331eab2", "score": "0.57542163", "text": "function move(pc, sq, gamestate)\n{\n\t// fail safe\n\tif (!pc.alive){console.log(\"FAILSAFE move\"); return false;}\n\n\t// function can operate on imaginary boards to calculate possible check, etc.\n\tvar board = gamestate.board;\n\tvar pieces = gamestate.pieces;\n\tvar jail0 = gamestate.jail0;\n\tvar jail1 = gamestate.jail1;\n\n\t// all pieces count their own moves, why not. Especially for pawn, king, rook\n\tpc.moves++;\n\n\t// EN PASSANT - pawns know if they're vulnerable: 1st move, 4th rank, adjacent opponent pawn\n\tif (pc.type == 'p')\n\t{\n\t\tif (\n\t\t\t(pc.moves == 1) &&\n\t\t\t(sq.ypos == (pc.team + 3)) && \n\t\t\t((\n\t\t\t\t(sq.xpos < 7) &&\n\t\t\t\t(board[(sq.xpos + 1)][sq.ypos] != null) && \n\t\t\t\t(board[(sq.xpos + 1)][sq.ypos].team != sq.team) &&\n\t\t\t\t(board[(sq.xpos + 1)][sq.ypos].type == 'p')\n\t\t\t) || ( \n\t\t\t\t(sq.xpos > 0) &&\n\t\t\t\t(board[(sq.xpos - 1)][sq.ypos] != null) &&\n\t\t\t\t(board[(sq.xpos - 1)][sq.ypos].team != sq.team) &&\n\t\t\t\t(board[(sq.xpos - 1)][sq.ypos].type == 'p')\n\t\t\t)) \n\t\t)\n\t\t\tpc.enpassant = true;\n\t\telse\n\t\t\tpc.enpassant = false;\n\t}\n\n\t// check for CASTLE, king has moved 2 spaces. move appropriate rook\n\tvar dist = (sq.xpos - pc.xpos);\n\tif ((pc.type == 'k') && (Math.abs(dist) > 1))\n\t{\n\t\t\tvar castlerook = pc.i + ((dist > 0) ? 3 : -4);\n\t\t\tboard[pieces[castlerook].xpos][pieces[castlerook].ypos] = null;\n\t\t\tpieces[castlerook].xpos += ((dist > 0) ? -2 : 3);\n\t\t\tpieces[castlerook].moves++;\n\t\t\tboard[pieces[castlerook].xpos][pieces[castlerook].ypos] = pieces[castlerook];\n\n\t\t\t// move rook - GRAPHICS\n\t\t\tif (gamestate.master)\n\t\t\t{\n\t\t\t\t$(\"#\" + pieces[castlerook].name).animate({\n\t\t\t\t'left' : (pieces[castlerook].xpos * squaresize),\n\t\t\t\t'top' : (pieces[castlerook].ypos * squaresize)}, 1000);\n\t\t\t}\n\t}\n\t\n\t// check for direct-landing capture\n\tif (board[sq.xpos][sq.ypos] != null)\n\t\tgotojail(board[sq.xpos][sq.ypos], gamestate);\n\n\t// check for EN PASSANT capture\n\tif ((pc.type == 'p') && (board[sq.xpos][(sq.ypos + (pc.team ? 1 : -1))] != null ) && (board[sq.xpos][(sq.ypos + (pc.team ? 1 : -1))].enpassant == true))\n\t\tgotojail(board[sq.xpos][(sq.ypos + (pc.team ? 1 : -1))], gamestate);\n\n\t// clear old board square\n\tboard[pc.xpos][pc.ypos] = null;\n\t// update new board square and piece object\n\tpc.xpos = sq.xpos;\n\tpc.ypos = sq.ypos;\n\tboard[sq.xpos][sq.ypos] = pc;\n\n\t// check for pawn promotion\n\tif ((pc.type == 'p') && (pc.ypos == (pc.team ? 0 : 7)))\n\t\tpromote(pc, gamestate);\n\n\t// check if opponent has been put in check, real board only\n\tif ( (gamestate.master) && (checkforcheck(pc.team, gamestate)) )\n\t{\n\t\t$(\"#start\").append(\"<br>\"+ (pc.team ? \"white\" : \"black\") + \" has put opponent in check\");\n\t}\n}", "title": "" } ]
f59845fa9a712d15b71e489482c4d8e0
Function that generate tickets from the amount given
[ { "docid": "9bda443ffd7c75f8b2998c34c276ddae", "score": "0.6142404", "text": "generateTickets() {\n var wrappers = [];\n var startPoint = parseInt(this.state.inputStartNo) || 1;\n var endPoint = startPoint + this.state.quantity - 1;\n var counter = startPoint;\n\n console.log(startPoint, this.state.quantity);\n \n // If quantity is empty\n if( !this.state.quantity || this.state.isPreviewMode ) {\n\n wrappers.push(\n <Wrapper key=\"0\">\n <Ticket \n logo_url={this.state.inputLogoUrl || 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQDK5X2Sjws2k1i6rKJHnO1mnDBtg2AFruxmBjZHbvATgc1b8_W'}\n title = {this.state.inputTitle || 'TITLE'}\n description = {this.state.textarea || 'Here is the ticket description'}\n date = {this.state.inputDate || '01.01.2020'}\n code = {'0001'}\n />\n </Wrapper> \n );\n\n } else {\n for (let i = 0; i < this.state.quantity / 6; i++) {\n let tickets = []; // Empty array that store the tickets generated\n\n for (let j = 0; j < 6 && counter <= endPoint; j++) {\n // Formating code\n let code = '0000';\n let tmpString = '' + counter;\n code = code.slice(tmpString.length) + tmpString;\n //--------------\n\n tickets.push(\n <Ticket \n logo_url={this.state.inputLogoUrl || 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQDK5X2Sjws2k1i6rKJHnO1mnDBtg2AFruxmBjZHbvATgc1b8_W'}\n title = {this.state.inputTitle || 'TITLE'}\n description = {this.state.textarea || 'Here is the ticket description'}\n date = {this.state.inputDate || '01.01.2020'}\n code = {code || '0000'}\n key={counter}\n />\n );\n\n counter++;\n }\n\n wrappers.push(\n <Wrapper key={i}>\n {tickets}\n </Wrapper>\n )\n }\n }\n\n return wrappers\n }", "title": "" } ]
[ { "docid": "d84aad68517c04b96c44ab28b0d69bf7", "score": "0.66024417", "text": "function createRandomTickets() {\n var ticket_array = [];\n //Randomize number of tickets (assuming a max of 50 tickets per event)\n var random_numberof_tickets = Math.floor(Math.random() * 50);\n for (var n = 0; n < random_numberof_tickets; n++) {\n\n //Randomize ticket prices (non-zero) assuming max of 20\n var random_ticket_price = Math.floor(Math.random() * 20 + 1);\n ticket_array.push(random_ticket_price);\n }\n return ticket_array;\n}", "title": "" }, { "docid": "6595419fafe62864cf87da88f6b6f986", "score": "0.633349", "text": "buyTicket() {\n let x = new BigNumber(this.state.ticketAmount);\n let price = this.state.ticketPriceRaw * x;\n this.props.web3.eth.sendTransaction({\n from: this.state.account,\n to: this.address,\n value: price});\n this.updateLotteryParticipants();\n }", "title": "" }, { "docid": "372cab74d1fff62c6d69825f8e1f45b9", "score": "0.60554904", "text": "async getTickets(amount = 0) {\n const token = await this._getSearchToken();\n const url = buildUrl(null, {\n path: \"tickets\",\n queryParams: {\n searchId: token,\n },\n });\n\n return this.get(url).then((result) => {\n const tickets = result?.data?.tickets || [];\n\n return ticketsNormalizer(\n amount ? tickets.slice(0, amount) : tickets\n );\n });\n }", "title": "" }, { "docid": "2182e56341be21646cb4a92ca7f243aa", "score": "0.6023183", "text": "function tickets(array) {\n twentyFive = 0\n fifty = 0\n\n for (amount of array) {\n if (amount === 25) {\n twentyFive += 1\n }\n if (amount === 50) {\n if (twentyFive >= 1) {\n fifty += 1\n twentyFive -= 1\n } else {\n return 'NO'\n }\n }\n if (amount === 100) {\n if (fifty === 0 && twentyFive <= 2) {\n return 'NO'\n }\n if (fifty > 0 && twentyFive > 0) {\n fifty -= 1\n twentyFive -= 1\n }\n if (fifty === 0 && twentyFive > 2) {\n twentyFive -= 3\n }\n\n }\n if (amount !== 25 && amount !== 50 && amount !== 100) {\n return 'NO'\n }\n }\n return 'YES'\n}", "title": "" }, { "docid": "d9981199d9d6ca76de27e3209fcb9d44", "score": "0.5944768", "text": "function mPriceGen(index, amount, i) {\n var mItemPrice = [10, 15, 25, 50, 100, 150, 1000, 1500];\n if (Math.random()>.5) {\n return ((mItemPrice[index] + (mItemPrice[index] / (Math.random() + 0.1)) * 0.09).toFixed()) * amount;\n } else {\n var rawPrice = (mItemPrice[index] - (mItemPrice[index] / (Math.random() + 0.1)) * 0.09).toFixed();\n setTimeout(botBuy, (rawPrice / mItemPrice[index] * 10000),'mSlot', i); //parameter for referencing the item\n return (rawPrice * amount);\n }\n}", "title": "" }, { "docid": "3b3cb1ba9c8bbe2157a522ae2137ca68", "score": "0.59192073", "text": "async function buyTicket(e, eventNumber) {\n const amount = eventData[eventNumber]['price']\n try {\n await eventContracts[eventNumber].methods.buyTicket().send({ value: amount, from: account });\n await getUserTickets();\n } catch(e) {\n console.log('Buy Ticket Error: ', e)\n }\n }", "title": "" }, { "docid": "893df854448a0f945aad63e1495c8fa0", "score": "0.5909313", "text": "function genItemNeeded() {\n numFruitNeeded = Math.floor(Phaser.Math.Between(1,diff));\n numDairyNeeded = Math.floor(Phaser.Math.Between(1,diff));\n numVeggiesNeeded = Math.floor(Phaser.Math.Between(1,diff));\n numMeatNeeded = Math.floor(Phaser.Math.Between(1,diff));\n \n numFruit = Math.floor(Phaser.Math.Between(numFruitNeeded + 1,diff*2));\n numDairy = Math.floor(Phaser.Math.Between(numDairyNeeded + 1,diff*2));\n numVeggies = Math.floor(Phaser.Math.Between(numVeggiesNeeded + 1,diff*2));\n numMeat = Math.floor(Phaser.Math.Between(numMeatNeeded + 1,diff*2));\n \n}", "title": "" }, { "docid": "396954ba28a6bcfa880e2a63847bf931", "score": "0.58245957", "text": "function amountOfTicket() {\n const firstClassTicketNumber = finalTicketAmount('firstClass-ticket');\n document.getElementById('firstClassTicketAmount').value = firstClassTicketNumber;\n const finalFirstClassTicketPrice = firstClassTicketNumber * 150;\n document.getElementById('firstClassTicketPrice').value = '$ ' + finalFirstClassTicketPrice;\n\n const economyTicketNumber = finalTicketAmount('economy-ticket');\n document.getElementById('economyTicketAmount').value = economyTicketNumber;\n const finalEconomyTicketPrice = economyTicketNumber * 100;\n document.getElementById('economyTicketPrice').value = '$ ' + finalEconomyTicketPrice;\n\n const finalSubtotal = finalTicketPrice('subtotal');\n document.getElementById('finalSubtotalPrice').value = '$ ' + finalSubtotal;\n\n const finalVat = finalTicketPrice('tax');\n document.getElementById('finalVatPrice').value = '$ ' + finalVat;\n\n const finalTotal = finalTicketPrice('total');\n document.getElementById('finalTotalPrice').value = '$ ' + finalTotal;\n}", "title": "" }, { "docid": "7a95d26338fa314781e03b82e6056d89", "score": "0.580184", "text": "function getAmount(ticketPrice, ticketQuantity) {\n\n return ticketPrice * ticketQuantity;\n\n}", "title": "" }, { "docid": "97db7809441d5c18eebf3b7cc9f4c609", "score": "0.57666266", "text": "function tickets(peopleInLine){\n let ret = 'YES'\n let vasyaBank = {\n twentyFive: 0,\n fiddy: 0,\n hunnid: 0\n }\n peopleInLine.forEach(money => {\n if(money === 25){\n vasyaBank.twentyFive ++\n }else if(money === 50){\n vasyaBank.fiddy ++\n if(vasyaBank.twentyFive > 0){\n vasyaBank.twentyFive --\n } else {\n ret = 'NO'\n }\n }else if(money === 100 ){\n vasyaBank.hunnid ++\n if(vasyaBank.twentyFive >0 && vasyaBank.fiddy >0 ){\n vasyaBank.twentyFive --\n vasyaBank.fiddy --\n }else if(vasyaBank.twentyFive >2){\n vasyaBank.twentyFive -=3\n }else{\n ret = 'NO'\n }\n }\n })\n return ret\n}", "title": "" }, { "docid": "c75c9e35e737a2d60b4af8845681ba45", "score": "0.57412905", "text": "function createBoxes(amount) {\n amount = userAmount.firstElementChild.value;\n console.log(amount);\n for(let i=0; i<=amount; i+=1) {\nconst divRef = document.createElement('div');\nconst baseWidth = '30';\ndivRef.style.maxWidth = `${baseWidth}+${amount*10}px`;\ndevRef.style.backgroundColor = 'randomColor';\nreturn divRef;\n };\n}", "title": "" }, { "docid": "a066629668223d5c9d665ea8d07a9337", "score": "0.5698209", "text": "function generateReceipts(){\n // Create a random transaction\n const receipt = {\n \"timestamp\" : Date.now(),\n \"customerName\" : chance.name({ nationality: \"en\" }),\n \"cardNumber\" : chance.cc(),\n \"location\" : chance.weighted(LOCATIONS, [2, 5, 3]),\n \"size\" : chance.weighted(SIZES, [1, 2, 3, 4, 5]),\n \"toppings\" : chance.weighted(TOPPINGS,[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]),\n \"total\" : parseFloat(chance.normal({mean: 20, dev: 3}).toFixed(2))\n };\n\n // Print to the console\n console.log(receipt);\n\n // Insert into MongoDB\n salesData.insertOne(receipt).then(\n // Wait for a random amount of time\n setTimeout(generateReceipts, chance.integer({min: 0, max: 3000}))\n );\n}", "title": "" }, { "docid": "a53821b859e6e3707f461ca575bf7ebf", "score": "0.56492174", "text": "function tickets(peopleInLine) {\n let enoughChange = 'YES';\n const ticketPrice = 25;\n // Cashier's change:\n let hundred = 0;\n let fifty = 0;\n let twentyFive = 0;\n\n peopleInLine.some(person => {\n // Take bill:\n if (person === 25) { twentyFive++ }\n else if (person === 50) { fifty++ }\n else if (person === 100) { hundred++ }\n // Give change:\n let changeDue = person - ticketPrice;\n if (changeDue === 0) {\n return;\n } else if (changeDue === 25) {\n if (twentyFive > 0) {\n twentyFive--;\n } else {\n enoughChange = 'NO';\n return;\n }\n } else if (changeDue === 75) {\n if (twentyFive > 0 && fifty > 0) {\n twentyFive--;\n fifty--;\n } else {\n enoughChange = 'NO';\n return;\n }\n }\n });\n return enoughChange;\n}", "title": "" }, { "docid": "01c85c84f17b8890bf9301b8b8c9267f", "score": "0.56320363", "text": "function distrubute(amount,count,cb){\n console.log(\"Distribute \"+amount+\" \"+concurrence.symbol+\" to \"+count+\" accounts...\")\n concurrence.selectAccount(1)\n let open = 0\n for(let i=0;i<count;i++){\n if(i!=concurrence.selectedAddress){\n open++\n concurrence.balanceOf(concurrence.accounts[i]).then((balance)=>{\n if(balance<amount){\n concurrence.transfer(concurrence.accounts[i],amount-balance).then((result)=>{\n if(DEBUG) console.log(result.transactionHash)\n concurrence.balanceOf(concurrence.accounts[i]).then((balance)=>{\n console.log(\"Account \"+i+\" has \"+balance+\" \"+concurrence.symbol)\n open--\n if(open<=0) cb()\n })\n })\n }\n else{\n console.log(\"Account \"+i+\" has \"+balance+\" \"+concurrence.symbol)\n open--\n if(open<=0) cb()\n }\n })\n }\n }\n}", "title": "" }, { "docid": "71d63615d66ed3f0db9854600e7d6e99", "score": "0.56037545", "text": "function ticketNumberCalculation(ticketType, isIncrease) {\n const ticketNumber = ticketInputValue(ticketType);\n let ticketCounter = ticketNumber;\n if (isIncrease === true) {\n ticketCounter = ticketNumber + 1;\n } else if (isIncrease === false && ticketCounter > 0) {\n ticketCounter = ticketNumber - 1;\n }\n document.getElementById(ticketType + '-ticket').value = ticketCounter;\n\n let subtotal = 0;\n\n if (ticketType == 'firstClass') {\n subtotal = ticketCounter * 150;\n } else if (ticketType == 'economy') {\n subtotal = ticketCounter * 100;\n }\n document.getElementById('subtotal').innerText = subtotal;\n priceCalculator();\n emptyInput();\n\n}", "title": "" }, { "docid": "c867abd3cbcc46c6460c676990193e1f", "score": "0.56027293", "text": "function make_amount(rupees_to_make, no_of_five, no_of_one){\r\n let five_needed = 0,\r\n one_needed = 0,\r\n flag = 0,\r\n fives = 0,\r\n ones = 0;\r\n if(rupees_to_make<=(no_of_five*5 + no_of_one)){\r\n fives = rupees_to_make / 5;\r\n ones = rupees_to_make % 5;\r\n if(fives > no_of_five){\r\n five_needed = fives;\r\n one_needed = ones;\r\n flag = 1;\r\n } else if(fives > no_of_five){\r\n five_needed = no_of_five;\r\n one_needed = rupees_to_make - (five_needed*5);\r\n flag = 1;\r\n }\r\n } \r\n if(flag === 1){\r\n return [Math.floor(five_needed), one_needed]\r\n } else {\r\n return -1;\r\n }\r\n}", "title": "" }, { "docid": "b532946f403ebd79feef9de759b1cf55", "score": "0.5587055", "text": "siguienteTicket() {\n this.ultimo += 1;\n let ticket = new Ticket(this.ultimo, null);\n this.tickets.push(ticket);\n this.grabarArchivo();\n\n return `Ticket ${this.ultimo}`\n }", "title": "" }, { "docid": "3b4eecd6610bfa8a92771c9e4f41a97c", "score": "0.55654174", "text": "function generateCoinChange(cents){\n var quarters = Math.floor(cents/25); //set quarters to how many quarters can be made from cents\n cents = cents - (quarters * 25) //remove the amount of cents from the quarters\n var dimes = Math.floor(cents/10); //set dimes to how many dimes can be made with the remaining cents\n cents = cents - (dimes * 10); //remove the amount of cents from the dimes\n var nickles = Math.floor(cents/5) //set nickles to how many nickles can be made with the remaining cents\n cents = cents - (nickles * 5); //remove the amount of cents from the dimes\n var pennies = cents //set pennies to remaining cents\n var coinchange = {quarters: quarters, dimes: dimes, nickles: nickles, pennies: pennies} //return them all in an object\n return coinchange\n}", "title": "" }, { "docid": "81094d1c9e905402c08de95e52c482a4", "score": "0.5564505", "text": "getRandomJokes(amount) {\n // old version, if you don't have an extra method for creating the URLs\n // const url = `${this.baseUrl}${this.endpoints.random}`.replace(\"{amount}\", \"\");\n\n // { amount } is equal to { amount: amount } because it sets the value for a property with\n // the name \"amount\" to the value of the variable with that same name \"amount\".\n const url = this.buildUrl(this.endpoints.random, { amount });\n return this.call(url);\n }", "title": "" }, { "docid": "10d4b7af7848948bf2ff794c187ee653", "score": "0.5533961", "text": "function giveChange(amount) {\n\tamount = Math.floor(amount);\n\tvar ch = { two: 0, five: 0, ten: 0 };\n\n\tif (amount < 2 || amount == 3) return \"Impossible!\";\n\n\tif (amount % 2) {\n\t\tamount -= 5;\n\t\tch.five = 1;\n\t}\n\n\twhile (amount % 10) {\n\t\tamount -= 2;\n\t\tch.two++;\n\t}\n\n\tch.ten = amount / 10;\n\n\treturn ch;\n}", "title": "" }, { "docid": "b041b82f55a1a0631d201e0f6395916d", "score": "0.55214995", "text": "function pay_actor()\n{\n events.forEach(event=>{\n \tactors.forEach(actor =>{\n \t\tif(actor.eventId==event.id){\n \t\t\tactor.payment[1].amount=event.price- event.price*0.3;\n \t\t\tactor.payment[2].amount=0.5*event.price*0.3;\n \t\t\tactor.payment[3].amount=event.persons;\n \t\t\tif(event.options.deductibleReduction==true){\n\n \t\t\t\tactor.payment[4].amount=200+(event.price*0.3)-(actor.payment[2].amount+actor.payment[3].amount);\n\n \t\t\t}\n \t\t\telse{\n \t\t\tactor.payment[4].amount=5000+(event.price*0.3)-(actor.payment[2].amount+actor.payment[3].amount);\n \t\t\t}\n \t\t}\n \t})\n });\n}", "title": "" }, { "docid": "7563f63e9fa5c6e7dd1dad10658ff6bc", "score": "0.55202264", "text": "function generateCoinChange(cents) {\n var quarters = Math.floor(cents / 25);\n cents = cents - (quarters * 25); \n\n var dimes = Math.floor(cents / 10);\n cents = cents - (dimes * 10); \n\n var nickels = Math.floor(cents / 5);\n\n var pennies = cents - (nickels * 5);\n\n var numCoins = quarters + dimes + nickels + pennies;\n\n console.log(\"Number of coins: \" + String(numCoins));\n}", "title": "" }, { "docid": "db1bfbe0308a505dd3e42928bcc5d826", "score": "0.5505413", "text": "function ticket(ticketNumber) {\n const bodyWidth = 1125;\n const bodyGutter = 50;\n const qrTop = 140;\n const stubStart = 1275;\n // const stubHeight =\n const qrEdge = 300;\n // const stubWidth = 400;\n const rotateLeftEdge = 550;\n const rotateWidth = 500;\n const rotateStubTop = 1275;\n const eventTitle = 'The New Pornographers with Neko Case';\n const ticketTitle = 'Early Bird Special - Balcony';\n\n const SEAT_TOP = 365;\n const SEAT_DETAIL_TOP = SEAT_TOP + 30;\n\n return [\n f.rotate(0),\n // f.rotate(-90), f.move(500, 50), f.useFont(10, 'TICKIT'),\n // f.rotate(0), f.move(30, 300), f.useFont(2, '30,300 Event Title Goes Here'),\n // f.move(60, 300), f.useFont(2, '60,300 Font2 Unmodified'),\n f.move(40, bodyGutter),\n // f.\n // f.useFont(2, f.alignCenter(`Villager Events Presents`, bodyWidth), 2, 2),\n f.useTTF(1, 9, f.alignCenter(`Villager Events Presents`, bodyWidth)),\n f.move(50, bodyGutter),\n f.horizontalLine(bodyWidth, 4),\n\n f.move(130, bodyGutter),\n f.useTTF(3, 12, f.alignCenter(eventTitle, bodyWidth), 1, 1),\n // f.useFont(3, f.alignCenter(eventTitle, bodyWidth), 1, 1),\n\n f.move(190, bodyGutter),\n // f.useFont(3, f.alignCenter(`${ticketTitle}`, bodyWidth)),\n f.useTTF(3, 12, f.alignCenter(`${ticketTitle}`, bodyWidth)),\n\n f.move(250, bodyGutter),\n f.useTTF(3, 9, f.alignCenter(`December 31, 2018 at 8pm`, bodyWidth)),\n // f.useFont(3, f.alignCenter(`December 31, 2018 at 8pm`, bodyWidth)),\n // f.move(300, bodyGutter),\n // f.useTTF(1, 20, `December 31, 2018 at 8pm`),\n\n f.move(305, bodyGutter),\n // f.useTTF(3, 20, `December 31, 2018 at 8pm`),\n f.useTTF(1, 9, f.alignCenter(`Amazeballs Venue, Vancouver, BC`, bodyWidth)),\n\n // f.move(300, bodyGutter),\n // f.useFont(11, f.alignCenter(`${ticketTitle}`, bodyWidth)),\n\n f.move(460, bodyGutter),\n f.useTTF(\n 3,\n 6,\n f.alignCenter(\n `Verify or register this ticket at https://tickit.ca/reg/AEAB9D57E01D78`,\n bodyWidth\n ),\n 1,\n 1\n ),\n // f.useFont(\n // 2,\n // f.alignCenter(\n // `Verify or register this ticket at https://tickit.ca/reg/aeab9d57e01d78`,\n // bodyWidth\n // ),\n // 1,\n // 1\n // ),\n\n f.move(515, bodyGutter),\n f.useTTF(\n 3,\n 6,\n f.alignCenter(\n `All sales are final. No refunds or exchanges. All outdoor mainstage concerts proceed rain or shine!`,\n bodyWidth\n ),\n 1,\n 1\n ),\n // f.useFont(\n // 2,\n // f.alignCenter(\n // `All sales are final. No refunds or exchanges. All outdoor mainstage concerts proceed rain or shine!`,\n // bodyWidth\n // ),\n // 1,\n // 1\n // ),\n\n // f.move(400, bodyGutter),\n // f.useFont(12, f.alignCenter(`${ticketTitle}`, bodyWidth)),\n\n // f.move(500, bodyGutter),\n // f.useFont(13, f.alignCenter(`${ticketTitle}`, bodyWidth)),\n\n f.move(SEAT_TOP, bodyGutter),\n f.useTTF(1, 8, 'Row'),\n\n f.move(SEAT_DETAIL_TOP, bodyGutter),\n f.useTTF(2, 15, 'AA'),\n\n f.move(SEAT_TOP, bodyGutter + 130),\n f.useTTF(1, 8, 'Seat'),\n\n f.move(SEAT_DETAIL_TOP, bodyGutter + 130),\n f.useTTF(2, 15, '88'),\n\n f.move(SEAT_TOP, bodyGutter + 260),\n f.useTTF(1, 8, 'Section'),\n\n f.move(SEAT_DETAIL_TOP, bodyGutter + 260),\n f.useTTF(2, 15, 'Orchestra'),\n\n f.move(SEAT_TOP, bodyGutter + 600),\n f.useTTF(1, 8, 'Ticket #'),\n\n f.move(SEAT_DETAIL_TOP, bodyGutter + 600),\n f.useTTF(2, 15, ticketNumber),\n\n // f.move(SEAT_TOP, bodyGutter),\n // f.useFont(2, 'Row', 2, 2),\n\n // f.move(SEAT_DETAIL_TOP, bodyGutter),\n // f.useFont(2, 'AA', 3, 3),\n\n // f.move(SEAT_TOP, bodyGutter + 130),\n // f.useFont(2, 'Seat', 2, 2),\n\n // f.move(SEAT_DETAIL_TOP, bodyGutter + 130),\n // f.useFont(2, '88', 3, 3),\n\n // f.move(SEAT_TOP, bodyGutter + 260),\n // f.useFont(2, 'Section', 2, 2),\n\n // f.move(SEAT_DETAIL_TOP, bodyGutter + 260),\n // f.useFont(2, 'Orchestra', 3, 3),\n\n // f.move(350, bodyGutter),\n // f.useFont(3, f.alignCenter(`${ticketTitle}`, bodyWidth), 2, 2),\n\n f.useFont(1, '', 1, 1),\n f.move(qrTop, stubStart + 10),\n f.qrCode(ticketNumber, 6),\n\n f.move(rotateStubTop + 100, stubStart),\n // f.useFont(2, f.alignCenter(ticketNumber, qrEdge), 2, 2),\n // f.move(qrTop + qrEdge + 100, stubStart),\n\n f.rotate(-90),\n // f.move(rotateLeftEdge, 50),\n // f.useFont(2, f.alignCenter('Some text ', rotateWidth), 2, 2),\n\n // f.move(50, rotateStubTop),\n // f.verticalLine(rotateWidth, 2),\n\n f.move(rotateLeftEdge, rotateStubTop + qrEdge + 20),\n f.useFont(1, f.alignCenter(ticketNumber, rotateWidth), 2, 2),\n\n f.move(rotateLeftEdge, rotateStubTop + qrEdge + 60),\n f.useFont(1, f.alignCenter(ticketTitle, rotateWidth), 1, 1)\n\n // f.move(rotateLeftEdge, rotateStubTop - 200),\n // f.useFont(2, f.alignCenter('Some text ', rotateWidth), 2, 2),\n\n // f.useFont(2, 'Some text, 600, 50 '),\n // f.move(600, 500),\n // f.useFont(2, 'Some text, 600, 500 '),\n // f.move(50, 500),\n // f.useFont(2, 'Some text, 50, 500 ')\n\n // f.move(500, 50), f.useFont(6), f.boxSize(26, 44), 'THREE', f.useFont(2), f.boxSize(26, 44), 'PARKS'),\n // f.line(f.move(24, 580), f.drawBox(340, 50, 2)),\n // f.line(f.move(500, 40), f.code128(ticketNumber, true, 10, 2))\n ].join(' ');\n}", "title": "" }, { "docid": "9545a431d74101089d28616a992baafa", "score": "0.5502405", "text": "function mBigPriceGen(index) {\n var mItemPrice = [10000, 20000, 25000, 75000];\n\n if (Math.random()>.5) {\n return ((mItemPrice[index] + (mItemPrice[index] * 0.9 / (Math.random() + 0.1)) / 10).toFixed());\n } else {\n var rawPrice1 = (mItemPrice[index] - (mItemPrice[index] * 0.9 / (Math.random() + 0.1)) / 10).toFixed();\n setTimeout(botBuy, (rawPrice1 / mItemPrice[index] * 10000), 'bMSlot', 0);\n return rawPrice1\n }\n}", "title": "" }, { "docid": "77d33c212c2ff11ba61bcc5745531523", "score": "0.5497886", "text": "_makeAsks(bestAsk, maxAsk) {\n const placedAsks = [];\n const cancelledAsks = [];\n\n // keep canceling orders until we have room to make new asks\n let status, makeAsks, makeBase;\n do {\n status = this.calculator.getStatus();\n\n makeAsks = this.maintainAsks - status.asks;\n const wantBase = this.makeRatio * (status.base + status.placedBase);\n makeBase = wantBase - status.placedBase;\n\n const orders = this.calculator.getOrders();\n for (const order of orders) {\n // cancel first ask\n if (!Calculator.isBid(order)) {\n this.calculator.cancel(order);\n cancelledAsks.push(order);\n break;\n }\n }\n } while (makeAsks === 0 && makeBase > 0);\n\n const take = base => {\n const price = getRandomArbitrary(bestAsk, maxAsk);\n makeBase -= base;\n if (base < MIN_AMOUNT) {\n return;\n }\n const order = { price, count: 1, amount: -base }; // negative amount - ask\n this.calculator.make(order);\n placedAsks.push(order);\n };\n\n if (makeAsks > 0 && makeBase > 0) {\n for (let i = 0; i < makeAsks-1; i++) {\n // we want random division of an interval\n // but instead we took 0.5 every time of remaining quote\n const base = calculateMakeValue(makeBase);\n take(base);\n }\n\n // last one takes remaining makeBase\n take(makeBase);\n }\n\n return { placedAsks, cancelledAsks };\n }", "title": "" }, { "docid": "71286df849867ef312033e73a022709e", "score": "0.5495746", "text": "async function generateW12CrowdsaleStubWithDifferentToken(\n {\n serviceWallet,\n swap,\n price,\n tranchePercent,\n serviceFee,\n saleFee,\n mint\n }, originTokens, wtokens, owner\n) {\n mint = new BigNumber(mint);\n\n const list = [];\n const ten = new BigNumber(10);\n\n for (const tokenIdx in wtokens) {\n const wtokenDecimals = wtokens[tokenIdx].decimal;\n const wtoken = wtokens[tokenIdx].token;\n const originTokenDecimals = originTokens[tokenIdx].decimal;\n const originToken = originTokens[tokenIdx].token;\n const item = {\n wtoken,\n originToken,\n args: {\n serviceWallet,\n swap,\n price,\n tranchePercent,\n serviceFee,\n saleFee,\n mint\n }\n };\n\n const fund = await W12CrowdsaleFundStub.new({from: owner});\n const rates = await Rates.new({from: owner});\n const crowdsale = await W12CrowdsaleStub.new(\n 0,\n originToken.address,\n wtoken.address,\n utils.toInternalUSD(price),\n serviceWallet,\n swap,\n utils.toInternalPercent(serviceFee),\n utils.toInternalPercent(saleFee),\n fund.address,\n rates.address,\n {from: owner}\n );\n const wtokenOwner = await wtoken.primary();\n const originTokenOwner = await originToken.primary();\n\n await wtoken.addAdmin(crowdsale.address, { from: wtokenOwner });\n await wtoken.mint(crowdsale.address, ten.pow(wtokenDecimals).mul(mint), 0, {from: wtokenOwner});\n await originToken.mint(swap, ten.pow(originTokenDecimals).mul(mint), 0, {from: originTokenOwner});\n await originToken.approve(\n crowdsale.address,\n utils.percent(ten.pow(originTokenDecimals).mul(mint),\n utils.toInternalPercent(saleFee)),\n {from: swap}\n );\n await fund.setCrowdsale(crowdsale.address, {from: owner});\n\n item.fund = fund;\n item.crowdsale = crowdsale;\n item.rates = rates;\n\n list.push(item);\n }\n\n return list;\n}", "title": "" }, { "docid": "34a3e4ae532bc1940d15fa82d4396b79", "score": "0.54877055", "text": "function ticketsNumber() {\n let num_of_tickets = document.getElementById('amount').value;\n total_sum_msg = 'Subtotal: ' + num_of_tickets * 495 + ' EUR';\n document.querySelector('.subtotal').innerHTML = total_sum_msg;\n updateCart(num_of_tickets);\n}", "title": "" }, { "docid": "6e02eac64e5e30013d6d5e80fa8227de", "score": "0.54826313", "text": "function tickets(line) {\n let result = \"YES\";\n let box = {};\n console.log(line)\n loop:\n for (let i of line) {\n box[i] ? box[i]++ : box[i] = 1;\n switch(i) {\n case 25:\n continue;\n case 50: \n if (box['25'] > 0) {\n box['25']--;\n } else { \n result = \"NO\";\n break loop;\n }\n break;\n case 100:\n if (box['50'] > 0 && box['25'] > 0) {\n box['50']--;\n box['25']--;\n } else if (box['25'] >= 3) {\n box['25'] -= 3;\n } else {\n result = \"NO\";\n break loop;\n }\n break;\n }\n }\n \n return result\n}", "title": "" }, { "docid": "14ecbe443d5a3465707d0f7c3487d997", "score": "0.54521346", "text": "function processAmount() {\n\n let amount = Number(get_elem('amount').value);\n if (isNaN(amount) || amount <= 0) {\n return;\n }\n\n let amount_msatoshi = amount * 1000;\n let expiry = 600;\n\n let post_data = {\n 'msatoshi': amount_msatoshi,\n 'expiry': expiry,\n 'description': 'Lightning Tip For Conor conscott Scott'\n }\n\n let client = new HttpClient();\n client.post(post_invoice_url, JSON.stringify(post_data), function(json_response) {\n\n let data = JSON.parse(json_response);\n\n // Get label for invoice\n let label = data.label;\n let bolt11 = data.bolt11;\n const now = Math.round((new Date().getTime()) / 1000);\n let expires = now + expiry;\n\n hide_element('make_invoice');\n get_elem('bolt11_inv').innerHTML = bolt11;\n show_element('bolt11_invoice');\n\n // Make qr code\n let qrcode = new QRCode(document.getElementById('qrcode'), bolt11);\n\n\n var timerCountdownId = registerInterval(label, function() { updateExpiration(expires) }, 1000);\n\n // Clear the timer after it's not longer needed\n setTimeout(function() {clearInterval(timerCountdownId)}, (expiry+2)*1000);\n\n // Settle for a polling solution\n var timerCheckInvoiceId = registerInterval(label, function() { checkInvoice(label) }, 3000);\n\n // Clear the timer after it's not longer needed\n setTimeout(function() {clearInterval(timerCheckInvoiceId)}, (expiry+2)*1000);\n });\n}", "title": "" }, { "docid": "cfc6ea0ee2f88988e87fe8b7dfd9409e", "score": "0.54465014", "text": "function generateTables(quantity) {\n if (quantity < 4) {\n tables = 1;\n } else {\n tables = Math.floor(quantity / 4);\n var overflow = quantity % 4;\n if (quantity < 11 && overflow == 2) {\n tables += 1;\n } else if (overflow > 2) {\n tables += 1;\n };\n };\n return tables;\n }", "title": "" }, { "docid": "15b99bad6208d36ff8982af57b08131f", "score": "0.5445752", "text": "function bill(price) {\n\treturn price * 6\n}", "title": "" }, { "docid": "6620032935a2e454b843509c8ee08442", "score": "0.54422575", "text": "buy(amount) {\n // Let the user know that they just exchanged off-network goods for network tokens\n console.log(`You bought $${amount} of tokens from our Central Payment Processor off-network`);\n }", "title": "" }, { "docid": "78e9145919341a94b6f7feaa66e51c50", "score": "0.5427856", "text": "function tickets(peopleInLine) {\n let pockets = {\n 25: 0,\n 50: 0\n }\n for (let person of peopleInLine) {\n if (person === 25) pockets[25]++\n else if (person === 50) {\n pockets[25]--\n pockets[50]++\n if (pockets[25] < 0) return 'NO'\n } else {\n pockets[25]--\n if (pockets[50] > 0) pockets[50]--\n else pockets[25] -= 2\n if (pockets[25] < 0 || pockets[50] < 0) return 'NO'\n }\n }\n return 'YES'\n}", "title": "" }, { "docid": "2265bfce116a886f6b848d324363b7d5", "score": "0.54205006", "text": "async function generateBets(userid) {\n const currentLines = await lines.get();\n if (!currentLines.length)\n return {status: 404, msg: \"Sorry, no lines available for this date.\"};\n const chosenLines = new Set();\n let nGames = randomInt(1, currentLines.length + 1);\n for (let i = 0; i < nGames; ++i)\n chosenLines.add(randomInt(0, currentLines.length));\n for (i of chosenLines.keys()) {\n let r = await makeAndSubmitPanel(userid, currentLines[i]);\n if (r.status == 402) {\n console.log(\"generation of bets cannot finish due to insufficient funds\");\n return r;\n }\n }\n return {status: 200};\n}", "title": "" }, { "docid": "57df2475c9e5b02b3d92f26e357e521b", "score": "0.53937775", "text": "function generateTicketID() {\n\t\t\tvar chars = \"0123456789ABCDEFGHJKLMNPQRSTUVWXYZ\";\n\t\t\tvar result = '';\n\t\t\tfor(var i=12; i>0; --i) {\n\t\t\t\tresult += chars[Math.round(Math.random() * (chars.length - 1))];\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "4be75d82d275ed021aaab6920fd22074", "score": "0.5393652", "text": "function stockNumberGen() {\n return Math.floor((Math.random() * 100) + 1);\n}", "title": "" }, { "docid": "0ca82a5b7f7314432db4b3b0267ab8f0", "score": "0.53901184", "text": "function generateRow(x) {\n for (let i = 0; i< x; i++) {\n //multiplicator\n let multi = i + 1;\n // Put in the addRow function\n addRow(\"table\", x, multi);\n }\n}", "title": "" }, { "docid": "a38c5ab8bca038dd80241eccd1204eb7", "score": "0.5388279", "text": "buy(amount) {\n this.web3.eth.getAccounts().then(accounts=>{\n this.state.token.methods.buy().send({from:accounts[this.state.defaultAccount],value:amount},(err,res)=>{\n err?console.error(err):console.log(res)\n })\n\n })\n\n }", "title": "" }, { "docid": "defa08961f28e2dcd7e37e11c7834504", "score": "0.5384613", "text": "makeDeposit(amount) {\n this.makeDepositBtn.click();\n this.amoutBox.setValue(amount);\n this.approve.click();\n }", "title": "" }, { "docid": "4f56cd6d3f5e140b629816af5f70c70e", "score": "0.53819764", "text": "async function generateTransferFunds () {\n\tconst data = {\n\t\tpayee_public_key: payeePubKey,\n\t\tamount: transferAmount,\n\t\tmax_fee: maxFee,\n\t\tactor: account,\n tpid: ''\n }\n\n\tconst transaction = await generateSignedTransaction ('fio.token', 'trnsfiopubky' , data)\n}", "title": "" }, { "docid": "76ada07fdc0221a186119561a0d7b250", "score": "0.53799915", "text": "function crystalNumberGenerator () {\n\n return Math.floor(Math.random() * 10) + 5;\n\n }", "title": "" }, { "docid": "23a5ae314091450b42600dc1a585e742", "score": "0.5374024", "text": "function tickets(peopleInLine){\n let result = 'YES';\n let twentyFiveBills = 0;\n let fiftyBills = 0;\n peopleInLine.forEach(val => {\n if (val === 25) {\n twentyFiveBills += 1\n } else if (val === 50) {\n twentyFiveBills -= 1;\n fiftyBills += 1;\n } else if (val === 100) {\n if (fiftyBills > 0) {\n fiftyBills -= 1;\n twentyFiveBills -= 1;\n } else {\n twentyFiveBills -= 3;\n }\n }\n\n if (twentyFiveBills < 0 || fiftyBills < 0) result = 'NO';\n });\n\n return result;\n}", "title": "" }, { "docid": "5107b52bd4b0b701307322733703b314", "score": "0.5345231", "text": "function tickets(peopleInLine){\n sale = 'YES'\n twentyFive = 0\n fifty = 0\n hundred = 0\n ticket = 25\n peopleInLine.forEach( person => {\n if (person === ticket) { \n twentyFive += 1\n } \n if (person === 50) { \n fifty += 1\n twentyFive -= 1 \n } \n if (person === 100) {\n hundred += 1\n twentyFive -=1\n fifty > 0 ? fifty -= 1 : twentyFive -= 2\n } \n if (twentyFive < 0 || fifty < 0 ) {\n console.log(twentyFive, fifty)\n sale = 'NO'\n return sale\n }\n })\n return sale\n }", "title": "" }, { "docid": "0b62b818e121dd8b1838a245c39520c1", "score": "0.534431", "text": "function forMultiply(){\n /// first number should be from 13 to 199\n generateNum1(13, 99);\n // second number should be 20 below\n generateNum2(5, 20);\n}", "title": "" }, { "docid": "14df2b98bdb61d7b547801782f04db61", "score": "0.53413045", "text": "function returnChange(amount){\n let tens = 0\n let fives = 0\n let twos = 0\n if (amount === 1 || amount === 3){\n return null\n }\n while (amount !== 0 && amount > 0) {\n console.log(amount)\n if (amount > 13 || amount === 12 || amount === 10) {\n tens += 1\n amount -= 10\n } else if (amount >= 5 && amount !== 8 && amount !== 6) {\n fives += 1;\n amount -= 5\n } else {\n twos += 1;\n amount -= 2;\n }\n }\n let result = {\n tens : `${tens}`,\n fives : `${fives}`,\n twos : `${twos}`\n }\n console.log(result)\n return result\n}", "title": "" }, { "docid": "6e36108e4ab3ac564783bf13163f497a", "score": "0.53401375", "text": "function custTicketsNext(){\r\n\tvar legal = 1;\r\n\r\n\t//checks if the number of tickets for each customer is invalid\r\n\tfor(var i = 0; i < cust_tickets.length; ++i){\r\n\t\tif(cust_tickets[i] == -1 || cust_tickets[i] == 0){\r\n\t\t\tlegal = 0;\r\n\t\t}\r\n\t}\r\n\r\n\t//checks that each number of tickets entered are valid\r\n\tif(legal){\r\n\t\t$(\"#error_container\").hide();\t\t\t\t\t\t//hides errors\r\n\t\tdiscounts(0.1);\r\n\t}\r\n\r\n\telse{\r\n\t\t$(\"#error_container\").show();\t\t\t\t\t\t//shows errors\r\n\t}\r\n}", "title": "" }, { "docid": "079a07f5e9d44263a7a36ba174fc5451", "score": "0.53301114", "text": "function createEvent(){\n\tlet xE=generateCoordinates();\n\tlet yE=generateCoordinates();\n\tlet id=events.length;\n\tlet number = Math.floor((Math.random() * 200));\n\tlet price = generateTicketPrices(number);\n\n\tlet event={\n\t\tid:id, \n\t\txE:xE, \n\t\tyE:yE, \n\t\ttickets:{\n\t\t\tprice: price,\n\t\t\tnumber:number\n\t\t}\n\t};\n\treturn event;\n}", "title": "" }, { "docid": "a9ae308c583b5678877e299d6b871abe", "score": "0.5322432", "text": "function newRec() {\n let minPrice = 10, maxPrice = 100,\n minCount = 1, maxCount = 10;\n\n arrReceipt = [];\n for (let i = 0; i < purchName.length; i++) {\n let purch = {};\n purch.name = purchName[i];\n purch.count = getRandom(maxCount, minCount);\n purch.price = getRandom(maxPrice, minPrice, true);\n arrReceipt.push(purch);\n }\n console.log(arrReceipt);\n}", "title": "" }, { "docid": "ca8cdc35906d3f074169a5a489734d82", "score": "0.5312988", "text": "function generateReceiptNumber() {\n var randNum = Math.floor(Math.random() * 1000000);\n $(\"#receiptNumber\").html(\"Receipt #: \" + randNum);\n}", "title": "" }, { "docid": "bd90684a6903fd7e49f41ed0ae3ff6fa", "score": "0.53058714", "text": "function generateCoinChange(cents) {\n var coins = [\n ['dollars', 100],\n ['halfdollars', 50],\n ['quarters', 25],\n ['dimes', 10],\n ['nickles', 5],\n ['pennies', 1]\n ];\n\n var change = {};\n for(var i = 0; i < coins.length; i++) {\n change[coins[i][0]] = Math.floor(cents/coins[i][1]);\n cents = cents % coins[i][1];\n }\n for(coin in change) {\n console.log(coin + \": \"+ change[coin]);\n }\n}", "title": "" }, { "docid": "b5565b80646f26b4ce17e5a8214d0a96", "score": "0.5283197", "text": "function ID_10_PurchaseTicket()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n \n WrapperFunction.selectKeyword(\"Daily Admission\");\n selectPackage(\"3 site Combi\",\"Adult\");\n aqUtils.Delay(5000);\n \n SelectQuantityFromSubWindow(3);\n selectSubPackageFromSubWindow(\"Adult\");\n SelectQuantityFromSubWindow(2);\n selectSubPackageFromSubWindow(\"Children (Ages 3-12)\");\n SelectDateFromSubWindow(\"8/24/2017\"); //mm-dd-yyyy\n SelectAvailableTimeFromSubWindow(\"11:30 AM\");\n SelectNextButtonFromSubWindow();\n aqUtils.Delay(2000);\n WrapperFunction.finilizeOrder()\n SelectPaymentType.selectPaymentType(\"Cash\");\n Button.clickOnButton(ValidateAllButton);\n Button.clickOnButton(NewOrder_Button);\n AppLoginLogout.logout(); \n \n}", "title": "" }, { "docid": "f9d645b8fec308cd4e478ae374678f74", "score": "0.5271254", "text": "async function buyPCT() {\n\t\t// Converts integer as Eth to Wei,\n\t\tlet amount = await ethers.utils.parseEther(transAmount.toString());\n\t\ttry {\n\t\t\tawait erc20.buyToken(transAmount, { value: amount });\n\t\t\t// Listens for event on blockchain\n\t\t\tawait erc20.on(\"PCTBuyEvent\", (from, to, amount) => {\n\t\t\t\tsetPendingFrom(from.toString());\n\t\t\t\tsetPendingTo(to.toString());\n\t\t\t\tsetPendingAmount(amount.toString());\n\t\t\t\tsetIsPending(true);\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (typeof err.data !== 'undefined') {\n\t\t\t\tsetErrMsg(\"Error: \" + err.data.message);\n\t\t\t}\n\t\t\tsetIsError(true);\n\t\t}\n\t}", "title": "" }, { "docid": "6c1d9454a7777973339f598c14d922c5", "score": "0.52587426", "text": "async function stakeAndGenesis(accounts, contracts) {\n const operator1 = accounts[1]\n const operator2 = accounts[2]\n const operator3 = accounts[3]\n const beneficiary1 = accounts[4]\n const beneficiary2 = accounts[5]\n const beneficiary3 = accounts[6]\n\n const operatorContract = contracts.operatorContract\n const stakingContract = contracts.stakingContract\n const token = contracts.token\n let ticket\n\n const operator1StakingWeight = 100\n const operator2StakingWeight = 200\n const operator3StakingWeight = 300\n\n const owner = accounts[0]\n const authorizer = accounts[0]\n\n const minimumStake = await stakingContract.minimumStake()\n\n await stakeDelegate(\n stakingContract,\n token,\n owner,\n operator1,\n beneficiary1,\n authorizer,\n minimumStake.muln(operator1StakingWeight)\n )\n await stakeDelegate(\n stakingContract,\n token,\n owner,\n operator2,\n beneficiary2,\n authorizer,\n minimumStake.muln(operator2StakingWeight)\n )\n await stakeDelegate(\n stakingContract,\n token,\n owner,\n operator3,\n beneficiary3,\n authorizer,\n minimumStake.muln(operator3StakingWeight)\n )\n\n await stakingContract.authorizeOperatorContract(\n operator1,\n operatorContract.address,\n { from: authorizer }\n )\n await stakingContract.authorizeOperatorContract(\n operator2,\n operatorContract.address,\n { from: authorizer }\n )\n await stakingContract.authorizeOperatorContract(\n operator3,\n operatorContract.address,\n { from: authorizer }\n )\n\n const groupSize = await operatorContract.groupSize()\n\n const groupSelectionRelayEntry = await operatorContract.getGroupSelectionRelayEntry()\n const tickets1 = generateTickets(\n groupSelectionRelayEntry,\n operator1,\n operator1StakingWeight\n )\n const tickets2 = generateTickets(\n groupSelectionRelayEntry,\n operator2,\n operator2StakingWeight\n )\n const tickets3 = generateTickets(\n groupSelectionRelayEntry,\n operator3,\n operator3StakingWeight\n )\n\n time.increase((await stakingContract.initializationPeriod()).addn(1))\n\n for (let i = 0; i < groupSize; i++) {\n ticket = packTicket(\n tickets1[i].valueHex,\n tickets1[i].virtualStakerIndex,\n operator1\n )\n await operatorContract.submitTicket(ticket, { from: operator1 })\n }\n\n for (let i = 0; i < groupSize; i++) {\n ticket = packTicket(\n tickets2[i].valueHex,\n tickets2[i].virtualStakerIndex,\n operator2\n )\n await operatorContract.submitTicket(ticket, { from: operator2 })\n }\n\n for (let i = 0; i < groupSize; i++) {\n ticket = packTicket(\n tickets3[i].valueHex,\n tickets3[i].virtualStakerIndex,\n operator3\n )\n await operatorContract.submitTicket(ticket, { from: operator3 })\n }\n\n const ticketSubmissionStartBlock = await operatorContract.getTicketSubmissionStartBlock()\n const submissionTimeout = await operatorContract.ticketSubmissionTimeout()\n await time.advanceBlockTo(ticketSubmissionStartBlock.add(submissionTimeout))\n\n const selectedParticipants = await operatorContract.selectedParticipants()\n\n const timeDKG = await operatorContract.timeDKG()\n const resultPublicationBlock = ticketSubmissionStartBlock\n .add(submissionTimeout)\n .add(timeDKG)\n await time.advanceBlockTo(resultPublicationBlock)\n\n const misbehaved = \"0x\"\n const resultHash = web3.utils.soliditySha3(blsData.groupPubKey, misbehaved)\n\n const signingMemberIndices = []\n let signatures = undefined\n\n for (let i = 0; i < selectedParticipants.length; i++) {\n const signature = await sign(resultHash, selectedParticipants[i])\n signingMemberIndices.push(i + 1)\n if (signatures === undefined) signatures = signature\n else signatures += signature.slice(2, signature.length)\n }\n\n await operatorContract.submitDkgResult(\n 1,\n blsData.groupPubKey,\n misbehaved,\n signatures,\n signingMemberIndices,\n { from: selectedParticipants[0] }\n )\n}", "title": "" }, { "docid": "50f85e83fdc7242dda414ae25ec0cf7c", "score": "0.5254582", "text": "function formatDollarAmountInTickets(tickets) {\n let output;\n output = tickets.map((ticket) => {\n ticket.price = currencyFormatter.format(ticket.price, { code: 'USD' })\n return ticket;\n })\n return output;\n}", "title": "" }, { "docid": "fc98a0a254b67f7d158e52f57cb2860c", "score": "0.5254576", "text": "function createTreasure(count) {\n const data = []\n let i = 0\n do {\n data.push({\n trapped: i % 2 === 0,\n gold: (count % 10 + 1) * 10\n })\n i++\n } while (i < count)\n return data\n}", "title": "" }, { "docid": "45a7124b3604fe8f3c9521d8220e3de7", "score": "0.52526826", "text": "function createShapesAmount (amount) {\n var id = 1,\n newAmount = amount ? amount : 1,\n x = 0,\n y = 0;\n Shape.allAreas = 0;\n randomShape.resetArea();\n\n while (id <= newAmount) {\n id++;\n x = (620 - 80) * Math.random() + 80;\n randomShape.createShape(x, y);\n }\n}", "title": "" }, { "docid": "492984a25c87047dd6bec139a4a21404", "score": "0.5240652", "text": "function generateAuctions(\n number, auctions, addTime,\n minNum, maxNum,\n minDen, maxDen,\n minLength, maxLength\n) {\n const auctionIndex = auctions.length;\n\n if (number === 0) {\n // Recursion base case\n return auctions\n } else if (auctionIndex === 0) {\n // First auction doesn't have auction start nor clearing time\n // (First price is saved from addTokenPair)\n auctions.push({\n auctionIndex,\n num: rand(minNum, maxNum),\n den: rand(minDen, maxDen),\n clearingTime: addTime,\n })\n } else {\n // Generate one auction and call fn recursively\n\n let clearingTime = auctions[auctionIndex - 1].clearingTime + rand(minLength, maxLength)\n\n if (auctionIndex === 1) {\n // Second auction begins after 6 hours of adding token pair\n clearingTime += WAITING_PERIOD_NEW_TOKEN_PAIR\n } else {\n // Other auctions begins at least 10 minutes after adding token pair\n clearingTime += WAITING_PERIOD_NEW_AUCTION\n }\n\n auctions.push({ \n auctionIndex,\n num: rand(minNum, maxNum),\n den: rand(minDen, maxDen),\n clearingTime,\n })\n } \n\n return generateAuctions(number - 1, ...Array.prototype.slice.call(arguments, 1))\n}", "title": "" }, { "docid": "2045aa5be6861be5c4b99ddb0970cd42", "score": "0.5235914", "text": "produce(amount, output, hourIndex){\n if(hourIndex === undefined)\n throw 'need hour index';\n this.hourlyDemand[hourIndex] += amount;\n }", "title": "" }, { "docid": "1fa2f2fbef8954d3b7879730d941e848", "score": "0.5233222", "text": "function createReceipt (arr, id, unit){\n var locator=id-1;\n var product=arr[locator].product;\n var price=parseFloat(arr[locator].price);\n var total=Math.round((unit*price)*100)/100;\n console.log(\"--------------------------------------------------------\");\n console.log(\"CUSTOMER RECEIPT\");\n console.log(\"--------------------------------------------------------\");\n console.log(\"You bought: \"+product);\n console.log(\"Price: $\"+price);\n console.log(\"Units: \"+unit);\n console.log(\"Total price: $\"+total);\n console.log(\"--------------------------------------------------------\");\n}", "title": "" }, { "docid": "ac735e1944e46db9dca44c10f460038a", "score": "0.52279294", "text": "function newNumbers() {\n\t\tNUMBERTOMATCH = Math.ceil(Math.random() * 110);\n\t\tcrystal1Val = Math.ceil(Math.random() * 15);\n\t\tcrystal2Val = Math.ceil(Math.random() * 15);\n\t\tcrystal3Val = Math.ceil(Math.random() * 15);\n\t\tcrystal4Val = Math.ceil(Math.random() * 15);\n\t}", "title": "" }, { "docid": "2a741a31aa61117e514069a4d04aa448", "score": "0.5218712", "text": "cost(x) { // cost for buying xth buyable, can be an object if there are multiple currencies\n let multiplier = new Decimal(30)\n return multiplier\n }", "title": "" }, { "docid": "2a741a31aa61117e514069a4d04aa448", "score": "0.5218712", "text": "cost(x) { // cost for buying xth buyable, can be an object if there are multiple currencies\n let multiplier = new Decimal(30)\n return multiplier\n }", "title": "" }, { "docid": "2a741a31aa61117e514069a4d04aa448", "score": "0.5218712", "text": "cost(x) { // cost for buying xth buyable, can be an object if there are multiple currencies\n let multiplier = new Decimal(30)\n return multiplier\n }", "title": "" }, { "docid": "2a741a31aa61117e514069a4d04aa448", "score": "0.5218712", "text": "cost(x) { // cost for buying xth buyable, can be an object if there are multiple currencies\n let multiplier = new Decimal(30)\n return multiplier\n }", "title": "" }, { "docid": "82bfdcc95a00a76ee33c1a0d95d266eb", "score": "0.5218408", "text": "function calculateBill(item, quant, tip){\n var unitprice, netamount, taxrate = 5, taxamount, totalPrice, discount = 0\n var date = new Date()\n var today = date.getDay()\n for(key in menu){\n if (key === item){\n unitprice = menu[key]\n break \n }\n }\n netamount = unitprice * quant\n taxamount = netamount * 0.05 \n if(today === 3 && netamount > 150){\n discount = 70\n } \n totalPrice = netamount + taxamount - discount + Number(tip)\n values.push(cnt, item, unitprice, quant, netamount, taxrate, taxamount, Number(tip), discount, totalPrice)\n if(cnt===1){\n createTable()\n }\n addItemIntoTable()\n}", "title": "" }, { "docid": "9a0079b3c3b86e1bfe0fcf1446d7c050", "score": "0.52179796", "text": "_devFee(amount) {\n let dev_fee = new Float64(amount).multi(new Float64('0.5')).toFixed(8).toString(); //half to each person\n blockchain.callWithAuth('token.iost', 'transfer', [\n 'iost',\n blockchain.contractName(),\n 'kingofiost', //MC's account direct deposit\n dev_fee,\n 'Sent ' + dev_fee + ' IOST for Developers.'\n ]);\n blockchain.callWithAuth('token.iost', 'transfer', [\n 'iost',\n blockchain.contractName(),\n 'dividends', //Justin's account direct deposit\n dev_fee,\n 'Sent ' + dev_fee + ' IOST for Developers.'\n ]);\n }", "title": "" }, { "docid": "cb74af3940812cc178aad08d04336bfa", "score": "0.52097005", "text": "function generateMonthlyBudget() {\n const monthlyBudget = [400, 600, 800, 1000];\n return monthlyBudget[Math.floor(Math.random() * monthlyBudget.length)];\n}", "title": "" }, { "docid": "be97a48c1feda5eb93e44e6580d83bbd", "score": "0.52072734", "text": "function myMarket() {\n var itemArr = invenCopy(false);\n var maxQuant = []; //used so you can't add more items than you have to your market\n var parent = document.getElementById('container');\n\n while (parent.hasChildNodes()) { //deletes anything currently in the users \"add to market\"\n parent.removeChild(parent.firstChild);\n }\n\n if (maxQuant.length === 0) { //sets maxQuant if not already\n for (var a = 0; a < itemArr.length; a++) {\n maxQuant.push(parseInt(itemArr[a].split(' ')[0]));\n }\n }\n\n for (var b = 0; b < itemArr.length-1; b++) { //loop that dynamically generates html via javascript and gives these elements unique id's\n var newDiv = document.createElement('div');\n newDiv.className = \"gridItem col-lg col-sm-4 col-6 col-xs-12\";\n\n var amountType = document.createElement('p');\n amountType.innerText = `${itemArr[b].split(' ')[0]}/${maxQuant[b]} ${itemArr[b].replace(/[0-9]|\\/|/g, '').trim()}`;\n amountType.setAttribute('id', 'typeID' + b);\n amountType.setAttribute('class', \"dt\");\n\n var up = document.createElement('p');\n up.innerText = '▲';\n up.setAttribute('id', 'upID~' + b);\n up.setAttribute('class', \"clickable dt\");\n\n var down = document.createElement('p');\n down.innerText = '▼';\n down.setAttribute('id', 'downID~' + b);\n down.setAttribute('class', \"clickable dt\");\n\n var input = document.createElement('input');\n input.type = 'number';\n input.setAttribute('id', 'input~' + b);\n amountType.setAttribute('class', \"dt\");\n input.value = itemType(itemArr[b].replace(/[0-9]|\\/|/g, '').trim())*itemArr[b].split(' ')[0];\n\n var confirm = document.createElement('button');\n confirm.innerText = 'Advertise';\n confirm.setAttribute('id', 'confirm~' + b);\n confirm.setAttribute('class', \"confirmBtn\");\n\n newDiv.appendChild(up);\n newDiv.appendChild(amountType);\n newDiv.appendChild(down);\n newDiv.appendChild(input);\n newDiv.appendChild(confirm);\n document.getElementById('container').appendChild(newDiv);\n }\n\n for (var c = 0; c < itemArr.length-1; c++) { //a simular for loop is needed to reference different id's to add listeners\n document.getElementById('upID~' + c).addEventListener('click', function() { //up button to increment quantity by + 1\n var itemOrderNum0 = parseInt(this.id.split('~')[1]);\n var amountOrig = parseInt(itemArr[itemOrderNum0].split(' ')[0]);\n\n if (amountOrig < maxQuant[itemOrderNum0]) {\n itemArr[itemOrderNum0] = `${amountOrig+1}/${maxQuant[itemOrderNum0]} ${itemArr[itemOrderNum0].replace(/[0-9]|\\/|/g, '').trim()}`;\n document.getElementById('input~' + itemOrderNum0).value = itemType(itemArr[itemOrderNum0].replace(/[0-9]|\\/|/g, '').trim())*(amountOrig+1);\n } else {\n itemArr[itemOrderNum0] = `${amountOrig}/${maxQuant[itemOrderNum0]} ${itemArr[itemOrderNum0].replace(/[0-9]|\\/|/g, '').trim()}`;\n document.getElementById('input~' + itemOrderNum0).value = itemType(itemArr[itemOrderNum0].replace(/[0-9]|\\/|/g, '').trim())*amountOrig;\n }\n\t document.getElementById('typeID' + itemOrderNum0).innerHTML = itemArr[itemOrderNum0];\n })\n\n document.getElementById('downID~' + c).addEventListener('click', function() { //down button to increment quantity by - 1\n var itemOrderNum1 = parseInt(this.id.split('~')[1]);\n var amountOrig1 = parseInt(itemArr[itemOrderNum1].split(' ')[0]);\n\n if (amountOrig1 > 1) {\n itemArr[itemOrderNum1] = `${amountOrig1-1}/${maxQuant[itemOrderNum1]} ${itemArr[itemOrderNum1].replace(/[0-9]|\\/|/g, '').trim()}`;\n document.getElementById('input~' + itemOrderNum1).value = itemType(itemArr[itemOrderNum1].replace(/[0-9]|\\/|/g, '').trim())*(amountOrig1 - 1);\n } else {\n itemArr[itemOrderNum1] = `${amountOrig1}/${maxQuant[itemOrderNum1]} ${itemArr[itemOrderNum1].replace(/[0-9]|\\/|/g, '').trim()}`;\n document.getElementById('input~' + itemOrderNum1).value = itemType(itemArr[itemOrderNum1].replace(/[0-9]|\\/|/g, '').trim())*(amountOrig1);\n }\n\t document.getElementById('typeID' + itemOrderNum1).innerHTML = itemArr[itemOrderNum1];\n })\n\n document.getElementById('confirm~' + c).addEventListener('click', function() { //advertise button to put on the users live market\n var itemOrderNum0 = parseInt(this.id.split('~')[1]);\n var value = document.getElementById('input~' + itemOrderNum0).value;\n var div = document.getElementById(\"myLiveItems\");\n var nodeList = div.getElementsByTagName(\"div\").length;\n\n if (value < 0) {\n document.getElementById('input~' + itemOrderNum0).value = 0;\n } else if (nodeList < 6) {\n if(nodeList == 4) {\n var el = document.getElementById(\"alert-oneMoreSlot\");\n el.style.display = \"block\";\n setTimeout(function(){\n $(\"#alert-oneMoreSlot\").fadeOut();\n }, 2000);\n }\n var type = document.getElementById('typeID' + itemOrderNum0).innerHTML;\n switch (type.replace(/[0-9]|\\/|/g, '').trim()) {\n case 'Wood':\n hostAppend(itemOrderNum0, type, 'Wood', value);\n localStorage.woodSave = Number(localStorage.woodSave) - parseInt(type.split('/')[0]);\n break;\n case 'Brick':\n hostAppend(itemOrderNum0, type, 'Brick', value);\n localStorage.brickSave = Number(localStorage.brickSave) - parseInt(type.split('/')[0]);\n break;\n case 'Steel':\n hostAppend(itemOrderNum0, type, 'Steel', value);\n localStorage.steelSave = Number(localStorage.steelSave) - parseInt(type.split('/')[0]);\n break;\n case 'Silver':\n hostAppend(itemOrderNum0, type, 'Silver', value);\n localStorage.silverSave = Number(localStorage.silverSave) - parseInt(type.split('/')[0]);\n break;\n case 'Gold':\n hostAppend(itemOrderNum0, type, 'Gold', value);\n localStorage.goldSave = Number(localStorage.goldSave) - parseInt(type.split('/')[0]);\n break;\n case 'Platinum':\n hostAppend(itemOrderNum0, type, 'Platinum', value);\n localStorage.platinumSave = Number(localStorage.platinumSave) - parseInt(type.split('/')[0]);\n break;\n case 'Cell Phone':\n hostAppend(itemOrderNum0, type, 'Cell Phone', value);\n localStorage.cellPhoneSave = Number(localStorage.cellPhoneSave) - parseInt(type.split('/')[0]);\n break;\n case 'Computer':\n hostAppend(itemOrderNum0, type, 'Computer', value);\n localStorage.computerSave = Number(localStorage.computerSave) - parseInt(type.split('/')[0]);\n break;\n case 'Electronics Store':\n hostAppend(itemOrderNum0, type, 'Electronics Store', value);\n localStorage.electronicsStoreSave = Number(localStorage.electronicsStoreSave) - parseInt(type.split('/')[0]);\n break;\n case 'Computer Store':\n hostAppend(itemOrderNum0, type, 'Computer Store', value);\n localStorage.computerStoreSave = Number(localStorage.computerStoreSave) - parseInt(type.split('/')[0]);\n break;\n case 'Cafe':\n hostAppend(itemOrderNum0, type, 'Café', value);\n localStorage.cafeSave = Number(localStorage.cafeSave) - parseInt(type.split('/')[0]);\n break;\n case 'Restaurant':\n hostAppend(itemOrderNum0, type, 'Restaurant', value);\n localStorage.restaurantSave = Number(localStorage.restaurantSave) - parseInt(type.split('/')[0]);\n break;\n }\n localStorage.totalItems = Number(localStorage.totalItems) - parseInt(type.split('/')[0]);\n myMarket();\n document.getElementById('inventory').innerHTML = invenCopy(false);\n } else {\n var el = document.getElementById(\"alert-notEnoughSlots\");\n el.style.display = \"block\";\n setTimeout(function(){\n $(\"#alert-notEnoughSlots\").fadeOut();\n }, 2000);\n }\n })\n }\n}", "title": "" }, { "docid": "c505e87518592dcfeca94c3889d346df", "score": "0.5198548", "text": "async function createToken () {\n // Deploy a token contract\n try {\n const tokenAccount = await eoslime.Account.createRandom();\n tokenContract = await eoslime.Contract.deployOnAccount(TOKEN_WASM_PATH, TOKEN_ABI_PATH, tokenAccount);\n await tokenContract.actions.create([faucetAccount.name, TOTAL_SUPPLY]);\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "f2f3e85d46a3cc2c41850d126f76105b", "score": "0.5195308", "text": "async function createLimitOrder(e) {\n e.preventDefault();\n setFormError(\"\");\n const side = e.target.elements[0].value;\n const amount = e.target.elements[1].value;\n const price = e.target.elements[2].value;\n try {\n await dex.methods\n .createLimitOrder(\n library.utils.fromAscii(currTicker),\n amount,\n price,\n side\n )\n .send({ from: account });\n await updateBalances();\n await updateOrderBook();\n } catch (e) {\n setFormError(e.message);\n }\n }", "title": "" }, { "docid": "f857a5ecf4cd5082ac87d0993b24f07e", "score": "0.51897556", "text": "function checkCashRegister(price, cash, cid) {\n //setup\n var change= cash-price;\n var count=0;\n var totalCid = 0;\n var face = \n [[\"PENNY\", 0.01],\n [\"NICKEL\", 0.05],\n [\"DIME\", 0.1],\n [\"QUARTER\", 0.25],\n [\"ONE\", 1],\n [\"FIVE\", 5],\n [\"TEN\", 10],\n [\"TWENTY\", 20],\n [\"ONE HUNDRED\", 100]];\n \n var template = [];\n var result = [];\n var changeTest = [];\n \n //check if change is greater than cid total\n for (i=0;i<cid.length;i++){\n totalCid += cid[i][1];\n }\n \n if (totalCid < change){\n return \"Insufficient Funds\";\n }\n \n //check if change is euqal to cid total\n if (totalCid == change){\n return \"Closed\";\n }\n \n \n for (i=face.length-1;i>=0;i--){\n count ++;\n if (change % face[i][1] != change){\n var value = Math.floor(change/face[i][1])*face[i][1];\n if (value > cid[i][1]){\n value = cid[i][1];\n }\n \n result.push([face[i][0],value]);\n change -= value;\n change = round(change,2);\n changeTest.push(change);\n }\n \n // check for insufficeint Funds again\n if(i == 0 && change !=0){\n return \"Insufficient Funds\";\n }\n }\n \n //rounding function\n function round(number, precision) {\n var shift = function (number, precision, reverseShift) {\n if (reverseShift) {\n precision = -precision;\n } \n var numArray = (\"\" + number).split(\"e\");\n return +(numArray[0] + \"e\" + (numArray[1] ? (+numArray[1] + precision) : precision));\n };\n return shift(Math.round(shift(number, precision, false)), precision, true);\n}\n \n \n // Here is your change, ma'am.\n \n return result;\n}", "title": "" }, { "docid": "aff322a77f1aa2b3e2aa0707b92a9b9c", "score": "0.5185857", "text": "function exchange(debt, arr_NumOfBills, arr_PriceOfCurrency) {\n\n let count = 0;\n\n // x = number of Dirham bill\n // y = number of Euro bill\n // z = number of deram bill\n\n let x = arr_NumOfBills[0]\n let y = arr_NumOfBills[1]\n let z = arr_NumOfBills[2]\n\n // a = price of Dirham bill\n // b = price of Euro bill\n // c = price of Dollar bill\n\n let a = arr_PriceOfCurrency[0]\n let b = arr_PriceOfCurrency[1]\n let c = arr_PriceOfCurrency[2]\n\n // console.log(typeof debt)\n\n if (debt < 1 || debt > 100000 || typeof (debt) !== \"number\")\n return console.log(\" please input an integer between 1 and 100000\")\n if ( 0 > x > 5000 || 0 > y > 5000 || 0 > z > 5000 || typeof (x) !== \"number\" || typeof (y) !== \"number\" || typeof (z) !== \"number\")\n return console.log(\" number of bills don't input correctly\")\n if ( toString.call(arr_NumOfBills) !== \"[object Array]\")\n return console.log(\" please input the numbers of bills in an array\")\n if ( 1 > a || a > 100000 || 1 > b || b > 100000 || 1 > c || c > 100000 || typeof (a) !== \"number\" || typeof (b) !== \"number\" || typeof (c) !== \"number\")\n return console.log(\" prices of currencies don't input correctly\")\n if ( toString.call(arr_NumOfBills) !== \"[object Array]\")\n return console.log(\" please enter the price of currencies in an array\")\n for (i = 0; i <= x; i++) {\n for (j = 0; j <= y; j++) {\n for (k = 0; k <= z; k++) {\n if (\n (i * a) + (j * b) + (k * c) === debt\n ) {\n count += 1\n console.log(\"Dirham: %s , Euro: %s , Dollar: %s\", i, j, k)\n }\n }\n }\n }\n console.log(\"Ali has %s way to pay his debt \\n ********************** \", count)\n}", "title": "" }, { "docid": "2806ace9316d314f6d12eb313cc2647b", "score": "0.5183125", "text": "function generate(t, n) {\n\n var max = n*(n+1)/2;\n var list = [], sum = 0, i = n;\n while(i--){\n var r = Math.random();\n list.push(r);\n sum += r;\n }\n var factor = t / sum;\n sum = 0;\n i = n;\n while(--i){\n list[i] = parseInt(factor * list[i], 10);\n sum += list[i];\n }\n list[0] = t - sum;\n console.log('list', list);\n return list;\n}", "title": "" }, { "docid": "41a81319684459da12533ef8d69b1925", "score": "0.51826435", "text": "function coinCombo(cents) {\n return 'TODO'\n}", "title": "" }, { "docid": "ff5f17bd23c7f99efaa5770bf67fb316", "score": "0.5173072", "text": "function payees_by_amount(ledger, limit) {\n return ledger.query().then(function (entries) {\n var sums = entries.transactions.reduce(function (val, transaction) {\n var sum = transaction.postings.reduce(function (sum, posting) {\n var amount = posting.amount;\n if (amount.commodity === '€') {\n sum = sum.plus(amount.quantity);\n }\n return sum;\n }, new BigNum(0));\n\n if (val[transaction.payee] === undefined) {\n val[transaction.payee] = sum;\n } else {\n val[transaction.payee] = val[transaction.payee].plus(sum);\n }\n\n return val;\n }, {});\n\n Object.keys(sums).forEach(function (key) {\n sums[key] = parseFloat(sums[key]);\n });\n\n return top_contributors(sums, limit).map(function (e) {\n return {\n name: e.key,\n total: sums[e.key],\n unit: '€'\n };\n });\n });\n}", "title": "" }, { "docid": "5358d500efb80932957f5236d5bd81f2", "score": "0.5172474", "text": "function genRandomPrice() {\n return Math.round(Math.random() * (5 - 3) + 3);\n}", "title": "" }, { "docid": "d0544cf3b0877f1af43518d37bbcfe9d", "score": "0.5172071", "text": "_calcChipsReceived(iostamount, token_price) {\n let have = iostamount;\n blockchain.receipt(JSON.stringify({\n iostamount:iostamount\n }));\n let inc = new Float64('0.0000001'); //.1 per million\n let price = token_price;\n let a = new Float64(inc).div(new Float64(2));\n let x = this._solve(a, new Float64(price).plus(new Float64(a)), new Float64(price).minus(new Float64(have)))\n // let x = this._solve(inc*.5,price+.5*inc,price-have)\n return x;\n\n }", "title": "" }, { "docid": "6cc633820e685f79a8afe5b21cfcbc29", "score": "0.51669157", "text": "siguiente() {\n // aumentamos en 1 el último ticket\n this.ultimo += 1;\n\n // Creamos un nuevo ticket\n let ticket = new Ticket(this.ultimo, null);\n // lo añadims al arreglo de tickets\n this.tickets.push(ticket);\n\n this.grabarArchivo();\n\n return `Ticket ${ this.ultimo }`;\n }", "title": "" }, { "docid": "ef7a20ee74dee69005968f0adf07fba1", "score": "0.5161504", "text": "function addTransaction(id, amount) {\r\n const price = countPrice(id)\r\n const name = coffees[id].name\r\n const sum = price * amount\r\n transactions.push({\r\n id,\r\n name,\r\n amount,\r\n price,\r\n sum\r\n })\r\n\r\n}", "title": "" }, { "docid": "70854d9e81773a5ad9ce080aeea7c79c", "score": "0.5152517", "text": "function generateWeeklyBudget() {\n const weeklyBudget = [100, 150, 175, 200];\n return weeklyBudget[Math.floor(Math.random() * weeklyBudget.length)];\n}", "title": "" }, { "docid": "5ab0f900bba7671fe68a436287fe8348", "score": "0.5148598", "text": "function main() {\n \n var today = new Date();\n var yesterday = new Date(new Date().setDate(new Date().getDate()-durationInDays));\n // yyyy-mm-dd quick hack\n var range = yesterday.toISOString().substring(0, 10);\n //console.log(range);\n \n var newTickets = getNewTickets(username, projectname, range);\n var modTickets = getUpdatedTickets(username, projectname, range);\n \n console.log(\"<h2>Summary for tickets from \"+yesterday.toISOString()+\" to \"+today.toISOString()+\"</h2>\");\n var ids = {}; // track already used ids\n printNewTickets(newTickets, username, projectname, ids);\n printUpdatedTickets(modTickets, username, projectname, ids);\n \n}", "title": "" }, { "docid": "b0d2dfba56182f9f128d8f398c182aef", "score": "0.51325536", "text": "async createToken(gasPrice, gasLimit, value) {\n var tokenowner;\n while (tokenowner != \"0x0000000000000000000000000000000000000000\") {\n var tokenid = bigInt.randBetween(\"0\", \"1e15\").toString();\n tokenowner = await this.contract.methods.ownerOf(tokenid).call({\n from: this.account\n });\n }\n\n var sendOptions = {};\n sendOptions.from = this.account;\n sendOptions.data = this.contract.methods.create_token(this.account).encodeABI();\n sendOptions.to = this.contract.options.address;\n //sendOptions.gasPrice = gasPrice;\n //sendOptions.gasLimit = gasLimit;\n var price = await this.contract.methods.getMakingPrice().call({\n from: this.account\n });\n sendOptions.value = price;\n\n this.web3.eth.sendTransaction(sendOptions);\n\n return new Promise(function(resolve, reject) {\n this.contract.once(\"NewbornFish\", function(error, event) {\n if (error != null) {\n reject(error);\n } else {\n resolve(event.returnValues);\n }\n });\n }.bind(this));\n }", "title": "" }, { "docid": "c3d26e411d87f96c6ec9a3b9451aaae5", "score": "0.51302415", "text": "function multiTable(multiple,maxProduct){\r\n // let multiple = 6;\r\n // let counter = 1;\r\n // while(counter <= 20){\r\n // console.log(`${counter} x ${multiple} = ${counter*multiple}`);\r\n // counter++; // counter = counter + 1;\r\n // }\r\n for(let counter = 1; counter <= maxProduct; counter++){\r\n console.log(`${counter} x ${multiple} = ${counter*multiple}`);\r\n }\r\n}", "title": "" }, { "docid": "a011101aec0e7364bf3e3c892ded9540", "score": "0.5122729", "text": "sendBidsAndAsks() {\n for (let i = 0, l = this.markets.length;i < l;++i) {\n let market = this.markets[i];\n let unitValue = this.unitValueFunction(market.goods, this.inventory);\n if (unitValue > 0) {\n if (this.ignoreBudgetConstraint)\n unitValue = this.maxPrice;\n let myPrice = this.bidPrice(unitValue, market); // calculate my buy price proposal\n if (myPrice){\n this.bid(market, myPrice); // send my price proposal\n }\n }\n let unitCost = this.unitCostFunction(market.goods, this.inventory);\n if (unitCost > 0) {\n if (this.ignoreBudgetConstraint)\n unitCost = this.minPrice;\n let myPrice = this.askPrice(unitCost, market); // calculate my sell price proposal\n if (myPrice){\n this.ask(market, myPrice); // send my price proposal\n }\n }\n }\n }", "title": "" }, { "docid": "0b4f841f0cec3958bb9c29a61c3ce591", "score": "0.51217026", "text": "function generateNumber(startnum, category, notnum) {\n let lucky;\n randnum = deleteNotNum(notnum);\n work = deleteLuckyNotNum(notnum, work);\n love = deleteLuckyNotNum(notnum, love);\n wealth = deleteLuckyNotNum(notnum, wealth);\n merchan = deleteLuckyNotNum(notnum, merchan);\n tech = deleteLuckyNotNum(notnum, tech);\n edu = deleteLuckyNotNum(notnum, edu);\n if (category.value == \"Work\") {\n lucky = randomnumber(work, startnum, randnum);\n } else if (category.value == \"Love\") {\n lucky = randomnumber(love, startnum, randnum);\n } else if (category.value == \"Wealth\") {\n lucky = randomnumber(wealth, startnum, randnum);\n } else if (category.value == \"Merchandising\") {\n lucky = randomnumber(merchan, startnum, randnum);\n } else if (category.value == \"Technology\") {\n lucky = randomnumber(tech, startnum, randnum);\n } else if (category.value == \"Education/Wiseness\") {\n lucky = randomnumber(edu, startnum, randnum);\n }\n return lucky;\n}", "title": "" }, { "docid": "ebbc3fcc7280d43dd70d502c924af45e", "score": "0.510333", "text": "addAvailableTickets (typ, price) {\n const ticket1 = new Ticket(typ, price);\n this.availableTickets.push(ticket1); \n }", "title": "" }, { "docid": "b8ae5fca2decf02b137d786d56c74844", "score": "0.51011187", "text": "function pumpIt () {\n const oneHundredThousand = 10e5;\n const acc = [];\n\n for(let i = 0; i < 10; i++) {\n acc.concat(generateNumbers((i * oneHundredThousand) + 1, ((i + 1) * oneHundredThousand)));\n }\n\n return acc;\n}", "title": "" }, { "docid": "5df73027f64525349412a1c5906107d8", "score": "0.510018", "text": "function mSlotGenBig() {\n var mBigItems = ['Electronics Store', 'Computer Store', 'Café', 'Restaurant'];\n var rarity, firstWord, index, price;\n var repeat = false;\n\n var el = document.getElementById(\"bMSlot0\");\n\n do {\n rarity = Math.random() * 10;\n firstWord = el.innerHTML.replace(\"<strike>\", '').split(' ')[0];\n\n if(rarity < 4) {\n if(firstWord == \"Electronics\")\n repeat = true;\n else {\n index = 0;\n repeat = false;\n }\n }\n else if(rarity < 7) {\n if(firstWord == \"Computer\")\n repeat = true;\n else {\n index = 1;\n repeat = false;\n }\n }\n else if(rarity < 9) {\n if(firstWord == \"Café\")\n repeat = true;\n else {\n index = 2;\n repeat = false;\n }\n } else {\n if(firstWord == \"Restaurant\")\n repeat = true;\n else {\n index = 3;\n repeat = false;\n }\n }\n\n } while (repeat);\n\n\n price = mBigPriceGen(index);\n el.innerHTML = `${mBigItems[index]} for $${price}`;\n el.value = `1~${mBigItems[index]}~${price}`;\n}", "title": "" }, { "docid": "0cd02ebea39ab0507f46cb938fa2c2ed", "score": "0.50956786", "text": "makeDeposit(amount) { //takes a parameter this is the amount of the deposit\n this.accountBalance += amount; //the specific user's account increases by the amount of the value received\n }", "title": "" }, { "docid": "a647be05f050c948d8b8ce52bbfe6cd8", "score": "0.50935787", "text": "function Coins() {\r\n var amount = Number(prompt(\"Please enter an amount in naira (e.g 10, or 10.5 or 10.50)...\"));\r\n var caption = \"The minimum number of coins that can be used to make \" + amount + \" naira are: \";\r\n amount = Math.floor(amount*100);\r\n document.getElementById(\"placeholder\").innerHTML = caption;\r\n\r\n var dict = {\r\n 200: \"url('CoinAssets/twohundredkobo.jpg')\",\r\n 100: \"url('CoinAssets/hundredkobo.jpg')\",\r\n 50: \"url('CoinAssets/fiftykobo.jpg')\",\r\n 20: \"url('CoinAssets/twentykobo.jpg')\",\r\n 10: \"url('CoinAssets/tenkobo.jpg')\",\r\n 5: \"url('CoinAssets/fivekobo.jpg')\",\r\n 2: \"url('CoinAssets/twokobo.jpg')\",\r\n 1: \"url('CoinAssets/onekobo.jpg')\"\r\n };\r\n var list = [200, 100, 50, 20, 10, 5, 2, 1];\r\n var i=0;\r\n\r\n for (var key = 0; key < list.length; key++) {\r\n while (Math.floor(amount/list[key]) >= 1 && amount!=0) {\r\n \r\n // new table row after 6 columns\r\n if (i%6==0) {\r\n tr();\r\n }\r\n i++;\r\n \r\n td(dict[list[key]]);\r\n amount-=list[key];\r\n }\r\n if (amount==0) {\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ed233dae8bb0f807c7f0e5c77e8f70b2", "score": "0.5092206", "text": "sell(account, amount) {\n let public_start_time = Number(1575583200); //december 5th 2:00pm PST\n let current_time = JSON.parse(blockchain.blockInfo()).time;\n current_time = Number(current_time) / 1000000000\n blockchain.receipt(JSON.stringify({\n current_time: current_time,\n public_start_time: public_start_time\n }));\n if (current_time < public_start_time && account=='fishnchips') { //FRY investment fund may NOT sell until dec 5th 2pm\n throw 'FRY Invesment fund cannot sell yet!'\n }\n if (!blockchain.requireAuth(account, 'active')) {\n throw 'no permission!';\n }\n //safety checks.\n if (!storage.has(account + '_chips')) {\n throw 'no chips owned'\n }\n if (new Float64(amount).lt(new Float64(1))) {\n throw 'must sell at least 1 chip.'\n }\n let current_chips = new Float64(storage.get(account + '_chips'));\n if (storage.has(account + '_fish')) {\n current_chips = new Float64(current_chips).minus(new Float64(storage.get(account + '_fish')));\n }\n if (isNaN(current_chips) || new Float64(current_chips).lte(new Float64(0))) {\n throw 'invalid amount of chips, cannot sell.'\n }\n let new_balance = new Float64(current_chips).minus(new Float64(amount));\n if (new Float64(new_balance).lt(new Float64('0'))) {\n throw 'cannot sell more chips than you own!'\n }\n blockchain.receipt(JSON.stringify({\n new_balance: new_balance,\n current_chips: current_chips,\n amount: amount\n }));\n //end safety checks\n //Eject all divs to wallet before selling.\n let mychips = new Float64(storage.get(account + '_chips'));\n let mydivs = mychips.multi(new Float64(storage.get('profitPerShare')));\n let myclaimed = new Float64(storage.get(account + '_claimed'));\n if (Math.ceil(myclaimed) < Math.floor(mydivs)) {\n this.claimchipdivs(account); //ensures the max ratio claimed before reduction\n }\n //You cannot sell FISH.\n //reduce claimed by amount of chips sold * profitPerShare.\n let amount_to_reduce = new Float64(storage.get('profitPerShare')).multi(new Float64(amount));\n storage.put(account + '_claimed', new Float64(storage.get(account + '_claimed')).minus(new Float64(amount_to_reduce)).toFixed(8).toString());\n //deduct balance first\n storage.put(account + '_chips', new Float64(storage.get(account + '_chips')).minus(new Float64(amount)).toFixed(8).toString())\n //reduce the supply of chips\n let new_supply = new Float64(storage.get('chipsCurrSupply')).minus(new Float64(amount)).toFixed(8).toString();\n storage.put('chipsCurrSupply', new_supply)\n //calc iost received\n let iost_to_receive = this._calcIOSTReceived(amount, storage.get('tokenPrice'));\n //reduce the token price\n this._decreasePrice(iost_to_receive);\n this._reduceIOSTCounter(iost_to_receive);\n blockchain.receipt(JSON.stringify({\n iost_to_receive: iost_to_receive,\n new_supply: new_supply\n }));\n let fryFee = new Float64(iost_to_receive).multi(new Float64('0.01')).toFixed(8).toString(); //1 percent fry investment fund\n this._fryInvestmentFund(fryFee);\n let devFee = new Float64(iost_to_receive).multi(new Float64('0.01')).toFixed(8).toString(); //1 percent dev fee\n this._devFee(devFee);\n let dividends = new Float64(iost_to_receive).multi(new Float64('0.08')).toFixed(8).toString(); //8 percent dividends\n this._payDividends(account, dividends);\n let buybackFee = new Float64(iost_to_receive).multi(new Float64('0.01')).toFixed(8).toString(); //1 percent B&B + B&D\n this._buyBack(buybackFee);\n iost_to_receive = new Float64(iost_to_receive).minus(new Float64(fryFee)); //subtract out the fry fee.\n iost_to_receive = new Float64(iost_to_receive).minus(new Float64(devFee)); //subtract out the dev fee.\n iost_to_receive = new Float64(iost_to_receive).minus(new Float64(dividends)); //subtract out the dividends.\n iost_to_receive = new Float64(iost_to_receive).minus(new Float64(buybackFee)).toFixed(8).toString(); //subtract out the buyback fee\n //transfer iost here\n blockchain.callWithAuth('token.iost', 'transfer', [\n 'iost',\n blockchain.contractName(),\n account,\n iost_to_receive,\n 'Sold ' + amount + ' chips for ' + iost_to_receive + ' IOST.'\n ]);\n\n }", "title": "" }, { "docid": "c53109ce26dd11b8b848214eafae89c4", "score": "0.5089131", "text": "function createRandomNumber() {\n for (let i = 0; i < 4; i++) {\n realNumber[i] = (Math.floor((Math.random()*6)+1))\n }\n}", "title": "" }, { "docid": "b784953f25f4fb72c1c2f2e98c86179e", "score": "0.5082958", "text": "function buyTick() {\n if (nutrients >= tickCost && ticks < maxMinions) {\n nutrients -= tickCost;\n ticks += 1;\n\n calculateCostTick();\n updateStats();\n\n //TODO: Make this a variables\n nutrientsPerClick += 1;\n\n let tick = new Tick(getRandom(100, gameWidth), getRandom(0, 200));\n arrayTicks.push(tick);\n gameScene.addChild(tick);\n }\n}", "title": "" }, { "docid": "0167d476b66de1580887761d88f38f8d", "score": "0.5080726", "text": "function coins(price) {\n let cents = price * 100\n const coins_available = [100,50,20,10,5,2,1]\n const coins_needed = []\n\n const combination = coins_available.forEach(function(element) {\n if(cents/element > 0){ \n Array(Math.floor(cents/element)).fill(element).forEach(function(i){\n coins_needed.push(i)\n })\n cents = cents - (Math.floor(cents/element) * element ) \n }\n });\n \n return coins_needed\n}", "title": "" }, { "docid": "159ed3d22ee1b1953a388c7a6ff83f5e", "score": "0.5076919", "text": "scheduleTransaction(uid, period, crypto, crypto_address, amount) {\n }", "title": "" }, { "docid": "cee2a68e701745413e5a4346f39d2176", "score": "0.5076735", "text": "function buy(string account, int value){\n\tconst result = await api.transact({\n actions: [{\n account: \"dividence\",\n name: actionName,\n authorization: [{\n actor: account,\n permission: 'active',\n }],\n data: value,\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n });\n}", "title": "" }, { "docid": "0a10908a723c3093fb1764e43bcefa24", "score": "0.5073302", "text": "function generateCarton(numbers) {\n // El parámetro de entrada nos indicará cuántos números tendrá el cartón\n let carton = [];\n while(carton.length < numbers){\n let randomN = Math.floor(Math.random() * 90 + 1);\n let existe = false;\n for(let i = 0; i < carton.length; i++){\n if(carton[i] == randomN) {\n existe = true;\n }\n }\n if(!existe){\n carton[carton.length] = randomN;\n }\n }\n return carton;\n}", "title": "" }, { "docid": "5bcd00f720c7e3e4308da1b2a2681e5c", "score": "0.5072608", "text": "_mintChips(account, amount, token_price, chips_curr_supply, ambassador, self_dividends) {\n if (!storage.has(account + '_chips')) {\n storage.put(account + '_chips', '0');\n }\n let chips_owned = storage.get(account + '_chips');\n if (isNaN(chips_owned)) {\n storage.put(account + '_chips', '0');\n chips_owned = '0';\n }\n let chips_to_receive = '0';\n if (ambassador) {\n chips_to_receive = new Float64(amount).div(new Float64('0.75')).toFixed(8).toString();\n } else {\n chips_to_receive = this._calcChipsReceived(amount, token_price);\n }\n if (new Float64(chips_to_receive).lt(new Float64(1))) {\n throw 'you must buy at least 1 CHIPS!';\n }\n let sum = new Float64(chips_owned).plus(new Float64(chips_to_receive)).toFixed(8).toString();\n storage.put(account + '_chips', sum)\n\n //subtract the profitPerShare from your own dividends. You don't receive divs on your own buy.\n if (!storage.has(account + '_claimed')) {\n storage.put(account + '_claimed', '0');\n }\n let claimed = storage.get(account + '_claimed');\n if (isNaN(new Float64(claimed))) {\n storage.put(account + '_claimed', '0');\n }\n claimed = storage.get(account + '_claimed');\n\n let selfclaim = new Float64(claimed).plus(new Float64(storage.get('profitPerShare')).multi(new Float64(chips_to_receive))).toFixed(8).toString()\n storage.put(account + '_claimed', selfclaim)\n //next part\n\n let new_supply = new Float64(chips_curr_supply).plus(new Float64(chips_to_receive)).toFixed(8).toString();\n storage.put('chipsCurrSupply', new_supply)\n blockchain.receipt(JSON.stringify({\n chips_to_receive: chips_to_receive,\n chips_owned: sum,\n chipsCurrSupply: new_supply,\n self_dividends: self_dividends,\n selfclaim: selfclaim,\n claimed: claimed,\n }));\n return chips_to_receive;\n }", "title": "" }, { "docid": "780d5ba64b4cde9907289dcaf8a7288c", "score": "0.507189", "text": "function tickets(peopleInLine) {\n let arr = [0, 0];\n for (var i = 0; i < peopleInLine.length; i++) {\n switch (peopleInLine[i]) {\n case 25:\n arr[0]++;\n break;\n case 50:\n [arr[0]--, arr[1]++];\n break;\n default:\n (arr[1]) ? arr[1]-- : arr[0] -= 2;\n arr[0]--;\n break;\n }\n if (arr[0] < 0) {\n return 'NO';\n }\n }\n\n return 'YES';\n}", "title": "" }, { "docid": "1e466bb2e805a60f6613a62de49478c7", "score": "0.50692946", "text": "atenderTicket(escritorio) {\n\n if (this.tickets.length === 0) {\n\n return 'No hay mas tickets';\n\n /*return status(400).json({\n ok: false,\n error: {\n message: 'No hay Tickets'\n }*/\n }\n\n let numeroTicket = this.tickets[0].numero; // mromper js q todo los datos son pasadopor referncia \n //luego borrar elnumero ya atendido\n this.tickets.shift();\n //declar estancia de nuevo ticket q voy a atender este recibe el numero del tickert \n let atenderTicket = new Ticket(numeroTicket, escritorio);\n // ponerlo al inicio del array con unshift y mando el valor\n this.ultimos4.unshift(atenderTicket);\n //borrar los q ya van saliendo de\n if (this.ultimos4.length > 4) {\n this.ultimos4.splice(-1, 1); // esto borra el ultimo numero\n }\n\n console.log('ultimos 4');\n console.log(this.ultimos4);\n\n // luego guardar en el bd de text\n this.grabarArchivo();\n\n return atenderTicket;\n }", "title": "" } ]
862b90487ebf78896ceb94f743035d62
deletes `key` from a clone of object and returns the new object
[ { "docid": "e88ead72e225c8449ee740ee53dd5836", "score": "0.7283593", "text": "function destructivelyDeleteFromObjectByKey(object, key) {\n delete object[key]\n return object\n}", "title": "" } ]
[ { "docid": "d6500ca3becced8b9627ac666d0139da", "score": "0.7405711", "text": "function removeKey(obj, key) {\n\n const outNewObj = { ...obj };\n delete outNewObj[key];\n return outNewObj;\n\n}", "title": "" }, { "docid": "0ddbe96c1bee3f779a2c282706b7c70b", "score": "0.73843974", "text": "function destructivelyDeleteFromObjectByKey(object, key){\n delete object[key]\n return object\n}", "title": "" }, { "docid": "dab339f90759fe2d4859ee259a432f3c", "score": "0.73347306", "text": "function deleteFromObjectByKey(object, key) {\n var temp = Object.assign({}, object, {})\n delete temp[key]\n return temp\n\n}", "title": "" }, { "docid": "b5c0b16ad15b411e8f89a95cf07f982a", "score": "0.72131634", "text": "function deleteFromObjectByKey(object, key){\n var obj = {object:key}\n var newObj = Object.assign({}, obj)\n return newObj\n\n delete newObj[object]\n return obj\n}", "title": "" }, { "docid": "8e115464927f8eebfc50858f4f970e51", "score": "0.71801907", "text": "function removeKey(obj, key) {\n delete obj[key];\n return obj;\n}", "title": "" }, { "docid": "9a3e2428b4d8e850d3cbd2b60fc24fc8", "score": "0.68884355", "text": "getCloned(key) {\n var value = this.data[key];\n return value ? clone(this.data[key]) : null;\n }", "title": "" }, { "docid": "c261a0dd919925695a07fda190e056b1", "score": "0.6836889", "text": "function deleteFromDriverByKey(driver, key){\n // return Object.assign({}, driver);\n const newDriver = Object.assign({}, driver);\n delete newDriver[key];\n return newDriver;\n // - It should delete the key/value pair from a clone of driver and returns the new driver, for the key that was passed in from the driver Object. This should not mutate the driver passed in.\n}", "title": "" }, { "docid": "724c727aa2c8728d395b7d75b6762e40", "score": "0.67456806", "text": "function deleteFromDriverByKey(driver, key) {\n const newDriver = Object.assign({});\n delete newDriver.key;\n return newDriver;\n}", "title": "" }, { "docid": "3c639dc3a46edb00d446eb06ee7de0d2", "score": "0.67058814", "text": "clone(key=false) {\r\n if(!key) {\r\n return Object.assign({}, this.data);\r\n }\r\n \r\n if(Array.isArray(this.data[key])) {\r\n return this.data[key].concat([]);\r\n }\r\n\r\n return Object.assign({}, this.data[key]);\r\n }", "title": "" }, { "docid": "a630ac47850d0c6ad52d58dc35b8dce4", "score": "0.6622045", "text": "unassign( key ) {\n\n _.unset(this, key);\n\n }", "title": "" }, { "docid": "f4bf74eead4218b56a79a62e9866e355", "score": "0.65802974", "text": "function destructivelyDeleteFromDriverByKey(driverObj, key) {\n delete driverObj[key]\n return driverObj\n}", "title": "" }, { "docid": "38eb9ff7ee73db0f196852d12428e946", "score": "0.6497804", "text": "remove(key) {}", "title": "" }, { "docid": "4513a198df002fc04987d7b5930e2204", "score": "0.6496031", "text": "function generalGetClonedObject(key, get) {\n const ob = get(key);\n if (ob === undefined) {\n return ob;\n }\n // Shallow clone,\n const clone = {};\n for (let prop in ob) {\n clone[prop] = ob[prop];\n }\n return clone;\n}", "title": "" }, { "docid": "1261bf9ad19b2e7f87452bfaef032e26", "score": "0.6466852", "text": "function deleteFromDriverByKey(driverObj, key) {\n const newDriverObj = Object.assign({}, driverObj);\n delete newDriverObj[key];\n // => true\n return newDriverObj\n}", "title": "" }, { "docid": "ce14b2a0689db3d49972b04c2b95d42f", "score": "0.6447544", "text": "function getClonedObject(key) {\n return generalGetClonedObject(key, get);\n }", "title": "" }, { "docid": "1549779e3325fa91433d235d46279df0", "score": "0.64261556", "text": "function getClonedObject(key) {\n return generalGetClonedObject(key, get);\n }", "title": "" }, { "docid": "8c5346c4d2a608083b7a6c7f47ee08e8", "score": "0.63290983", "text": "delete(key) {\n delete object[key];\n }", "title": "" }, { "docid": "8c5346c4d2a608083b7a6c7f47ee08e8", "score": "0.63290983", "text": "delete(key) {\n delete object[key];\n }", "title": "" }, { "docid": "ee520791e917460263da5b1a587c8a46", "score": "0.63021344", "text": "function pop(obj, key) {\n\tconst value = obj[key];\n\tdelete obj[key];\n\treturn value;\n}", "title": "" }, { "docid": "adfd6b60d1eaa19914d5072850165f22", "score": "0.6288241", "text": "removeCmp(key) {\n return this;\n }", "title": "" }, { "docid": "6bfeae0d64c3e6c32b26562ceaf7350a", "score": "0.6270624", "text": "function remove() {\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n var obj = this.value(), result = {};\n Object.keys(obj).forEach(function (key) { if (keys.indexOf(key) === -1)\n result[key] = obj[key]; });\n return new lift_1.ObjectOps(result);\n}", "title": "" }, { "docid": "6cd1962d5ad1517d391aed4bf77ad527", "score": "0.6253524", "text": "deleteProperty(key) {\n this.setProperty(key, null);\n return this;\n }", "title": "" }, { "docid": "84ff725c9d3d0915a925b1451d5fab20", "score": "0.6201474", "text": "remove(key) {\n if (this[key] !== undefined) {\n const value = this[key];\n delete this[key];\n return value;\n }\n return undefined;\n }", "title": "" }, { "docid": "9f082efb02e0a51a08b0b276c2f8b109", "score": "0.61684066", "text": "function destructivelyDeleteFromDriverByKey(driver, key) {\n delete driver[key];\n return driver;\n}", "title": "" }, { "docid": "111ceabb1186762827a19ccb2998c48b", "score": "0.60953176", "text": "remove(key)\r\n {\r\n this.table[this.loseloseHashCode(key)] = undefined;\r\n }", "title": "" }, { "docid": "3262f229f6b7b2c5d0365b24d67952e5", "score": "0.6090542", "text": "function remove(key) {\r\n var result = null;\r\n var index = this.contains(key);\r\n if(index != -1) {\r\n this.keys = this.keys.removeAt(index);\r\n this.values = this.values.removeAt(index);\r\n } \r\n return;\r\n}", "title": "" }, { "docid": "7de1ea3d58c01184b26ff06f6c7eebaf", "score": "0.6090053", "text": "remove(key) {\n return new SortedMap(this.comparator_, this.root_.remove(key, this.comparator_).copy(null, null, LLRBNode.BLACK, null, null));\n }", "title": "" }, { "docid": "53d6a872bb9a58dd43281247c4cf6038", "score": "0.6033957", "text": "Unsub(key) {\n return this.s.Unsub(key);\n }", "title": "" }, { "docid": "52ace92993787e9b1626884ebbf5dd9c", "score": "0.6028695", "text": "remove(key) {\n // YOUR WORK HERE\n }", "title": "" }, { "docid": "98902dce749034ec1c0cc39623eb3375", "score": "0.5995646", "text": "remove(key) {\n var res = delete this.data[key];\n fs.writeFileSync(this.path, JSON.stringify(this.data));\n return res;\n // delete is far slower than just setting undefined\n // but may cause problems with the JSON parser\n }", "title": "" }, { "docid": "713c09e2ec5889225f4068171413ff55", "score": "0.59888", "text": "remove(key) {\n // -----------------------------------------------------------\n this.filled--;\n const index = this.map(key);\n const bucket = this.storage.get(index);\n // -----------------------------------------------------------\n if (!bucket || bucket === []) { return undefined; }\n // -----------------------------------------------------------\n let reValue;\n this.storage.set(index, undefined);\n // -----------------------------------------------------------\n const l = bucket.length;\n for (let i = 0; i < l; i++) {\n if (bucket[0] !== key) {\n this.insert(bucket[i]);\n } else {\n reValue = bucket[i];\n }\n }\n return reValue;\n }", "title": "" }, { "docid": "eff4ba41c5435ce340af6cef59d3a292", "score": "0.5968736", "text": "function pick(source, key) {\n var newObj = {};\n\n for (var i = 0; i < key.length; i++) {\n for (var akey in source) {\n if (!akey) {\n break;\n }\n if (source[akey] === undefined) {\n break;\n }\n if (akey === key[i]) {\n newObj[akey] = source[akey];\n break;\n }\n }\n }\n return newObj;\n}", "title": "" }, { "docid": "2811b5a98c8db5994d798a9011a309c8", "score": "0.59365577", "text": "setWipeKey(key) {\n this._body.setWipekey(key._toProtoKey());\n return this;\n }", "title": "" }, { "docid": "6058b3abef2c5fd32dfc3c36e9eef8af", "score": "0.590803", "text": "delete(key) {\r\n\t\tlet id = this.getHash(key, 0);\r\n\t\tlet crr = this.items[id];\r\n\t\tlet i = 1;\r\n\t\twhile(crr != null) {\r\n\t\t\tif(crr != this.delItem) {\r\n\t\t\t\tif(crr.key == key) {\r\n\t\t\t\t\tthis.items[key] = this.delItem;\r\n\t\t\t\t\tthis.count += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\tid = this.getHash(it.key, i);\r\n\t\t\tcrr = this.items[id];\r\n\t\t\ti += 1;\r\n\t\t}\r\n\t\t// We resize down, if load < 0.1\r\n\t\tconst load = this.count * 100 / this.size;\r\n\t\tif(load < 10) this.resizeDown();\r\n\r\n\t\treturn this;\r\n\t}", "title": "" }, { "docid": "ac1ce949101d2b6ae7ba87c8ba92438a", "score": "0.58966845", "text": "function objectOmit (obj, key) {\n if (obj instanceof Object) {\n for (k in obj) {\n if (k === key) {\n delete obj [k];\n } else {\n obj [k] = objectOmit (obj [k], key);\n }\n }\n }\n else if (obj instanceof Array && obj.length >= 1) {\n var i;\n for (i = 0; i < obj.length; i++) {\n obj [i] = objectOmit (obj [i], key);\n }\n }\n return obj;\n}", "title": "" }, { "docid": "07d185e0c71080dc522a7252793816ba", "score": "0.58846724", "text": "function shallowClearAndCopy(src,dst){dst=dst||{},angular.forEach(dst,function(value,key){delete dst[key]});for(var key in src)!src.hasOwnProperty(key)||\"$\"===key.charAt(0)&&\"$\"===key.charAt(1)||(dst[key]=src[key]);return dst}", "title": "" }, { "docid": "16c19af519ef342764681ff6c3b5c8ad", "score": "0.58763605", "text": "function deleteKey(key) {\n first = deleteSpecifiedKey(first, key);\n }", "title": "" }, { "docid": "1bc30f957880e876320db29890197b2c", "score": "0.5873912", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n angular.forEach(dst, function (value, key) {\n delete dst[key];\n });\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n return dst;\n }", "title": "" }, { "docid": "764b070e0416a523f33eff49c86f8620", "score": "0.5867477", "text": "function clone(object) {\n function get(object, key) {\n return object[key];\n }\n}", "title": "" }, { "docid": "209161afb978ac5d2cf8824e59979463", "score": "0.58654284", "text": "clone( source ) {\n\n const target = {};\n\n for ( const key in source ) {\n\n if ( ! __hasOwnProperty.call( source, key ) ) continue;\n target[ key ] = source[ key ];\n\n }\n\n return target;\n\n }", "title": "" }, { "docid": "5ae88fea4a89244675dea5b433368ed6", "score": "0.5864262", "text": "delete(key) {\n let oldVal = this._map.get(key);\n let removed = this._map.delete(key);\n if (removed) {\n this._changed.emit({\n type: 'remove',\n key: key,\n oldValue: oldVal,\n newValue: undefined\n });\n }\n return oldVal;\n }", "title": "" }, { "docid": "97a21fc41f627312911d70325cf729bd", "score": "0.5850071", "text": "function clearCopy(obj) {\n var result = {};\n Object.keys(obj).forEach(function(key) {\n if ((key.charAt(0) != '$') && (key.substr(0, 2) != '__')) {\n result[key] = obj[key];\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "67b81b25015d405d68b9643b3b32e14a", "score": "0.5835142", "text": "function unstoreObject(key)\n{\n if (!isStored(key))\n {\n console.log('[ERROR] failed to locate object in local store using key: ' + key);\n return null;\n }\n\n let value = unstore(key);\n return JSON.parse(value);\n}", "title": "" }, { "docid": "798dbebe45bc462e1767c3bef7cf2f51", "score": "0.58317035", "text": "function deleteKey(key) {\n delete filter[key];\n }", "title": "" }, { "docid": "903ceb77267c15d8e224330bb898b7bb", "score": "0.58147186", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "687f54c5d62e43e84ee9483da7b35ccf", "score": "0.58136284", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "ae7c9ceab231161e6648941e3a431f66", "score": "0.58121496", "text": "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "title": "" }, { "docid": "afbccf3a8940a59b3b046954e237b302", "score": "0.5806367", "text": "remove(key, comparator) {\n return this;\n }", "title": "" }, { "docid": "c9aa2d003bf74ca29604ea049a52cce7", "score": "0.5794044", "text": "function removeBook(key) {\n myLibrary.splice(\n myLibrary.findIndex(x => x.key = key), 1)\n}", "title": "" }, { "docid": "826f2b97a628618ebe0ed983be398496", "score": "0.57890177", "text": "delete(key) {\n return this._items.delete(key);\n }", "title": "" }, { "docid": "cd0ee4de9beacc802254ea0d225db515", "score": "0.5772173", "text": "function clone(source){\n var target = {};\n for(var i in source){\n if(source.hasOwnProperty(i)){\n target[i] = source[i];\n }\n }\n return target;\n}", "title": "" }, { "docid": "e5382fcb1b20438016a89f44a5a5fdea", "score": "0.5765523", "text": "Unsub(key) {\n if (this.closed) {\n return false;\n }\n return delete this.m[key];\n }", "title": "" }, { "docid": "9c9bb9dfeec83b0248011b636ca97264", "score": "0.5745203", "text": "function del(tree, key) {\n var hash = getHash(tree.level, key),\n slots = tree.slots;\n\n\n if (!hasHash(tree, key)) {\n return tree;\n } else if (isTree(slots[hash], tree.level + 1)) {\n var sub = del(slots[hash], key);\n if (slots[hash] !== sub) {\n return wrapTree({\n level: tree.level,\n slots: replaceInArray(slots, hash, sub)\n });\n }\n return tree;\n } else {\n if (slots[hash].key === key && slots[hash].value !== undefined) {\n return wrapTree({\n level: tree.level,\n slots: replaceInArray(slots, hash, undefined)\n });\n }\n return tree;\n }\n}", "title": "" }, { "docid": "d4c6aa193b07b3ef2a569cdc84f535fe", "score": "0.5743812", "text": "cleanKeys() {\n [...this];\n return this;\n }", "title": "" }, { "docid": "e4a6cb418f3d1b779a08b652872eeb51", "score": "0.57417876", "text": "function cloneAndReplaceKey(oldElement, newKey) {\r\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\r\n \r\n return newElement;\r\n }", "title": "" }, { "docid": "b14ad434cee67333e2660d3780b2bade", "score": "0.57337004", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "786cee92446291a24322c134ec8cf491", "score": "0.5732116", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "8f00e21df9466e8ebb0586fbf415cc6a", "score": "0.5724106", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n }", "title": "" }, { "docid": "f4327bbf88a1df6c23f77c69828203ac", "score": "0.572247", "text": "function cloneAndReplaceKey(oldElement, newKey) {\r\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\r\n \r\n return newElement;\r\n }", "title": "" }, { "docid": "be31d32f8d6c389775a41d3bd4c43d0a", "score": "0.57132757", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n\n return newElement;\n }", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" }, { "docid": "0d56663f6bb1fd4070f24bd54c3005c7", "score": "0.57018244", "text": "function cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}", "title": "" } ]
0b48df00149f51fc369e7e1e413fad5d
Emit event on text selection
[ { "docid": "48eccecd8c12b411cca5b620728037c1", "score": "0.65333486", "text": "triggerSelectedEvent(selection) {\n var range, cfirange;\n\n if (selection && selection.rangeCount > 0) {\n range = selection.getRangeAt(0);\n\n if (!range.collapsed) {\n // cfirange = this.section.cfiFromRange(range);\n cfirange = new _epubcfi__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"](range, this.cfiBase).toString();\n this.emit(_utils_constants__WEBPACK_IMPORTED_MODULE_5__[/* EVENTS */ \"c\"].CONTENTS.SELECTED, cfirange);\n this.emit(_utils_constants__WEBPACK_IMPORTED_MODULE_5__[/* EVENTS */ \"c\"].CONTENTS.SELECTED_RANGE, range);\n }\n }\n }", "title": "" } ]
[ { "docid": "d9dccd0a5c944931bf36cd142e96574a", "score": "0.75745535", "text": "function selectionEventAction() {\r\n var selectedText = window.getSelection().toString().trim();\r\n\r\n if (selectedText) {\r\n var msg = new SpeechSynthesisUtterance(selectedText);\r\n window.speechSynthesis.speak(msg);\r\n }\r\n}", "title": "" }, { "docid": "d2c442ee38c00582df151d2957df3d5c", "score": "0.74606717", "text": "function textSelectEvent() {\n const p = document.body\n p.addEventListener('mouseup', (e) => {\n const selection = window.getSelection().toString();\n\n if (selection === '') {\n console.log('click');\n } else {\n console.log('selection', selection);\n }\n });\n}", "title": "" }, { "docid": "0d3b1dc2016f8dbeb6fc5f1a4def8b60", "score": "0.74022", "text": "function on_selection_changed() { }", "title": "" }, { "docid": "936c4d377dbd17e9af89a3d17e690ece", "score": "0.7139341", "text": "onSelectionChange(){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var e=this.window.getSelection();this.triggerSelectedEvent(e)}.bind(this),250)}", "title": "" }, { "docid": "3cbb481ed47909fd4b87449344524a23", "score": "0.70663667", "text": "selectionChanged() {}", "title": "" }, { "docid": "1fe01d974fa8c76b7091eb88ef7c6fb5", "score": "0.7041651", "text": "function getSelectedText(event) {\n if ($(event.target).hasClass(configuration.selectorName)) {\n if (window.getSelection) {\n if(configuration.sanitize)\n {\n SELECTED_TEXT = sanitizeText(window.getSelection().toString());\n } else {\n SELECTED_TEXT = window.getSelection().toString();\n }\n if (SELECTED_TEXT.length === 0) {\n $(document).trigger('click');\n return false;\n }\n getSoSharePosition(event);\n placeSoShare();\n }\n }\n }", "title": "" }, { "docid": "979d5474b9d186502b65778316863f89", "score": "0.6948585", "text": "static set selectionChanged(value) {}", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.6925009", "text": "function SelectionChange() {}", "title": "" }, { "docid": "29d9e5bc34b33a850af5862ed4570b86", "score": "0.68781346", "text": "onSelectionChange(e) {\n if (this.selectionEndTimeout) {\n clearTimeout(this.selectionEndTimeout);\n }\n\n this.selectionEndTimeout = setTimeout(function () {\n var selection = this.window.getSelection();\n this.triggerSelectedEvent(selection);\n }.bind(this), 250);\n }", "title": "" }, { "docid": "44ab96a58bfeb14708fe8ae8755c06ee", "score": "0.68296987", "text": "function select(event) {\n var start = event.currentTarget.selectionStart;\n var finish = event.currentTarget.selectionEnd;\n\n var a = document.getElementById(\"downloadSelection\");\n\n if (start != finish) {\n selectedText = event.currentTarget.value.substring(start, finish);\n a.style.display = \"block\";\n }\n else {\n selectedText = null;\n a.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.6794469", "text": "function SelectionChange() { }", "title": "" }, { "docid": "8929c21f47f1020fa134ca6bc6f5064b", "score": "0.67351586", "text": "selectTarget() {\n this.selectedText = select(this.target);\n this.copyText();\n }", "title": "" }, { "docid": "d87188987d0b39f2b586e08d224b3121", "score": "0.6689472", "text": "function text_clicked(event) {\n\t var ranges = CKEDITOR.instances.trans_editor.getSelection().getRanges();\n\t var text = CKEDITOR.instances.trans_editor.getSelection().getSelectedText();\n\t var element = CKEDITOR.instances.trans_editor.getSelection().getStartElement();\n\n\t if((ranges[0] != undefined) || (ranges[0] != null)) {\n\t\t var selection_length = (ranges[0].endOffset - ranges[0].startOffset);\n\t\t // User can click on a time marker\n\t\t if(selection_length == 0) {\n\t\t\t if (element.getName() == 'time' ) {\n\t\t\t\t var mark = $('<p>' + element.getOuterHtml() + '</p>').find('time:first').attr('type');\n\t\t\t\t if(mark != null) {\n\t\t\t\t\t var goto_time = $('<p>' + element.getOuterHtml() + '</p>').find('time:first').attr('datetime');\n\t\t\t\t\t var duration = wavesurfer.getDuration();\n\t\t\t\t\t wavesurfer.seekAndCenter(goto_time / duration);\n\t\t\t\t }\n\t\t\t }\n\t // User has selected a word\n\t\t } else { \n\t\t\t var node = ranges[0];\n\t\t\t var pnode = node.startContainer.getParent();\n\t\t\t if (pnode.getName() == 'time' ) {\n\t\t\t\t var goto_time = $('<p>' + pnode.getOuterHtml() + '</p>').find('time:first').attr('datetime');\n\t\t\t\t var duration = wavesurfer.getDuration();\n\t\t\t\t wavesurfer.seekAndCenter(goto_time / duration);\n\t\t\t }\n\t\t\t else if(pnode.getName() == \"conf\") {\n\t\t\t\t pnode = pnode.getParent();\n\t\t\t\t var goto_time = $('<p>' + pnode.getOuterHtml() + '</p>').find('time:first').attr('datetime');\n\t\t\t\t var duration = wavesurfer.getDuration();\n\t\t\t\t wavesurfer.seekAndCenter(goto_time / duration);\n\t\t\t }\n\t\t }\n\t }\n }", "title": "" }, { "docid": "aec912c8dd3af260a94605f3d6164041", "score": "0.66458553", "text": "initSelection() {\n if (this.text) {\n this.selectFake();\n } else if (this.target) {\n this.selectTarget();\n }\n }", "title": "" }, { "docid": "7de9242291904192b73aa2bb6f174414", "score": "0.6613856", "text": "getNewText (text, selection) {\n return text || selection.getText()\n }", "title": "" }, { "docid": "17f3e5010209cc72776f63e98652f7cb", "score": "0.6578196", "text": "static get selectionChanged() {}", "title": "" }, { "docid": "ab1f8782ab0e4625856f876b69743f2f", "score": "0.6578089", "text": "function selectionChanged(event){\n\t// if focus moves away, the selectionChanged event is fired because the context changes\n\t// if selection is null, this means the context is switching away\n\t// if out of focus, retain the current selection (if an user wants to use the same selection twice)\n\t// this is done because the selectionChanged event doesn't fire when the context is switched back\n if(selection.text != null){\n\t selectedText = selection.text;\n\t}\n}", "title": "" }, { "docid": "00ae20cac558ea0ef84c9a347bf25970", "score": "0.6559187", "text": "function ClickText2(ref) {\nvar self = this;\nvar selected = false;\nvar el = El(ref).on('mousedown', init);\n\nfunction init() {\nel.removeEventListener('mousedown', init);\nel.attr('contentEditable', true)\n.attr('spellcheck', false)\n.attr('autocorrect', false)\n.on('focus', function(e) {\n el.addClass('editing');\n selected = false;\n}).on('blur', function(e) {\n el.removeClass('editing');\n self.dispatchEvent('change');\n getSelection().removeAllRanges();\n}).on('keydown', function(e) {\n if (e.keyCode == 13) { // enter\n e.stopPropagation();\n e.preventDefault();\n this.blur();\n }\n}).on('click', function(e) {\n var sel = getSelection(),\n range;\n if (!selected && sel.isCollapsed) {\n range = document.createRange();\n range.selectNodeContents(el.node());\n sel.removeAllRanges();\n sel.addRange(range);\n }\n selected = true;\n e.stopPropagation();\n});\n}\n\nthis.value = function(str) {\nif (utils.isString(str)) {\n el.node().textContent = str;\n} else {\n return el.node().textContent;\n}\n};\n}", "title": "" }, { "docid": "cf2db97243bdc22b54fe66c5c27e88cf", "score": "0.64897823", "text": "handleTextChange(e) {}", "title": "" }, { "docid": "998308a7803a2a2f9526ed7cda79204b", "score": "0.64534646", "text": "function handleWordSelect() {\n let word = this.innerText;\n lookWord(word);\n }", "title": "" }, { "docid": "f838718a89cfbe51a715f04291a4c27a", "score": "0.6411964", "text": "oninput(select, e)\n {\n this.sendAction('oninput', select, e);\n }", "title": "" }, { "docid": "bfdc06893638b72be51111298cc74d76", "score": "0.63547677", "text": "function sendEvent(value){\n\t\t\tlet event = new CustomEvent(that.selectionEvent, {detail: {selection : value}});\t\t\t\t\t\t\t\n\t\t\tthat.eventTarget.dispatchEvent(event);\n\t\t}", "title": "" }, { "docid": "ac09d9667e8654fe18898d453b1fc0e5", "score": "0.63514346", "text": "function bsSelection() {\n var sel = rangy.getSelection();\n var selText = sel.text();\n\n}", "title": "" }, { "docid": "e10c864cc21598f64a11129546b4ed4c", "score": "0.6309916", "text": "addSelectionListeners(){this.document&&this.document.addEventListener('selectionchange',this.onSelectionChange.bind(this),!1)}", "title": "" }, { "docid": "64fe9f666c25a84b939b12bade1f6a64", "score": "0.6293159", "text": "function selectLabelText() {\n ref.current.focus();\n var selection = window.getSelection();\n var range = document.createRange(); // Get the range of the current ref contents so we can add this range to the selection.\n\n range.selectNodeContents(ref.current);\n selection.removeAllRanges();\n selection.addRange(range);\n }", "title": "" }, { "docid": "4a719b02a785fe75bebe3597347e84d1", "score": "0.62616426", "text": "function setSelected(){\n\t var textComponent = document.getElementById('contents');\n\n\t // IE version\n\t if (document.selection != undefined)\n\t {\n\t textComponent.focus();\n\t var sel = document.selection.createRange();\n\t controller.selectedText = sel.text;\n\t }// Mozilla version\n\t else if (textComponent.selectionStart != undefined){\n\t var startPos = textComponent.selectionStart;\n\t var endPos = textComponent.selectionEnd;\n\t controller.selectedText = textComponent.value.substring(startPos, endPos)\n\t }\n}", "title": "" }, { "docid": "80ce66fa066368a85841dfe76096600e", "score": "0.6199902", "text": "function emitOnChange() {\n \t\tif (onChange) {\n \t\t\tonChange(text);\n \t\t}\n \t}", "title": "" }, { "docid": "f0f94f128e0d94cdb3362641ac36b249", "score": "0.6175723", "text": "select() {\r\n this.ui.input.select();\r\n }", "title": "" }, { "docid": "943c60c8999cd80e1b02231a9e9e49c4", "score": "0.6174418", "text": "function handleTextEdit() {\n\n $('.js-shopping-item').on( 'select', function (event) {\n\n console.log('selected text works');\n $(this).removeAttr('readonly');\n $(this).on('keypress', function(e) {\n console.log('keypress listener working');\n if ( e.which === 13 ) {\n const newText = $('input:text').val();\n $('input:text').attr(`value=\"${newText}\"`);\n console.log(newText);\n const { items } = STORE;\n const sameIndex = getItemIndexFromElement(event.currentTarget);\n items[sameIndex].name = newText;\n $('.js-shopping-item').attr('readonly', true);\n }\n });\n });\n}", "title": "" }, { "docid": "a274daa351820a0e249133617b13c979", "score": "0.6169576", "text": "onBodySelect(event) {\n this.select.emit(event);\n }", "title": "" }, { "docid": "b6169c240d524ffc4401c6389c3817b0", "score": "0.6162648", "text": "function handleSelect(e){\n const end = e.target.selectionEnd\n const start = e.target.selectionStart\n const selectValue = e.target.value.slice(start, end) \n if(selectValue){\n setSelectionValue(selectValue);\n }\n }", "title": "" }, { "docid": "8e69bd4ecf336d63d4da2a68a185b3ec", "score": "0.61591274", "text": "function selectText(el) {\n if (document.selection) {\n var range = document.body.createTextRange();\n range.moveToElementText(el);\n range.select();\n } else if (window.getSelection) {\n var range = document.createRange();\n range.selectNode(el);\n window.getSelection().addRange(range);\n }\n }", "title": "" }, { "docid": "3cfafeddded875df67bdcce0fe79904a", "score": "0.6132125", "text": "OnSelectionChanged() {\n this.Trigger('SelectionChanged', {});\n }", "title": "" }, { "docid": "2e66dbfb875e7db59f95d8221810b7eb", "score": "0.6127836", "text": "function asClicked(event) { //when the mouse is clicked\n let choice = event.target.innerHTML; //choice is equal to the event.target.innerHTML (aka: a,b,c,etc)\n event.target.disabeld = true; //disables the selection of a letter after it has been selected once\n //console.log(event.target.innerHTML);\n }", "title": "" }, { "docid": "1d7f01cbff64d43a613b2a5b486ff91b", "score": "0.6117866", "text": "function setTextBorderSelected(){\n $('#file').mouseup(function (e){\n if(mode === 1){//modalità annotatore\n selectedText = getSelectedText();\n rangeObject = selection.getRangeAt(0);\n if(!rangeObject){\n rangeObject = document.createRange();\n rangeObject.setStart(selection.anchorNode, selection.anchorOffset);\n rangeObject.setEnd(selection.focusNode, selection.focusOffset);\n }\n if(rangeObject && (rangeObject.collapsed == false)){\n rangySelection = rangy.getSelection();\n }\n }\n });\n}", "title": "" }, { "docid": "26bbdd02cbcc8d019e45135a32eb6700", "score": "0.61151516", "text": "function autoSelectListener(e) {\n var t = e.target;\n while (t.nodeName !== 'PRE') { t = t.parentNode; }\n selectContent(t);\n }", "title": "" }, { "docid": "7dc8d95ae41188af1864eb9eecaa0c65", "score": "0.6095936", "text": "function renderFieldSelection(opts) {\n app.text\n .init(opts)\n .on('mouse-select', function (options) {\n /*var rect = canvas.getBoundingClientRect();\n options.x -= rect.left;\n options.y -= rect.top;*/\n\n app.text.selection(options); // Draw selection area\n app.text.add({ // Draw Text\n style: {\n fontsize: options.height * 0.5,\n font: 'Calibri'\n },\n x: options.x,\n y: options.y,\n width: options.width,\n height: options.height,\n text: 'Field ' + String(parseInt(app.text.all('selections').length) - 1),\n color: 'red'\n });\n app.text.fields(addFields); // Add field on fieldlist (HTML element)\n });\n}", "title": "" }, { "docid": "b232aa320245cc04eb07e4a951eaf79b", "score": "0.6084923", "text": "triggerSelectedEvent(e){var t,n;e&&0<e.rangeCount&&(t=e.getRangeAt(0),!t.collapsed&&(n=new Ze(t,this.cfiBase).toString(),this.emit($e.CONTENTS.SELECTED,n),this.emit($e.CONTENTS.SELECTED_RANGE,t)))}", "title": "" }, { "docid": "12773e02a0570fd693a9cf6b9aea2132", "score": "0.605895", "text": "selectChanged() {\n if (this.getSelectedText() === \"-- Select --\") {\n removeVisibility(\"selection_buttons\");\n } else {\n addVisibility(\"selection_buttons\");\n }\n }", "title": "" }, { "docid": "f48a21ab1bd6525f435cec63f1a51e8b", "score": "0.6058323", "text": "function onSelectStart( event ) {\n\n this.userData.selectPressed = true;\n\n }", "title": "" }, { "docid": "64333ec82c3955d0a8d5cd310af23d1b", "score": "0.605819", "text": "function selectText (el, begin, end) {\n var len = el.value.length;\n end = end || len;\n if (begin == null)\n el.select();\n else\n if (el.setSelectionRange)\n el.setSelectionRange(begin, end);\n else\n if (el.createTextRange) {\n var tr = el.createTextRange()\n ,c = \"character\";\n tr.moveStart(c, begin);\n tr.moveEnd(c, end - len);\n tr.select();\n }\n else\n el.select();\n el.focus();\n }", "title": "" }, { "docid": "5366195db34f49f97b13274ecf255258", "score": "0.60254806", "text": "function handleSelection(e) {\n const start = inputRef.current.selectionStart;\n const end = inputRef.current.selectionEnd;\n\n\n\n if (start === end) {\n setSelection(undefined);\n //inputRef.current.select()\n } else {\n console.log(start, end)\n setSelection({\n selectionStart: start,\n selectionLength: end - start,\n });\n }\n }", "title": "" }, { "docid": "b100c6a3a5511efc9ff4fa050008b305", "score": "0.60247993", "text": "accept()\n\t{\n\t\tif ( this._options.length > 0 )\n\t\t{\n\t\t\tvar ch = this.options[ this.activeIndex ];\n\t\t\tvar sel = new Event(\"select\");\n\t\t\tsel.character = ch.character;\n\t\t\tsel.score = ch.score;\n\t\t\tthis.dispatchEvent(sel);\n\t\t}\n\n\t\tthis.reset();\n\t}", "title": "" }, { "docid": "590d00e79c5a4e7ad61231e709fe27d5", "score": "0.60122436", "text": "function selectText(textField) {\r\n\ttextField.focus();\r\n\ttextField.select();\r\n}", "title": "" }, { "docid": "a75ae50285b1d0da378ea1796261b702", "score": "0.6005294", "text": "function selectText(containerid) {\n if (document.selection) {\n var range = document.body.createTextRange();\n range.moveToElementText(this);\n range.select();\n } else if (window.getSelection) {\n var range = document.createRange();\n range.selectNode(this);\n window.getSelection().removeAllRanges();\n window.getSelection().addRange(range);\n }\n}", "title": "" }, { "docid": "f8bc8709e2ab719d709c46ca574161ee", "score": "0.59784675", "text": "function addSelectOnClick(scope, element, attrs) { \n element.on('click', function clickEvent() {\n var text = selectText(this);\n this.setAttribute('data-selected-text', text);\n });\n }", "title": "" }, { "docid": "2a527af0c17301412ccb32af797e8466", "score": "0.597699", "text": "selectText(element) {\n let doc = document;\n if (doc.body.createTextRange) {\n let range = document.body.createTextRange();\n range.moveToElementText(element);\n range.select();\n } else if (window.getSelection) {\n let selection = window.getSelection();\n let range = document.createRange();\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }", "title": "" }, { "docid": "605f925b3ae7467d31f4d4a37b33b764", "score": "0.59680015", "text": "_emitSelectEvent(option) {\n const event = new MatAutocompleteSelectedEvent(this, option);\n this.optionSelected.emit(event);\n }", "title": "" }, { "docid": "89232664786ba37c202db4de27579b0f", "score": "0.5967931", "text": "function selectText(containerid) {\n if (document.selection) {\n var range = document.body.createTextRange();\n range.moveToElementText(document.getElementById(containerid));\n range.select();\n } else if (window.getSelection) {\n var range = document.createRange();\n range.selectNode(document.getElementById(containerid));\n window.getSelection().addRange(range);\n }\n alert(\"To copy highlighted text use 'Ctrl + C'\");\n}", "title": "" }, { "docid": "dfef29fced8d630c87ed081c78d64919", "score": "0.5967205", "text": "function getDataFromSelection(){\r\n Office.context.document.getSelectedDataAsync(Office.CoercionType.Text,\r\n function(result){\r\n if (result.status === Office.AsyncResultStatus.Succeeded) {\r\n app.showNotification('The selected text is:', '\"' + result.value + '\"');\r\n } else {\r\n app.showNotification('Error:', result.error.message);\r\n }\r\n }\r\n );\r\n }", "title": "" }, { "docid": "abb91bf3eb270e48953fe2a85e215221", "score": "0.5952541", "text": "function getDataFromSelection() {\n Office.context.document.getSelectedDataAsync(Office.CoercionType.Text,\n function (result) {\n if (result.status === Office.AsyncResultStatus.Succeeded) {\n app.showNotification('The selected text is:', '\"' + result.value + '\"');\n } else {\n app.showNotification('Error:', result.error.message);\n }\n }\n );\n }", "title": "" }, { "docid": "abb91bf3eb270e48953fe2a85e215221", "score": "0.5952541", "text": "function getDataFromSelection() {\n Office.context.document.getSelectedDataAsync(Office.CoercionType.Text,\n function (result) {\n if (result.status === Office.AsyncResultStatus.Succeeded) {\n app.showNotification('The selected text is:', '\"' + result.value + '\"');\n } else {\n app.showNotification('Error:', result.error.message);\n }\n }\n );\n }", "title": "" }, { "docid": "8b3e0282224e1a8789eb2fd2ac3d66d6", "score": "0.5951551", "text": "function synthesizeQuerySelectedText(aWindow)\n{\n netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');\n\n var utils = _getDOMWindowUtils(aWindow);\n if (!utils) {\n return nsnull;\n }\n return utils.sendQueryContentEvent(utils.QUERY_SELECTED_TEXT, 0, 0, 0, 0);\n}", "title": "" }, { "docid": "caa4f75510fbd710fa6334977c785b2a", "score": "0.59297633", "text": "function textColorSel() {\n\n}", "title": "" }, { "docid": "f958c178ad3b5ab392e8ab57792cd77e", "score": "0.59265655", "text": "hndSelect(_event) {\n // _event.stopPropagation();\n let detail = _event.detail;\n let index = this.controller.selection.indexOf(detail.data);\n if (detail.interval) {\n let dataStart = this.controller.selection[0];\n let dataEnd = detail.data;\n this.clearSelection();\n this.selectInterval(dataStart, dataEnd);\n return;\n }\n if (index >= 0 && detail.additive)\n this.controller.selection.splice(index, 1);\n else {\n if (!detail.additive)\n this.clearSelection();\n this.controller.selection.push(detail.data);\n }\n this.displaySelection(this.controller.selection);\n }", "title": "" }, { "docid": "648da4a36e1e8a0b15ee24b212ea499e", "score": "0.5918473", "text": "logTextEvent(text) {\n console.log(text);\n }", "title": "" }, { "docid": "c6315e9814e789db4e4c16829a9801e5", "score": "0.59116334", "text": "function selectText( containerid ) {var node = document.getElementById(containerid);if(document.selection){var range = document.body.createTextRange();range.moveToElementText(node);range.select();}else if(window.getSelection){var range = document.createRange();range.selectNodeContents(node);window.getSelection().removeAllRanges();window.getSelection().addRange(range);}}", "title": "" }, { "docid": "821655c351b0a1ccc6913240fa98cc02", "score": "0.59104854", "text": "onTagSelected(tag) {\n // We replace the partial text tag within the editor with the text representation of the tag that was selected in the TagSelect component.\n this.setEditableContent(this.getEditableContent().replace(this.tagInputManager.textTag, tag.textTag));\n this.tagInputManager.reset();\n }", "title": "" }, { "docid": "583ee8590e57965262510c3b55206cd5", "score": "0.5904912", "text": "function selectText(el, begin, end) {\n var len = el.value.length;\n end = end || len;\n if (begin == null)\n el.select();\n else\n if (el.setSelectionRange)\n el.setSelectionRange(begin, end);\n else\n if (el.createTextRange) {\n var tr = el.createTextRange()\n ,c = \"character\";\n tr.moveStart(c, begin);\n tr.moveEnd(c, end - len);\n tr.select();\n }\n else\n el.select();\n el.focus();\n}", "title": "" }, { "docid": "60b0fe44f4dfb50a033d88db6b8d0448", "score": "0.59045166", "text": "handleEventSelect(event) {\n \n }", "title": "" }, { "docid": "85fd477ada525f6e6b3cb1256dc1872c", "score": "0.58938247", "text": "function select_text() {\n $(\"#addPromptModal\").modal('hide');\n $(\"#reasoning-table-tag\").css(\"background-color\", \"yellow\");\n document.onmouseup = mouse_up_select_text;\n document.getElementById(\"clear-text-but\").disabled = false;\n}", "title": "" }, { "docid": "1459e84444b16d7c69043581ed3d1957", "score": "0.5883817", "text": "onSelect(e) {\n if (State.debugMode) {\n console.log(\"select event!\");\n console.log(e);\n }\n State.eventHandler.dispatchEvent(\"select\", e);\n }", "title": "" }, { "docid": "fa1db31e85068dd5e86ae016baf9fd85", "score": "0.58827734", "text": "function selectText(element) {\n try {\n var range;\n var selection;\n text = document.getElementById(element);\n\n if (document.body.createTextRange) {\n range = document.body.createTextRange();\n range.moveToElementText(text);\n range.select();\n } else if (window.getSelection) {\n selection = window.getSelection();\n range = document.createRange();\n range.selectNodeContents(text);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "782bfa23aa2232b3ca3702db6691d237", "score": "0.584307", "text": "function searchTextChange(text) {\n // console.log('Text changed to ' + text);\n }", "title": "" }, { "docid": "f26788d32328f50fa8a5b053982a41ca", "score": "0.5841839", "text": "function setTranscriptSelectionEventListener()\r\n{\r\n var transcript = document.getElementById('transcriptdiv');\r\n //transcript.onmouseover = mouseoverTransdcriptHandler();\r\n transcript.addEventListener('mouseup', transcriptMouseupHandler, false);\r\n}", "title": "" }, { "docid": "104a30838606c1849cef6093b3e606bf", "score": "0.5837853", "text": "function setSelection(selectionText){\n\tdoAction(selectionText, globalArchiveService, true);\n}", "title": "" }, { "docid": "edbee31a2acf7d16eea9a9837ea8a989", "score": "0.5828172", "text": "function selectText(element) {\n var doc = document\n , range, selection\n ; \n if (doc.body.createTextRange) { //ms\n range = doc.body.createTextRange();\n range.moveToElementText(element);\n range.select();\n } else if (window.getSelection) { //all others\n selection = window.getSelection(); \n range = doc.createRange();\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }", "title": "" }, { "docid": "8d44c89b1a773d98ff5b1cb3c9396f20", "score": "0.58275235", "text": "function selectText(containerid) {\n window.getSelection().selectAllChildren( document.getElementById( containerid) );\n}", "title": "" }, { "docid": "3e029f9827b02e7c9ff0912ea5c4470a", "score": "0.58271486", "text": "OnSelectedIndexChanged() {\n this.SetSelectionIndication(false);\n this.SetSelectionIndication(true);\n this.Trigger('SelectedIndexChanged', {});\n }", "title": "" }, { "docid": "e71b98d8c1e4684c4584d8753193221d", "score": "0.58201396", "text": "function quoteSelection(name)\r\n{\r\n\tif (selection)\r\n\t{ \r\n\t\temoticon_wospaces('[quote=\"'+name+'\"]' + selection + '[/quote]\\n'); \r\n\t\tselection = '';\r\n\t\tdocument.post.message.focus(); \r\n\t\treturn; \r\n\t}\r\n\telse\r\n\t{ \r\n\t\talert(l_no_text_selected);\r\n\t\treturn; \r\n\t} \r\n}", "title": "" }, { "docid": "d3989cb8587997f203040afa22a9a7af", "score": "0.581992", "text": "setUserText(text) {\n this.textHolderDOM().innerText = text\n this.onInput() // ~~ call handler manually\n }", "title": "" }, { "docid": "46c6845b32fa84087e654b7ef42fe9b1", "score": "0.5814099", "text": "function unblockTextSelection() {\n document__default[\"default\"].onselectstart = function () {\n return true;\n };\n}", "title": "" }, { "docid": "c9e924c82dc06d95037d431efa9d6ca0", "score": "0.58133817", "text": "onCursorSelectionChange(callback) {\n this._onCursorSelectionChange = callback;\n }", "title": "" }, { "docid": "6c06f14df1edfd3a264a98a981f0f885", "score": "0.58111167", "text": "_handleSelectionChange() {\n this.querySelectorAll(`${this.__query}`).forEach((i) =>\n this._setItemSelected(i)\n );\n /**\n * Fires when selection update, so that parent radio group can listen for it.\n * @event selection-changed\n */\n this.dispatchEvent(\n new CustomEvent(\"selection-changed\", {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: this,\n })\n );\n }", "title": "" }, { "docid": "f2189bb52981278976275d99753bd879", "score": "0.58063996", "text": "function handleTextChange(e) {\n setText(e.target.value);\n }", "title": "" }, { "docid": "9fdc0f7e1c516ebb26eda94ce16a8e71", "score": "0.5799249", "text": "function onSelect(e){\n setSelector(e.target.id);\n }", "title": "" }, { "docid": "1a1692512f58d0dde8fb23d70404f6ad", "score": "0.57938194", "text": "onSelectedChangedListener({ text, scope, items })\n\t\t{\n\t\t\tthis.manualSelection = true;\n\n\t\t\tif (!this.hasItemsInCurrentItems(items))\n\t\t\t{\n\t\t\t\tthis.setItems([...items, ...this.currentItems]);\n\t\t\t}\n\n\t\t\tthis.setSelected(items);\n\n\t\t\tthis.handleOnEventsCallback('onSelectedChanged', this.getEntityItems());\n\n\t\t\tif (this.closeOnSelect)\n\t\t\t{\n\t\t\t\tvoid this.close();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "08b099e4a685567ce99cc2cf6ffc8a2c", "score": "0.5784436", "text": "function codeText(selCode){\n \n // Get Selection\n sel = window.getSelection();\n \n var range;\n var div;\n \n if (sel.rangeCount && sel.getRangeAt) {\n range = sel.getRangeAt(0);\n var clonedSelection = range.cloneContents();\n div = document.createElement('div');\n div.appendChild(clonedSelection);\n }\n \n // Set design mode to on\n document.designMode = \"on\";\n if (range) {\n sel.removeAllRanges();\n sel.addRange(range);\n }\n \n // Insert code boundry\n document.execCommand(\"insertHTML\", false, '<div class=\"' + classID + '\">' + '{' + selCode + '}'+ div.innerHTML + '{/' + selCode + '}' + '</div>');\n \n // Set design mode to off\n //document.designMode = \"off\";\n \n // Get full version of new transcript\n var NewTranscriptID = document.getElementById('active_transcript_text');\n NewTranscript = NewTranscriptID.innerHTML;\n \n // Return transcript to Shiny\n Shiny.onInputChange(\"active_new_transcript\", NewTranscript);\n}", "title": "" }, { "docid": "a379410280a0d4861e6f4e338735e8ee", "score": "0.57839215", "text": "function emitText(text) {\n this.emit('data', escape(text));\n}", "title": "" }, { "docid": "487167da4453b7cdfcda4cfaf482fe2c", "score": "0.5778298", "text": "select() {\n\t\tthis.element.select();\n\t}", "title": "" }, { "docid": "8b1b1d2283242abe1bbd0bef729cc580", "score": "0.57660884", "text": "_dispatchSelectionChange(isUserInput = false) {\n this.selectionChange.emit({\n source: this,\n isUserInput,\n selected: this.selected\n });\n }", "title": "" }, { "docid": "f34da66c3c4a7fa9579cf21e8f54eef2", "score": "0.5763713", "text": "saveSelection_() {\n if (this.selectionStartIndex_ === TextNavigationManager.NO_SELECT_INDEX ||\n this.selectionEndIndex_ === TextNavigationManager.NO_SELECT_INDEX) {\n console.error(SwitchAccess.error(\n ErrorType.INVALID_SELECTION_BOUNDS,\n 'Selection bounds are not set properly: ' +\n this.selectionStartIndex_ + ' ' + this.selectionEndIndex_));\n } else {\n this.setSelection_();\n }\n }", "title": "" }, { "docid": "eaedf1bf68f1441ab333040d2f2be5c7", "score": "0.5756708", "text": "function __highlight( e ){\n var input = e.target;\n input.select();\n input.removeEventListener( \"focus\", __highlight, false );\n }", "title": "" }, { "docid": "d788f5a28e3db4559fd9c21f45f06417", "score": "0.57563555", "text": "function getSelectedText(){\n var text=\"\";\n if (window.getSelection) {// se e' stato selezionato qualcosa\n text = window.getSelection().toString();\n selection = window.getSelection();\n }\n else if (document.selection && document.selection.type != \"Control\") {// se ho la selezione ed e' del testo\n text = document.selection.createRange().text;//mi salvo il testo selezionato\n selection = document.selection.createRange(); //creo il range\n }\n return text;\n}", "title": "" }, { "docid": "eff2f31d9ce49330c3ddb6f7a7baca0f", "score": "0.5749435", "text": "_reportSelectionState() {\n this._cursorDidChange();\n }", "title": "" }, { "docid": "250b1cbfd2ad39eafa0de401d5b51a6d", "score": "0.57463604", "text": "function handleText() {\n element.bind('focus', clickToEditCtrl.enableEditor);\n element.bind('blur', clickToEditCtrl.disableEditor);\n element.bind('keypress', function(event) {\n if (event.which == 13) {\n clickToEditCtrl.save(event);\n }\n });\n }", "title": "" }, { "docid": "7e9714ea8f43ca5f5f08bafdd42fa545", "score": "0.5745655", "text": "function unblockTextSelection() {\n _document2['default'].onselectstart = function () {\n return true;\n };\n}", "title": "" }, { "docid": "e47c8da12abfc98fb4e9b26f74e0f132", "score": "0.57386905", "text": "function textJoke(joke) {\n\tconst { Text } = require(\"scenegraph\");\n\tconst app = require(\"application\");\n \n app.editDocument(function (selection) {\n selection.items[0].fill = new Color(\"red\");\n let selectedText = selection.items[0];\n \n if (!(selectedText instanceof Text)) {\n selectedText = makeText(joke);\n selection.insertionParent.addChild(selectedText);\n selectedText.moveInParentCoordinates(100, 100);\n \n if (selectedText === undefined) {\n (selection.items[0]).removeFromParent();\n }\n \n } else if (selectedText instanceof Text) {\n selectedText.text = joke;\n }\n });\n\n}", "title": "" }, { "docid": "c5c679497875479ebfb8fd6f5b5578ab", "score": "0.5732239", "text": "onChangeText() {\n this.model.markup = this.editor.getDoc().getValue();\n\n this.trigger('change', this.model);\n }", "title": "" }, { "docid": "005ea5b941172b8322b4ee293b7dbd3a", "score": "0.5716734", "text": "ChangeSelection( idx )\n {\n var itm = this.Items[ idx ];\n\n this.text.text( itm.Name );\n this.selItem = idx;\n\n if( itm.Id <= 0 ) this.text.addClass(\"tenue\");\n else this.text.removeClass( \"tenue\" );\n\n if( this.selFun ) this.selFun( itm.Id, itm.Name );\n\n return true;\n }", "title": "" }, { "docid": "663232d02de302a3c18c26749d359b1e", "score": "0.5716558", "text": "doTextOperation() {\n let root = this,\n range = root.range;\n if (root.toggled && root.toggledCommand !== null) {\n document.execCommand(\n root.toggledCommand,\n false,\n root.toggledCommand || \"\"\n );\n } else if (root.command !== null) {\n root.dispatchEvent(\n new CustomEvent(root.command + \"-button\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: root\n })\n );\n console.log(\n \"doTextOperation\",\n range,\n root.command,\n false,\n root.commandVal || \"\"\n );\n document.execCommand(root.command, false, root.commandVal || \"\");\n root.range = range;\n }\n }", "title": "" }, { "docid": "126a160d99f060e1b0ab40ac8be89e64", "score": "0.5714761", "text": "function selectText(containerid) {\n if (document.selection) {\n var range = document.body.createTextRange();\n range.moveToElementText(document.getElementById(containerid));\n range.select();\n } else if (window.getSelection) {\n var range = document.createRange();\n range.selectNode(document.getElementById(containerid));\n window.getSelection().addRange(range);\n }\n}", "title": "" }, { "docid": "715e49610c0c6d6f798a06f352f76800", "score": "0.5703751", "text": "function catchSelection()\r\n{\r\n\tif (window.getSelection)\r\n\t{\r\n\t\tselection = window.getSelection().toString();\r\n\t}\r\n\telse if (document.getSelection)\r\n\t{\r\n\t\tselection = document.getSelection();\r\n\t}\r\n\telse if (document.selection)\r\n\t{\r\n\t\tselection = document.selection.createRange().text;\r\n\t}\r\n}", "title": "" }, { "docid": "69533c3152c721ea77854230728f5450", "score": "0.5692336", "text": "function mouse_up_select_text() {\n var selected_text = add_reasoning_from_highlight();\n if (selected_text !== \"\") {\n $(\"#addPromptModal\").modal('show'); // make modal visable\n document.onmouseup = null;\n is_active_submit_but();\n $(\"#reasoning-table-tag\").css(\"background-color\", \"white\");\n return ;\n }\n}", "title": "" }, { "docid": "eeb3abbadd21665f0d812a63bffdf0eb", "score": "0.5691552", "text": "function unblockTextSelection(){document_1.onselectstart=function(){return true;};}", "title": "" }, { "docid": "7f1c0a819403e283408cb4e6ec68eb13", "score": "0.56877685", "text": "function handleSelectionDoubleClick() {\n\n var doubleClick = function (event) {\n this.selection.dragging = false;\n var editMode = this.editor.editMode;\n editMode && editMode.onDoubleClick(this.markup);\n }.bind(this);\n\n var selectorBoxWrapper = this.selectionLayer;\n selectorBoxWrapper.addEventListener('dblclick', doubleClick);\n }", "title": "" }, { "docid": "9c4f7e00a5f16886d529bbd1f930739d", "score": "0.5687186", "text": "onClearSelection() {\n this.selectionChange.emit(null);\n setTimeout(() => this.inputEl.focus(), 0);\n }", "title": "" }, { "docid": "dc6de934361ed6a4e5e1fc7003fd4644", "score": "0.56857544", "text": "onSelect(node, obj) {\n if (this.selectedNode) {\n this.selectedNode.classList.remove(\"selected\");\n }\n this.selectedNode = node;\n this.selectedNode.classList.add(\"selected\");\n \n this.selection = obj;\n lively.showElement(obj);\n window.that = obj; // #Experimental\n this.get(\"#editor\").doitContext = obj;\n this.dispatchEvent(new CustomEvent(\"select-object\", {detail: {node: node, object: obj}}));\n }", "title": "" }, { "docid": "237801b8d7b5971afe3913ec7c034d19", "score": "0.5666103", "text": "_onSelected(evt) {\n let item = evt.detail.model || evt.model.item;\n this._handleSelection({\n label: item.label, \n id: item.id\n });\n }", "title": "" }, { "docid": "fd7c03f2b112feb6d526bdf8e5e1d1f0", "score": "0.5664909", "text": "textChangeHandler(event) {\n this.textChangeValue = event.target.value;\n\n }", "title": "" } ]
d4288a88e10a7a1e50ef5838c38abd85
helpers // extend objects
[ { "docid": "80e9c8041bdaf8843dc08bfa6435300c", "score": "0.5733281", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "title": "" } ]
[ { "docid": "0707e2276203dfe049e92d77ca4d36f7", "score": "0.65491366", "text": "extend() {}", "title": "" }, { "docid": "2466272139f6d5184d75ba10549eb575", "score": "0.65439206", "text": "extend() { }", "title": "" }, { "docid": "d4d3e456f7021a90ea5a9f24b2defc33", "score": "0.6273882", "text": "function extend(t,e){for(var r in t=t||{},e)\"object\"==typeof e[r]?t[r]=extend(t[r],e[r]):t[r]=e[r];return t}", "title": "" }, { "docid": "11bc6c24a163f13dce4c2a3a23b8dd4b", "score": "0.6250118", "text": "_extendObject(objA, objB) {\n objA = objA || {};\n objB = objB || {};\n return Ember.$.extend(objA, objB);\n }", "title": "" }, { "docid": "4a5669ccb7b0dff6cf722eec93e31f2a", "score": "0.6241516", "text": "function extend(a,b){for(var prop in b){a[prop]=b[prop];}return a;}", "title": "" }, { "docid": "300f291a28220b5cd51000bd59868fb1", "score": "0.6207108", "text": "extend(obj, other) {\n let result = this.copy(obj)\n Object.keys(other).forEach(key => result[key] = other[key])\n return result\n }", "title": "" }, { "docid": "ce96b75d71da8f8b32f9439075857ccd", "score": "0.6184945", "text": "function _extend(){\n\t \n\t\tvar out = {};\n\t\t\n\t\t//Itterate over all objects and copy each property\n\t\t// shallow copy only \n\t\tvar len = arguments.length;\n\t\tfor(var i=0; i < len;i++)\n\t\t for (var prop in arguments[i]) { out[prop] = arguments[i][prop]; }\n\t\t \n\t\treturn(out);\n\t}", "title": "" }, { "docid": "ec25c5ffed4495348f7c29e000710a7c", "score": "0.61542755", "text": "function _extend(obj1,obj2){\n\t\tvar obj3 = {};\n\t\tfor (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n\t\tfor (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n\t\treturn obj3;\n\t}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.61262864", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.61262864", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "bd598a5e44e42c63374211f7ed21001b", "score": "0.61233133", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "7f8b22d1ab91c4fe31437ecde45e7a70", "score": "0.6119641", "text": "function object(){return{}}", "title": "" }, { "docid": "64f093d7847e014bab04257eaed4a65f", "score": "0.60909534", "text": "function MeuObjeto() {}", "title": "" }, { "docid": "daeaf5542a4f0ad0947675d595273075", "score": "0.59867513", "text": "function BasicObject(){}", "title": "" }, { "docid": "6d960ef802257f6367f0ad6da0cca7eb", "score": "0.5984999", "text": "function extend(base, obj) {\n for(var i in obj) {\n if(obj.hasOwnProperty(i)) {\n base[i] = obj[i];\n }\n }\n return base;\n }", "title": "" }, { "docid": "6d960ef802257f6367f0ad6da0cca7eb", "score": "0.5984999", "text": "function extend(base, obj) {\n for(var i in obj) {\n if(obj.hasOwnProperty(i)) {\n base[i] = obj[i];\n }\n }\n return base;\n }", "title": "" }, { "docid": "6ee0e8a4e31061065c064e8a1fde5c1c", "score": "0.598147", "text": "function extend(){ var a=arguments,i=1,c=a.length,o=a[0],x;for(;i<c;i++){if(typeof(a[i])!='object')continue;for(x in a[i])if(a[i].hasOwnProperty(x))o[x]=a[i][x]};return o }", "title": "" }, { "docid": "48836f05448e6185b7898b8e360a7214", "score": "0.5964144", "text": "_extendHelpers() {\n let helperName = this.linkName;\n let linker = this;\n let symbol = Symbol('accessor');\n\n this.getMainCollection().helpers({\n [helperName]: function() {\n if (this[symbol]) {\n return this[symbol];\n }\n\n this[symbol] = linker.createAccessor(this);\n\n return this[symbol];\n }\n });\n }", "title": "" }, { "docid": "cff26ed5d3ae006628365c0097e18059", "score": "0.59467626", "text": "function extend (obj, base) {\n Object.keys(base).forEach(function (key) {\n var attr = base[key];\n\n if (! obj[key]) {\n if (typeof attr === 'function') obj[key] = attr.bind(obj);\n else if (typeof attr === 'object') obj[key] = Object.create(attr);\n else obj[key] = attr;\n }\n\n });\n }", "title": "" }, { "docid": "eec4a471740938775571a9f2b33cc181", "score": "0.5936988", "text": "function extendObj( obj ){\n\t\tvar exclude = ['extend'];\n\t\tfor ( var k in exports ){\n\t\t\tif ( exports.hasOwnProperty( k ) && exclude.indexOf( k ) < 0 && !obj.hasOwnProperty(k)){\n\t\t\t\tobj[ k ] = exports[ k ];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3b88496f6aab17e7935e29a6f5310ab9", "score": "0.59259814", "text": "function _extendDefaults(obj1, obj2) {\n\t\tfor(var attr in obj2) {\n\t\t\tobj1[attr] = obj2[attr];\n\t\t}\n\n\t\treturn obj1;\n\t}", "title": "" }, { "docid": "8c6c543ce69ddaa22ccb84a7c4b1353b", "score": "0.5925814", "text": "function _extendObj(obj) {\n\tvar i, key, other;\n\tfor(i = 1; i < arguments.length; ++i) {\n\t\tother = arguments[i];\n\t\tfor(key in other)\n\t\t\tobj[key] = other[key];\n\t}\n\treturn obj;\n}", "title": "" }, { "docid": "0152a7dbc12bf32c0abfa636fd3502bc", "score": "0.5891376", "text": "function Utils(){ \n }", "title": "" }, { "docid": "75344db182d0065298474d2d2318370a", "score": "0.5888222", "text": "function tmp_object(){}", "title": "" }, { "docid": "01a04c5b8b02a0b67a2b7b4d36f2c2f6", "score": "0.5887385", "text": "function extend( a, b ) {\r\n\t\t for ( var prop in b ) {\r\n\t\t a[ prop ] = b[ prop ];\r\n\t\t }\r\n\t\t return a;\r\n\t\t}", "title": "" }, { "docid": "3f3f13c677da84d6cdaecb75655e4bce", "score": "0.5879151", "text": "function withKoUtils(obj) {\n return obj;\n}", "title": "" }, { "docid": "b9eb9e835187bd51b92af318f51e5509", "score": "0.5876753", "text": "function extend(t,o) {\r\n for(var n in o){\r\n t[n]=o[n] ;\r\n }\r\n }", "title": "" }, { "docid": "66e033993ea48679829dd31cd0c5e916", "score": "0.5869716", "text": "function poorManExtend(object, source){\n\tobject || (object = {});\n\n\tfor (var prop in source) {\n\t if(source.hasOwnProperty(prop)) {\n\t object[prop] = source[prop];\n\t }\n\t}\n\treturn object;\n}", "title": "" }, { "docid": "cd9ab336cf93e738327bab30f0315fa2", "score": "0.5868186", "text": "function extend(e,t){for(var n in t)e[n]=t[n];return e}", "title": "" }, { "docid": "40eb98b6f301c8bf213933c50f3fca6c", "score": "0.5852091", "text": "function extend(obj1, obj2) {\n\t each(obj2, function(v, k) {\n\t\t obj1[k] = v;\n\t });\n\n\t return obj1;\n }", "title": "" }, { "docid": "f6a7fe814dd1188a9133f084f9d00ded", "score": "0.58497745", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "title": "" }, { "docid": "f6a7fe814dd1188a9133f084f9d00ded", "score": "0.58497745", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "title": "" }, { "docid": "6e38b176c13ed8fe88ad86a4e0e32d19", "score": "0.58116084", "text": "function extend(a, b) {\n\tfor (var prop in b) {\n\t a[prop] = b[prop];\n\t}\n\treturn a;\n }", "title": "" }, { "docid": "14072eb5c4810980ba3cd09f0fb6a04b", "score": "0.5805527", "text": "function Object() {}", "title": "" }, { "docid": "fb86079d50eba76c2f89b8594eff88be", "score": "0.5792624", "text": "static Mixin(a, b) {\t\t\t\t\r\n\t\tfor (var key in b) {\r\n\t\t\tif (b.hasOwnProperty(key)) a[key] = b[key];\r\n\t\t}\r\n\r\n\t\t// TODO : Why did I use arguments[0] instead of a?\r\n\t\treturn arguments[0];\r\n\t}", "title": "" }, { "docid": "5ea58e91e29608d5b28cf79e033fe487", "score": "0.5780494", "text": "function Object(){}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.5772423", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "849f571cb3e32f5e3f1d57262099a711", "score": "0.57700264", "text": "function extend(obj, extObj) {\n\t\tvar a, b, i;\n\t\tif (arguments.length > 2) {\n\t\t\tfor (a = 1, b = arguments.length; a < b; a += 1) {\n\t\t\t\textend(obj, arguments[a]);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (i in extObj) {\n\t\t\t\tif (extObj.hasOwnProperty(i)) {\n\t\t\t\t\tobj[i] = extObj[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "f2fcfe87ac53d1ab4d9fc779f06b57df", "score": "0.5769807", "text": "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "title": "" }, { "docid": "12f63659f6594984e4cd72e34dae47d3", "score": "0.5762813", "text": "function extend(o, e){\n each(e, function(v, n){\n if (is(o[n], 'object') && is(v, 'object')){\n o[n] = extend(o[n], v);\n } else if (v !== null) {\n o[n] = v;\n }\n });\n return o;\n }", "title": "" }, { "docid": "86f13f31ac43e16842f1d90689e5129c", "score": "0.5759643", "text": "function extend( obj ) {\n each(slice.call(arguments, 1), function ( source ) {\n if ( source ) {\n each(source, function ( value, prop ) { obj[prop] = value; });\n }\n });\n return obj;\n }", "title": "" }, { "docid": "20ca84ffb92939c193d7bbdc66ce86ab", "score": "0.57535905", "text": "function extend ( obj ) {\n each( Array.prototype.slice.call( arguments, 1 ), function ( source ) {\n if (source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n }", "title": "" }, { "docid": "e02c8cbf6f0f5cf751baf820250b853c", "score": "0.57507825", "text": "function extend(to,_from){\nfor(var key in _from){\nto[key]=_from[key];\n}\nreturn to;\n}", "title": "" }, { "docid": "e26e994588371c7ac95fabb1121e1f64", "score": "0.5731159", "text": "function utils_extend(obj, dict)\n{\n for (var key in dict)\n {\n obj[key] = dict[key];\n }\n}", "title": "" }, { "docid": "0633f05cf6a4ef41e895a300ec6a48d0", "score": "0.57260686", "text": "function Object() {\n \n }", "title": "" }, { "docid": "a2f8dac21f1c124dfbf9e6354d296aa2", "score": "0.5725838", "text": "function extend(a,b){\n\tvar c={};\n\tfor(var i in a){\n\t\tif(a.hasOwnProperty(i)){\n\t\t\tc[i]=a[i];\n\t\t}\n\t}\n\tfor(var i in b){\n\t\tif(b.hasOwnProperty(i)){\n\t\t\tc[i]=b[i];\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "a2f8dac21f1c124dfbf9e6354d296aa2", "score": "0.5725838", "text": "function extend(a,b){\n\tvar c={};\n\tfor(var i in a){\n\t\tif(a.hasOwnProperty(i)){\n\t\t\tc[i]=a[i];\n\t\t}\n\t}\n\tfor(var i in b){\n\t\tif(b.hasOwnProperty(i)){\n\t\t\tc[i]=b[i];\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "a2f8dac21f1c124dfbf9e6354d296aa2", "score": "0.5725838", "text": "function extend(a,b){\n\tvar c={};\n\tfor(var i in a){\n\t\tif(a.hasOwnProperty(i)){\n\t\t\tc[i]=a[i];\n\t\t}\n\t}\n\tfor(var i in b){\n\t\tif(b.hasOwnProperty(i)){\n\t\t\tc[i]=b[i];\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "a2f8dac21f1c124dfbf9e6354d296aa2", "score": "0.5725838", "text": "function extend(a,b){\n\tvar c={};\n\tfor(var i in a){\n\t\tif(a.hasOwnProperty(i)){\n\t\t\tc[i]=a[i];\n\t\t}\n\t}\n\tfor(var i in b){\n\t\tif(b.hasOwnProperty(i)){\n\t\t\tc[i]=b[i];\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "3b14df6dc30c90de67c7c8bf2d1f2d00", "score": "0.57210934", "text": "static initialize(obj, name, title, description) { \n obj['name'] = name;\n obj['title'] = title;\n obj['description'] = description;\n }", "title": "" }, { "docid": "6c93274b596c93d478e834aa97e46ac9", "score": "0.5716823", "text": "static initialize(obj, admin, read, write) { \n obj['admin'] = admin;\n obj['read'] = read;\n obj['write'] = write;\n }", "title": "" }, { "docid": "651d6662004c997d9e9a233b7e34ac72", "score": "0.5715292", "text": "function extend() {\n return framework.extend.apply(this, arguments);\n }", "title": "" }, { "docid": "48f3f6d38f9f6bb946fffef5d022030d", "score": "0.5703605", "text": "extend () {\n // Variables\n const extended = {}\n let deep = false\n let i = 0\n const length = arguments.length\n \n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0]\n i++\n }\n \n // Merge the object into the extended object\n const merge = function (obj) {\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n // If deep merge and property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(true, extended[prop], obj[prop])\n } else {\n extended[prop] = obj[prop]\n }\n }\n }\n }\n \n // Loop through each object and conduct a merge\n for (; i < length; i++) {\n const obj = arguments[i]\n merge(obj)\n }\n \n return extended\n }", "title": "" }, { "docid": "f354a390842d1f7e4c5027d9bf4c4a97", "score": "0.56941843", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "title": "" }, { "docid": "f354a390842d1f7e4c5027d9bf4c4a97", "score": "0.56941843", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "title": "" }, { "docid": "4240df38a1cd2f229936a4dfbada03e0", "score": "0.5691668", "text": "function mixin(o1, o2) {\n var o3 = {};\n var k;\n for (k in o1) {\n if (o1.hasOwnProperty(k)) {\n o3[k] = o1[k];\n }\n }\n for (k in o2) {\n if (o2.hasOwnProperty(k) && o2[k] !== undefined) {\n o3[k] = o2[k];\n }\n }\n return o3;\n }", "title": "" }, { "docid": "9a90e9c53c972a23f697ad394d161587", "score": "0.568994", "text": "extend(object) {\n\t\t\tObject.keys(dbRepos).forEach(repoName => {\n\t\t\t\tobject[repoName] = new dbRepos[repoName](object, pgp);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e2a65bde336e03b1124c9da691d3cd27", "score": "0.56849235", "text": "function extend(obj, src) {\n\tObject.keys(src).forEach(function(key) { obj[key] = src[key]; });\n\treturn obj;\n}", "title": "" }, { "docid": "099f2995cc6cdbf6d782491f4810f79a", "score": "0.56784844", "text": "function Extend(target, source){ \r\n if (typeof source === 'object') {\r\n var property;\r\n for(property in source) {\r\n if (source.hasOwnProperty(property)) {\r\n if (source[property] != null) {\r\n if (/Object/.test(source[property].constructor)) {\r\n if (property in target) void(0);\r\n else target[property] = {};\r\n Extend(target[property], source[property]); \r\n }\r\n else try { \r\n target[property] = source[property];\r\n } catch (exception) { ; }\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "title": "" }, { "docid": "3b88d330ae02ef6d8a71ffb420bd9c28", "score": "0.56784475", "text": "function Utils() {\r\n}", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "97bfa4f4a8173e0cd2241987785ad9bc", "score": "0.5677216", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.5664533", "text": "function Utils() {}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.5664533", "text": "function Utils() {}", "title": "" }, { "docid": "8eb59c0c16b49fce6e6b23ea53480027", "score": "0.5661827", "text": "function entries(obj){\n\n}", "title": "" }, { "docid": "3f1e0d3634edaec50a30fa96c37a3430", "score": "0.5658972", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "a0a53fbb3450659bdba6fd3222e27180", "score": "0.5656934", "text": "docHelpers (helpers) {\n if (!this._docLocalHelpers) {\n this._docLocalHelpers = {};\n }\n Object.keys(helpers).forEach((key) => {\n this._docLocalHelpers[key] = helpers[key];\n this._documentClass.prototype[key] = helpers[key];\n });\n }", "title": "" }, { "docid": "769a8b0b23b24e5856b1c144e7068038", "score": "0.5651494", "text": "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "769a8b0b23b24e5856b1c144e7068038", "score": "0.5651494", "text": "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "769a8b0b23b24e5856b1c144e7068038", "score": "0.5651494", "text": "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "8719707a3dabe685380f2b6ccf95da2b", "score": "0.564941", "text": "function d(e,t){for(var n in e=e||{},t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},d(e[n],t[n])):e[n]=t[n];return e}", "title": "" }, { "docid": "78488c641ef5209840f6e31c29aa62c5", "score": "0.5644393", "text": "function process_object_data(helpers) {\n\n Object.keys(helpers).forEach(function(key) {\n\n helpers_global[key] = helpers[key];\n\n grunt.log.debug('process_object_data() the current key is ' + key);\n\n });\n\n }", "title": "" }, { "docid": "7b636faaea52a357e377c3cb6137ade3", "score": "0.5644325", "text": "static initialize(obj, notes, time) { \n obj['notes'] = notes;\n obj['time'] = time;\n }", "title": "" }, { "docid": "7a5dad9f9cd7346fdec53a1194f8efc3", "score": "0.5639713", "text": "function extend(/* ...objects */) {\n return toArray(arguments).reduce(function(result, source) {\n return Object.keys(source).reduce(function(result, key) {\n result[key] = source[key]\n return result\n }, result)\n }, {})\n}", "title": "" }, { "docid": "4bd8ba1be2d691c3de82e8b16f9fbff3", "score": "0.5639225", "text": "function extend(dst, src) {\n if (wijmo.isObject(dst) && wijmo.isObject(src)) {\n for (var key in src) {\n var value = src[key];\n if (wijmo.isObject(value) && dst[key] != null) {\n extend(dst[key], value); // extend sub-objects\n } else if (value != null && dst[key] == null) {\n dst[key] = value; // assign values\n }\n }\n return dst;\n } else {\n return src;\n }\n }", "title": "" }, { "docid": "9117cbf1fd56d452bfdfbc9f12fbab89", "score": "0.5633291", "text": "function extend(a, b) {\n for (var key in b)\n if (b.hasOwnProperty(key))\n a[key] = b[key];\n return a;\n }", "title": "" }, { "docid": "210c38905cfbf00e67e5ce8df3bfd2de", "score": "0.5626064", "text": "function $extend(objTarget, objAdd, forceOverride){\n\n\tvar obj = $clone(objTarget); // always new, no pollution\n\n\tif(typeof obj != \"object\") return obj;\n\n\tfor(var item in objAdd){\n\t\tif(obj[item] == undefined || forceOverride) obj[item] = objAdd[item];\n\t}\n\n\treturn obj;\n\n}", "title": "" }, { "docid": "30a0de321bc4194ea3c831b775808a3e", "score": "0.56226224", "text": "function extend( a, b ) {\n\t\tfor( var key in b ) { \n\t\t\tif( b.hasOwnProperty( key ) ) {\n\t\t\t\ta[key] = b[key];\n\t\t\t}\n\t\t}\n\t\treturn a;\n }", "title": "" }, { "docid": "7c18d59da2e4a86507931dbeab9bf190", "score": "0.5617033", "text": "function caseObject(object) {\n return { imgSource: object.image, imgDesc: 'placeholder text', name: object.partname, id: object.itemid, desc: object.partdescription, price: object.price };\n}", "title": "" }, { "docid": "bf0218a32c0d1a447aa0944268463797", "score": "0.56152964", "text": "function jsonifyObj() {\n\tthis.jsonifyCharacter = jsonifyCharacter;//probably dont need only for a single function \n}", "title": "" } ]
fb418066d0dc0691a7de7fbc3105e531
funzione che cerca in un array
[ { "docid": "200827e3e3482f47172e02ef9e74c1ad", "score": "0.0", "text": "function presenteInArray(array, indice) {\r\n var i = 0;\r\n var trovato = false;\r\n while (i < array.length && trovato == false) {\r\n if (array[i] == indice) {\r\n trovato = true;\r\n }\r\n i++;\r\n }\r\n return trovato;\r\n }", "title": "" } ]
[ { "docid": "db1dffd9e733f014bcbd896c05b6bd3d", "score": "0.6451125", "text": "function SeaArray() {}", "title": "" }, { "docid": "db1dffd9e733f014bcbd896c05b6bd3d", "score": "0.6451125", "text": "function SeaArray() {}", "title": "" }, { "docid": "281c3ccbf59fd3f611ac4a2c89f7cade", "score": "0.62436163", "text": "function calcular_casillas_libres()\r\n{\r\n var casillas_libres = new Array();\r\n var b = 0;\r\n for (a=1; a<=81; a++) { if (celdas[a] == 0) { casillas_libres[b] = a; b++; } }\r\n return casillas_libres;\r\n}", "title": "" }, { "docid": "bdbe2b1679c835bca8ff2f4d33462dc8", "score": "0.603814", "text": "function ex_11_R(array)\n{\n j=0;\n i=array.length-1;\n riordinaDispari(array,j,i)\n return array;\n}", "title": "" }, { "docid": "23304bc48d993be76757c30b0791b094", "score": "0.60173917", "text": "function controllo(numeri, tentativi){\n // confronto i due array e restituisco la quantità di numeri indovinati e quali sono.\n\n var numeriCorretti = [];\n\n for (var i = 0; i < 5; i++) {\n if (cercaElemento(tentativi[i], numeri)){\n numeriCorretti.push(tentativi[i]);\n }\n }\n\n return numeriCorretti;\n\n}", "title": "" }, { "docid": "81f6c19399315728363ce2f7e433cfdf", "score": "0.5967448", "text": "function processArray(array){\r\n \r\n}", "title": "" }, { "docid": "5d9b03525cd691ccdc9d7263095a767c", "score": "0.59033346", "text": "function criar(){\n\tlet a = [1,2,3];\n\treturn [1,2,3];\n}", "title": "" }, { "docid": "7b0deb3d77d7a8affce99bca28917d63", "score": "0.5887953", "text": "function InicializaArray(){\r\n primervalor = 0;\r\n segundovalor = 0;\r\n accion = '';\r\n\r\n}", "title": "" }, { "docid": "988ec93aeda447042bd266f2683b3dd0", "score": "0.5871753", "text": "function adicionarAoArray(id){\n var tam = celulas.length;\n \n celulas[tam] = id;\n//toda vez que comer um biscoito ele vai adicionar um indice ao array\n}", "title": "" }, { "docid": "5c2e256777cccae83ab5a0f0da306cce", "score": "0.586651", "text": "function OtherProducts(arr) {\n var arrBaru = [];\n for(var i=0;i<arr.length;i++) {\n var hasilKali=1;\n for (var j=0; j<arr.length; j++) {\n //menghitung hasil kali tiap bagian dari array\n hasilKali = hasilKali * arr[j];\n }\n //menghitung hasil kali jika dibagi dengan elemen array\n arrBaru[i]=hasilKali/arr[i];\n }\n //konversi array jadi string(sesuai permintaan soal)\n arrBaru=arrBaru.join('-');\n return arrBaru;\n}", "title": "" }, { "docid": "7f1c361959572a6699bc65aa7a0fd902", "score": "0.58656967", "text": "function pruebaCopiaArreglo() {\n var arr1 = [3, 2, 6, 9, 5, 4],\n arr2 = copiaArreglo(arr1);\n\n console.log(\"Arreglo 1 (antes): \" + arr1);\n console.log(\"Arreglo 2 (antes): \" + arr2);\n\n arr1[2] = 7;\n arr1[5] = 1;\n arr2[1] = 0;\n arr2[4] = 8;\n\n console.log(\"Arreglo 1 (despues): \" + arr1);\n console.log(\"Arreglo 2 (despues):\" + arr2);\n}", "title": "" }, { "docid": "b303e9f11a7c8cd3de5aa2d752454a1a", "score": "0.58560157", "text": "function oblicz () {\n return [1,2,3]; // pomysl by funkcja zwracala kilka wartosci\n}", "title": "" }, { "docid": "eb4bc4808dcd3955a05db46779ca45be", "score": "0.5839161", "text": "function punteggio () {\n var i = 0;\n var presente = (isInArray);\n var points = [];\n while (presente == false) {\n i++;\n\n points.push(presente);\n\n }\n\n // if (inserisciNumeroUtente){\n // punti++;\n // }\n\n\n\n}", "title": "" }, { "docid": "f3d35a7e984f7578956eca4fb34ee631", "score": "0.58357644", "text": "function e(){return[1,0,0,0,1,0,0,0,1]}", "title": "" }, { "docid": "e0059a50490b0acbaac6dca648702d70", "score": "0.582728", "text": "telaParaArray(){\n this.cadastro(this.tela());\n document.getElementById(\"c1\").value = \"\";\n document.getElementById(\"c2\").value = \"\";\n arr = this.aluno.length;\n }", "title": "" }, { "docid": "9d7d59888a442f39c0c82b9d0d213cfa", "score": "0.5823917", "text": "function e(){return[0,0,0,1]}", "title": "" }, { "docid": "f9f9943cf9665fa4bb93f64ad3b33c65", "score": "0.5817652", "text": "function a_unico(ar){ \r\n // Codigo creado por EspacioWebmasters.com\r\n // puedes copiarlo citando la fuente\r\n // Declaramos las variables\r\n var ya=false,v=\"\",aux=[].concat(ar),r=Array(); \r\n // Buscamos en el mismo Array si\r\n // cada elemento tiene uno repetido\r\n for (var i in aux){ // \r\n v=aux[i]; \r\n ya=false; \r\n for (var a in aux){ \r\n // Preguntamos si es el primer elemento\r\n // o si ya se recorrio otro igual\r\n // Si es el primero se asigna true a la variable \"ya\"\r\n // Si no es el primero, se le da valor vacio\r\n if (v==aux[a]){ \r\n if (ya==false){ \r\n ya=true; \r\n } \r\n else{ \r\n aux[a]=\"\"; \r\n } \r\n } \r\n } \r\n } \r\n // Aqui ya tenemos los valores duplicados\r\n // convertidos en valores vacios\r\n // Solo falta crear otro Array con los valores\r\n // que quedaron sin contar los vacios\r\n for (var a in aux){ \r\n if (aux[a]!=\"\"){ \r\n r.push(aux[a]); \r\n } \r\n } \r\n // Retornamos el Array creado\r\n return r; \r\n}", "title": "" }, { "docid": "07effb56a63c793d1a81b54bbc3c0e81", "score": "0.5810346", "text": "function devuelveArrayComentado() {\n var el_nombre = document.getElementById(\"nombre2\").value.toUpperCase();\n var su_nombre = [...el_nombre];\n console.log(`Partim del nom ${el_nombre}`);\n\n for (let i = 0; i < su_nombre.length; i++) {\n\n if (isNaN(su_nombre[i])) {\n \n var letra = su_nombre[i];\n \n if (letra === 'A' || letra === 'E' || letra === 'I' || letra === 'O' || letra === 'U') {\n console.log(`He trobat la VOCAL: ${letra}`);\n } else {\n \n console.log(`He trobat la CONSONANT: ${letra}`);\n }\n\n \n } else {\n console.log(`Els noms de persones no contenen el numero: ${su_nombre[i]}`);\n \n\n }\n }\n}", "title": "" }, { "docid": "63c4387f72f3a5dea5044e695cdddce0", "score": "0.57640785", "text": "privateCalculaArrayTramo(p_arrayTotal,p_numElementosXPag,p_numPagSolicitada){\n try {\n \n if( (p_arrayTotal || p_numElementosXPag || p_numPagSolicitada) == null){\n throw 'El (Los) argumento(s) no puede(n) ser \"undefined\" o \"null\"';\n }else{\n // variables para el problema\n let l_arrayAuxTramo = [];\n let l_indiceInicio;\n let l_indiceFin;\n // variables auxiliares\n let l_numElementosXPagAux = Number.parseInt(p_numElementosXPag);\n let l_numPagSolicitadaAux = Number.parseInt(p_numPagSolicitada);\n let l_numPagTotalesAux;\n\n if(p_arrayTotal.length == 0){\n throw ('El array pasado por parámetro no puede ser vacío');\n }else if(Number.isNaN(l_numElementosXPagAux)){\n throw ('El número de elementos por página pasado por parámetro no es un número');\n }else if(Number.isNaN(l_numPagSolicitadaAux)){\n throw ('El número de elementos por página pasado por parámetro no es un número');\n }else{\n // numero paginas totales\n l_numPagTotalesAux = Math.ceil(p_arrayTotal.length/l_numElementosXPagAux);\n\n if(l_numPagSolicitadaAux < 1){\n l_indiceInicio = 0;\n l_indiceFin = l_numElementosXPagAux-1;\n }else if(l_numPagSolicitadaAux >= l_numPagTotalesAux){\n l_indiceInicio = (l_numPagTotalesAux*l_numElementosXPagAux)-l_numElementosXPagAux;\n l_indiceFin = p_arrayTotal.length-1;\n }else{\n l_indiceInicio = (l_numPagSolicitadaAux*l_numElementosXPagAux)-l_numElementosXPagAux;\n l_indiceFin = (l_numPagSolicitadaAux*l_numElementosXPagAux)-1;\n }\n // Actualizamos el valor de la página actual\n // this.setNumPagActual(l_numPagActualAux);\n \n // Actualiza numero total de paginas a mostrar\n // this.setNumTotalPag(this.getArrayElemTotales().length/this.getElementosXPagina());\n \n // Trozo de array que cumple el tramo\n l_arrayAuxTramo = p_arrayTotal.slice(l_indiceInicio,l_indiceFin+1);\n // this.setArrayElemTotales(l_arrayAuxTramo);\n \n return l_arrayAuxTramo;\n }\n }\n \n \n \n } catch (error) {\n console.log('TCL: privateCalculaArrayTramo }catch -> error:', error)\n }\n }", "title": "" }, { "docid": "cb7bb494c87beaef923864f48759243c", "score": "0.572309", "text": "function dataOpschonenOogkleur() {\n\n //van de antwoorden hoofdletters maken\n oogkleurData = oogKleur.map(entry => entry.toUpperCase());\n\n //van rgb naar hex\n //oogkleurData = oogkleur.forEach(element => {\n \n \n\n}", "title": "" }, { "docid": "de145c6eab42c3dd653c0bc77fb5fb21", "score": "0.57070446", "text": "function choque(cabeza, array) {\n for (let i = 0; i < array.length; i++) {\n if (cabeza.x == array[i].x && cabeza.y == array[i].y) {\n return true;\n }\n }\n return false\n}", "title": "" }, { "docid": "98f867d6fadfeea4be77629714703c96", "score": "0.5689905", "text": "function getArray(reqArray){\n\n\n\n let strV = \"\";\n\n let strH1 = \"\";\n let strH2 = \"\";\n \n //Arreglo que descompone cada string y lo convierte en arreglo\n let arrayDNA = [];\n //arreglo que almacena todo\n let arrayPeticionDNA = [];\n //expresion regular verifica si se encuentran estas letras en el string\n const REX = /[B,D,E,F,H,I,J,K,L,M,N,Ñ,O,P,Q,R,S,U,V,W,X,Y,Z]/; \n\n\n for (let i = 0; i < reqArray.length; i++) {\n\n //SI no es cuadrada\n if(reqArray.length !== reqArray[i].length){\n return [];\n }\n\n //si tiene un caracter invalido\n if(REX.exec(reqArray[i].toUpperCase())){\n console.log(reqArray[i]);\n return ['i'];\n }\n\n\n //Agrega todas las horizontales\n arrayPeticionDNA.push(reqArray[i]);\n\n //Descompone el string y evalua sus posiciones\n arrayDNA = Array.from(reqArray[i]);\n\n //se obtiene la diagonal y se almacena en el strH2 hasta tener un \"TTGGTT\"\n strH2 = strH2 + arrayDNA[i];\n\n //se obtiene la diagonal y se almacena en el strH1 hasta tener un \"AAGGCC\"\n strH1 = strH1 + arrayDNA[reqArray.length-1];\n \n \n strV =\"\";\n\n for (let j = 0; j < reqArray.length; j++) {\n //obtiene las verticales y las hace un solo string\n arrayDNA = Array.from(reqArray[j]);\n strV = strV + arrayDNA[i];\n \n } \n \n //ya que se genera el string con los valores se guarda en los arreglos\n arrayPeticionDNA.push(strV.toUpperCase());\n \n \n }\n\n arrayPeticionDNA.push(strH1.toUpperCase(),strH2.toUpperCase());\n\n \n return arrayPeticionDNA;\n \n}", "title": "" }, { "docid": "af3e50daf4e3e334da7e90735bba6fb1", "score": "0.56691", "text": "filtro(func) {\n let arrN = new Array();\n for (let x of this.arr) {\n if (func(x)) {\n arrN.push(x);\n }\n }\n return new Arreglo(arrN);\n }", "title": "" }, { "docid": "2c469657f9cae85fc4f47f4bb5e617db", "score": "0.56660527", "text": "function cargar() {\n for (let i = 0; i < arreglo.length; i++) {\n cargarCanciones(i)\n espectro(i+1,arreglo[i][0], arreglo[i][1]);\n }\n}", "title": "" }, { "docid": "86e775a41cda8d5f7ee345628dc1ba26", "score": "0.5661677", "text": "function alContrario (parola){\n //divido la parola in un array contenente in ogni elemento un lettera\n var splitParola = parola.split(\"\");\n //inverto l'ordine degli elementi dell'array\n var revArray = splitParola.reverse(); \n return revArray.join(\"\"); //convero l'array in una stringa\n \n}", "title": "" }, { "docid": "d2d9175e296e7a0df157e4232ccd5875", "score": "0.56387484", "text": "function arrayg(first) {\n\n}", "title": "" }, { "docid": "83efe4e308118f5661a8c5f0d2ebbfe3", "score": "0.5622732", "text": "function contigousSubArr(array) {\n\n}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "ad9860bbe45635cffa524cc6aab9cb5d", "score": "0.5608235", "text": "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "title": "" }, { "docid": "02ec0b56c18a6788e7307a88e2300f00", "score": "0.55865455", "text": "function _toConsumableArray(arr) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t_arrayWithoutHoles(arr) ||\r\n\t\t\t\t\t_iterableToArray(arr) ||\r\n\t\t\t\t\t_nonIterableSpread()\r\n\t\t\t\t);\r\n\t\t\t}", "title": "" }, { "docid": "02ec0b56c18a6788e7307a88e2300f00", "score": "0.55865455", "text": "function _toConsumableArray(arr) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t_arrayWithoutHoles(arr) ||\r\n\t\t\t\t\t_iterableToArray(arr) ||\r\n\t\t\t\t\t_nonIterableSpread()\r\n\t\t\t\t);\r\n\t\t\t}", "title": "" }, { "docid": "c772f61123c1acbdaf237ce5b84818fd", "score": "0.55824345", "text": "function mengelompokkanAngka(arr) {\n // you can only write your code here!\n var panjang = arr.length\n var genap = []\n var ganjil = []\n var kelipatanTiga = []\n var hasil = []\n for (i = 0; i < panjang; i++){\n if (arr[i] % 2 === 0 && arr[i] % 3 !== 0) {\n var x = i\n genap.push(arr[x])\n } else if (arr[i] % 2 !== 0 && arr[i] % 3 !== 0) {\n var y = i\n ganjil.push(arr[y])\n } else if (arr[i] % 3 === 0) {\n var z = i\n kelipatanTiga.push(arr[z])\n }\n }\n hasil.push(genap)\n hasil.push(ganjil)\n hasil.push(kelipatanTiga)\n return hasil\n }", "title": "" }, { "docid": "3dbedf62431e5a88e341cb074c874fb8", "score": "0.55810004", "text": "function recogerDatos(){\n\t//Metemos los datos de la unidad en una array bidimensional\n\tfor(i=0; i<indice.length; i++){\n\n\t $unidad.push([]);\n\t $unidad[i].push(indice[i].tema, indice[i].subtema);\t\n }\n\n}", "title": "" }, { "docid": "f61d05781e321a5bf1c3ed13a972008e", "score": "0.55405676", "text": "function isEtoile(){\n var res=[0,0];\n //on cherche la générale non annoncée\n for (let i=0;i<4;i++){\n if (this.plis[i].length==32){//le joueur i a || le joueur i a fait une générale\n if (this.contrat.valeur!='Générale' || this.preneur!=i){//le joueur i n'a pas annoncé une générale ou n'est pas le preneur\n res[i%2]=1;\n }\n }\n }\n\n //on cherche le capot non annoncé de l'équipe 0\n if (this.plis[0].length +this.plis[2].length==32){//l'équipe 0 a fait un capot\n if ((this.contrat.valeur!='Générale' && this.contrat.valeur!='Capot')){//le contrat n'est ni une générale ni un capot\n res[0]=1;\n } else if (this.preneur==1 || this.preneur==3){//le preneur n'est pas 0 ni 2\n res[0]=1;\n }\n }\n\n //on cherche le capot non annoncé de l'équipe 1\n if (this.plis[1].length +this.plis[3].length==32){//l'équipe 0 a fait un capot\n if ((this.contrat.valeur!='Générale' && this.contrat.valeur!='Capot')){//le contrat n'est ni une générale ni un capot\n res[1]=1;\n } else if (this.preneur==0 || this.preneur==2){//le preneur n'est pas 0 ni 2\n res[1]=1;\n }\n }\n\n return res;\n }", "title": "" }, { "docid": "cfb90006ab952893672cac38bbd99153", "score": "0.551369", "text": "function agafaValors(){\n table = document.getElementById(\"taula\");\n window.arrayValors=[];\n window.arrayValorRows=[];\n\n var rows = table.rows, rowcount = rows.length, r, cells, cellcount, c, cell;\n for( r=2; r<rowcount; r++) {\n cells = rows[r].cells;\n cellcount = cells.length;\n for( c=2; c<cellcount; c++) {\n cell = Number(cells[c].children[0].value);\n arrayValors.push(cell);\n }\n }\n var arrayCopy = arrayValors.slice(0);\n var i, j, x;\n var cellsEscrites = cellcount-2;\n for (x=0,i=0,j=arrayCopy.length; i<j; i+=cellsEscrites) {\n temparray = arrayCopy.slice(i,i+cellsEscrites);\n arrayValors[x]=temparray;\n x++;\n }\n agafaNameColumnes();\n agafaNameRows();\n agafaColors();\n}", "title": "" }, { "docid": "f0f642da187f823982ffd716418c5573", "score": "0.5502206", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || CheckboxGroup_unsupportedIterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "6fcc4b4c64979eaf4e6fe2619efef44b", "score": "0.5485412", "text": "copyToArray(array) {\n array[0] = this.m00();\n array[1] = this.m10();\n array[2] = this.m20();\n array[3] = this.m01();\n array[4] = this.m11();\n array[5] = this.m21();\n array[6] = this.m02();\n array[7] = this.m12();\n array[8] = this.m22();\n return array;\n }", "title": "" }, { "docid": "d8b057eb91086f04510c4b7b167da5f6", "score": "0.54815936", "text": "function getArray(array){\n return array;\n}", "title": "" }, { "docid": "b020ea1038e866aa95748f506615116e", "score": "0.5472211", "text": "function Gooble(a) { // turns a 2d array of numbers to an array of strings\n\t\t\t\t\t // to turn a 1d array of numbers into a string, do Gooble([a])[0]\n\t\t\t\t\t // to turn a number into a character, do Gooble([[a]])[0]\n\t\t\t\t\t \n\t\t\t\t\t // to turn a 2d array of numbers into a single string, do Gooble(a).join(\"\\n\")\n\t\t\t\t\t \n\t\t\t\t\t //i know this is just 1 line but this is for my convenience\n\treturn a.map((b)=>{return String.fromCodePoint(...b.map((c)=>{return c+32;}))});\n}", "title": "" }, { "docid": "2645aca1fbacec3c47542e96e16b055f", "score": "0.54573137", "text": "function duplicaArray(param){\n var valorToReturn = new Array();\n if ( param != \"\"){\n var cantFilas = param.length;\n var cantCols = param[0].length;\n \n for (var i = 0; i < cantFilas; i++)\t{\n \n var nuevaFila = new Array();\n \n for (var j = 0; j < cantCols; j++)\t{\t\n var dato = param[i][j];\n nuevaFila[j] = dato;\n }\n \n valorToReturn[i] = nuevaFila;\n }\n }\n \n return valorToReturn;\n}", "title": "" }, { "docid": "90d1da333fdc1168d52981f351800862", "score": "0.54474777", "text": "function repartirCentro(centro){\n for(var h=0;h<4;h++){\n var cartaC=baraja.shift();\n centro.push(cartaC);\n }\n}", "title": "" }, { "docid": "6b836b7dc32be2915a2b534fac341608", "score": "0.5442245", "text": "function liczbyPierwsze () {\r\n const args = arguments;\r\n // mozna uzyc juz args\r\n const lnArgs = arguments.length;\r\n let outback = [];\r\n\r\n function pomocnicza(i) {\r\n if(i < 2) return false;\r\n for (let j = 2; j < i; j += 1) {\r\n if (i % j === 0)\r\n return false;\r\n }\r\n return true;\r\n }\r\n \r\n // czy to sprawdzenie daje nam informacje ze mamy array - \r\n // raczej tylko ze mamy podany jeden argument - \r\n // jak podam przy wywolaniu np (3)\r\n // to walnie bledem\r\n // porownanie scisle ===\r\n if (lnArgs == 1) {\r\n // czy mozna uzyc innej metody ? Jezeli tak - jakiej?\r\n args[0].forEach(function (element, index) {\r\n if (pomocnicza(element)) {\r\n outback.push(element);\r\n }\r\n }) // brak srednika moze prowadzic do powaznych bledow ;)\r\n return outback.join(\",\");\r\n }\r\n \r\n else if (lnArgs == 2) { // bardzo nieczytelne wyglada jak by else if bylo samodzielna instrukcja, brak scislego porownania\r\n // czy ta konstrukcja else if jest potrzeban ?\r\n const minInt = args[0];\r\n const maxInt = args[1];\r\n\r\n for (let i = minInt; i <= maxInt; i += 1) {\r\n if (pomocnicza(i)) {\r\n outback.push(i);\r\n }\r\n }\r\n\r\n // dwa razy zwracasz to samo - celowo?\r\n return outback.join(\",\");\r\n }\r\n}", "title": "" }, { "docid": "1ad3969fed403d4996272f4bf5ecde28", "score": "0.5432947", "text": "function mapArray(arr, func){\r\n //Définir func comme une fonction\r\n func();\r\n //Array de résultat à stocker \r\n const res = [];\r\n //Boucle pour passer la fonction à chaque élément de l'array et copier le résultat dans le nouvel array\r\n for(let i=0; i<arr.length; i++){\r\n res[i] = func(arr[i]);\r\n }\r\n //Montrer le résultat\r\n console.log(res)\r\n}", "title": "" }, { "docid": "d4d843803dec9004c6eba447e7cd452a", "score": "0.5431907", "text": "function crearArrayDeDosNumeros(){\n\n\n\treturn [1,2] // me devuelve un arrat de dos numeros\n}", "title": "" }, { "docid": "d4d843803dec9004c6eba447e7cd452a", "score": "0.5431907", "text": "function crearArrayDeDosNumeros(){\n\n\n\treturn [1,2] // me devuelve un arrat de dos numeros\n}", "title": "" }, { "docid": "26d9b7f951784ef7964d93ca37ef4363", "score": "0.54230714", "text": "function colisionaPieza(){\n for (var v=1;v < 5;v++){\n var des=piezas[pieza][v];\n var pos2=rotarCasilla(pos[des]);\n if (cuadroNoDisponible(pos2 [ 0 ] +fpi, pos2 [ 1 ]+cpi)){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "389ca7bde98372bfb783cbb782e26213", "score": "0.5420027", "text": "getArrayTramo(){\n return this.l_arrayTramo;\n }", "title": "" }, { "docid": "6469e8c84f1cb2a740aca8182c99b868", "score": "0.541206", "text": "function sukeistiMasyvo2elementus(x,y) {\n let pagalbinis = prekiautojai[x];\n prekiautojai [x] = prekiautojai [y];\n prekiautojai [y] = pagalbinis;\n}", "title": "" }, { "docid": "76ffe80578ced7f763d3d79a84b3085b", "score": "0.54055536", "text": "getSubArray(c){\n checkIntArgs(c);\n const data = MeshGrid.allocate(this.length, this.type);\n for(let i = 0; i < this.length; ++i)\n data[i] = this.data[i * this.channels + c];\n return data;\n }", "title": "" }, { "docid": "6f010a08e050aa998b494dc42be055f5", "score": "0.5402601", "text": "Inferensi() {\n //1. Jika fasilitas BIASA dan ukuran SEMPIT dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[0] = this.CariMin(this.FasilitasBiasa(), this.UkuranSempit(), this.JarakDekat());\n this.z_arr[0] = this.HargaMahal(this.alpha_arr[0]);\n //2. Jika fasilitas BIASA dan ukuran SEMPIT dan jarak SEDANG maka harga MURAH\n this.alpha_arr[1] = this.CariMin(this.FasilitasBiasa(), this.UkuranSempit(), this.JarakSedang());\n this.z_arr[1] = this.HargaMurah(this.alpha_arr[1]);\n //3. Jika fasilitas BIASA dan ukuran SEMPIT dan jarak JAUH maka harga MURAH\n this.alpha_arr[2] = this.CariMin(this.FasilitasBiasa(), this.UkuranSempit(), this.JarakJauh());\n this.z_arr[2] = this.HargaMurah(this.alpha_arr[2]);\n //4. Jika fasilitas BIASA dan ukuran SEDANG dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[3] = this.CariMin(this.FasilitasBiasa(), this.UkuranSedang(), this.JarakDekat());\n this.z_arr[3] = this.HargaMahal(this.alpha_arr[3]);\n //5. Jika fasilitas BIASA dan ukuran SEDANG dan jarak SEDANG maka harga MURAH\n this.alpha_arr[4] = this.CariMin(this.FasilitasBiasa(), this.UkuranSedang(), this.JarakSedang());\n this.z_arr[4] = this.HargaMurah(this.alpha_arr[4]);\n //6. Jika fasilitas BIASA dan ukuran SEDANG dan jarak JAUH maka harga MURAH\n this.alpha_arr[5] = this.CariMin(this.FasilitasBiasa(), this.UkuranSedang(), this.JarakJauh());\n this.z_arr[5] = this.HargaMurah(this.alpha_arr[5]);\n //7. Jika fasilitas BIASA dan ukuran LUAS dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[6] = this.CariMin(this.FasilitasBiasa(), this.UkuranLuas(), this.JarakDekat());\n this.z_arr[6] = this.HargaMahal(this.alpha_arr[6]);\n //8. Jika fasilitas BIASA dan ukuran LUAS dan jarak SEDANG maka harga MURAH\n this.alpha_arr[7] = this.CariMin(this.FasilitasBiasa(), this.UkuranLuas(), this.JarakSedang());\n this.z_arr[7] = this.HargaMurah(this.alpha_arr[7]);\n //9. Jika fasilitas BIASA dan ukuran LUAS dan jarak JAUH maka harga MURAH\n this.alpha_arr[8] = this.CariMin(this.FasilitasBiasa(), this.UkuranLuas(), this.JarakJauh());\n this.z_arr[8] = this.HargaMurah(this.alpha_arr[8]);\n //10. Jika fasilitas LENGKAP dan ukuran SEMPIT dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[9] = this.CariMin(this.FasilitasLengkap(), this.UkuranSempit(), this.JarakDekat());\n this.z_arr[9] = this.HargaMahal(this.alpha_arr[9]);\n //11. Jika fasilitas LENGKAP dan ukuran SEMPIT dan jarak SEDANG maka harga MAHAL\n this.alpha_arr[10] = this.CariMin(this.FasilitasLengkap(), this.UkuranSempit(), this.JarakSedang());\n this.z_arr[10] = this.HargaMahal(this.alpha_arr[10]);\n //12. Jika fasilitas LENGKAP dan ukuran SEMPIT dan jarak JAUH maka harga MURAH\n this.alpha_arr[11] = this.CariMin(this.FasilitasLengkap(), this.UkuranSempit(), this.JarakJauh());\n this.z_arr[11] = this.HargaMurah(this.alpha_arr[11]);\n //13. Jika fasilitas LENGKAP dan ukuran SEDANG dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[12] = this.CariMin(this.FasilitasLengkap(), this.UkuranSedang(), this.JarakDekat());\n this.z_arr[12] = this.HargaMahal(this.alpha_arr[12]);\n //14. Jika fasilitas LENGKAP dan ukuran SEDANG dan jarak SEDANG maka harga MAHAL\n this.alpha_arr[13] = this.CariMin(this.FasilitasLengkap(), this.UkuranSedang(), this.JarakSedang());\n this.z_arr[13] = this.HargaMahal(this.alpha_arr[13]);\n //15. Jika fasilitas LENGKAP dan ukuran SEDANG dan jarak JAUH maka harga MURAH\n this.alpha_arr[14] = this.CariMin(this.FasilitasLengkap(), this.UkuranSedang(), this.JarakJauh());\n this.z_arr[14] = this.HargaMurah(this.alpha_arr[14]);\n //16. Jika fasilitas LENGKAP dan ukuran LUAS dan jarak DEKAT maka harga MAHAL\n this.alpha_arr[15] = this.CariMin(this.FasilitasLengkap(), this.UkuranLuas(), this.JarakDekat());\n this.z_arr[15] = this.HargaMahal(this.alpha_arr[15]);\n //17. Jika fasilitas LENGKAP dan ukuran LUAS dan jarak SEDANG maka harga MAHAL\n this.alpha_arr[16] = this.CariMin(this.FasilitasLengkap(), this.UkuranLuas(), this.JarakSedang());\n this.z_arr[16] = this.HargaMahal(this.alpha_arr[16]);\n //18. Jika fasilitas LENGKAP dan ukuran LUAS dan jarak JAUH maka harga MURAH\n this.alpha_arr[17] = this.CariMin(this.FasilitasLengkap(), this.UkuranLuas(), this.JarakJauh());\n this.z_arr[17] = this.HargaMurah(this.alpha_arr[17]);\n }", "title": "" }, { "docid": "9ac8415b182623b0f8f5c38389e7e14d", "score": "0.5402306", "text": "function point(coordenadas){//coordenadas [1231,123123]\n final = [ ];\n for (var i = 0; i < coordenadas.length; i++) {\n var punto = ol.proj.transform(coordenadas[i], 'EPSG:4326', 'EPSG:3857'); \n final.push(punto);\n }\n return final;\n}", "title": "" }, { "docid": "f9e37c2d0499930b946f8afb0fa90bf8", "score": "0.5397498", "text": "function bez_array_maker(arrarc, mass=4){ var rez=[]; for(var i=0;i<arrarc.length;i++){ rez.push( bez_maker(arrarc[i],mass) ); } return rez; }", "title": "" }, { "docid": "fe656166ad06024e6f8f424082455f08", "score": "0.5388901", "text": "function Array() {}", "title": "" }, { "docid": "fe656166ad06024e6f8f424082455f08", "score": "0.5388901", "text": "function Array() {}", "title": "" }, { "docid": "0a7e9ac4040961c3c5e0aa580915f384", "score": "0.53858715", "text": "function makeArray(e){return Array.isArray(e)?e:[e]}", "title": "" }, { "docid": "51c3df7ad28c90662a17eb4c4c255e2e", "score": "0.5383684", "text": "function saludoArray (n){\n\n if(n!==\"Eduardo\")\n return Saludo = [\"hola\", n]\n \n\n else\n return listadenombresnogustada = [\"no nos gusta\", \"el nombre de\", n]\n\n}", "title": "" }, { "docid": "7787aa784dd117fe836175aad6639292", "score": "0.5372153", "text": "function isPseudoArrgs(a){\n \"use strict\";\n let arr;\n console.log(a);\n arguments[0] = \"WOW\";\n console.log(arguments);\n console.log(a);\n arr = Array.from(arguments);\n console.log(arr);\n}", "title": "" }, { "docid": "e8563ea8fe0d0d1e3088f9543022441d", "score": "0.53710216", "text": "function arrayCalculation(array,fntion){\n var resultArray=[];\n for(var i=0;i<array.length;i++){\n resultArray.push(fntion(array[i]));\n }\n return resultArray;\n}", "title": "" }, { "docid": "a67d68565246006019273c41b8db2046", "score": "0.5370596", "text": "function newArray(array, a , b){\n\n // creo una variabile per salvare l'array filtrato (prendendo come parametro l'indice)\n let newStringNumbers = array.filter((Element,index) => {\n\n // l'indice è maggiore uguale di a e minore uguale di b\n if(index >= a && index <= b){\n return true;\n };\n return false;\n });\n return newStringNumbers;\n}", "title": "" }, { "docid": "ffd3ab528675c6e5b2fac15d5e3c21db", "score": "0.53670216", "text": "function devuelveArray() {\n var nombre = document.getElementById(\"nombre1\").value.toUpperCase();\n var mi_nombre = Array.from(nombre);\n\n mi_nombre.forEach((letras) => console.log(letras));\n\n}", "title": "" }, { "docid": "d619294cebdc887a0e140608dd79f87a", "score": "0.5366167", "text": "determineDomain() {\n let domain = [];\n this.field.forEach((row, rowIndex) => {\n row.forEach((col, colIndex) => {\n let values = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n values = values.filter(item => !row.includes(item)); // filter horizontaal\n\n for(let i = 0; i < 9; i++) {\n values = values.filter(item => item !== this.field[i][colIndex]); // filter verticaal\n let rowIndexToCheck = Math.floor(rowIndex / 3) * 3;\n let colIndexToCheck = Math.floor(colIndex / 3) * 3;\n rowIndexToCheck += Math.floor(i / 3);\n colIndexToCheck += (i % 3);\n values = values.filter(item => item !== this.field[rowIndexToCheck][colIndexToCheck]); // filter 3x3 grid\n }\n if(!domain[rowIndex]) domain[rowIndex] = []; // voorkomt reference error\n domain[rowIndex][colIndex] = values;\n });\n });\n return domain;\n }", "title": "" }, { "docid": "7eb2da7e3c4f10741732ac6b283e10ef", "score": "0.5364564", "text": "function bez_array_getPoints_maker(arrarc,mass=4){ var rez=[]; for(var i=0;i<arrarc.length;i++){ rez.push( bez_maker(arrarc[i],mass).getPoints() ); } return rez; }", "title": "" }, { "docid": "91e9cc6a8ae408a2172fb1fb51fee2a5", "score": "0.53604", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "91e9cc6a8ae408a2172fb1fb51fee2a5", "score": "0.53604", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "91e9cc6a8ae408a2172fb1fb51fee2a5", "score": "0.53604", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "5d13a7c108c4ee033c934f3d95756ece", "score": "0.5347772", "text": "function embaralhaPecas(qtd_pares) {\n\n var imagensPossiveis = new Array();\n var imagensPossiveis_aux = new Array();\n var posicoesPossiveis = new Array();\n\n var posicoes;\n\n\n for (var i = 0; i < NUM_IMAGENS; i++) {\n imagensPossiveis[i] = i;\n }\n\n shuffle(imagensPossiveis);\n\n for (var i = 0; i < qtd_pares; i++) {\n imagensPossiveis_aux[imagensPossiveis_aux.length] = imagensPossiveis[i];\n }\n\n for (var i = 0; i < qtd_pares; i++) {\n posicoesPossiveis[posicoesPossiveis.length] = imagensPossiveis_aux[i];\n\n }\n for (var i = 0; i < qtd_pares; i++) {\n posicoesPossiveis[posicoesPossiveis.length] = imagensPossiveis_aux[i];\n\n }\n\n shuffle(posicoesPossiveis);\n\n //console.log(\"Posições das peças\");\n //console.log(posicoesPossiveis);\n\n return posicoesPossiveis;\n\n\n }", "title": "" }, { "docid": "cbb6be370cda5c287a809393eb5fcb43", "score": "0.5346316", "text": "clonarUbicaciones(ubicaciones) {\n let temporal = [];\n ubicaciones.forEach(elemento => {\n temporal.push(this.clonarUbicacion(elemento));\n });\n return temporal;\n }", "title": "" }, { "docid": "2ee40b6c69d6aaa37a8fba7f2ed2ba60", "score": "0.53455627", "text": "function conexo(arrayIdV){\n let matrizCaminos = matrizDeCaminos(arrayIdV);\n for(let i=0; i<matrizCaminos.length; i++){\n for(let j=0; j<matrizCaminos[i].length; j++){\n if(matrizCaminos[i][j] == 0){\n alert(\"No es conexo\");\n return false;\n }\n }\n }\n alert(\"Es conexo\");\n return true;\n}", "title": "" }, { "docid": "d89f1716ce5e7fc6f3488adc113521ec", "score": "0.53408253", "text": "function array(a) {\n return _.map(a, point);\n}", "title": "" }, { "docid": "a6910c2acb964a1d14f6c8084899f6bd", "score": "0.5334223", "text": "function ScaletheArray(arr,num){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i] * num;\n }\n return arr;\n}", "title": "" }, { "docid": "f0d524e3e226312857a327fe1709e797", "score": "0.533008", "text": "function rotarCasilla(celda){\n var pos2=[celda [ 0 ] , celda [ 1 ] ];\n for (var n=0;n < rot ;n++){\n var f=pos2 [ 1 ]; \n var c=-pos2 [ 0 ] ;\n pos2 [ 0 ] =f;\n pos2 [ 1 ] =c;\n }\n return pos2;\n }", "title": "" }, { "docid": "04325af7fba8f10a01368df5df09a783", "score": "0.5328297", "text": "function perspectivaNegativa(array) {\n var auxArray = [];\n var recibe = 0;\n for (var i = 0; i < array.length; i++) {\n\n if (array[i] > 0) {\n recibe = -array[i]\n } else\n recibe = array[i];\n\n auxArray.push(recibe);\n }\n\n return auxArray;\n}", "title": "" }, { "docid": "63366a20d32bb32a3ec7d65030fcf1f1", "score": "0.5323675", "text": "function showElements(array){\n //OJO: si no fuesen objetos-->alert(\"Discos de la lista: \"+arrayDiscos); \n //alert(arrayDiscos.toString()); (ver como crear una .toString en js)\n cadena=JSON.stringify(array);\n //console.log(cadena);\n alert(\"Mostrando elementos:\\n\"+cadena);\n}", "title": "" }, { "docid": "e33933336de5bdd06434f95dd0ff75fe", "score": "0.53227895", "text": "constructor(rows, cols){\n this.rows = rows; //Linhas\n this.cols = cols; //Colunas\n\n this.data = []; //Array Multidimensional da Rede\n \n for(let i=0; i < rows; i++){ \n //Função para armezenar um array dentro de outro, pois [[]] daria erro\n let arr = []\n for (let j=0; j<cols; j++){\n arr.push(0) //Vai inserir um valor randômico entre 0 ou 1 e multiplicar por 10\n }\n this.data.push(arr); //Adiciona um array ao array\n }\n }", "title": "" }, { "docid": "871cd25f41597ba8a70d39377b4c7973", "score": "0.5320834", "text": "function NegativeArrays(pro,pas,pre,par,key){\r\n let table=[];\r\n table[0]=MakeUpperArray(Simple(modn1,pro,pas,pre,key));\r\n table[1]=MakeUpperArray(Progressive(modn1,pro,pre,key));\r\n table[2]=MakeUpperArray(Perfect(modn2,pro,pre,par,key));\r\n table[3]=MakeUpperArray(PerfectProgressive(modn2,pro,pre,key)); \r\n return table;\r\n }", "title": "" }, { "docid": "2a2326b4aba9d73336628ff22b2d3696", "score": "0.53139365", "text": "function controllo (vettore_giusto, vettore_utente){\n var vettore_finale= [];\n for (var i= 0 ; i < vettore_giusto.length; i++ ){\n for (var j = 0; j < vettore_utente.length; j++){\n if (vettore_utente[j] == vettore_giusto[i]){\n vettore_finale.push(vettore_utente[j]);\n }\n }\n\n }\n return [vettore_finale, vettore_finale.length];\n}", "title": "" }, { "docid": "1fbfb9a0e7d8be5b49e5dcf2d977b1e1", "score": "0.53096324", "text": "function le_converteLidasEmArray( stringLidas ) {\n/*---------------------------------------------*/\nconsole.log(\"leit.js> *** Executando le_converteLidasEmArray() ***\");\n\n var arrayLidas = new Array();\n\n for (i = 0; i <= 365; i++) {\n if ( i == 0 ) {\n arrayLidas[i] = \"X\";\n } else {\n if ( i <= ( stringLidas.length ) ) {\n arrayLidas[i] = stringLidas.charAt( i-1 );\n } else {\n arrayLidas[i] = \"N\";\n };\n };\n };\n\n return arrayLidas;\n}", "title": "" }, { "docid": "d929d688080ac7548d7fc79417d8a507", "score": "0.5306936", "text": "mapeo(func) {\n let arrN = new Array();\n for (let x of this.arr) {\n arrN.push(func(x));\n }\n return new Arreglo(arrN);\n }", "title": "" }, { "docid": "f1849f9370477866c05f5cc695ac3c4b", "score": "0.53038615", "text": "function creaArray(array, a, b) {\n for (var i = a-1; i < b; i++) {\n array_finale.push(array[i]);\n }\n}", "title": "" }, { "docid": "48d61d9c4a7884a0eaa4f9a5217fbe5f", "score": "0.5299268", "text": "function\nARR(num)\n { return DIM | ((num & 255) << 16);\n }", "title": "" }, { "docid": "3dffea29c8146d98705196d4560036b0", "score": "0.5293006", "text": "function tentukanDeretGeometri(arr) {\n // you can only write your code here!\n\n\n var tampung=[];\n var hasil=0;\n if(arr[0]<arr[1]){\n for(var a=0;a<(arr.length-1);a++){\n tampung +=arr[a+1]/arr[a];\n if(tampung.length>1&&tampung[a]===tampung[a-1]){\n hasil +=1;\n }\n }\n return hasil===(tampung.length-1);\n }\n\n\n }", "title": "" }, { "docid": "ee5ea835f5a34796a51f220344d63421", "score": "0.5292989", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "ee5ea835f5a34796a51f220344d63421", "score": "0.5292989", "text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }", "title": "" }, { "docid": "4c0e36c3a93de38def5afa33b1fb9ac4", "score": "0.5290745", "text": "function _toConsumableArray(c){if(Array.isArray(c)){for(var b=0,a=Array(c.length);b<c.length;b++){a[b]=c[b]}return a}return Array.from(c)}", "title": "" }, { "docid": "7c3d643c3ab3aa83411e0ae644a66374", "score": "0.5287958", "text": "function obtenerCasillas() {\n\n\tconst obtenerCasillaBlanca = (e, i, arr) => {\t\t\t\t\t\t//callbacks para 'forEach()' \n\t\tarr[i].numeroCasilla = document.getElementById(\"casilla\" + (i + 1))\n\t\tarr[i].puesto = [document.getElementById(\"puesto1-\" + (i + 1)),\n\t\tdocument.getElementById(\"puesto2-\" + (i + 1)),\t\n\t\tdocument.getElementById(\"puesto3-\" + (i + 1)),\t\n\t\tdocument.getElementById(\"puesto4-\" + (i + 1))],\n\t\tarr[i].fichasEnPuesto = [[], [], [], []]\n\t}\n\n\tconst obtenerCasillaA = (e, i, arr) => {\n\t\tarr[i].Casilla = document.getElementById(\"casillaA\" + (i + 1))\t//almacena una casilla Azul i\n\t\tarr[i].puesto = document.getElementById(\"puesto1-A\" + (i + 1))\t//en un arreglo\n\t}\t\n\n\tconst obtenerCasillaR = (e, i, arr) => {\n\t\tarr[i].numeroCasilla = document.getElementById(\"casillaR\" + (i + 1))\t//almacena una casilla Roja i\n\t\tarr[i].puesto = document.getElementById(\"puesto1-R\" + (i + 1))\t//en un arreglo\n\t}\t\n\n\tconst obtenerCasillaV = (e, i, arr) => {\n\t\tarr[i].numeroCasilla = document.getElementById(\"casillaV\" + (i + 1))\t//almacena una casilla Verde i\n\t\tarr[i].puesto = document.getElementById(\"puesto1-V\" + (i + 1))\t//en un arreglo\n\t}\t\n\n\tconst obtenerCasillaY = (e, i, arr) => {\n\t\tarr[i].numeroCasilla = document.getElementById(\"casillaY\" + (i + 1))\t//almacena una casilla Amarilla i\n\t\tarr[i].puesto = document.getElementById(\"puesto1-Y\" + (i + 1))\t//en un arreglo\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//en un arreglo\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\n\tcasilla.forEach(obtenerCasillaBlanca) \t//Llena el arreglo casilla con las casillas blancas\n\tcasillaAzul.forEach(obtenerCasillaA)\t\t//Llena el arreglo casilla con las casillas azules\n\tcasillaRoja.forEach(obtenerCasillaR)\t\t//Llena el arreglo casilla con las casillas rojas\n\tcasillaVerde.forEach(obtenerCasillaV)\t\t//Llena el arreglo casilla con las casillas verdes\n\tcasillaAmarilla.forEach(obtenerCasillaY)\t//Llena el arreglo casilla con las casillas amarillas\n\n}", "title": "" }, { "docid": "8d2998b61ee56c9afd8c82bd0b3472c7", "score": "0.5280295", "text": "function prendoPerTipo(array) {\r\n const iconeTipi = [];\r\n array.forEach((element) => {\r\n //*devo inserire la condizione perché per pushare non lo deve includere\r\n // types.push(element.type)\r\n if (!iconeTipi.includes(element.type)) {\r\n iconeTipi.push(element.type);\r\n };\r\n\r\n });\r\n return iconeTipi;\r\n}", "title": "" }, { "docid": "df21118ff127a2eb9fab41eed9f65abd", "score": "0.5276976", "text": "function generar(){\n var filas1 = document.getElementById(\"filas1\").value;\n var filas2 = document.getElementById(\"filas2\").value;\n var columnas1 = document.getElementById(\"columnas1\").value;\n var columnas2 = document.getElementById(\"columnas2\").value;\n array1 = new ArrayMatematicos(filas1,columnas1);\n array2 = new ArrayMatematicos(filas2,columnas2);\n resultado = \"Primer Array: <br/>\" + array1.mostrarArray() + \"Segundo Array: <br/>\" + array2.mostrarArray();\n texto.innerHTML = resultado;\n}", "title": "" }, { "docid": "6ca5c5b7163e74ca37d0e06f8ce56788", "score": "0.5275681", "text": "function pickOutcoms(twoD_Array){\n\n\n var verTransArray =[];\n //var k=0;\n for (i=2; i<twoD_Array.length; i++){\n var trow_array = twoD_Array[i];\n var swishstr = String(trow_array[9]);\n swishstr = swishstr.substring(0, 5);\n //console.log('swishstr ' + swishstr);\n\n var strEight = String();\n\n\n var strNine= String(trow_array[9]);\n //flytta refferens om de är bellop till rätt plats i radArrayen\n if (typeof trow_array[9] != \"string\"){\n //console.log(trow_array);\n trow_array[11] = trow_array[10];\n trow_array[10] = trow_array[9];\n trow_array[9] = \"-\";\n }\n //console.log(trow_array);\n //console.log('------------------');\n\n if ('Swish' != swishstr) {\n var trow =[trow_array[2], trow_array[5], trow_array[8], trow_array[9], trow_array[10], trow_array[11]];\n verTransArray.push(trow);\n\n }//end of if\n\n }//end of forloop\n\n //console.log(verTransArray);\n return verTransArray;\n}", "title": "" }, { "docid": "3d88f456850e2bb105f0a4541d04ed9a", "score": "0.52754605", "text": "function keitimas(x,y){\n var antras = prekiautojai[1];\n prekiautojai[1] = prekiautojai[3];\n prekiautojai[3] = antras;\n var keturi = prekiautojai[0];\n prekiautojai[0] = prekiautojai[2];\n prekiautojai[2] = keturi;\n }", "title": "" }, { "docid": "81d9ec9e8b6e0b14adb69b99398fabff", "score": "0.5274355", "text": "function NegativeShortArrays(pro,pas,pre,par,key){\r\n let table=[];\r\n table[0]=MakeUpperArray(DeleteSpaces(Simple(modsn1,pro,pas,pre,key)));\r\n table[1]=MakeUpperArray(DeleteSpaces(Progressive(modsn1,pro,pre,key)));\r\n table[2]=MakeUpperArray(DeleteSpaces(Perfect(modsn2,pro,pre,par,key)));\r\n table[3]=MakeUpperArray(DeleteSpaces(PerfectProgressive(modsn2,pro,pre,key)));\r\n return table;\r\n }", "title": "" }, { "docid": "4563079321c11701e35acc39c96c4aa2", "score": "0.5267583", "text": "function ShortArrays(pro,pas,pre,par,key){\r\n let table=[];\r\n table[0]=MakeUpperArray(DeleteSpaces(Simple(smod1,pro,pas,pre,key)));\r\n table[1]=MakeUpperArray(DeleteSpaces(Progressive(smod1,pro,pre,key)));\r\n table[2]=MakeUpperArray(DeleteSpaces(Perfect(smod2,pro,pre,par,key)));\r\n table[3]=MakeUpperArray(DeleteSpaces(PerfectProgressive(smod2,pro,pre,key)));\r\n return table;\r\n }", "title": "" }, { "docid": "c50b4500c3ac5f37fe8abadec4216176", "score": "0.5263506", "text": "function rango_fechas(entrada,salida,fecha_hoy){\n fechaEntrada = new Array();\n fechaEntrada = entrada.replace(/[ :]/g, \"-\").split(\"-\");\n\n fechaSalida = new Array(); \n fechaSalida = salida.replace(/[ :]/g, \"-\").split(\"-\");\n\n var fechaEntradaFinal = Array(fechaEntrada[2],fechaEntrada[1],fechaEntrada[0]);\n var fechaSalidaFinal = Array(fechaSalida[2],fechaSalida[1],fechaSalida[0]);\n//console.log(fechaSalidaFinal);\n\n arr_fechas = [];\n _rango_maxLength(fechaEntradaFinal,fechaSalidaFinal,_rango_para_meses(fechaEntradaFinal));\n var encontro = arr_fechas.indexOf(fecha_hoy);\n \n //console.log(\"arr final:\");\n //console.log(arr_fechas);\n\n return encontro;\n}", "title": "" }, { "docid": "cab865cbd78ffbea0b8e72df466c881f", "score": "0.52566105", "text": "convertToString(){\r\n var casillas_string=[\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null]\r\n ];\r\n for(var i=0;i<8;i++){\r\n for(var j=0;j<8;j++){\r\n if(this.casillas[i][j] != null){\r\n var ficha_char = this.casillas[i][j].getTipoFicha().charAt(0) + this.casillas[i][j].getColor();\r\n }else{\r\n ficha_char = '*2';\r\n }\r\n \r\n casillas_string[i][j] = ficha_char;\r\n }\r\n }\r\n return casillas_string;\r\n }", "title": "" }, { "docid": "54ef1966ef3eaeeb85eacd85d6910ade", "score": "0.5254551", "text": "function bez_array_getPoints(bez_array){ var rez=[]; for(var i=0;i<bez_array.length;i++){ rez.push( bez_array[i].getPoints() ); } return rez; }", "title": "" }, { "docid": "1126a2bf23b4d0dd0a51dee67ff75bde", "score": "0.5245907", "text": "function controlliArray(valore,array) {\n var found = false;\n // creo ciclo while fino a quando found è falso e i < array.length\n var i = 0;\n while (found == false && i < array.length) {\n if (array[i] == valore) {\n found = true;\n }\n i++;\n }\n return found;\n}", "title": "" }, { "docid": "1126a2bf23b4d0dd0a51dee67ff75bde", "score": "0.5245907", "text": "function controlliArray(valore,array) {\n var found = false;\n // creo ciclo while fino a quando found è falso e i < array.length\n var i = 0;\n while (found == false && i < array.length) {\n if (array[i] == valore) {\n found = true;\n }\n i++;\n }\n return found;\n}", "title": "" }, { "docid": "cdfb1a36696bde09e4a4e26a60567c4b", "score": "0.52454525", "text": "function rangos(){\n //var rx=[]; objetoInicial.cromosomaArray.push(aleatorio);\n /* cualquiernumero/!=0 */\n if (restriccionValida(r1))\n dividirValores(r1);\n \n if (restriccionValida(r2))\n dividirValores(r2);\n \n if (restriccionValida(r3)) \n dividirValores(r3);\n \n if (restriccionValida(r4))\n dividirValores(r4);\n \n if (restriccionValida(r5)) \n dividirValores(r5);\n \n \n rangoX = [0,infinito(Math.max(...rx))];\n\n rangoY = [0,infinito(Math.max(...ry))];\n\n rangoZ = [0,infinito(Math.max(...rz))];\n\n rangoW = [0,infinito(Math.max(...rw))];\n console.log(typeof(rangoW[1]));\n\n}", "title": "" } ]
b21bd4c16ef8e4e59bad8b62194f949f
property to set Raduis
[ { "docid": "cbe8892b9fbe2f9a88ae8d720475b834", "score": "0.79256773", "text": "set Raduis(raduis){\n this.raduis = raduis;\n }", "title": "" } ]
[ { "docid": "38fbfacb7e99394896cb70679c505fbe", "score": "0.698436", "text": "get Raduis(){\n return this.raduis;\n }", "title": "" }, { "docid": "eb9f2cf91b0d0922d72b7ab7b71b5b04", "score": "0.66769737", "text": "setRut(rut){this.rut=rut;}", "title": "" }, { "docid": "363d49d195fb6ffe4d7f685d708d98b4", "score": "0.66080564", "text": "set setRaza(raza){\n this.raza = raza;\n }", "title": "" }, { "docid": "3d71ce79d9ea71673ade65278f88427e", "score": "0.63275194", "text": "set setRaza(newRaza) {\n this.raza = newRaza;\n }", "title": "" }, { "docid": "d5d0eec8b0d992c7e0e44c94cc6a30bd", "score": "0.6113441", "text": "setIntents() {\n\n\n }", "title": "" }, { "docid": "33b886b05f38fa774a1f744351459fd8", "score": "0.5916823", "text": "set rdyShipRedGrills(){\n this._rdyShipRedGrills = this._rdyShipRedTruck + this._rdyShipRedNoteboard\n }", "title": "" }, { "docid": "c27a5dfbfefe32db99816ddce567d0b1", "score": "0.5884118", "text": "set quuz(val) {\n this._quuz = val;\n }", "title": "" }, { "docid": "2353fba56ab4a8471f5e83d7490fb757", "score": "0.58568156", "text": "set nombre(nombre){\r\n this._nombre = nombre;\r\n }", "title": "" }, { "docid": "909656eb6ebf207026b97ed37ff5dedf", "score": "0.583124", "text": "get getRaza(){\n return this.raza;\n }", "title": "" }, { "docid": "456cdd8e0805b7fbadddc474d7fa8dd1", "score": "0.57353455", "text": "get getRaza() {\n return this.raza;\n }", "title": "" }, { "docid": "56d5f36fa85dedc3de212498f12eec32", "score": "0.54876477", "text": "set a(val){\n this.a = val;\n }", "title": "" }, { "docid": "0e2ffab4fe3520fb9eb0ba2e9641b205", "score": "0.54767025", "text": "setCantidad() {\n if(this.cantidad){\n this.cantidad = this.cantidad;\n }else{\n this.cantidad = this.aleatorio(5, 10);\n }\n }", "title": "" }, { "docid": "ca998c7285df828fc8a2c5406def5867", "score": "0.54295254", "text": "set() {\n return this.admin || this.moderator;\n }", "title": "" }, { "docid": "b8a9a80c66871b74a608df38671cd449", "score": "0.5428757", "text": "setValue() {}", "title": "" }, { "docid": "b52bb50f11e83f0ac2a9327287552bdd", "score": "0.5427589", "text": "setValue() {\n }", "title": "" }, { "docid": "a5a67b14d74b73d3970226e902c0038c", "score": "0.5415649", "text": "get muerto(){ return this._muerto; }", "title": "" }, { "docid": "f7bb25b84aa34d225048a1ed3dd79298", "score": "0.53963983", "text": "constructor() {\n this.racine = undefined;\n }", "title": "" }, { "docid": "4e4f70f04be4c1bb63573d06062f0c18", "score": "0.5393674", "text": "set Right(value) {}", "title": "" }, { "docid": "a4b444fc873822e0f843b739dae0f45d", "score": "0.5386621", "text": "set nuevo_nombre(nombre) {\n this.nombre = nombre;\n }", "title": "" }, { "docid": "760dfaef151780e80bd5a94f0ed06480", "score": "0.5371516", "text": "bindUI() {\n this.onAttributeChange('property', this.setProperty);\n }", "title": "" }, { "docid": "d7281b2a8ee59b7cc84bf4a5ba3d23ec", "score": "0.5350386", "text": "set(setting, value) {\n /**\n\t\t\t * Get the control of the sub-setting.\n\t\t\t * This will be used to get properties we need from that control,\n\t\t\t * and determine if we need to do any further work based on those.\n\t\t\t */\n let $this = this,\n subControl = wp.customize.settings.controls[setting],\n valueJSON;\n\n // If the control doesn't exist then return.\n if (_.isUndefined(subControl)) {\n return true;\n }\n\n // First set the value in the wp object. The control type doesn't matter here.\n $this.setValue(setting, value);\n\n // Process visually changing the value based on the control type.\n switch (subControl.type) {\n case 'checkbox':\n case 'kirki-toggle':\n value = !!((value === 1 || value === '1' || value === true));\n jQuery($this.findElement(setting, 'input')).prop('checked', value);\n wp.customize.instance(setting).set(value);\n break;\n\n case 'kirki-select':\n $this.setSelectWoo($this.findElement(setting, 'select'), value);\n break;\n\n case 'kirki-slider':\n jQuery($this.findElement(setting, 'input')).prop('value', value);\n jQuery($this.findElement(setting, '.kirki_range_value .value')).html(value);\n break;\n\n case 'kirki-generic':\n if ( _.isUndefined( subControl.choices ) || _.isUndefined( subControl.choices.element ) ) {\n subControl.choices.element = 'input';\n }\n jQuery( $this.findElement( setting, subControl.choices.element ) ).prop( 'value', value );\n break;\n\n case 'kirki-color':\n $this.setColorPicker($this.findElement(setting, '.kirki-color-control'), value);\n break;\n\n case 'kirki-radio-buttonset':\n case 'kirki-radio-image':\n case 'kirki-radio':\n case 'kirki-dashicons':\n case 'kirki-color-palette':\n case 'kirki-palette':\n jQuery( $this.findElement( setting, 'input[value=\"' + value + '\"]' ) ).prop( 'checked', true );\n break;\n\n case 'kirki-repeater':\n\n // Not yet implemented.\n break;\n\n case 'kirki-custom':\n\n // Do nothing.\n break;\n default:\n jQuery($this.findElement(setting, 'input')).prop('value', value);\n }\n }", "title": "" }, { "docid": "3f318aa31ae026dfb507ccdca17a9ec4", "score": "0.53446025", "text": "testElemAssign() {\n super[\"prop\"] = ruin();\n }", "title": "" }, { "docid": "3ed39196fd1ddba321e7a80d6d008ad2", "score": "0.53320456", "text": "setMarca(marca){\n this.marca = marca\n }", "title": "" }, { "docid": "fbbab96fa8dc75534a47e04cfa2756ab", "score": "0.5314109", "text": "set radius(value) {}", "title": "" }, { "docid": "29bf02bb51d38b030fea4178a83ce267", "score": "0.53136194", "text": "_setProperty($args) {\n // 1. Save data with parent set accessor.\n const origin = this.get();\n super._setProperty($args);\n if (!this.equals(origin)) {\n // 2. Notify this token, if token have some handler observer.\n // When notify happen, every node in attribute path will check and trigger notification.\n let token = null;\n if ($args.node) {\n let node = $args.node.concat($args.key);\n let temp = \"\";\n token = [];\n node.forEach((value, index) => {\n temp = index ? `${temp}.${value}` : value;\n token.push(temp);\n });\n } else {\n token = [$args.key];\n }\n //console.log(\"Proxy set property\", token);\n // 3. Noityf by token.\n this._notify(token);\n }\n }", "title": "" }, { "docid": "8ca9aac0b1e425f61c96a674dee23c75", "score": "0.53107697", "text": "get n_cuotas(){\n return this.n;\n }", "title": "" }, { "docid": "b21cbb0fb6708a950ce804b8d8b8c2db", "score": "0.5298024", "text": "set InNodes(value) {}", "title": "" }, { "docid": "f0918fddd466f970707621eaaf840bd7", "score": "0.52937376", "text": "set() {\r\n\t\tthis.calibrate();\r\n\t}", "title": "" }, { "docid": "d932137804ad10fe716c005b38830d77", "score": "0.5279991", "text": "changeSet(val) {\n this.setting = val;\n }", "title": "" }, { "docid": "b41c9afd48411fe088603a2fc39dd515", "score": "0.5278961", "text": "set boja(x){\n this._boja = x;\n }", "title": "" }, { "docid": "3c0471dec06a1873281624ab9c19e7a5", "score": "0.52782667", "text": "setNombre(nombre) {\n this.nombre = nombre;\n }", "title": "" }, { "docid": "e7d1469411abfac41078c12eae2780bd", "score": "0.52701133", "text": "set () {\n return this;\n }", "title": "" }, { "docid": "e0dc0abb599b39cd31c6a09b839ecbfd", "score": "0.5268445", "text": "set(value) {\n this.value = value;\n }", "title": "" }, { "docid": "4ead8edafbda8050e952540533d9bdf5", "score": "0.5255356", "text": "function setSpecies(){\n\n var queryType = getQueryType();\n var defSpecies = getSpecies(); \n var control = document.settings.species;\n}", "title": "" }, { "docid": "94bce604187ac5116ecf30dd1a996610", "score": "0.52504194", "text": "setRadius(){\n return map(this.rng(), 0, 1, 0.1, 0.9);\n }", "title": "" }, { "docid": "fdeed3d1671dc0fb279982290f79c70b", "score": "0.5245621", "text": "set Static(value) {}", "title": "" }, { "docid": "67fda25335127deb91e9f079ead3a6bd", "score": "0.52228457", "text": "function outerSet(value) {\n var bridge = oj.BaseCustomElementBridge.getInstance(this);\n set.bind(bridge._PROPS_PROXY)(value, true);\n }", "title": "" }, { "docid": "07d2d37b3077d9571a74b41cf9ca3a08", "score": "0.5201136", "text": "setDefaultRAIDA(raidaNum) {\n this.options.defaultRaidaForQuery = raidaNum\n }", "title": "" }, { "docid": "86e102f0ab4441591e9b8cadc46418da", "score": "0.5199441", "text": "setMale() {\n this.sex = 'm';\n }", "title": "" }, { "docid": "589963f047e33bc4f29730495b1d6f6f", "score": "0.5189956", "text": "function setUI() {\n if (iAttrs.disconnectText && iAttrs.connectText) {\n if (scope.entity[userConnectedProp]) {\n iElement.text(iAttrs.disconnectText);\n } else {\n iElement.text(iAttrs.connectText);\n }\n }\n\n // TODO use ng-class directive\n if (iAttrs.connectedClass) {\n if (scope.entity[userConnectedProp]) {\n iElement.addClass(iAttrs.connectedClass);\n } else {\n iElement.removeClass(iAttrs.connectedClass);\n }\n }\n }", "title": "" }, { "docid": "90ac8cc0338f9a18e087e22022a40546", "score": "0.5178295", "text": "set aa(a) {\n this.a = a;\n }", "title": "" }, { "docid": "8024fbc10d57070ffee3291d406568b7", "score": "0.5174674", "text": "function setAsResident() {\n\tsetResidentValue({minimized: false, state: RESIDENT_START}, false);\n}", "title": "" }, { "docid": "8239210023cbed9a530052fefb273ea5", "score": "0.51742315", "text": "changeMode(value) {\n\t\tconst { id } = this.handle.api;\n\t\t\t\n\t\treturn this.call('set_properties', [\n\t\t\t{ did: `${id}`, siid: 2, piid: 3, value: value }\n\t\t]);\n\t}", "title": "" }, { "docid": "a5a8a672624e656597d660e42ff45f2e", "score": "0.51688796", "text": "set cliente(newValue){\n // instanceof == Instancia \n if(newValue instanceof Cliente){\n this._cliente = newValue;\n } \n }", "title": "" }, { "docid": "858312c62c95aa68c399584250c816f9", "score": "0.51578873", "text": "setSalario(salario){\n this._salario = salario;\n }", "title": "" }, { "docid": "91b8a53aa8b3ccdb8c625a29ccf0958e", "score": "0.5155258", "text": "_setRoleFromData() {\n if (!this._tree.treeControl.isExpandable && !this._tree.treeControl.getChildren &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getTreeControlFunctionsMissingError();\n }\n this.role = 'treeitem';\n }", "title": "" }, { "docid": "e0a27f968e611ceb5e483118e9a33ee4", "score": "0.51424074", "text": "static set value(value) {}", "title": "" }, { "docid": "e198c2fb1d74e58aa3025e8e52c696e5", "score": "0.51170534", "text": "set value(value) {\n this._value = value;\n }", "title": "" }, { "docid": "e99560ab54039ce82bdf611a5a1dd820", "score": "0.51098335", "text": "get role() {\n return super.role;\n }", "title": "" }, { "docid": "6366b8e94946bb0012d2ed17b500adea", "score": "0.51049423", "text": "constructor() {\n super(expressionType_1.ExpressionType.SetProperty, SetProperty.evaluator(), returnType_1.ReturnType.Object, SetProperty.validator);\n }", "title": "" }, { "docid": "e34eed2ac54348c77b7aabd284726ec7", "score": "0.5100834", "text": "testProp() {\n super.method(ruin());\n }", "title": "" }, { "docid": "00a10e6df67c087630253573e6e66390", "score": "0.5092029", "text": "llevaMartillo(){ return this._martillo; }", "title": "" }, { "docid": "f6c5f938e038e12cf80c1abd2ad93dad", "score": "0.5079255", "text": "function outerSet(value) {\n var bridge = ojcustomelementUtils.CustomElementUtils.getElementBridge(this);\n set.bind(bridge._PROPS_PROXY)(value, true);\n }", "title": "" }, { "docid": "24d23921819a9dfe4f28c72b609566a5", "score": "0.5074621", "text": "atraviesa(){ if(this._subiendo)this._atraviesa = true; }", "title": "" }, { "docid": "e1a02c64134f1af31d4fc60bfadbcd6d", "score": "0.5069129", "text": "setAriaProperty(property, value) {\n if (Agent.isTouchDevice()) this._boundingRect.setAriaProperty(property, value);\n else super.setAriaProperty(property, value);\n }", "title": "" }, { "docid": "92143816185569455e8f2a04a5b23052", "score": "0.5068661", "text": "set(r, g, b, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "title": "" }, { "docid": "58668b1120c23b0bbe29c016f269d043", "score": "0.50615805", "text": "setRed(red) {\n\t\tthis.red = red;\n\t}", "title": "" }, { "docid": "4bce849a6dfb3df966bcd3c3960a094c", "score": "0.50606894", "text": "set value(value) {\n this._value = value\n }", "title": "" }, { "docid": "92d6a690136e886f04374e9e1f0abead", "score": "0.5060212", "text": "function setRply(){\r\n let reply = `***Force Utilities Settings***`;\r\n reply += `\\nPrefix : ${config[1]}`;\r\n reply += `\\nMod Ch : ${config[4]}`;\r\n reply += `\\nWelcome Ch : ${config[6]}`;\r\n reply += `\\nCMD Ch : ${config[5]}`;\r\n reply += `\\nMember Count Ch : ${config[7]}`;\r\n reply += `\\nWatch List : \\n${config[2]}`;\r\n\r\n message.channel.send(reply);\r\n }", "title": "" }, { "docid": "cbd811b732d7ba8b899846b1fdc945a8", "score": "0.5056201", "text": "setValue() {\n throw new DomainError('derived class must override this method');\n }", "title": "" }, { "docid": "d7cebf74e92f01caef1f13367e3ee7d0", "score": "0.5055267", "text": "set properties(in_val){\n console.error( lapi.CONSTANTS.CONSOLE_MSGS.IMMUTABLE );\n }", "title": "" }, { "docid": "b7074b3db0a0494b1319ff465fdf1631", "score": "0.5053475", "text": "function set_recherche(r){\n recherche_courante = r;\n}", "title": "" }, { "docid": "7fe6a08da708bb0ec9cfff01f7ad5bf8", "score": "0.50459766", "text": "set InRoot(value) {}", "title": "" }, { "docid": "ba2c47a1255885a4e549bdb2ae358051", "score": "0.5044643", "text": "setted(value){}", "title": "" }, { "docid": "23a2b52c11342b605f04d914a0090776", "score": "0.5041673", "text": "setComponent() {\n // Properties\n if (this.id) this.safeSet(\"id\", this.id);\n if (this.type) this.safeSet(\"type\", this.type);\n\n // Attributes\n if (this.color) this.safeSet(\"color\", this.color);\n if (this.col) this.safeSet(\"col\", this.col);\n if (this.offset) this.safeSet(\"offset\", this.offset);\n if (this.css) this.safeSet(\"css\", this.css);\n }", "title": "" }, { "docid": "7b45bdf2132ddb5a3fa27aad55f60e2d", "score": "0.503732", "text": "setRadiusScale() {\n let vis = this;\n\n // Get the least and most amount of consumption by a country\n const minMaxConsumption = d3.extent(Array.from(vis.normalizedConsumption.values()))\n\n vis.radiusScale = d3.scalePow().exponent(0.5)\n .range([8, 15])\n .domain(minMaxConsumption);\n }", "title": "" }, { "docid": "454549ee1a4ae8e4dec16e954a3b0f16", "score": "0.5036587", "text": "setValue(value)\n\t\t{\n\n\t\t}", "title": "" }, { "docid": "8bb95c482c93ef7009048b87166039b3", "score": "0.5030743", "text": "setRed() {\n this.setColor('red');\n }", "title": "" }, { "docid": "2a9fb09b3a38f629af810890e171e9b8", "score": "0.5027768", "text": "setValue(value) {\n if (typeof value == 'string' && !value.startsWith('=')) {\n // Resource Id's will be resolved to actual dialog value\n // if it's not a = then we want to convert to a constant string expressions to represent a\n // external dialog id resolved by dc.FindDialog()\n value = `='${value}'`;\n }\n super.setValue(value);\n }", "title": "" }, { "docid": "ef3c8dd2d2129191358fb2915030bc50", "score": "0.5025128", "text": "set Auto(value) {}", "title": "" }, { "docid": "c732f8f21b16193b723a00d9ef7629e4", "score": "0.50212586", "text": "set() {}", "title": "" }, { "docid": "c732f8f21b16193b723a00d9ef7629e4", "score": "0.50212586", "text": "set() {}", "title": "" }, { "docid": "c732f8f21b16193b723a00d9ef7629e4", "score": "0.50212586", "text": "set() {}", "title": "" }, { "docid": "213a48b5a7c511e3b632f5d07e105460", "score": "0.5014862", "text": "set a(val) {\n\t\tthis._a_ = val;\n\t}", "title": "" }, { "docid": "dfaae95ba09e0c296fd938c019b5c0ae", "score": "0.50089717", "text": "function YCellular_set_radioConfig(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('radioConfig',rest_val);\n }", "title": "" }, { "docid": "86fafd4d164728993763630026a32b92", "score": "0.50064385", "text": "function ub(a){this.radius=a}", "title": "" }, { "docid": "86fafd4d164728993763630026a32b92", "score": "0.50064385", "text": "function ub(a){this.radius=a}", "title": "" }, { "docid": "1c4d80cf9a0a12adc9a8ca38102d667f", "score": "0.4996794", "text": "setRectangle()\n {\n this.isRectangle = true;\n this.isCircle = false;\n\n this.sprite.image.style.borderRadius = \"\";\n }", "title": "" }, { "docid": "6e6c961ac59613fec993db2bb77e8a54", "score": "0.4991005", "text": "set [_owner.OWNER](value) {\n this[OVERRIDE_OWNER] = value;\n }", "title": "" }, { "docid": "146a70522cd52933b061d2a126e6dc46", "score": "0.4986286", "text": "setMutatorValue(_value) {\n this.value = _value;\n this.display();\n }", "title": "" }, { "docid": "13b1e98f54a68f764be1b51dd3867bc7", "score": "0.49857014", "text": "set readerId(value) { //\r\n this._readerId = value; //\r\n }", "title": "" }, { "docid": "d65a687e4b3485baa658fb1a63dcb575", "score": "0.49738714", "text": "set Other(value) {}", "title": "" }, { "docid": "3560fa1d6d9154f7b3b6915f08fea892", "score": "0.4972551", "text": "get prenom() {\n\treturn this._nom;\n}", "title": "" }, { "docid": "168b01179a26c01ce27c67f7949a01dc", "score": "0.49717984", "text": "set bar(v) { this.foo = v; }", "title": "" }, { "docid": "e033c7ba3150bcff6a2d0be2d6bbf4e1", "score": "0.4970136", "text": "function property(name, get, set, wrap, unique) {\n\t\tObject.defineProperty(vanilla.prototype, name, {\n\t\t\tget: get ? getter(name, wrap, unique) : undefined,\n\t\t\tset: set ? setter(name) : undefined,\n\t\t\tconfigurable: true // We must be able to override this.\n\t\t});\n\t}", "title": "" }, { "docid": "eebdff61f9c3eca856e4a84155b42d8b", "score": "0.49624157", "text": "get radialTypes(){\n return [this.borderTypes[1], this.borderTypes[2]];\n }", "title": "" }, { "docid": "e553fb76117df52454fc18bc3e9b8bb1", "score": "0.49620992", "text": "setType(type) {\n this.__type = type;\n return this;\n }", "title": "" }, { "docid": "ea0ac21be70f484f4464d02ab0b220a5", "score": "0.49619347", "text": "constructor(){\n this.plateau = null;\n this.rovers = [];\n }", "title": "" }, { "docid": "aedb59294eb6c396c54bc4b9311e1897", "score": "0.49610013", "text": "function changeProperty() {\n\t// if the element is not colot, this is set to \"px\"\n\tconst unitOfMeasure = this.dataset.unit || \"\";\n\n\tdocument.documentElement.style.setProperty(`--${this.name}`, this.value + unitOfMeasure);\n\tconsole.log(unitOfMeasure);\n}", "title": "" }, { "docid": "64892445d5d0892e3042b0944cc5337a", "score": "0.49585173", "text": "get cuotas_a(){\n return this.cuotas;\n }", "title": "" }, { "docid": "f03f072203e927f912a2bad50b28cec7", "score": "0.49505997", "text": "static set objects(value) {}", "title": "" }, { "docid": "e49f92e08dcb8eeed4786e1ce3866d27", "score": "0.49495345", "text": "setMaleza(state, nuevaMaleza) {\n state.maleza = nuevaMaleza\n }", "title": "" }, { "docid": "43a6137e1482f420d816b82fa048fa12", "score": "0.49489427", "text": "set parameters(value) {}", "title": "" }, { "docid": "8a6798c946de4a0d41cc39e961e3ca62", "score": "0.4946256", "text": "setUltimoNumeroNoDisplay(){\n\n let ultimoNumero = this.getUltimoItem(false);\n\n //console.log(\"Ultimo Numero Digitado\", ultimoNumero);\n\n //Verificando se a variavel ultimoNumero esta vazia, caso sim, exibe erro na tela do usuario\n if (!ultimoNumero) ultimoNumero = 0;\n\n this.displayNumeros = ultimoNumero;\n\n\n }", "title": "" }, { "docid": "f3b93797f4ba82313b3842d4c367c1a3", "score": "0.49448422", "text": "setX(newX) { this.x = newX;}", "title": "" }, { "docid": "4cf258c39eb3c99d4000793fbb9b438f", "score": "0.49411845", "text": "get valor() {\n return this._valor\n }", "title": "" }, { "docid": "99474354461515ebe90e6868ddc6d036", "score": "0.4937411", "text": "function setNeedleRpm() {\n values.rpm = (rpmNeedleCount)\n}", "title": "" }, { "docid": "2441a5c46d902b3a3af9f9f5d1d53679", "score": "0.49343094", "text": "setSettings() {\n this.density =\n this.canvas.width < 600 ? 12 : this.canvas.width < 1000 ? 20 : 30;\n this.drawDistance = 1;\n this.baseRadius =\n this.canvas.width < 600 ? 6 : this.canvas.width < 1000 ? 10 : 15;\n this.maxLineThickness = 10;\n this.reactionSensitivity = 5;\n this.lineThickness = 100;\n }", "title": "" }, { "docid": "2b0b98ef4e54bd19957c959ff4b8b848", "score": "0.49312228", "text": "set(instance, data) {\n instance[`_${this.name}_raw`] = data;\n }", "title": "" }, { "docid": "9c348edb146eb55da9c75286b6d1e03f", "score": "0.4926337", "text": "function newres() {\n //res base = W.resbaseui.value * 1;\n //res dyndelta = W.resdyndeltaui.value * 1;\n refall();\n}", "title": "" } ]
036407ed0935aa148814b55973cb27b6
render the view of the App compoent and the state has binded in the view
[ { "docid": "892d15c64d6554bcff545ade9bb2c583", "score": "0.0", "text": "render() {\n return (\n <div id=\"chart\">Graph</div>\n )\n }", "title": "" } ]
[ { "docid": "a901e0e18ff1f5c32eea62909e1a2a79", "score": "0.72318715", "text": "function renderApp() {\n document.body.innerText = store.getState();\n}", "title": "" }, { "docid": "4b66b8e0e289e2af01817bfeba3c05b9", "score": "0.71636117", "text": "render(app) { }", "title": "" }, { "docid": "379825ce13d3392b03c1899030ed2d74", "score": "0.69704807", "text": "render() {\n if (this.state.loading) {\n return <ApplicationLoadingView/>;\n } else if (this.state.isError) {\n return <ApplicationLoadingErrorView/>;\n }\n return <App />;\n }", "title": "" }, { "docid": "25f35a5bc93e50115c7c8bfcc0a77a91", "score": "0.69151384", "text": "render() {\n if (this.props.app.ready) {\n return this.renderMessenger();\n } else {\n return this.renderEmptyScreen();\n }\n }", "title": "" }, { "docid": "679ea15a9584da58863a56289f376222", "score": "0.6882337", "text": "render() { return this.App(); }", "title": "" }, { "docid": "bd7efda92431e25e72c13db905389155", "score": "0.68662906", "text": "render () {\n\t\tlet { context, user } = this.state;\n\n\t\tif (user.name == null) {\n\t\t\treturn this.renderApp(<Auth key={0} />);\n\t\t} else {\n\t\t\treturn this.renderApp(\n\t\t\t\t<SideBar key={0} {...this.state} />,\n\t\t\t\t<Diagram key={1} {...this.state} />,\n\t\t\t\t<Context key={2} context={context} />\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "a87a44a549d60eac7f30d6685c6670bf", "score": "0.68564993", "text": "render() {\n return (this.showFromState());\n }", "title": "" }, { "docid": "df7e2e3e9de8a5225fb3312f2caadc69", "score": "0.6809439", "text": "async view() {\n await this.renderSelf();\n window.app.intercom.view(false);\n window.app.view(this.header, this.main);\n this.manage();\n }", "title": "" }, { "docid": "57a3fe1ab50da54b8e5e49b2a100a0a5", "score": "0.6779533", "text": "render() {\n render(this._template(this), this, {eventContext: this});\n if (!this._app) {\n this._app = this.firstElementChild;\n // render again in case anything was using attributes on this._app.\n render(this._template(this), this, {eventContext: this});\n }\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.6753349", "text": "render(){}", "title": "" }, { "docid": "952f8e84097087463c4ee3a980f0f95d", "score": "0.6753218", "text": "_render()\n {\n const ContentView = this.view.content;\n const SidebarView = this.view.sidebar;\n\n if(SidebarView)\n {\n const sidebarContents = new SidebarView(this.dataStore, this.callbacks, this.routeName);\n sidebarContents.setSidebarContainer(this.sidebarContainer);\n sidebarContents.setContentContainer(this.contentContainer);\n\n sidebarContents.render();\n }\n\n if(ContentView)\n {\n const contents = new ContentView(this.getData(), this.callbacks);\n contents.setContentContainer(this.contentContainer);\n\n return contents.render();\n }\n\n\n }", "title": "" }, { "docid": "0bd09c01519e11301b34f296830721e9", "score": "0.6534915", "text": "function renderView() {\n console.log('`renderView` ran');\n let newView = STORE.info.currentView;\n let viewString = generateView(newView);\n $('#render-this').html(viewString);\n }", "title": "" }, { "docid": "8abadcb6c471cfbd8d76e0fd767773ed", "score": "0.6488623", "text": "function render (state) {\n return App(state, dispatch)\n}", "title": "" }, { "docid": "abe9cc3c54edd78f7af27dec00267c02", "score": "0.6471638", "text": "view() {\n window.app.intercom.view(false);\n window.app.view(this.header, this.main);\n this.manage();\n }", "title": "" }, { "docid": "2ebb2b6ae7b261da4b14b48c2632991b", "score": "0.6466707", "text": "renderView(){\n if(this.state.mode === 'loading'){\n return(\n <div className=\"loading\">\n <img src=\"https://s-media-cache-ak0.pinimg.com/originals/8b/a8/ce/8ba8ce24910d7b2f4c147359a82d50ef.gif\"\n alt=\"loading\" />\n </div>\n )\n } else if(this.state.mode === 'auth') {\n return (\n <UserAuth\n setUser={this.setUser.bind(this)}\n urlApi={this.state.urlApi}\n />\n )\n } else{\n return this.renderAllGames()\n }\n }", "title": "" }, { "docid": "c972611b7f3f449fde1bc553bc19fec0", "score": "0.6458465", "text": "render() {\n\t\treturn (\n\t\t\t<View>\n\t\t\t</View>\n\t\t);\n\t}", "title": "" }, { "docid": "332b91d53be4c7eca8a8949c7c37b2f9", "score": "0.645745", "text": "onRender () {\n this.setupComponents();\n this.setupComponentEventListeners();\n this.rendered = true;\n this.hydrateFromLocalStorage();\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.64264023", "text": "render() {\n }", "title": "" }, { "docid": "b398cf969327e2ae4dbaa5f96756d063", "score": "0.63983953", "text": "render(c){\n \n return c(app);\n }", "title": "" }, { "docid": "d1b89d473161a599ffda74f488521bae", "score": "0.6388876", "text": "function render() {\n if (window.location.hash === '#/projects') {\n if (!stateObj.projectsHtml) {\n $.get('/projects.html', function(data) {}).then(function(data) {\n stateObj.projectsHtml = data;\n showTemplate(data);\n });\n } else {\n showTemplate(stateObj.projectsHtml);\n }\n // must remove scroll listeners otherwise the stateObj.scrollData doesn't work\n $(window).off();\n } else {\n window.location.hash = '#';\n if (!stateObj.indexHtml) {\n $.get('/mainTemp.html', function(data) {}).then(function(data) {\n stateObj.indexHtml = data;\n showTemplate(data);\n // this is the javascript that this view requires\n mainPage();\n // function that scrolls to the stateObj.scrollData height, taking into account the navBars height\n scrollDown();\n });\n } else {\n showTemplate(stateObj.indexHtml);\n mainPage();\n scrollDown();\n }\n }\n }", "title": "" }, { "docid": "018bc3f6a741a5625a743986268b1316", "score": "0.63718265", "text": "executeRender() {\n\n if (this.state.isError) {\n\n return this.renderError();\n\n }\n else if (this.state.isLoaded) {\n\n return this.renderLoaded();\n\n }\n else {\n\n return this.renderLoading();\n\n }\n\n }", "title": "" }, { "docid": "ddc898d14c063ab2bc9f60e221b08514", "score": "0.6353571", "text": "function App(state) {\n if (state.get('apod')) {\n return `\n <main>\n <div class=\"info-card padded row\">\n <div class=\"six columns\">\n ${roverInfo(state)}\n </div>\n </div>\n <div class=\"padded row\">\n ${roverImages(state)}\n </div>\n <div class=\"row\">\n <footer class=\"u-full-width text-center\">\n <p>Mars Dashboard 2021 - delivering the latest rover news.</p>\n </footer>\n </div>\n </main>'\n `;\n }\n else {\n return `\n <main>\n <div class=\"info-card row\">\n <div class=\"u-full-width\">\n <h5>Please click on the buttons above to load the latest news from the Mars rovers.</h5>\n </div>\n </div>\n </main>\n `;\n }\n}", "title": "" }, { "docid": "f85b6ac2cafb8478ed5f26a5f914c990", "score": "0.6322788", "text": "render() {\n this.modelView.render()\n this.root.firstElementChild.nextElementSibling.innerHTML = this.model.getStatusContainer()\n let controlPanel = this.root.lastElementChild\n controlPanel.innerHTML = this.model.getControlPanel()\n controlPanel.firstElementChild.nextElementSibling.onclick = () => this.model.previousState()\n controlPanel.lastElementChild.onclick = () => this.model.nextState()\n }", "title": "" }, { "docid": "7d85d0ef74018a86c25514ff12948e2a", "score": "0.6320127", "text": "updateView() {\n this.emptyBody()\n\n // push new view based of state\n switch (this.appState) {\n case 0:\n $(\"#body\").load(\"page_assets/landing.html\");\n break;\n\n case 1:\n $(\"#body\").load(\"page_assets/disclaimer.html\");\n break;\n\n case 2:\n $(\"#body\").load(\"page_assets/menu.html\");\n break;\n\n case 3:\n $(\"#body\").load(\"page_assets/progress.html\");\n break;\n\n case 4:\n $(\"#body\").load(\"page_assets/instructions.html\");\n break;\n\n case 5:\n $(\"#body\").load(\"page_assets/settings.html\");\n break;\n\n case 6:\n if (this.getLocalStorage('playedBefore')) {\n $(\"#body\").load(\"page_assets/level_select.html\");\n } else {\n $(\"#body\").load(\"page_assets/first_time.html\");\n }\n break;\n\n case 7:\n this.startLevel(this.levelSelected)\n break;\n\n case 8:\n $(\"#body\").load(\"page_assets/delete_data.html\");\n break;\n\n case 9:\n $(\"#body\").load(\"page_assets/change_height.html\");\n break;\n\n case 10:\n $(\"#body\").load(\"page_assets/after_level_questions.html\");\n break;\n\n default:\n console.warn(\"State controller catched a unknown state.\");\n break;\n }\n }", "title": "" }, { "docid": "aa6dad064c2ab742c59394263b56181a", "score": "0.6294954", "text": "renderContent(){\n\t\tswitch(this.state.loggedIn){\n\t\t\tcase true:\n\t\t\t\treturn (\n\n\t\t\t\t\t<PageOne/>\n\t\t\t\t);\n\t\t\tcase false:\n\t\t\t\treturn <LoginForm />\n\n\t\t\tdefault:\n\t\t\t\treturn(\n\t\t\t\t\t<View style={styles.spinnerViewStyle}>\n\t\t\t\t \t\t<Spinner size=\"large\" />\n\t\t\t\t \t</View>\n\t\t\t\t );\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "a95607bdb7d4fc8d1f18b7ff47231d71", "score": "0.6278545", "text": "render() {\n\t\tif (!localStorage[\"aiims-login-token\"]) {\n\t\t\treturn <Login userInfo={this.rememberUserInfo} />;\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<App\n\t\t\t\t\tuserInfo={this.state.userInfo}\n\t\t\t\t\tforgetUserInfo={this.forgetUserInfo}\n\t\t\t\t\tsendPageIndexToMain={this.getPageIndex}\n\t\t\t\t\tgetRequest={this.getRequest}\n\t\t\t\t\tpostRequest={this.postRequest}\n\t\t\t\t\tdeleteRequest={this.deleteRequest}\n\t\t\t\t\tputRequest={this.putRequest}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "ef7eb94627210ea74c7223acdbb59a51", "score": "0.6256747", "text": "render(){\n\t\t//if not logged in, dispaly login\n\t\tif(!this.data.currentUser){\n\t\t\treturn (\n\t\t\t\t<div> \n\t\t\t\t\t<LoginWrapper />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tswitch (this.state.display){\n\t\t\tcase 'list':\n\t\t\t\treturn this.renderList();\n\t\t\tcase 'poll':\n\t\t\t\treturn this.renderPoll();\n\t\t\tcase 'comments':\n\t\t\t\treturn this.renderComments();\n\t\t\tcase 'visualize':\n\t\t\t\treturn this.renderVisual();\n\t\t\tdefault:\n\t\t\t\treturn this.renderList();\n\t\t}\n\t}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.62481046", "text": "render () {}", "title": "" }, { "docid": "81ca7d6215c1c18a05ae9d367ad6a954", "score": "0.62386245", "text": "onRender() {}", "title": "" }, { "docid": "b138b682c231804bf37b01c372ad79f2", "score": "0.62110806", "text": "_renderMainContent () {\n switch (this.currentView) {\n case views.HOME:\n return lazyLoad(\n import('./views/view-home'),\n html`\n <view-home \n ._hasPendingChildren=\"${this._hasPendingChildren}\"\n ._pendingCount=\"${this._pendingCount}\" >\n </view-home>\n `\n )\n case views.LOGIN:\n return lazyLoad(\n import('./views/view-login'),\n html`<view-login\n ._hasPendingChildren=\"${this._hasPendingChildren}\"\n ._pendingCount=\"${this._pendingCount}\" >\n </view-login>`\n )\n default:\n return lazyLoad(\n import('./views/view-notfound'),\n html`<view-notfound></view-notfound>`\n )\n }\n }", "title": "" }, { "docid": "c3f27e4386101d6416419bb004070be4", "score": "0.6202422", "text": "render() {\n console.log(\"We are in the render method\");\n return (\n <>\n <NavBar />\n <ApplicationViews />\n </>\n );\n }", "title": "" }, { "docid": "54b1aed1c05dc0e76f8c662afef7b689", "score": "0.6198303", "text": "render () {\n if (this.props.isAppReady) {\n Actions.RequestsList();\n } else {\n return (\n <AuthScreen\n login={this._login}\n signup={this._signup}\n isLoggedIn={this.props.isLoggedIn}\n isLoading={this.props.isLoading}\n onLoginAnimationCompleted={() => this.setState({ isAppReady: true })}\n />\n )\n }\n }", "title": "" }, { "docid": "dc0d6e4af8284060a9598da7d53d31f3", "score": "0.61976886", "text": "function render() {\n if (game.state !== '') {\n renderState();\n } else {\n game.renderGame();\n }\n }", "title": "" }, { "docid": "00135bbfae0d38d8d03a15fb99c4943b", "score": "0.61962587", "text": "function mainView (state, prev, send) {\n const dats = state.app.archives\n return html`\n <body>\n ${svgSprite()}\n ${header({\n create: () => send('app:create'),\n download: (link) => send('app:download', link)\n })}\n <table style=${css(style.table)} class=\"dat-list\">\n <thead style=${css(style.heading)} class=\"dat-list__header\">\n <tr>\n <th></th>\n <th>Link</th>\n <th>Download</th>\n <th class=\"cell-right\">Network</th>\n <th class=\"cell-right\">Size</th>\n </tr>\n </thead>\n <tbody>\n ${createTable(dats, send)}\n </tbody>\n </table>\n </body>\n `\n}", "title": "" }, { "docid": "7d86b62ac28bdae89e3b6a9440e41c9e", "score": "0.618367", "text": "render() {\n\t\t/** get the template and inner html */\n\t\tconst tempDOM = createTemporaryDOM(this.template, this.data, this.getDirectiveContainer().getDirectives());\n\n\t\t/** set the app */\n\t\tupdateDOM(this.container, virtualizeDOM(tempDOM.content.children[0]), this.initd() ? virtualizeDOM(this.container.children[0]) : undefined);\n\t\t\n\t\t/** cycle through post directives */\n\t\tparseDirectives(this.getDirectiveContainer().getDirectives().filter(dir => dir.isPost()), this.container, this.data);\n\n\t\t/** set initd to true */\n\t\tthis.setInitd(true);\n\t}", "title": "" }, { "docid": "bca2a4185ea0a22b2b486b6a456c6c3f", "score": "0.617052", "text": "render() {\n return this.appState.availableChannels.length ? html`${appBodyTemplate({\n filterDerivation: `${this.store.config.tool}/${this.store.config.tool\n }.js`,\n config: this.store.config,\n zoomIn: () => this.store.zoomIn(),\n zoomOut: () => this.store.zoomOut(),\n toggleCards: this.handleOnCardToggle,\n togglePanel: this.handleOnPanelToggle,\n baseApiUrl: this.store.baseApiUrl,\n })}` : html`<div/>`;\n }", "title": "" }, { "docid": "4bfac131763f28196002409f7c0f8ee7", "score": "0.6163107", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "21457b10ec6e3c87b0a0b20b097e64d1", "score": "0.6158362", "text": "_renderState(state) {\n state = new State(state);\n this._renderQuestion(state);\n this._renderAverage(state);\n this._renderVoteTable(state);\n this._renderLogbook(state);\n this._renderIceCream(state);\n }", "title": "" }, { "docid": "e741e0716167bf4a81a530c5d33ef1bb", "score": "0.6150989", "text": "render(){\n\n }", "title": "" }, { "docid": "495fc050e7825f930f2279fcbc640c22", "score": "0.61451054", "text": "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "title": "" }, { "docid": "495fc050e7825f930f2279fcbc640c22", "score": "0.61451054", "text": "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "title": "" }, { "docid": "495fc050e7825f930f2279fcbc640c22", "score": "0.61451054", "text": "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "title": "" }, { "docid": "9fbad4b6ada31036f48287ac5b25866e", "score": "0.6135929", "text": "function ViewStructure(){\n\t\n\t\n\n\tvar StateView = Backbone.View.extend({\n\t\n el: 'body',\n \n events: {\n },\n \n initialize: function() {\n console.log(\"StateView initialize\");\n console.log(this.el);\n },\n\n render: function() {\n //renderizado de la coleccion de estados en ambos sitios:\n \t\n\t\tvar str = '{\"user\":\"'+globalV.User+'\"}';\n\t\tvar json = JSON.parse(str);\n\t\t\n\t\tvar data = remoteDT.pedidosLogin.where(json);\n \t\n\t\tvar viewHtml=\"\";\n\t\tvar viewHtml_1=\"\";\n\t\t\n\t\tif (data != 0){\n\t\t\t\n\t\t\tfor(var i = 0; i < data.length; ++i) {\n\t\t\t\t\n\t\t\t\tvar pedido = data[i];\t\t\t\t\n\t\t\t\t\n\t\t\t\tviewHtml+= \"<li>\";\n\t\t\t\tviewHtml+=\"<div class=\\\"ui-grid-b\\\">\";\n\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n\t\t\t\tviewHtml+=\"<img src=\\\"img/user.png\\\">\";\n\t\t\t\tviewHtml+=\"</div>\";\t\n\t \t\tviewHtml+=\"<div class=\\\"ui-block-b\\\">\";\n\t \t\tviewHtml+=\"<div class=\\\"ui-grid-solo\\\">\";\n\t \t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml+=\"<p>Code: <b>\"+pedido.get(\"code_command\")+\"</b></p>\";\n\t \t\tviewHtml+=\"</div>\"\n\t \t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml+=\"<p>Type: <b>\"+pedido.get(\"type\")+\"</b></p>\";\t\n\t \t\tviewHtml+=\"</div>\";\n\t \t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml+=\"<p>State: <b>\"+pedido.get(\"state\")+\"</b></p>\";\t\n\t \t\tviewHtml+=\"</div>\";\n\t \t\tviewHtml+=\"</div>\";\n\t \t\tviewHtml+=\"</div>\";\n\t \t\tviewHtml+=\"<div class=\\\"ui-block-c\\\">\";\n\t \t\tviewHtml+=\"<a href=\\\"#p\\\" onclick=\\\"getDataConsulta('\"+pedido.get(\"code_command\")+\"','\"+pedido.get(\"type\")+\"','\"+pedido.get(\"state\")+\"')\\\"><img src=\\\"img/carat-r-black.png\\\"/></a>\";\n\t \t\tviewHtml+=\"</div>\";\n\t \t\tviewHtml+=\"</div>\";\n\t\t\t\tviewHtml+=\"</li>\";\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tviewHtml_1+= \"<li>\";\n\t\t\t\tviewHtml_1+=\"<div class=\\\"ui-grid-c\\\">\";\n\t\t\t\tviewHtml_1+=\"<div class=\\\"ui-block-a\\\" style=\\\"width:25%;\\\">\";\n\t\t\t\tviewHtml_1+=\"<img src=\\\"img/user.png\\\">\";\n\t\t\t\tviewHtml_1+=\"</div>\";\n\t\t\t\tviewHtml_1+=\"<div class=\\\"ui-block-b\\\" style=\\\"width:25%;\\\">\";\n\t\t\t\tviewHtml_1+=\"<input type=\\\"checkbox\\\" name=\\\"sel_\"+pedido.get(\"code_command\")+\"\\\" id=\\\"sel_\"+pedido.get(\"code_command\")+\"\\\" class=\\\"custom\\\">\";\n\t\t\t\tviewHtml_1+=\"</div>\";\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-block-c\\\" style=\\\"width:25%;\\\">\";\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-grid-solo\\\">\";\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml_1+=\"<p>Code: <b>\"+pedido.get(\"code_command\")+\"</b></p>\";\n\t \t\tviewHtml_1+=\"</div>\"\n\t \t\t\t\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml_1+=\"<p>Type: <b>\"+pedido.get(\"type\")+\"</b></p>\";\t\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-block-a\\\">\";\n\t \t\tviewHtml_1+=\"<p>State: <b>\"+pedido.get(\"state\")+\"</b></p>\";\t\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t \t\tviewHtml_1+=\"<div class=\\\"ui-block-d\\\" style=\\\"width:15%;\\\">\";\n\t \t\tviewHtml_1+=\"<a href=\\\"#p\\\" onclick=\\\"getDataConsultaEdicion('\"+pedido.get(\"code_command\")+\"','\"+pedido.get(\"type\")+\"','\"+pedido.get(\"state\")+\"','\"+i+\"')\\\"><img src=\\\"img/carat-r-black.png\\\"/></a>\";\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t \t\tviewHtml_1+=\"</div>\";\n\t \t\t\n\t\t\t\tviewHtml_1+=\"</li>\";\t\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById(\"deliveries\").innerHTML = viewHtml;\n\t\t\tdocument.getElementById(\"deliveries_1\").innerHTML = viewHtml_1;\n\t\t\t\n\t\t\treturn this;\n\t\t}\n \t\n\t\t\n \tconsole.log('State rendered');\n },\n\n\t});\n\n\tthis.vistaEstado = StateView;\n\t\n\t\n\tvar StateView_1 = Backbone.View.extend({\n\t\t\n\t el: 'body',\n\t \n\t events: {\n\t },\n\t \n\t initialize: function() {\n\t console.log(\"StateView_1 initialize\");\n\t console.log(this.el);\n\t },\n\n\t render: function(pedido) {\n\t //renderizado de la coleccion de estados en ambos sitios:\n\t \t\n\t\t\tvar str = '{\"user\":\"'+globalV.User+'\",\"code_command\":\"'+pedido+'\"}';\n\t\t\tvar json = JSON.parse(str);\n\t\t\t\n\t\t\tvar data = remoteDT.estadosLogin.where(json);\n\t \t\n\t\t\tvar viewHtml=\"\";\n\t\t\tvar viewHtml_1=\"\";\n\t\t\t\n\t\t\tif (data != 0){\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i < data.length; ++i) {\n\t\t\t\t\t\n\t\t\t\t\tvar estado = data[i];\t\t\n\t\t\t\t\t\n\t\t\t\t\tviewHtml+= \"<li>\";\n\t\t\t\t\t\n\t\t\t\t\tviewHtml+=\"<div class=\\\"ui-grid-b\\\">\";\n\t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n\t\t\t\t\tviewHtml+=\"<img src=\\\"img/truck.png\\\">\";\n\t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\n\t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-b\\\">\";\n\t\t\t\t\tviewHtml+=\"<div class=\\\"ui-grid-solo\\\">\";\n \t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n \t\t\t\t\tviewHtml+=\"<p>Code: <b>\"+estado.get(\"code_state\")+\"</b></p>\";\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n \t\t\t\t\tviewHtml+=\"<p>State: <b>\"+estado.get(\"state\")+\"</b></p>\";\t\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n \t\t\t\t\tviewHtml+=\"<p>Situation: <b>\"+estado.get(\"situation\")+\"</b></p>\";\t\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-a\\\">\";\n \t\t\t\t\tviewHtml+=\"<p>Time: <b>\"+estado.get(\"timestamp\")+\"</b></p>\";\t\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\n \t\t\t\t\tviewHtml+=\"<div class=\\\"ui-block-c\\\">\";\n \t\t\t\t\tviewHtml+=\"<a href=\\\"#\\\"><img src=\\\"img/carat-r-black.png\\\"/></a>\";\n \t\t\t\t\tviewHtml+=\"</div>\";\n \t\t\t\t\tviewHtml+=\"</div>\";\n\t\t\t\t\tviewHtml+=\"</li>\";\n\t\t\t\t}\t\n\t\t\t\n\t\t\t\tdocument.getElementById(\"states\").innerHTML = viewHtml;\t\t\t\t\n\t\t\t\treturn this;\n\t\t\t}\n\t \t\n\t\t\t\n\t \tconsole.log('State_1 rendered');\n\t },\n\n\t\t});\n\n\t\tthis.vistaEstado_1 = StateView_1;\t\n}", "title": "" }, { "docid": "0fe346e2a3dbef0087d66d44ed188f38", "score": "0.6124641", "text": "_runView() {\n this._renderTimeMeasures();\n this._renderMomentEvents();\n this._renderLanes();\n this._listenEvents();\n }", "title": "" }, { "docid": "853f297fa28eb5853a081a19379900ba", "score": "0.61165273", "text": "render() {\n\n //Header Section\n const Header = $(`<div class=\"header\"></div>`)\n const Heating = new HeatDisplay(this.store);\n Header.html( [$(`<h1>DJ's Smart Home</h1>`), Heating.render()] )\n const HeaderWrapper = $(`<header></header>`)\n HeaderWrapper.html(Header)\n\n //Main Content Section\n const Main = $(`<main></main>`)\n const NavBar = new Nav(this.store);\n const Lights = new LightList(this.store);\n const TemperatureControl = new HeatingWidget(this.store);\n const CurtainControl = new CurtainList(this.store);\n\n const Routes = [Lights,TemperatureControl, CurtainControl]\n Main.html(Routes[this.store.currentRoute].render())\n\n //Finally render all children to the root element (document.body)\n this.$root.html([HeaderWrapper, NavBar.render(), Main])\n }", "title": "" }, { "docid": "909a6f06b89fb3be06e407c7fa0c0255", "score": "0.6114349", "text": "function mainMenuView(viewname) { \n ReactDOM.unmountComponentAtNode(document.getElementById('react-app'));\n globalState=autoutils.copyData(globalState,rawInit);\n globalState.viewname=viewname;\n globalState.parent=null;\n globalState.op='list';\n globalState.sortkey=\"id\";\n globalState.down=true; \n initReact(globalState);\n}", "title": "" }, { "docid": "c6e384e9dee665ae1f59688265df9667", "score": "0.6109849", "text": "constructor() {\n this.viewSection = document.createElement('section'); // <section> where the views is rendering to\n BaseView.renderRoot.appendChild(this.viewSection);\n this.viewSection.style.display = 'none'; // View should not be displayed until all preparations is done (like data fetch)\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.61059904", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "a1933fe044cf5aa61f58acc01195a3e9", "score": "0.61046636", "text": "render() {\n return (\n <div className=\"App\">\n <div className=''>\n <h1>{this.state.users}</h1> \n {this.renderLoginButtonG()}\n </div>\n \n </div>\n );\n }", "title": "" }, { "docid": "a6cb0934bef15c306533c28dc3da2976", "score": "0.6104057", "text": "render() {\n//todo add component view\n return (\n <div>\n PageTest\n </div>\n );\n }", "title": "" }, { "docid": "63748de97d5813dafb5d65747e019071", "score": "0.6100133", "text": "render() {\n var self = this;\n var view = new PortalView();\n\n this.view.showSpinner(this.target);\n\n var snippet = this.template(this.dataModel);\n\n this.target.html(snippet).promise().done(() => {\n self.view.removeSpinner();\n\n view.showPanelsWithAnimation(self);\n });\n }", "title": "" }, { "docid": "bfe2a039e8f5c03e3d2cb868a28ac19a", "score": "0.6080335", "text": "function _render() {\n // Destroy slider.\n if (slider) {\n let paggination = $modal.querySelector('.siema-pagination');\n if (paggination) {\n paggination.parentElement.removeChild(paggination)\n }\n slider.destroy();\n }\n\n if (state.open && state.data) {\n // Replace all the data.\n _renderImage();\n _renderProducts();\n $desc.innerHTML = state.data.desc;\n $date.innerHTML = moment(state.data.created_at).format('LL');\n // Setup Siema.\n slider = new Siema(SLIDER_PARAMS);\n slider.addPagination();\n \n // Then show the modal.\n $modal.classList.add(ACTIVE_CLASS);\n document.body.classList.add(NO_SCROLL_CLASS);\n\n _addEventListeners();\n return;\n }\n // Hide modal.\n $modal.classList.remove(ACTIVE_CLASS);\n document.body.classList.remove(NO_SCROLL_CLASS);\n\n // Clean up\n $image.innerHTML = '';\n $products.innerHTML = '';\n $desc.innerHTML = '';\n $date.innerHTML = '';\n\n // Cleanup after buttons if there are any.\n if ($btns) {\n _removeEventListeners();\n }\n}", "title": "" }, { "docid": "28aa10b1b59b132e3c2e7b751b2967b9", "score": "0.6079632", "text": "render(config, _caller) {\n this.routingService.go(config);\n }", "title": "" }, { "docid": "9457568e1357b9c8bdc0c08f629b55ca", "score": "0.60748005", "text": "getView(view) {\n\t\tconsole.log(\"New view\");\n\t\tthis.setState(view.game);\n\t}", "title": "" }, { "docid": "6c69fde62147df748ca582a6a53e3648", "score": "0.6068415", "text": "function render() {\n const state = store.getState();\n books = state;\n }", "title": "" }, { "docid": "1764efb74dfbb6d611653191154156b1", "score": "0.6065476", "text": "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "title": "" }, { "docid": "1764efb74dfbb6d611653191154156b1", "score": "0.6065476", "text": "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "title": "" }, { "docid": "1764efb74dfbb6d611653191154156b1", "score": "0.6065476", "text": "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "title": "" }, { "docid": "1764efb74dfbb6d611653191154156b1", "score": "0.6065476", "text": "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "title": "" }, { "docid": "a180679f841651218941dd96d2001536", "score": "0.6058896", "text": "willRender () {}", "title": "" }, { "docid": "a65f9a684b5e39a436228ccfcf36e36c", "score": "0.6058788", "text": "render() {\n return (\n <div id=\"app-container\">\n <Header />\n\n {this.renderAside(this.state.login.loggedIn)}\n\n <div id=\"main-container\">\n {this.renderComponent(this.state.currentPage)}\n </div>\n <Footer />\n </div>\n );\n }", "title": "" }, { "docid": "7f9fb04667b2fefe6ba8eb37f5472160", "score": "0.60548306", "text": "render() {\n this.setTheme();\n this.calculateBounds();\n this.renderElements();\n this.renderComplete();\n }", "title": "" }, { "docid": "0b939be9f3138f2d389c1b4b77ebfcc9", "score": "0.6053343", "text": "renderScreenContent(){}", "title": "" }, { "docid": "39d0d5e408461f68b01d2211fb8f0fb3", "score": "0.60478884", "text": "render () {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Common title={this.state.title}></Common>\n\t\t\t\t<p> Text from server side config: {help_text} </p>\n\t\t\t\t<a href=\"/people\"> See all the people </a>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "282449bd41f57e4877d26fef0dc1f84a", "score": "0.6047849", "text": "onRender () {\n this.setupComponents();\n this.setupComponentEventListeners();\n }", "title": "" }, { "docid": "10252591b78d474c4a70464c6c5380af", "score": "0.60449886", "text": "function render () {\n root = html.update(root, router(store.getState().path, store.getState(), store.dispatch))\n}", "title": "" }, { "docid": "cc448a97ef66e9458e2f534db31836e7", "score": "0.6040798", "text": "render() {\n return (\n <Provider store={store}>\n <View style={styles.body}>\n <View style={styles.sectionContainer}>\n <Hello name={this.state.name} />\n </View>\n </View>\n </Provider>\n );\n }", "title": "" }, { "docid": "4d4aefe196083ec5a85f8b1d9b709930", "score": "0.6034934", "text": "render(){\n\t\treturn (<div className=\"chatApp\">\n\t\t\t<h1 class=\"title\">Chat client</h1>\n\t\t\t{ this['state_'+ this.state.state ]()}\n\t\t</div>);\n\t}", "title": "" }, { "docid": "811a30f854bf0b76f5ff3a14ca22f285", "score": "0.60315305", "text": "function render () { }", "title": "" }, { "docid": "947cea09dc8a0b89d6e99f7c7d872ae9", "score": "0.6030974", "text": "function display(){\n ReactDOM.render(\n <HeadsTails on={store.getState()}/>,\n document.getElementById('root'));\n}", "title": "" }, { "docid": "6057c5de14aded5d58debafe6d5e452d", "score": "0.60300696", "text": "function updateUI() {\n if(store.library.state === \"library\") {\n renderLibrary();\n } else if(store.library.state === \"creator\") {\n renderCreator();\n };\n}", "title": "" }, { "docid": "bcca618dbf7c6664ec687c08fa87201f", "score": "0.6019818", "text": "gotView(view){\n\t\tthis.setState(view.game);\n\t}", "title": "" }, { "docid": "dfbd64c0b02f94eb9eadd9d7604e847f", "score": "0.6018589", "text": "got_view(view) {\n console.log(\"new view\", view);\n this.setState(view.game);\n }", "title": "" }, { "docid": "0d13320ea5b88c72d7c652ad28fc534a", "score": "0.60174257", "text": "render() {\n\t return (\n\t \t<div></div>\n\t );\n\t}", "title": "" }, { "docid": "fa228235c11d15995c07d08f2c32a675", "score": "0.60164064", "text": "render() {\n let contents = this.state.loading\n ? <p><em>Loading...</em></p>\n : this.renderArtykulsForm();\n\n return (\n <div>\n <h1>Create Artykul</h1>\n {contents}\n </div>\n );\n }", "title": "" }, { "docid": "f52f8ae94e0235fee88fe95bdae44ade", "score": "0.6008443", "text": "function renderUI() {\n renderNotifications();\n const state = fsm.getCurrentState();\n\n // Button state\n state.ui.buttons.enabled.forEach((button) => {\n ui.enableButton(button);\n });\n state.ui.buttons.disabled.forEach((button) => {\n ui.disableButton(button);\n });\n\n // Element state\n state.ui.elements.show.forEach((element) => {\n ui.showElement(element);\n });\n state.ui.elements.hide.forEach((element) => {\n ui.hideElement(element);\n });\n\n ui.setContent('flags.fsm', JSON.stringify(fsm.getCurrentState().state));\n }", "title": "" }, { "docid": "48b41f5eba9646c8c857109ce3cab87a", "score": "0.6008056", "text": "function render(){\n ReactDOM.render(\n <MyComponents.App\n data={data}\n actions={actions}/>,\n $('#app-container').get(0)\n )\n}", "title": "" } ]
8ed9755afd9e46a2e3eb2a4cba3e6a5b
============== PUBLIC METHODS ==============
[ { "docid": "dc7364a253361db83358096ea28ecd69", "score": "0.0", "text": "async connect() {\n await this.mongoClient.connect();\n await this.refreshCache();\n }", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.68909925", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "59d3beeaa84f482085e491e2542c80f9", "score": "0.6375406", "text": "constructor() {\n\t\t//\n\t}", "title": "" }, { "docid": "450415ee6ba669c85259ba82c85a6dc4", "score": "0.6164721", "text": "constructor() {\n\n\t\t\t//ALLOWS THE USE OF THIS WHEN EXTENDING TO ANOTHER CLASS\n\t\t\tsuper()\n\t\t\t\n\t\t}", "title": "" }, { "docid": "28ea76b92ede9ad186f59db950053d19", "score": "0.6069896", "text": "constructor(\r\n\r\n ) {\r\n \r\n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.60068536", "text": "constructor() {\n \n }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.5987128", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.5987128", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "70dc644c848be8b6b7d499b82293c880", "score": "0.5984221", "text": "contructor() {}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.59089935", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "5252c9dccb3e8b690802703c30d0be2a", "score": "0.58988994", "text": "constructor(){\n\t\t\n\t}", "title": "" }, { "docid": "9c95abb9088b1c35e7ca47e1f40df6d1", "score": "0.58625454", "text": "constructor() {\r\n\t\tthrow new Error('Not implemented');\r\n\t}", "title": "" }, { "docid": "e20d36a8b26e163da19fe04ae884c878", "score": "0.57689", "text": "constructor() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "5078ef749f085d0a4b0075a1bbbb53a6", "score": "0.5758842", "text": "constructor() {\n // Unused class for now. Maybe in the future.\n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.57406235", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.57320255", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5690499", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5690499", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5690499", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5690499", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5690499", "text": "initialize() {}", "title": "" } ]
fe80c10e1952ce215c52a0fec745d701
If these variables are changed we need to adjust the stepSize
[ { "docid": "7b58c56b664c9b9d62bd9e826cae55bf", "score": "0.0", "text": "set shrinkTime(t) {\n this._shrinkTime = t; // how many milliseconds we want to take to shrink the canvas\n }", "title": "" } ]
[ { "docid": "b6acc33d38da945f5568eb9d87d51b2e", "score": "0.7179594", "text": "function updateStep(){\n\n //sets the step value to equal the scalerange value\n step = Number(window.scalerange.value);\n}", "title": "" }, { "docid": "deb94b35a811eb760458aceda13523d6", "score": "0.67844003", "text": "set stepSize(value) {\n this._stepSize =\n value >= poStepperStepSizeDefault && value <= poStepperStepSizeMax ? value : poStepperStepSizeDefault;\n }", "title": "" }, { "docid": "7f4b0b2426c8b0d183ddc1d57ef1506d", "score": "0.6726121", "text": "function resizeStep() {\n if (boxWidth != targetSize) {\n var epsilon = 0.00001;\t\t// avoids round-off error\n if (sizeStepTimer > epsilon) {\n sizeStepTimer -= Number(dtSlider.value);\n } else {\n var stepSize = 0.004;\t\t\t// size of each step as we change boxWidth\n if (boxWidth > targetSize) stepSize = -stepSize;\n var newSize = boxWidth + stepSize;\n var offset = (newSize - boxWidth) / 2.0;\n for (var atom = 0; atom < N; atom++) {\n x[atom] += offset;\n y[atom] += offset;\n }\n boxWidth = newSize;\n if (Math.abs(boxWidth - targetSize) < epsilon) {\n boxWidth = targetSize;\n } else {\n sizeStepTimer = 0.01;\t// this value controls the rate of resizing\n }\n pxPerUnit = canvas.width / boxWidth;\n computeAccelerations();\n computeStats();\n reset();\n resetStepsPerSec();\n }\n }\n}", "title": "" }, { "docid": "cba623194ad6ce7093cc94c97c11cf61", "score": "0.6672126", "text": "stepsize(val) {\n this._stepsize = val;\n return this;\n }", "title": "" }, { "docid": "97b549c2df370272742f53f29499d237", "score": "0.6597271", "text": "function calc_steps() {\n\t\t\t for (var key in rgb_values) {\n\t\t\t if (rgb_values.hasOwnProperty(key)) {\n\t\t\t for(var i = 0; i < 4; i++) {\n\t\t\t rgb_values[key][i] = gradients[currentIndex][key][i];\n\t\t\t rgb_steps[key][i] = calc_step_size(gradients[nextIndex][key][i],rgb_values[key][i]);\n\t\t\t }\n\t\t\t }\n\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "a5fd327933a632960940620482d63caf", "score": "0.65048337", "text": "function calc_step_size(a,b) {\n\t\t\t return (a - b) / steps_total;\n\t\t\t}", "title": "" }, { "docid": "ae78ae765188414054e154512653ca93", "score": "0.6404129", "text": "function stepresize() {\r\n\t\t\t\tblockwidth = 50;\r\n\t\t\t\tminmargin = 3;\r\n\t\t\t\tminsize = 8;\r\n\t\t\t\temwidth = (minmargin * 2) + blockwidth;\r\n\t\t\t\tcomputeResize(emwidth, minsize, true)\r\n\t\t\t}", "title": "" }, { "docid": "40c97c28b5e5626c0f2c5a878ae3e097", "score": "0.6358814", "text": "calculateStep() {\r\n this.stepNumber += 1;\r\n this.info.updateStep(this.stepNumber);\r\n }", "title": "" }, { "docid": "48a54d38b854241a8ced733178e3f41f", "score": "0.6276036", "text": "function changeSize() {\n var newSize = Number(sizeSlider.value);\n var oldSize = boxWidth;\n if (newSize == oldSize) return;\n if (running) {\t// in this case we'll do it slowly via resizeStep()\n if (targetSize != boxWidth) {\t// abort if a resizing via resizeStep is already in progress\n sizeSlider.value = targetSize;\n return;\n }\n if (newSize < oldSize) {\n newSize = oldSize - 1;\n } else {\n newSize = oldSize + 1;\n }\n var minSize = 0.9 * Math.sqrt(N);\n if (newSize < minSize) {\t\t// abort if new size would be too small to hold all the atoms\n sizeSlider.value = oldSize;\n return;\n }\n targetSize = newSize;\n sizeSlider.value = newSize;\n resizeStep();\n } else {\t\t\t\t\t\t\t// if not running, do the resize all at once\n var offset = (newSize - oldSize) / 2.0;\n for (var atom = 0; atom < N; atom++) {\n x[atom] += offset;\n y[atom] += offset;\n }\n boxWidth = newSize;\n pxPerUnit = canvas.width / boxWidth;\n targetSize = boxWidth;\n computeAccelerations();\n computeStats();\n paintCanvas();\n reset();\n resetStepsPerSec();\n }\n var volume = Math.round(newSize * newSize);\n sizeReadout.innerHTML = newSize + \" (volume = \" + volume + \")\";\n}", "title": "" }, { "docid": "b6251e7a78c7c3bf7d1e36e2ff453e15", "score": "0.62704194", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "37c91fb4c6f51ec5a848c48101a67ead", "score": "0.6266618", "text": "function updateValues (id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "f24f43447f59a85c7b11df92bd456be8", "score": "0.6247998", "text": "function adjustStepHeight(){\n sum = 0;\n //get the current step number\n stepNumber = $(\"#example-basic\").steps(\"getCurrentIndex\");\n\n //get the combined height of all child elements in the step\n $(\"#example-basic-p-\"+stepNumber).children().each(function(){\n sum += ($(this).height()+\n parseInt($(this).css(\"margin-top\"))+\n parseInt($(this).css(\"margin-bottom\"))\n )});\n\n //add vertical padding to the sum variable\n sum += (parseInt($(\"#example-basic-p-\"+stepNumber).css(\"padding-top\")))*2;\n\n //set height of step to the sum value\n $(\".wizard > .content\").css(\"height\",sum);\n }", "title": "" }, { "docid": "9f40524c81574c96492f25e7ca5c3b46", "score": "0.620765", "text": "function updateValues(id, withoutStep) {\n\t if (!withoutStep) {\n\t margin = (areaLength - totalLength - itemLength) / 2;\n\t if (margin < posMin) {\n\t margin = (areaLength - itemLength) / 2;\n\t totalLength = 0;\n\t step++;\n\t }\n\t }\n\t steps[id] = step;\n\t margins[step] = $$.isLegendInset ? 10 : margin;\n\t offsets[id] = totalLength;\n\t totalLength += itemLength;\n\t }", "title": "" }, { "docid": "a8ccd417cb0b91219e8ee70772b5f9d7", "score": "0.62057513", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "a8ccd417cb0b91219e8ee70772b5f9d7", "score": "0.62057513", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "5d7922c7507345e6d4eabd6a606f7160", "score": "0.62024313", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "5d7922c7507345e6d4eabd6a606f7160", "score": "0.62024313", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "5d7922c7507345e6d4eabd6a606f7160", "score": "0.62024313", "text": "function updateValues(id, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - totalLength - itemLength) / 2;\n if (margin < posMin) {\n margin = (areaLength - itemLength) / 2;\n totalLength = 0;\n step++;\n }\n }\n steps[id] = step;\n margins[step] = $$.isLegendInset ? 10 : margin;\n offsets[id] = totalLength;\n totalLength += itemLength;\n }", "title": "" }, { "docid": "40dc329934a7fc5bc95ff647ca38e5e0", "score": "0.60888636", "text": "function _updateValues() {\n const currentVal = Number( _inputDom.value );\n const numerator = ( currentVal - _min ) + _lastValue;\n const currentStep = Math.round( numerator / _options.step );\n\n _valMin = _min + ( currentStep * UNITS_PER_STEP );\n _valMax = _valMin + UNITS_PER_STEP - 1;\n if ( _valMax > _max ) {\n _valMax = _max;\n }\n }", "title": "" }, { "docid": "3e7a0abac8bbd9dfa8bcb6098f770e3d", "score": "0.60822105", "text": "calculateSteps() {\n const steps = [];\n const lastMs = this.internalOptions.times.lastTime;\n const currentDate = dayjs_min_default()(this.internalOptions.times.firstTime);\n steps.push({\n time: currentDate.valueOf(),\n offset: {\n ms: 0,\n px: 0\n }\n });\n for (\n let currentDate = dayjs_min_default()(this.internalOptions.times.firstTime)\n .add(1, this.internalOptions.times.stepDuration)\n .startOf('day');\n currentDate.valueOf() <= lastMs;\n currentDate = currentDate.add(1, this.internalOptions.times.stepDuration).startOf('day')\n ) {\n const offsetMs = currentDate.diff(this.internalOptions.times.firstTime, 'milisecods');\n const offsetPx = offsetMs / this.internalOptions.times.timePerPixel;\n const step = {\n time: currentDate.valueOf(),\n offset: {\n ms: offsetMs,\n px: offsetPx\n }\n };\n const previousStep = steps[steps.length - 1];\n previousStep.width = {\n ms: offsetMs - previousStep.offset.ms,\n px: offsetPx - previousStep.offset.px\n };\n steps.push(step);\n }\n const lastStep = steps[steps.length - 1];\n lastStep.width = {\n ms: this.internalOptions.times.totalViewDurationMs - lastStep.offset.ms,\n px: this.internalOptions.times.totalViewDurationPx - lastStep.offset.px\n };\n this.$store.commit(this.updateOptionsMut, { times: { steps } });\n }", "title": "" }, { "docid": "380f5f24e92e8f0f0d3827002520a3db", "score": "0.6063859", "text": "calculateStep() {\n // debugger;\n\n for (let i = 0; i < this.toneNodes.length; i++) {\n // debugger;\n this.toneNodes[i].step += this.incrementStep(this.toneNodes[i]);\n // debugger;\n }\n }", "title": "" }, { "docid": "c445f06f98b7f46df4032d98857e99f4", "score": "0.60593086", "text": "function minus() { // negative step size\n var tol = mODEEngine.getTolerance();\n var remainder = mFixedStepSize; // track the remaining step\n if ((mODEEngine.getStepSize()>=0)||( // is the step negative?\n mODEEngine.getStepSize()<mFixedStepSize)||( // is the stepsize larger than what is requested?\n mFixedStepSize-mODEEngine.getStepSize()==mFixedStepSize // is the stepsize smaller than the precision?\n )) {\n mODEEngine.setStepSize(mFixedStepSize); // reset the step size and let it adapt to an optimum size\n }\n var counter = 0;\n while(remainder<tol*mFixedStepSize) { // check to see if we are close enough\n counter++;\n var oldRemainder = remainder;\n if(remainder>mODEEngine.getStepSize()) {\n var tempStep = mODEEngine.getStepSize(); // save the current optimum step size\n mODEEngine.setStepSize(remainder); // set the step RK4/5 size to the remainder\n var delta = mODEEngine.step();\n remainder -= delta;\n mODEEngine.setStepSize(tempStep); // restore the original step size\n } else {\n remainder -= mODEEngine.step(); // do a step and set the remainder\n }\n // check to see if roundoff error prevents further calculation.\n if ( (mODEEngine.getErrorCode()!=EJSS_ODE_SOLVERS.ODEMultistepSolver.NO_ERROR) ||\n (Math.abs(oldRemainder-remainder)<=Number.MIN_VALUE) || \n (tol*mFixedStepSize/10.0<mODEEngine.getStepSize()) ||\n (counter>mMaxIterations)) {\n mErr_msg = \"ODEMultiStep did not converge. Remainder=\"+remainder; //$NON-NLS-1$\n mErr_code = EJSS_ODE_SOLVERS.ODEMultistepSolver.DID_NOT_CONVERGE;\n if(enableExceptions) {\n throw mErr_msg;\n }\n if(mMaxMessages>0) {\n mMaxMessages--;\n console.log(mErr_msg);\n }\n }\n }\n return remainder;\n }", "title": "" }, { "docid": "10633e0594f917c2d3bf6557c697c798", "score": "0.6012822", "text": "function plus() { // positive step size\n var tol = mODEEngine.getTolerance();\n var remainder = mFixedStepSize; // track the remaining step\n if((mODEEngine.getStepSize()<=0)||( // is the stepsize postive?\n mODEEngine.getStepSize()>mFixedStepSize)||( // is the stepsize larger than what is requested?\n mFixedStepSize-mODEEngine.getStepSize()==mFixedStepSize // is the stepsize smaller than the precision?\n )) {\n mODEEngine.setStepSize(mFixedStepSize); // reset the step size and let it adapt to an optimum size\n }\n var counter = 0;\n while(remainder>tol*mFixedStepSize) { // check to see if we are close enough\n counter++;\n var oldRemainder = remainder;\n if(remainder<mODEEngine.getStepSize()) { // temporarily reduce the step size so that we hit the exact dt value\n var tempStep = mODEEngine.getStepSize(); // save the current optimum step size\n mODEEngine.setStepSize(remainder); // set the step size to the remainder\n var delta = mODEEngine.step();\n remainder -= delta;\n mODEEngine.setStepSize(tempStep); // restore the original step size\n } else {\n remainder -= mODEEngine.step(); // do a step and set the remainder\n }\n // check to see if roundoff error prevents further calculation.\n if ( (mODEEngine.getErrorCode()!=EJSS_ODE_SOLVERS.ODEMultistepSolver.NO_ERROR) ||\n (Math.abs(oldRemainder-remainder)<=Number.MIN_VALUE) ||\n (tol*mFixedStepSize/10.0>mODEEngine.getStepSize()) || \n (counter>mMaxIterations)) {\n mErr_msg = \"ODEMultiStep did not converge. Remainder=\"+remainder; //$NON-NLS-1$\n mErr_code = EJSS_ODE_SOLVERS.ODEMultistepSolver.DID_NOT_CONVERGE;\n if (mEnableExceptions) {\n throw mErr_msg;\n }\n if (mMaxMessages>0) {\n mMaxMessages--;\n console.log(mErr_msg);\n }\n break;\n }\n }\n return remainder;\n }", "title": "" }, { "docid": "d37217a5c3c16cd64c8fa8ea1f462efb", "score": "0.5988738", "text": "function changeSize() {\n var size = slider.value();\n rows = cols = size;\n grid = createGrid();\n w = width / cols;\n h = height / rows;\n start = grid[0][0]\n end = grid[rows-1][cols-1]\n start.blocked = false;\n end.blocked = false;\n path = []\n open = [];\n closed = [];\n open.push(start);\n full = false;\n}", "title": "" }, { "docid": "b43269dd699e6ca80e5fb5a4f485ddbe", "score": "0.59804195", "text": "function estimatedStepSize(err){\n var fac11 = 0;\n // taking decision for HNEW/H value\n if (err != 0) {\n fac11 = Math.pow(err,mExpO1);\n mFactor = fac11 / Math.exp(EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.BETA * Math.log(mErrOld)); // stabilization\n mFactor = Math.max (1.0/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.FAC2, \n Math.min(1.0/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.FAC1, \n mFactor/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.SAFE)); // we require FAC1 <= HNEW/H <= FAC2\n }\n else {\n fac11 = 1.0/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.FAC1;\n mFactor = 1.0/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.FAC2;\n }\n if (err<=1.0) { // step accepted\n mErrOld = Math.max(err, 1.0e-4);\n return mActualStepSize / mFactor;\n }\n return mActualStepSize/Math.min(1.0/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.FAC1, fac11/EJSS_ODE_SOLVERS.SolverEngineDiscreteTimeAdaptive.SAFE); // step rejected\n }", "title": "" }, { "docid": "5484dd7abe52bb66266b9c016ea11b60", "score": "0.5937235", "text": "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.20);\n //console.log(\"stepH\", stepH);\n step\n .style(\"height\", stepH + \"px\")\n\n var figureHeight = window.innerHeight / 2;\n var figureMarginTop = (window.innerHeight - figureHeight) / 6;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "9c53c419bf1a1c48910cc6afbf98ccd1", "score": "0.59308094", "text": "function handleResize() {\n\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.8);\n\n step.style('height', stepH + 'px');\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "title": "" }, { "docid": "fa2e3ff7283405cde4a84395e0f2770a", "score": "0.58987457", "text": "function resetStep()\n{\n\nstep = 0;\n\n}", "title": "" }, { "docid": "506806c68904fbac9ac0734ba61db773", "score": "0.5890123", "text": "set step(value){Helper.UpdateInputAttribute(this,\"step\",value)}", "title": "" }, { "docid": "506806c68904fbac9ac0734ba61db773", "score": "0.5890123", "text": "set step(value){Helper.UpdateInputAttribute(this,\"step\",value)}", "title": "" }, { "docid": "506806c68904fbac9ac0734ba61db773", "score": "0.5890123", "text": "set step(value){Helper.UpdateInputAttribute(this,\"step\",value)}", "title": "" }, { "docid": "506806c68904fbac9ac0734ba61db773", "score": "0.5890123", "text": "set step(value){Helper.UpdateInputAttribute(this,\"step\",value)}", "title": "" }, { "docid": "506806c68904fbac9ac0734ba61db773", "score": "0.5890123", "text": "set step(value){Helper.UpdateInputAttribute(this,\"step\",value)}", "title": "" }, { "docid": "2a5b2dd440958873e5466f9f6ac77563", "score": "0.5872737", "text": "getFanSpeedStepSize() {\n const step = this.data['stepSize']\n\n // since fan speed is % based in the plugin the default\n // step size is set to 1.\n return isNaN(step) || step > 100 || step < 1 ? 1 : step\n }", "title": "" }, { "docid": "dca24c208e1ff479ebf476d915e35927", "score": "0.58674204", "text": "function changeSize() {\n\t\tpuzzleSize = this.value;\n\t\ttileSize = parseInt(puzzleHeight / puzzleSize);\n\t\tmakeTiles();\t\t\n\t}", "title": "" }, { "docid": "d60d083a15770db48d34eceee97886be", "score": "0.5855002", "text": "incrementBetSize() {\n const currentBetSizeIndex = this.betSizeOptions.findIndex(option => option === this.currentBetSize);\n const nextBetSizeIndex = currentBetSizeIndex + 1;\n if (this.betSizeOptions[nextBetSizeIndex] !== undefined) {\n this.currentBetSize = this.betSizeOptions[nextBetSizeIndex];\n } else {\n this.currentBetSize = this.betSizeOptions[0];\n }\n // render new bet size\n this.controlPanel.renderBetSize();\n }", "title": "" }, { "docid": "83ef3752bdcb47fbf6dac3ebd4695312", "score": "0.58384347", "text": "function step(){\n\t\t//create a copy of all values, so we can tell where we come from for animation\n\t\two.state.a.d3 = wo.state.v.d3;\n\t\two.state.a.d2 = wo.state.v.d2;\n\t\two.state.a.d1 = wo.state.v.d1;\n\t\two.state.a.d0 = wo.state.v.d0;\n\t\two.state.a.h1 = wo.state.v.h1;\n\t\two.state.a.h0 = wo.state.v.h0;\n\t\two.state.a.m1 = wo.state.v.m1;\n\t\two.state.a.m0 = wo.state.v.m0;\n\t\two.state.a.s1 = wo.state.v.s1;\n\t\two.state.a.s0 = wo.state.v.s0;\n\t\tif (wo.myOptions.counterDirection == 'up'){\n\t\t\two.state.inc();\n\t\t}else{\n\t\t\two.state.dec();\n\t\t}\n\t\two.setState(wo.state, wo.myOptions);\n\t}", "title": "" }, { "docid": "0117d470c2c3d26bf747245837f56130", "score": "0.5830387", "text": "function changeSize(event) {\n if (event.deltaY > 0) {\n z = z * .9;\n a = a * .9;\n b = b * .9;\n c = c * .9;\n d = d * .9;\n e = e * .9;\n f = f * .9;\n g = g * .9;\n h = h * .9;\n i = i * .9;\n j = j * .9;\n k = k * .9;\n l = l * .9;\n m = m * .9;\n n = n * .9;\n w = w * .9;\n } else {\n z = z * 1.1;\n a = a * 1.1;\n b = b * 1.1;\n c = c * 1.1;\n d = d * 1.1;\n e = e * 1.1;\n f = f * 1.1;\n g = g * 1.1;\n h = h * 1.1;\n i = i * 1.1;\n j = j * 1.1;\n k = k * 1.1;\n l = l * 1.1;\n m = m * 1.1;\n n = n * 1.1;\n w = w * 1.1;\n }\n}", "title": "" }, { "docid": "433f155ec362c705998c396d8c81daae", "score": "0.58264935", "text": "function handleResize() {\n\t\twindowWidth = window.innerWidth;\n\n\t\tif (windowWidth >= 576) {\n\t\t\t// 1. update height of step elements\n\t\t\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\t\t\tstep.style('height', stepH + 'px');\n\n\t\t\tvar figureHeight = window.innerHeight * 0.85// / 2\n\t\t\tvar figureMarginTop = Math.max((window.innerHeight - figureHeight) / 2, 60); \n\n\t\t} else if (windowWidth <= 350) { \n\t\t\t// 1. update height of step elements\n\t\t\tvar stepH = Math.floor(window.innerHeight * 0.30);\n\t\t\tstep.style('height', stepH + 'px');\n\n\t\t\tvar figureHeight = window.innerHeight * 0.70// / 2\n\t\t\t//var figureMarginTop = Math.max((window.innerHeight - figureHeight) / 2, 60); \n\t\t\tvar figureMarginTop = Math.max((window.innerHeight - figureHeight), 60); \n\n\t\t} else {\n\t\t\t// 1. update height of step elements\n\t\t\tvar stepH = Math.floor(window.innerHeight * 0.40);\n\t\t\tstep.style('height', stepH + 'px');\n\n\t\t\tvar figureHeight = window.innerHeight * 0.55// / 2\n\t\t\t//var figureMarginTop = Math.max((window.innerHeight - figureHeight) / 2, 60); \n\t\t\tvar figureMarginTop = Math.max((window.innerHeight - figureHeight), 60); \n\t\t}\n\n\t\tfigure\n\t\t\t.style('height', figureHeight + 'px')\n\t\t\t//.style('top', '20px');\n\t\t\t.style('top', figureMarginTop + 'px');\n\n\t\t// 3. tell scrollama to update new element dimensions\n\t\tscroller.resize();\n\t}", "title": "" }, { "docid": "83aa78b730bb1ad2b38252d71a30bb00", "score": "0.5824186", "text": "function beforechange(start1, stop1) {\n if (!isFinite(start)) start = start1;\n values.splice(0, Math.max(0, Math.min(size, Math.round((start1 - start) / step))));\n start = start1;\n stop = stop1;\n }", "title": "" }, { "docid": "c76a06d4f1645d020d75c61a629ea0f9", "score": "0.5819897", "text": "sizeChanged(prev, next) {\n super.sizeChanged(prev, next);\n if (this.proxy) {\n this.proxy.size = next;\n }\n }", "title": "" }, { "docid": "e0795aece61dfa100d296a6103644123", "score": "0.58164996", "text": "function stepMultiplier() {\n var temp, rounded;\n //temp is a number that is getting ever closer to 0\n //as the player's step multiplier increases. \n temp = 2-dataObj.stepMultiplier;\n \n //Round the number to the nearest hundreth. \n temp *= .2\n \n //Set the step multiplier. \n dataObj.stepMultiplier += temp;\n}", "title": "" }, { "docid": "d1816aa2ebdbf6bc4a61646d2c63d741", "score": "0.57876897", "text": "function step() {\n step_counter++;\n if(step_counter <= max_counter) {\n //cost = tsne.step();\n //cost_each = cost[1];\n //for(var i = 0; i < final_dataset.length; i++) final_dataset[i].cost = cost_each[i];\n if (sliderTrigger) {\n if (sliderInsideTrigger) {\n if (cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3) < 0) {\n $(\"#cost\").html(\"(Ov. Cost: 0.000)\");\n ArrayWithCosts.push(0);\n Iterations.push(step_counter);\n } else {\n $(\"#cost\").html(\"(Ov. Cost: \" + cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3) + \")\");\n ArrayWithCosts.push(cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3));\n Iterations.push(step_counter);\n }\n\n } else {\n if (cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) < 0) {\n $(\"#cost\").html(\"(Ov. Cost: 0.000)\");\n ArrayWithCosts.push(0);\n Iterations.push(step_counter);\n } else {\n $(\"#cost\").html(\"(Ov. Cost: \" + cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) + \")\");\n ArrayWithCosts.push(cost_overall[activeProjectionNumber][step_counter-1].toFixed(3));\n Iterations.push(step_counter);\n }\n }\n } else {\n if (cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) < 0) {\n $(\"#cost\").html(\"(Ov. Cost: 0.000)\");\n ArrayWithCosts.push(0);\n Iterations.push(step_counter);\n } else {\n $(\"#cost\").html(\"(Ov. Cost: \" + cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) + \")\");\n ArrayWithCosts.push(cost_overall[activeProjectionNumber][step_counter-1].toFixed(3));\n Iterations.push(step_counter);\n }\n }\n }\n else {\n clearInterval(runner);\n }\n if (step_counter == max_counter){\n ArrayWithCostsList.push(ArrayWithCosts);\n IterationsList.push(Iterations);\n updateEmbedding(AnalysisResults);\n }\n}", "title": "" }, { "docid": "4011c0aa9eb9bd1d040edd7e29501b5e", "score": "0.5779384", "text": "function updateSize (size) { this.size = parseFloat(adj.value); }", "title": "" }, { "docid": "e5e2f0ab8b191da2ce2f3f50e14a592a", "score": "0.5759128", "text": "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.75);\n step.style(\"height\", stepH + \"px\");\n\n var figureHeight = window.innerHeight; /// 1.1;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "title": "" }, { "docid": "09b5e998a5e047bde365681ed34b7d6c", "score": "0.57545024", "text": "function handleResize() {\n\t// 1. update height of step elements\n\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\t// scrollyA.step.style(\"height\", stepH + \"px\");\n\t// scrollyB.step.style(\"height\", stepH + \"px\");\n\t// scrollyC.step.style(\"height\", stepH + \"px\");\n\n\td3.selectAll(\".step.height1\").style(\"height\", stepH + \"px\");\n\td3.selectAll(\".step.height2\").style(\"height\", 2 * stepH + \"px\");\n\td3.selectAll(\".step.height3\").style(\"height\", 3 * stepH + \"px\");\n\n\tvar figureHeight = window.innerHeight * 0.95;\n\tvar figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\tallFigures\n\t\t.style(\"height\", figureHeight + \"px\")\n\t\t.style(\"top\", figureMarginTop + \"px\");\n\t// 3. tell scrollama to update new element dimensions\n\tscrollerA.resize();\n\tscrollerB.resize();\n\tscrollerC.resize();\n}", "title": "" }, { "docid": "9b124fd901562aa95c36376b9f1db944", "score": "0.57494736", "text": "function scaleDown(step){ //normalizando\n return {\n unidades: step.unidades / 8216,\n precio: step.precio / 1\n\n };\n }", "title": "" }, { "docid": "dfce57d8cf82d9a15443323761b7eb3a", "score": "0.5725313", "text": "function step() {\n\t\t\tupdate(time_value.invert(currentValue));\n\t\t\tcurrentValue = currentValue + (targetValue/100);\n\t\t\tif (currentValue > targetValue) {\n\t\t\t\tclearInterval(timer);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "43af68a3111a63d68a750a94c23bef08", "score": "0.572354", "text": "changeSize() {\n // Smooth amplitude to reduce the unwanted noise in the size of the drop\n this.amplitude.smooth(0.9);\n // Set the level variable to the actual amplitude of the sound\n this.level = this.amplitude.getLevel();\n // Set the size of the drop according to the amplitude level of the sound\n this.dropSize = map(this.level, 0, 1, 0, 350);\n }", "title": "" }, { "docid": "6650ebca75f0aacb1007909c3582f769", "score": "0.57215", "text": "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.75);\n step.style(\"height\", stepH + \"px\");\n\n var figureHeight = window.innerHeight / 2;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "title": "" }, { "docid": "22f6fc7236cf1d46794c53c58d3825ae", "score": "0.5715708", "text": "function limitStepSize(intendedStep) {\n var ode = self.getODE();\n var delays;\n var i, length;\n\tif (intendedStep>=0) {\n if (ode.getDelays) { // Don't step more than half the minimum delay\n\t delays = ode.getDelays(self.getInitialState());\n\t length = delays.length;\n\t for (i=0; i<length; i++) intendedStep = Math.min(intendedStep, delays[i]/2);\n }\n\t return Math.min(intendedStep, self.getMaximumStepSize());\n\t}\n if (ode.getDelays) { // Don't step more than half the minimum delay\n delays = ode.getDelays(self.getInitialState());\n length = delays.length;\n\t for (i=0; i<length; i++) intendedStep = Math.max(intendedStep, delays[i]/2);\n\t}\n return Math.max(intendedStep, -self.getMaximumStepSize()); \n }", "title": "" }, { "docid": "ca7f7a0bcd97d40c310ce6660d1a76b9", "score": "0.57150793", "text": "getSteps() {\n const current = Math.floor(this.nzSteps * (this.nzPercent / 100));\n const stepWidth = this.nzSize === 'small' ? 2 : 14;\n const steps = [];\n for (let i = 0; i < this.nzSteps; i++) {\n let color;\n if (i <= current - 1) {\n color = this.nzStrokeColor;\n }\n const stepStyle = {\n backgroundColor: `${color}`,\n width: `${stepWidth}px`,\n height: `${this.strokeWidth}px`\n };\n steps.push(stepStyle);\n }\n this.steps = steps;\n }", "title": "" }, { "docid": "3762fc47164ca22e53a314ff43ce3bdc", "score": "0.5709796", "text": "recalculate(lastSeg, nextSeg) {\n super.recalculate(lastSeg, nextSeg);\n\n // adjust the generated segment to move towards the steadystate Val\n if (this.startVal > this.steadystateVal) {\n this.changePerMin = -Math.abs(this.changePerMin);\n } else {\n this.changePerMin = Math.abs(this.changePerMin);\n }\n\n const lifespan = this.getLifespan(nextSeg);\n\n this.end = util.AdjustMinutes(this.start, lifespan);\n }", "title": "" }, { "docid": "61834ec954be50b1a45cc86a44366ba6", "score": "0.5706667", "text": "function updateStep( body, animated, previousStep, newStep )\n {\n var previousStr = previousStep.toString();\n var nextStr = newStep.toString();\n body.dataset.previousstep = previousStr;\n body.dataset.currentstep = nextStr;\n for ( var i = 0; i < animated.length; ++i )\n {\n animated[i].dataset.fromstep = previousStr;\n animated[i].dataset.step = nextStr;\n }\n }", "title": "" }, { "docid": "6b585e5f06d6c7f7f4d891aac7889795", "score": "0.5692179", "text": "function handleResize() {\n // 1. update height of step elements\n const stepHeight = Math.floor(window.innerHeight * 0.75);\n step.style(\"height\", stepHeight + \"px\");\n\n // 2. update width/height of graphic element\n const bodyWidth = d3.select(\"body\").node().offsetWidth;\n\n const figureHeight = Math.floor(window.innerHeight * 0.5);\n figure.style(\"height\", figureHeight + \"px\");\n // 3. tell scrollama to update new element dimensions for responsiveness\n scroller.resize();\n}", "title": "" }, { "docid": "e1ce054b012e4ac987f865c208033854", "score": "0.568718", "text": "function resizeStep()\n {\n \ttry\n \t{\n \t\t/*var stepsTable = sbFindFrame(getTopWindow(),\"StepsTable\");\n \t\t\n \t\tvar oldrow = localStorage.getItem(\"stepSelected\");\n \t\t\n \t\tvar selectedornot = jQuery('tr[id^=\"'+oldrow+'\"]', \n \t\t\t\t [stepsTable.document.body]).attr(\"class\");\n \t\t\n \t\t// see if the step is highlighted.\n \t\tif( \"root-node even mx_rowSelected\" !== selectedornot &&\n \t\t\t \"root-node mx_altRow even mx_rowSelected\" !== selectedornot\n \t )\n \t\t\treturn;*/\n \t\t\n \t\tvar maxstep = \n \t\t\t \"../simulationcentral/images/smaIconMaximize.gif\";\n \t\tvar minstep = \n \t\t\t \"../simulationcentral/images/smaIconMinimize.gif\";\n \t\t\n \t\tvar detailsDisplay = sbFindFrame(getTopWindow(),\"detailsDisplay\");\n \t\t\n \t\tvar title = jQuery('span[id^=\"StepResizeSpan\"]', \n \t\t\t\t [detailsDisplay.document.body]).attr('title');\n \t\t\n \t\tif(\"Minimize Step Explorer\" === title)\n \t\t{\n \t\t\t// decrease div style\n \t\t\tjQuery('div[id^=\"stepsDetails\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('left','0px');\n \t\t\tjQuery('div[id^=\"StepResize\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('left','0px');\n\n \t\t\t// change button style\n \t\t\tjQuery('span[id^=\"StepResizeSpan\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).\n \t\t\t\t\tattr('title','Maximize Step Explorer');\n \t\t\tjQuery('span[id^=\"StepResizeSpan\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).\n \t\t\t\t\tfind(\"#StepResizeImage\").attr(\"src\",maxstep);\n \t\t\t// change content style to fill page\n \t\t\tjQuery('div[id^=\"stepsDetails\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('width',\"100%\");\n \t\t}\n \t\tif(\"Maximize Step Explorer\" === title)\n \t\t{\n \t\t\t// increase div styles\n \t\t\tjQuery('div[id^=\"stepsDetails\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('left','230px');\n \t\t\tjQuery('div[id^=\"StepResize\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('left','230px');\n \t\t\t\n \t\t\t// change button styles\n \t\t\tjQuery('span[id^=\"StepResizeSpan\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).\n \t\t\t\t\tattr('title','Minimize Step Explorer');\n \t\t\tjQuery('span[id^=\"StepResizeSpan\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).\n \t\t\t\t\tfind(\"#StepResizeImage\").attr(\"src\",minstep);\n \t\t\t\n \t\t\t// adjust content page WRT to details display\n \t\t\tvar len = detailsDisplay.window.innerWidth-230;\n \t\tjQuery('div[id^=\"stepsDetails\"]', \n \t\t\t\t\t[detailsDisplay.document.body]).css('width',len+\"px\");\n \t\t}\n\n \t}\n \tcatch(e)\n {\n \tconsole.log(\"ERROE\"+e);\n }\n }", "title": "" }, { "docid": "f5d3addaeb65ed492d456d8dd1bf5c94", "score": "0.56755114", "text": "function handleResize() {\n // 1. update height of step elements\n var stepHeight = Math.floor(window.innerHeight * 0.75);\n step.style(\"height\", stepHeight + \"px\");\n\n // 2. update width/height of graphic element\n var figureH = window.innerHeight / 1.2;\n var figureMarginTop = (window.innerHeight - figureH) / 2;\n\n graphic\n .style(\"height\", figureH + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "title": "" }, { "docid": "feb25722660f70ab7a871cc00d0a217e", "score": "0.5666859", "text": "updateLimits() {\n this.limitTop = this.currentChunkObj.limitTop;\n this.limitBottom = this.currentChunkObj.limitBottom;\n }", "title": "" }, { "docid": "6984ecb4584ac8aee90a2fb7e4075734", "score": "0.5663511", "text": "calculateUpdates() {\n\t\tthis.stage.step();\n\t}", "title": "" }, { "docid": "4e1cd0c1db321f0c5ec771b50abacd8c", "score": "0.56612825", "text": "stepUp() {\n const stepUpValue = this.step + parseFloat(this.value);\n this.value = this.getValidValue(stepUpValue);\n this.$emit(\"input\");\n }", "title": "" }, { "docid": "5e78215b2d27a273d2fc555411d05251", "score": "0.5660907", "text": "function handleResize() {\n // 1. update height of step elements - should be 75% of windows height\n const stepH = Math.floor(window.innerHeight * 0.75) \n step.style(\"height\", `${stepH}px`)\n // 2. update the height of the figure\n const figureHeight = window.innerHeight / 2;\n const figureMarginTop = (window.innerHeight - figureHeight) / 2;\n figure \n .style(\"height\", `${figureHeight}px`)\n .style(\"top\", `${figureMarginTop}px`)\n // 3. tell scrollama to update new element dimensions \n scroller.resize();\n}", "title": "" }, { "docid": "77cd16d8e7bb20da5ad2ddc39ace7051", "score": "0.565819", "text": "function changeStep(direction){ \n if (direction == \"next\"){\n step = step < 6 ? step + 1 : step;\n }else if (direction == \"prev\") {\n step = step > 1 ? step - 1 : step;\n }\n buttonStyle(step);\n switch(step){ \n case 1:\n step1(direction);\n break;\n case 2:\n step2(direction);\n break;\n case 3:\n step3(direction);\n break;\n case 4:\n step4(direction);\n break;\n case 5:\n step5(direction);\n break;\n case 6:\n step6(direction);\n break; \n }\n\n }", "title": "" }, { "docid": "564296eaa08d292e288c64e119ab76a7", "score": "0.5646791", "text": "function set_step(step){\n Private.step = step;\n redraw_screen();\n redraw(Private.first, Private.first + (Private.step * Private.frame_rate * (Private.window_width - 1)));\n }", "title": "" }, { "docid": "b5d2f83c4e41098adcc0a95fc0ddc717", "score": "0.56458694", "text": "stepDown() {\n const stepDownValue = parseFloat(this.value) - this.step;\n this.value = this.getValidValue(stepDownValue);\n this.$emit(\"input\");\n }", "title": "" }, { "docid": "0f00ac7202426fb3897a4c0ce5a55905", "score": "0.5630772", "text": "changeStep(step) {\n const {enabledStep: enabled, changeStep, disableSteps} = this.props;\n\n if (enabled >= step) {\n changeStep(step, disableSteps);\n }\n }", "title": "" }, { "docid": "4425de4fb31ac26136560ab4493680eb", "score": "0.5622597", "text": "static get SPIRAL_STEP_Y() { return 1.2 }", "title": "" }, { "docid": "d88bde900f6f3936c8f13591cfa622d1", "score": "0.5615405", "text": "increment () {\n this.value = this._clampValue(this.value + this.step)\n }", "title": "" }, { "docid": "9f4f01bf90dd0e7014ca8d2179d881d2", "score": "0.56129384", "text": "function updateSize(obj, dt) {\r\n if(obj.width === obj.newWidth)\r\n return;\r\n\r\n if(obj.width < obj.newWidth)\r\n obj.width = obj.newWidth;\r\n\r\n obj.width += obj.growRate * dt * .001 * -1;\r\n }", "title": "" }, { "docid": "f191de457100999281fb31031708ed19", "score": "0.5608462", "text": "function changeArraySize() {\r\n let sliderValue = rangeSlider.value;\r\n\r\n //Changes Max Array Size To The Slider Value\r\n max_array_size = sliderValue;\r\n currentBar = max_array_size - 1;\r\n previousBar = max_array_size - 1;\r\n rangeLabel.textContent = `Size: ${sliderValue}`;\r\n\r\n //Changes Bar Width And Tick Speed According To Array Size\r\n if (max_array_size > 100 && max_array_size <= 200) {\r\n bar_width = 4;\r\n primary_tick_speed = 10;\r\n secondary_tick_speed = primary_tick_speed * max_array_size;\r\n } else if (max_array_size <= 100 && max_array_size >= 50) {\r\n bar_width = 6;\r\n primary_tick_speed = 15;\r\n secondary_tick_speed = primary_tick_speed * max_array_size;\r\n } else if (max_array_size < 50) {\r\n bar_width = 8;\r\n primary_tick_speed = 20;\r\n secondary_tick_speed = primary_tick_speed * max_array_size;\r\n } else if (max_array_size > 200) {\r\n bar_width = 2;\r\n primary_tick_speed = 5;\r\n secondary_tick_speed = primary_tick_speed * max_array_size;\r\n }\r\n\r\n //Generates New Array For Slider Changes\r\n generateArray(max_array_size);\r\n}", "title": "" }, { "docid": "939a6646cd1107ed32c25c3de1378fce", "score": "0.5606472", "text": "function changeCanvasSize(newCols, newRows)\n{\n if(newCols !== cols || newRows !== rows)\n {\n if(!warned)\n {\n console.log(\"this fonction will overwrite the current drawing\");\n console.log(\"run again to do it\");\n warned = true;\n }\n else\n {\n if(newCols * newRows < 40000)\n {\n let ratio = newCols / cols;\n scale /= ratio;\n\n cols = newCols;\n rows = newRows;\n resizeCanvas(cols * scale, rows * scale)\n drawing.changeSize(cols, rows);\n }\n else\n {\n console.log(\"Values too big. aborted\");\n }\n }\n }\n}", "title": "" }, { "docid": "66f981a57a77d3bb7956fe3519d1c5d8", "score": "0.56024885", "text": "function updateVisSizeControls()\r\n{\r\n\t$(\"#visWidth\").val(defaultVisWidth);\r\n\t$(\"#visHeight\").val(defaultVisHeight);\r\n\t$(\"#dataPoints\").val(maxPoints);\r\n\r\n}", "title": "" }, { "docid": "67fdeb7711710f23d526b3ef72cf4d94", "score": "0.5601575", "text": "function setStep (frames) {\n\t\treturn {\n\t\t\ttick: 1 / frames,\n\t\t\tfront: Math.floor(vertex_count / frames)\n\t\t};\n\t}", "title": "" }, { "docid": "22f2ce61021fcd45956baf5db03bc305", "score": "0.5582691", "text": "function update_parameters(grid_size_x,grid_size_y) //this function is used for every iteration of OnFrame() and for every onMouseDrag() events\n {\n\n x_axis_ori=origo.y/grid_size_y;\n y_axis_ori=origo.x/grid_size_x;\n\n }", "title": "" }, { "docid": "a2a49508c8205cbe1efeaf5a532a6274", "score": "0.5577695", "text": "function workoutNewScale(){\n // Start at 2 decimals places\n var decimals = 2;\n\n // While it wont produce a unique list\n // increase number of decimal places\n while( willDecimalProduceUnqiueList(decimals) == false ){\n decimals++;\n };\n\n // Cache the required number\n axis._tickFormatCache.decimals = decimals;\n }", "title": "" }, { "docid": "748054607a16e56bceafac2dea7563e8", "score": "0.5571026", "text": "function setNextLigaSize() {\n setNextOpt(__OPTSET.ligaSize);\n}", "title": "" }, { "docid": "d259fee27488e48fcdb0b7ab57bf3f1c", "score": "0.5569679", "text": "function handleResize() {\r\n\t\t\t// 1. update height of step elements\r\n\t\t\tvar stepHeight = Math.floor(window.innerHeight * 0.75);\r\n\t\t\tstep.style('height', stepHeight + 'px');\r\n\r\n\t\t\t// 2. update width/height of graphic element\r\n\t\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\r\n\r\n\t\t\tvar graphicMargin = 16 * 4;\r\n\t\t\tvar textWidth = text.node().offsetWidth;\r\n\t\t\tvar graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\r\n\t\t\tvar graphicHeight = Math.floor(window.innerHeight / 2)\r\n\t\t\tvar graphicMarginTop = Math.floor(graphicHeight / 2)\r\n\r\n\t\t\tgraphic\r\n\t\t\t\t.style('width', graphicWidth + 'px')\r\n\t\t\t\t.style('height', graphicHeight + 'px')\r\n\t\t\t\t.style('top', graphicMarginTop + 'px');\r\n\r\n\r\n\t\t\t// 3. tell scrollama to update new element dimensions\r\n\t\t\tscroller.resize();\r\n\t\t}", "title": "" }, { "docid": "bd2604a41f2905f77ffc00cc5140f644", "score": "0.55647916", "text": "function adjustPreviewSize() {\n\t\tif ($(window).height() >= 650) {\n\t\t\tvar skinCanvas = document.getElementById(\"skinCanvas\");\n\t\t\tvar previewCanvas = document.getElementById(\"preview\");\n\t\t\t$scope.skinCanvasWidthAdd = skinCanvas.width;\n\t\t\t$scope.skinCanvasHeightAdd = 110;\n\t\t\t$scope.sizeClass = \"'double-size'\";\n\t\t\tscale = 2;\n\t\t\tpreviewCanvas.width -= skinCanvas.width;\n\t\t\tpreviewCanvas.height += skinCanvas.height + 10;\n\t\t\tskinCanvas.width *= 2;\n\t\t\tskinCanvas.height *= 2;\n\t\t}else {\n\t\t\t$scope.skinCanvasHeightAdd = $scope.skinCanvasWidthAdd = 0;\n\t\t\t$scope.sizeClass = \"\";\n\t\t\tscale = 1;\n\t\t}\n\t}", "title": "" }, { "docid": "aadbfd9ee86b57e9e5cdc9a4265ad4e6", "score": "0.5564313", "text": "function handleResize() {\n // 1. update height of step elements\n // var stepHeight = Math.floor($(window).innerHeight() * 0.75);\n // step.style('height', stepHeight + 'px');\n\n // 2. update height of graphic element\n graphic.style('height', $(window).innerHeight() + 'px');\n\n if ( $(window).innerWidth() > 1030 && !isMobile ) {\n chart.style('height', Math.floor($(window).innerHeight() / 1.25) + 'px');\n } else {\n chart.style('height', Math.floor($(window).innerHeight() / 1.1) + 'px');\n }\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "92cb73f7018a7eb03388e85cc78fd916", "score": "0.5556707", "text": "_nextStep() {\n this._currentStepIdx++;\n console.log(\"RG: change to step \", this._currentStepIdx);\n }", "title": "" }, { "docid": "d9ef85fa850ad8de00000b3350d47b59", "score": "0.55562145", "text": "stepDivergence() {\n\t\tfor (let i = 0; i < this.width; i++) {\n\t\t\tfor (let j = 0; j < this.height; j++) {\n\t\t\t\tconst w = -this.velocityX.get(i - 1, j);\n\t\t\t\tconst e = +this.velocityX.get(i + 1, j);\n\t\t\t\tconst n = -this.velocityY.get(i, j - 1);\n\t\t\t\tconst s = +this.velocityY.get(i, j + 1);\n\n\t\t\t\tconst divergence = 0.5 * (e + w + n + s);\n\t\t\t\tthis.divergence.set(i, j, divergence);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a9eb0f1d09348ac69998994fe8bc573a", "score": "0.55543864", "text": "function nextStep(){\n setStep(step+1);\n }", "title": "" }, { "docid": "9bac7fa8c9d19166ade512b7589c9db0", "score": "0.55541533", "text": "_getCurrentStepValue() {\n const { zoomStep } = this.props\n const {\n currentZoom,\n realZoomMin,\n } = this.state\n if (currentZoom - this._interpolateWithScale(zoomStep) > this._interpolateWithScale(1)) {\n return zoomStep\n } else if (currentZoom > realZoomMin && currentZoom - this._interpolateWithScale(0.1) < realZoomMin) {\n return 0.01\n } else {\n return 0.1\n }\n }", "title": "" }, { "docid": "98885290b44c4357879f594a35aca40c", "score": "0.55526316", "text": "function resetStepsPerSec() {\n stepCount = 0;\n startTime = (new Date()).getTime();\n}", "title": "" }, { "docid": "ac8dfddbca91f6ce810b1bb5e667e23a", "score": "0.5549485", "text": "function pointSizeSliderChange(ev, gl){\r\n var size = ev.target.value;\r\n changePointSize(size, gl);\r\n renderClickScene(gl);\r\n }", "title": "" }, { "docid": "ff6452e340fb69712d6aeb07f8eacd23", "score": "0.5549475", "text": "function handleResize() {\n\t\t// 1. update height of step elements\n\t\tvar stepHeight = Math.floor(window.innerHeight * 0.25);\n\t\tstep.style('height', stepHeight + 'px');\n\t\t// 2. update width/height of graphic element\n\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\n\t\tvar graphicMargin = 16 * 4;\n\t\tvar textWidth = text.node().offsetWidth;\n\t\tvar graphicWidth = container.node().offsetWidth; // - textWidth - graphicMargin;\n\t\tvar graphicHeight = Math.floor(window.innerHeight * 0.5);\n\t\tvar graphicMarginTop = Math.floor(graphicHeight / 2);\n\t\tgraphic\n\t\t\t.style('width', graphicWidth + 'px')\n\t\t\t.style('height', graphicHeight + 'px');\n\t\t// 3. tell scrollama to update new element dimensions\n\t\tscroller.resize();\n\t}", "title": "" }, { "docid": "ec43e8598736853f317e4972a1454fa4", "score": "0.5538059", "text": "function handleResize() {\n // 1. update height of step elements\n var stepHeight = Math.floor(window.innerHeight * 0.75);\n step.style('height', stepHeight + 'px');\n\n // 2. update width/height of graphic element\n var bodyWidth = d3.select('body').node().offsetWidth;\n\n graphic\n .style('width', bodyWidth + 'px')\n .style('height', window.innerHeight + 'px');\n\n var chartMargin = 32;\n var textWidth = text.node().offsetWidth;\n var chartWidth = graphic.node().offsetWidth - textWidth - chartMargin;\n\n chart\n .style('width', chartWidth + 'px')\n .style('height', Math.floor(window.innerHeight / 2) + 'px');\n\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "0642bd5d68ad0c425a298b64eb0d3add", "score": "0.553572", "text": "_updateZooming() {\r\n const [d, t] = [this._zoomDuration, this._zoomScaleTarget];\r\n this._zoomScale = (this._zoomScale * (d - 1) + t) / d;\r\n this._zoomDuration--;\r\n }", "title": "" }, { "docid": "6cff881974cf938eaf415b803e14c413", "score": "0.55336994", "text": "function estimateFirstStepSize(hMax){\n var i;\n var dimension = self.getDimension();\n var initialState = self.getInitialState();\n var initialRate = self.getInitialRate();\n var ode = self.getODE();\n \n var posneg =(hMax<0)?-1:1;\n hMax = Math.abs(hMax);\n var normF = 0.0, normX = 0.0 ;\n for(i = 0; i < dimension; i++) {\n var sk = mAbsTol[i] + mRelTol[i]*Math.abs(initialState[i]);\n var aux = initialRate[i]/sk;\n normF += aux*aux;\n aux = initialState[i]/sk;\n normX += aux*aux;\n }\n var h;\n if ((normF <= 1.e-10) || (normX <= 1.e-10)) h = 1.0e-6;\n else h = Math.sqrt(normX / normF) * 0.01;\n h = posneg*Math.min(h, hMax);\n // perform an Euler step and estimate the rate, reusing finalState (it is SAFE to do so)\n if (ode.getDelays) {\n var eventSolver = self.getEventSolver(); \n eventSolver.resetDiscontinuities(initialState);\n var counter = 0;\n var done = false;\n while (!done) {\n for (i = 0; i < dimension; i++) finalState[i] = initialState[i] + h * initialRate[i];\n switch (eventSolver.checkDiscontinuity(finalState, false)) {\n case EJSS_ODE_SOLVERS.DISCONTINUITY_CODE.DISCONTINUITY_PRODUCED_ERROR : return Number.NaN; \n case EJSS_ODE_SOLVERS.DISCONTINUITY_CODE.DISCONTINUITY_JUST_PASSED :\n case EJSS_ODE_SOLVERS.DISCONTINUITY_CODE.DISCONTINUITY_ALONG_STEP : h = h/2; break;\n case EJSS_ODE_SOLVERS.DISCONTINUITY_CODE.DISCONTINUITY_EXACTLY_ON_STEP : done = true; break; \n case EJSS_ODE_SOLVERS.DISCONTINUITY_CODE.NO_DISCONTINUITY_ALONG_STEP : done = true; break; \n }\n if ((++counter)>100) return Number.NaN;\n }\n }\n else {\n for (i = 0; i < dimension; i++) \n finalState[i] = initialState[i] + h * initialRate[i];\n }\n ode.getRate(finalState, finalRate);\n var der2 = 0.0;\n for (i = 0; i < dimension; i++) {\n var sk = mAbsTol[i] + mRelTol[i] * Math.abs(initialState[i]);\n var aux = (finalRate[i] - initialRate[i]) / sk;\n der2 += aux*aux;\n }\n der2 = Math.sqrt(der2) / h;\n //step size is computed as follows\n //h^order * max ( norm (initialRate), norm (der2)) = 0.01\n var der12 = Math.max(Math.abs(der2), Math.sqrt(normF));\n var h1;\n if (der12 <= 1.0e-15) h1 = Math.max(1.0e-6, Math.abs(h) * 1.0e-3);\n else h1 = Math.exp((1.0 / mMethodOrder) * Math.log(0.01 / der12));\n h = posneg*Math.min(100*h, h1);\n if (hMax != 0) h = posneg*Math.min(Math.abs(h),hMax);\n return h;\n }", "title": "" }, { "docid": "e9f7250ffc9cca2f62c36f3ab6d453c7", "score": "0.55269456", "text": "function handleResize() {\n // 1. update height of step elements\n var stepHeight = Math.floor(window.innerHeight * 0.75);\n step.style('height', stepHeight + 'px');\n // 2. update width/height of graphic element\n var bodyWidth = d3.select('body').node().offsetWidth;\n var graphicMargin = 16 * 4;\n var textWidth = text.node().offsetWidth;\n \n var graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\n containerWidth = container.node().offsetWidth;\n if (0) { //(containerWidth > 770) {\n graphicWidth = containerWidth - textWidth - graphicMargin;\n } else {\n graphicWidth = containerWidth - graphicMargin;\n }\n\n var graphicHeight = Math.floor(window.innerHeight * 0.95);\n var graphicMarginTop = Math.floor(graphicHeight / 2);\n graphic\n .style('width', graphicWidth + 'px')\n .style('height', graphicHeight + 'px');\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "6580808bb3789c4c29dd8506ee48fe94", "score": "0.5518598", "text": "function prevStep(){\n setStep(step-1);\n }", "title": "" }, { "docid": "4b1621841a8e54138f14d7453638bf49", "score": "0.55063665", "text": "function changeNodeSize() {\n // recompute the normalization\n var range = _nodeSizeAccessor.getRange();\n _nodeSizeScale.domain([range.min,range.max])\n\n _nodeSizeAccessor.cacheAllValues();\n\n //Redraw all graphics\n _nodeData.forEach(function(d) {\n d.size = _nodeSizeScale(_nodeSizeAccessor.getOne(d.index));\n d.clear();\n d.beginFill(d.color);\n d.drawCircle(0, 0, d.size);\n });\n\n _nodeSizeAccessor.deleteCache();\n _renderer.render(_stage);\n }", "title": "" }, { "docid": "637245d5f3a6d9e874baab659229db37", "score": "0.54985356", "text": "_updatePrevPoints() {\n equalizePoints(this.prevP1, this.p1);\n equalizePoints(this.prevP2, this.p2);\n }", "title": "" }, { "docid": "637245d5f3a6d9e874baab659229db37", "score": "0.54985356", "text": "_updatePrevPoints() {\n equalizePoints(this.prevP1, this.p1);\n equalizePoints(this.prevP2, this.p2);\n }", "title": "" }, { "docid": "deda75ff3d34727ec8a9495f4d55f7cd", "score": "0.5489949", "text": "function changeRowSize(){\n cancelAnimationFrame(globalID);\n let rowSize = document.getElementById('rowSlider').value\n document.getElementById('rowLabel').innerHTML =\"Rows = \" + rowSize;\n let colSize = document.getElementById('colSlider').value\n document.getElementById('colLabel').innerHTML =\"Columns = \" + colSize;\n resetGlobals();\n resetGrid(rowSize, colSize);\n}", "title": "" }, { "docid": "57520d4da23304713adee07051c6ef09", "score": "0.5477208", "text": "_increment(numSteps) {\n this.value = this._clamp((this.value || 0) + this.step * numSteps, this.min, this.max);\n }", "title": "" }, { "docid": "57520d4da23304713adee07051c6ef09", "score": "0.5477208", "text": "_increment(numSteps) {\n this.value = this._clamp((this.value || 0) + this.step * numSteps, this.min, this.max);\n }", "title": "" }, { "docid": "c881fea4bac2f706ed6d38151aa43050", "score": "0.54747355", "text": "function handleResize() {\n\t// 1. update height of step elements\n\tvar scrollyWidth = window.innerWidth * 0.98\n\n\tscrolly\n\t\t.style('width', scrollyWidth + 'px')\n\n\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\tvar longstep = window.innerHeight * 2.5\n\tstep1.style('height', stepH + 'px');\n\tstep2.style('height', stepH + 'px');\n\tstep3.style('height', stepH + 'px');\n\tprelong.style('height', longstep + 'px');\n\n\tvar figureHeight = window.innerHeight / 1.2\n\tvar figureMarginTop = (window.innerHeight - figureHeight) / 2 \n\n\tfigure1\n\t\t.style('height', figureHeight + 'px')\n\t\t.style('top', figureMarginTop + 'px');\n\n\tfigure2\n\t\t.style('height', figureHeight + 'px')\n\t\t.style('top', figureMarginTop + 'px');\n\n\tfigure3\n\t\t.style('height', figureHeight + 'px')\n\t\t.style('top', figureMarginTop + 'px');\n\n\t// 3. tell scrollama to update new element dimensions\n\tscroller.resize();\n}", "title": "" }, { "docid": "82b93be01582a49c9e8ba9ffb0e58ac5", "score": "0.5472454", "text": "adjustSizeOfItems() {\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i];\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n if (item.autoSize) {\n if (this.options.direction === 'horizontal') {\n item.h = this.options.lanes;\n }\n else {\n item.w = this.options.lanes;\n }\n }\n }\n }", "title": "" }, { "docid": "d93aa7767cc393f545da28181e0e68fc", "score": "0.54598397", "text": "step( dt ) {\n this.fluid.step( dt );\n }", "title": "" }, { "docid": "8d936a9d73361cfcfebca6dde2487af6", "score": "0.5452143", "text": "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar dotDirty = false;\n\t\tif(dotCanvas === null) {\n\t\t\tdotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdotCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(dotCanvas.width != rw) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.width = rw;\n\t\t}\n\t\tif(dotCanvas.height != rh) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\t\tif(dropCanvas.width != rw) {\n\t\t\tdropCanvas.width = rw;\n\t\t}\n\t\tif(dropCanvas.height != rh) {\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t// $log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\tupdateSelectionsWhenZoomingOrResizing();\n\t\tupdateDropZones(textColor, 0.3, false);\n\t\t// $log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "title": "" }, { "docid": "fb10836f05b638a2c0ccb136d973f2de", "score": "0.5446353", "text": "resize() {\n this.removeValues();\n this.distributeValues();\n //Maxtest zurücksetzen um die Bedingung für Eintritt in die selectValue zu genügen\n if(!isNaN(this.lastValue)) {\n this.selectValue(this.lastValue);\n }\n }", "title": "" } ]
6554cfb56f6460d04efc89cd4678ccd6
Copies the mafskins.xml file from the application location ([appRoot]/ApplicationController/src/METAINF) to a deployment folder for inclusion in the native application.
[ { "docid": "f8841b8e0f7fda46a2dd9c8627406bd4", "score": "0.7183376", "text": "function _copyAdfmfSkinsXml() {\n\tvar copyTask = createCopyTask(self.getProject(), self.getOwningTarget());\n\n\tvar appControllerProjectName = self.getProject().getProperty(\n\t\t\t\"oepe.adfmf.assembly.appControllerFolder\");\n\tvar assemblyProject = self.getProject().getProperty(\n\t\t\t\"oepe.adfmf.assembly.project\");\n\tvar assemblyProjectDir = new java.io.File(assemblyProject);\n\tvar parentDir = assemblyProjectDir.getParent();\n\tvar appControllerDir = new java.io.File(parentDir, appControllerProjectName);\n\n\tself.getProject().setProperty(OEPE_ADFMF_APPCONTROLLER_PROJECT_PATH,\n\t\t\tappControllerDir.getAbsolutePath());\n\n\tvar sourceFile = new java.io.File(appControllerDir, \"src/META-INF/maf-skins.xml\");\n\tcopyTask.setFile(sourceFile);\n\n\tvar buildRootDir = self.getProject().getProperty(\"adf.build.root.dir\");\n\tvar stagingRelPathToFARs = self.getProject().getProperty(\n\t\t\t\"oepe.adfmf.staging.relpath.fars\");\n \n var applicationController = self.getProject().getProperty(\"oepe.adfmf.assembly.appControllerFolder\");\n var appControllerFarPath = new java.io.File(buildRootDir + \"/\"\n + stagingRelPathToFARs + \"/\" + applicationController);\n\n\tvar deployADFmfSkinsDir = new java.io.File(appControllerFarPath, \"META-INF\");\n\tcopyTask.setTodir(deployADFmfSkinsDir);\n\tcopyTask.setOverwrite(true);\n\n\tself.getProject().setProperty(OEPE_ADFMF_STAGING_ADFMF_SKINS_XML,\n\t\t\tdeployADFmfSkinsDir + \"/maf-skins.xml\");\n\tcopyTask.perform();\n}", "title": "" } ]
[ { "docid": "9f6e6250586d627311e7db1cd636b037", "score": "0.6027618", "text": "function _copyAdfmfConfigXml() {\n\tvar copyTask = createCopyTask(self.getProject(), self.getOwningTarget());\n\n\tvar dotAdfDir = self.getProject().getProperty(\n\t\t\t\"oepe.adfmf.assembly.dotadf.dir.path\");\n\tvar appAdfmfConfigUrl = dotAdfDir + \"/META-INF/maf-config.xml\";\n\tvar sourceFile = new java.io.File(appAdfmfConfigUrl);\n\n\tcopyTask.setFile(sourceFile);\n\n\tvar deployAdfmfConfigDir = self.getProject().getProperty(\n\t\t\t\"adf.staging.dotadf.dir\");\n\tvar deploymentAdfmfConfigDir = new java.io.File(deployAdfmfConfigDir);\n\tcopyTask.setTodir(deploymentAdfmfConfigDir);\n\tcopyTask.setOverwrite(true);\n\tself.getProject().setProperty(OEPE_ADFMF_STAGING_ADFMF_CONFIG_XML,\n\t\t\tdeploymentAdfmfConfigDir + \"/maf-config.xml\");\n\n\tcopyTask.perform();\n}", "title": "" }, { "docid": "6c34aafaa6478c32b98f4088bd11c194", "score": "0.5669403", "text": "copySkeletonApp() {\n this.log.verbose('copying skeleton app');\n try {\n shell.cp(\n '-rf',\n join(this.$.env.paths.meteorDesktop.skeleton, '*'),\n this.$.env.paths.electronApp.appRoot + path.sep\n );\n } catch (e) {\n this.log.error('error while copying skeleton app:', e);\n process.exit(1);\n }\n }", "title": "" }, { "docid": "c7116462846eebaa1cfc8fb56f83cd3b", "score": "0.5264156", "text": "function _updateAdfmfSkinsXml(adfSkins) {\n\t// Update the deployed version of maf-skins.xml\n\tvar adfmf_skins_xml = self.getProject().getProperty(\n\t\t\tOEPE_ADFMF_STAGING_ADFMF_SKINS_XML);\n\tvar skinXmlUpdater = new AdfmfSkinsXmlUpdater(adfSkins,\n\t\t\tadfmf_skins_xml);\n\tskinXmlUpdater.update();\n}", "title": "" }, { "docid": "0c67b359518e96dfd99d1b3c048939b9", "score": "0.5034341", "text": "function copyCoreInjectionsFiles() {\n const srcFrontend = path.resolve(ESN_ROOT, 'frontend');\n const destFrontEnd = path.resolve(__dirname, 'src', 'frontend');\n\n CONSTANTS.coreInjectionsFiles.forEach((f) => {\n const srcFile = path.resolve(srcFrontend, f);\n const destFile = path.resolve(destFrontEnd, f);\n mkdirp.sync(path.dirname(destFile));\n fs.copyFileSync(srcFile, destFile);\n });\n}", "title": "" }, { "docid": "1d90971bb640c149dfb75bcdc325a61a", "score": "0.5017122", "text": "function copy_cordova() {\r\n return src(['app/cordova.js', 'app/cordova_plugins.js'])\r\n .pipe(dest('www'));\r\n}", "title": "" }, { "docid": "410d8cc75d458adec8c618081b34b8bb", "score": "0.49641016", "text": "static copyTestApp(platform) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst\n\t\t\t\tappRoot = path.join(global.projRoot, 'Build', platform, app.name),\n\t\t\t\tfilePath = path.join(appRoot, 'Resources', 'app.js'),\n\t\t\t\ttestApp = path.join(global.projRoot, 'Config', 'Support', 'app.js');\n\n\t\t\treadFilePromise(testApp)\n\t\t\t\t.then(data => fs.writeFile(filePath, data))\n\t\t\t\t.then(resolve())\n\t\t\t\t.catch(e => reject(e));\n\n\t\t});\n\t}", "title": "" }, { "docid": "881eab47f1a2969b13b8f694273dbe2e", "score": "0.4941705", "text": "function writeBundle(savPath, srcPath) {\n fs.readFile(srcPath, 'utf8', (err, data) => {\n if (err) throw err;\n fs.writeFile(savPath, data, (err) => {\n if (err) throw err;\n console.log('complete write vendor');\n });\n });\n}", "title": "" }, { "docid": "df579a2f3f7ad19e929c1bda150294b8", "score": "0.4928731", "text": "async function copyAppUiAssets(appSrcPath) {\n await execa_1.default('npm', ['run', 'sync-assets'], { cwd: appSrcPath });\n}", "title": "" }, { "docid": "6db2855864df921e8b138b84316758e4", "score": "0.49250728", "text": "function setupNewShareModule (pathPrefix) {\n this.out.info('Setting up new share amp: ' + pathPrefix);\n const basename = path.basename(pathPrefix);\n\n const defaultModule = this.sdk.defaultSourceModule.call(this, constants.WAR_TYPE_SHARE);\n if (defaultModule) {\n const webExtensionPath = this.destinationPath(`${pathPrefix}/${this.sdk.shareConfigBase}/alfresco/web-extension`);\n const appContextName = `${defaultModule.artifactId}-slingshot-application-context.xml`;\n const appContextPath = path.join(webExtensionPath, appContextName);\n debug('Looking for resources bean in %s', appContextPath);\n if (memFsUtils.existsInMemory(this.fs, appContextPath) || fs.existsSync(appContextPath)) {\n const appContextDocOrig = this.fs.read(appContextPath);\n const doc = domutils.parseFromString(appContextDocOrig);\n let bean = domutils.getFirstNodeMatchingXPath(`//bean[@id=\"org.alfresco.${defaultModule.artifactId}.resources\"]`, doc);\n // SDK3 includes schema info that SDK2 did not include\n if (!bean) {\n bean = domutils.getFirstNodeMatchingXPath(`//beans:bean[@id=\"org.alfresco.${defaultModule.artifactId}.resources\"]`, doc);\n }\n if (bean) {\n let value = domutils.getFirstNodeMatchingXPath(`property[@name=\"resourceBundles\"]/list/value`, bean);\n // SDK3 includes schema info that SDK2 did not include\n if (!value) {\n value = domutils.getFirstNodeMatchingXPath(`beans:property[@name=\"resourceBundles\"]/beans:list/beans:value`, bean);\n }\n if (value) {\n bean.setAttribute('id', 'org.alfresco.${project.artifactId}.resources');\n value.textContent = 'alfresco.web-extension.messages.${project.artifactId}';\n const appContextDocNew = domutils.prettyPrint(doc);\n this.fs.write(appContextPath, appContextDocNew);\n } else {\n debug('Failed to find value element');\n }\n } else {\n debug('Failed to find resources bean element');\n }\n\n // Rename files with artifactId in their name\n [\n path.join(webExtensionPath, appContextName),\n path.join(webExtensionPath, 'messages', `${defaultModule.artifactId}.properties`),\n path.join(webExtensionPath, 'site-data', 'extensions', `${defaultModule.artifactId}-example-widgets.xml`),\n ].forEach((file) => {\n if (memFsUtils.existsInMemory(this.fs, file) || fs.existsSync(file)) {\n const dir = path.dirname(file);\n const base = path.basename(file);\n const baseNew = base.replace(new RegExp(`^${defaultModule.artifactId}`), basename);\n if (baseNew !== base) {\n const fileNew = path.join(dir, baseNew);\n debug('RENAME FROM %s TO %s', file, fileNew);\n this.fs.move(file, fileNew);\n }\n } else {\n debug('Could not find %s, so not attempting to rename it', file);\n }\n });\n } else {\n debug('Did not find %s', appContextPath);\n }\n }\n debug('setupNewShareAmp() finished');\n}", "title": "" }, { "docid": "5b02a26c1ad7f5910304dd234420a175", "score": "0.48963466", "text": "function minify_app_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/app.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "title": "" }, { "docid": "0b540ed3b97200a442ff8383d118c3bf", "score": "0.48430562", "text": "function concat_app_js(cb){\r\n\tpump([\r\n\t\tgulp.src(source.js.app),\r\n\t\tconcatJS('app.js'),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "title": "" }, { "docid": "c81296da1800f4a806abc562c6ea0c19", "score": "0.48420313", "text": "function assetsCopy(){\n return src(\"./src/assets/**/*\")\n .pipe(dest(buildDir+\"assets/\"));\n}", "title": "" }, { "docid": "2a6e653757625296a9e6f97d6ff265be", "score": "0.47647592", "text": "function deploy () {\n return src('build/**/*', {\n base: 'build',\n since: lastRun(deploy)\n })\n .pipe(existClient.dest({ target }))\n}", "title": "" }, { "docid": "c86ee79cf7038c375968076b03b00f27", "score": "0.47486544", "text": "function copy() {\r\n\treturn gulp.src(CONF.PATHS.assets + '/**/*')\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets'));\r\n}", "title": "" }, { "docid": "2bff8563823d57252aea92730a6c4316", "score": "0.47183228", "text": "function _createApplication() {\n /**\n * Create the root of the application\n */\n mkdirSync(appPath);\n\n /**\n * Copy the baseline structure of the application\n */\n const templateBaselinePath = path.join(__dirname, '..', constants.TEMPLATE_BASELINE_PATH);\n deepCopySync(templateBaselinePath, appPath);\n\n /**\n * Copy the index.html file according to the configuration\n */\n if (program.menu === 'left') {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_LEFT_MENU), appPath);\n } else {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_TOP_MENU), appPath);\n }\n\n /**\n * Create the other directiories that are needed for the start\n */\n constants.DIRECTORIES_FOR_mkdirSync.forEach(__path => {\n mkdirSync(path.join(appPath, __path));\n });\n\n /**\n * Run the steps to aquire the final form of the skeleton\n */\n startTaskRunner(appPath);\n}", "title": "" }, { "docid": "d70b5db6440820cd6d9913b6f488b864", "score": "0.47101483", "text": "function copy_cordova_plugins() {\r\n return src('app/plugins/**/*')\r\n .pipe(dest('www/plugins'));\r\n}", "title": "" }, { "docid": "45e7248821f83e62bbabbe353b75829f", "score": "0.46986756", "text": "function convertWithFileCopy (program) {\n return new Promise((resolve, reject) => {\n let preAppx = path.join(program.outputDirectory, 'pre-appx')\n let app = path.join(preAppx, 'app')\n let manifest = path.join(preAppx, 'AppXManifest.xml')\n let manifestTemplate = path.join(__dirname, '..', 'template', 'AppXManifest.xml')\n let assets = path.join(preAppx, 'assets')\n let assetsTemplate = path.join(__dirname, '..', 'template', 'assets')\n\n utils.log(chalk.green.bold('Starting Conversion...'))\n utils.debug(`Using pre-appx folder: ${preAppx}`)\n utils.debug(`Using app from: ${app}`)\n utils.debug(`Using manifest template from: ${manifestTemplate}`)\n utils.debug(`Using asset template from ${assetsTemplate}`)\n\n // Clean output folder\n utils.log(chalk.green.bold('Cleaning pre-appx output folder...'))\n fs.emptyDirSync(preAppx)\n\n // Copy in the new manifest, app, assets\n utils.log(chalk.green.bold('Copying data...'))\n fs.copySync(manifestTemplate, manifest)\n utils.debug('Copied manifest template to destination')\n fs.copySync(assetsTemplate, assets)\n utils.debug('Copied asset template to destination')\n fs.copySync(program.inputDirectory, app)\n utils.debug('Copied input app files to destination')\n\n // Then, overwrite the manifest\n fs.readFile(manifest, 'utf8', (err, data) => {\n utils.log(chalk.green.bold('Creating manifest..'))\n let result = data\n let executable = program.packageExecutable || `app\\\\${program.packageName}.exe`\n\n if (err) {\n utils.debug(`Could not read manifest template. Error: ${JSON.stringify(err)}`)\n return utils.log(err)\n }\n\n result = result.replace(/\\${publisherName}/g, program.publisher)\n result = result.replace(/\\${publisherDisplayName}/g, program.publisherDisplayName || 'Reserved')\n result = result.replace(/\\${identityName}/g, program.identityName || program.packageName)\n result = result.replace(/\\${packageVersion}/g, program.packageVersion)\n result = result.replace(/\\${packageName}/g, program.packageName)\n result = result.replace(/\\${packageExecutable}/g, executable)\n result = result.replace(/\\${packageDisplayName}/g, program.packageDisplayName || program.packageName)\n result = result.replace(/\\${packageDescription}/g, program.packageDescription || program.packageName)\n result = result.replace(/\\${packageBackgroundColor}/g, program.packageBackgroundColor || '#464646')\n\n let extensions = '';\n\n if (program.protocols && program.protocols.length > 0) {\n extensions = '<Extensions>';\n \n program.protocols.forEach(item => {\n const protocol = Object.keys(item) && Object.keys(item).length > 0 && Object.keys(item)[0];\n const name = protocol && item[protocol];\n\n protocol && name && (extensions += `<uap:Extension Category=\"windows.protocol\"><uap:Protocol Name=\"${protocol}\"><uap:DisplayName>${name}</uap:DisplayName></uap:Protocol></uap:Extension>`);\n });\n\n extensions += '</Extensions>';\n }\n\n result = result.replace(/\\${extensions}/g, extensions);\n\n fs.writeFile(manifest, result, 'utf8', (err) => {\n if (err) {\n const errorMessage = `Could not write manifest file in pre-appx location. Error: ${JSON.stringify(err)}`\n utils.debug(errorMessage)\n return reject(new Error(errorMessage))\n }\n\n resolve()\n })\n })\n })\n}", "title": "" }, { "docid": "a1fad051dc7283aa799be64b9e3bf7de", "score": "0.46812692", "text": "app() {\r\n this.fs.copy(\r\n this.templatePath('src/app.js'),\r\n this.destinationPath('src/app.js')\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('src/app/controllers/_index.js'),\r\n this.destinationPath('src/app/controllers/index.js'),\r\n this.opts\r\n );\r\n this.fs.copy(\r\n this.templatePath('src/app/controllers/extras.js'),\r\n this.destinationPath('src/app/controllers/extras.js')\r\n );\r\n this.directory(\r\n this.templatePath('src/app/models'),\r\n this.destinationPath('src/app/models')\r\n );\r\n this.directory(\r\n this.templatePath('src/app/views'),\r\n this.destinationPath('src/app/views')\r\n );\r\n }", "title": "" }, { "docid": "5f9ba13df68f30441cbe55bb051398c5", "score": "0.46649826", "text": "build(appOutDir, arch) {\n var _this = this;\n\n return (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* () {\n const packager = _this.packager;\n const cscInfo = yield packager.cscInfo;\n if (cscInfo == null) {\n throw new Error(\"AppX package must be signed, but certificate is not set, please see https://github.com/electron-userland/electron-builder/wiki/Code-Signing\");\n }\n let publisher = _this.options.publisher;\n if (publisher == null) {\n const computed = yield packager.computedPublisherName.value;\n if (computed != null) {\n publisher = `CN=${computed[0]}`;\n }\n if (publisher == null) {\n throw new Error(\"Please specify appx.publisher\");\n }\n }\n const appInfo = packager.appInfo;\n const preAppx = _path.join(_this.outDir, `pre-appx-${(0, (_electronBuilderCore || _load_electronBuilderCore()).getArchSuffix)(arch)}`);\n yield (0, (_fsExtraP || _load_fsExtraP()).emptyDir)(preAppx);\n const vendorPath = yield (0, (_windowsCodeSign || _load_windowsCodeSign()).getSignVendorPath)();\n const templatePath = _path.join(__dirname, \"..\", \"..\", \"templates\", \"appx\");\n const safeName = (0, (_sanitizeFilename || _load_sanitizeFilename()).default)(appInfo.name);\n const resourceList = yield packager.resourceList;\n yield (_bluebirdLst2 || _load_bluebirdLst2()).default.all([(_bluebirdLst2 || _load_bluebirdLst2()).default.map([\"44x44\", \"50x50\", \"150x150\", \"310x150\"], function (size) {\n const target = _path.join(preAppx, \"assets\", `${safeName}.${size}.png`);\n if (resourceList.indexOf(`${size}.png`) !== -1) {\n return (0, (_fsExtraP || _load_fsExtraP()).copy)(_path.join(packager.buildResourcesDir, `${size}.png`), target);\n }\n return (0, (_fsExtraP || _load_fsExtraP()).copy)(_path.join(vendorPath, \"appxAssets\", `SampleAppx.${size}.png`), target);\n }), (0, (_fs || _load_fs()).copyDir)(appOutDir, _path.join(preAppx, \"app\")), _this.writeManifest(templatePath, preAppx, safeName, arch, publisher)]);\n const destination = _path.join(_this.outDir, packager.generateName(\"appx\", arch, false));\n const args = [\"pack\", \"/o\", \"/d\", preAppx, \"/p\", destination];\n (0, (_electronBuilderUtil || _load_electronBuilderUtil()).use)(_this.options.makeappxArgs, function (it) {\n return args.push.apply(args, _toConsumableArray(it));\n });\n // wine supports only ia32 binary in any case makeappx crashed on wine\n // await execWine(path.join(await getSignVendorPath(), \"windows-10\", process.platform === \"win32\" ? process.arch : \"ia32\", \"makeappx.exe\"), args)\n yield (0, (_electronBuilderUtil || _load_electronBuilderUtil()).spawn)(_path.join(vendorPath, \"windows-10\", arch === (_electronBuilderCore || _load_electronBuilderCore()).Arch.ia32 ? \"ia32\" : \"x64\", \"makeappx.exe\"), args);\n yield packager.sign(destination);\n packager.dispatchArtifactCreated(destination, _this, packager.generateName(\"appx\", arch, true));\n })();\n }", "title": "" }, { "docid": "41a50d7aedae9e169d0417e83c084d5c", "score": "0.46478686", "text": "function copyUnoConfig() {\n\n // We've seen %PROGRAMDATA% being empty on some systems.\n const dir = process.env.PROGRAMDATA && process.env.PROGRAMDATA.length\n ? path.join(process.env.PROGRAMDATA, 'fuse X')\n : path.join(process.env.SYSTEMDRIVE, 'ProgramData', 'fuse X')\n\n const src = path.join(os.homedir(), '.unoconfig');\n const dst = path.join(dir, '.unoconfig');\n\n if (fs.existsSync(src)) {\n if (!fs.existsSync(dir))\n fs.mkdirSync(dir, {recursive: true});\n\n fs.copyFileSync(src, dst);\n console.log(dst);\n }\n}", "title": "" }, { "docid": "70e6b78a947465ec8a95b14f1d384137", "score": "0.4632377", "text": "static copyAssetsIntoReleases (platforms) {\n if (new Set(platforms).has('darwin')) {\n fs.copySync(path.join(__dirname, 'dmg/First Run.html'), path.join(ROOT_PATH, 'WMail-darwin-x64/First Run.html'))\n return Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }", "title": "" }, { "docid": "3cd37abf922a36525e296ed96291034c", "score": "0.4629273", "text": "function copyAppSetting() {\n const config_path = './src/config';\n const app_settings_file = `${config_path}/appsettings.json`;\n const dev_app_settings_file = `${config_path}/appsettings.development.json`;\n\n try {\n if (!fs.existsSync(dev_app_settings_file)) {\n // file not exists, then create one\n fs.copyFileSync(app_settings_file, dev_app_settings_file);\n console.log('Development appsettings file created.');\n } else {\n console.warn(\n 'Warning: Development appsettings file already exists.'\n );\n }\n } catch (error) {\n console.error(error);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "5e9b8288a299edb5fba9fce98aae1ead", "score": "0.462198", "text": "function copyAssets() {\n const distAssetsPath = path.resolve(distDirectory, 'assets');\n const srcAssetsPath = path.resolve('src', 'assets');\n\n fse.copy(srcAssetsPath, distAssetsPath);\n}", "title": "" }, { "docid": "0729901ecddb6cf94205d683f7da640e", "score": "0.46206477", "text": "function copyDirIntoTestRunnerApp(allowSymlink, ...parts) {\n // Depending on whether the user has run `meteor run` or other commands, they\n // may or may not exist yet\n const appDirPath = files.pathJoin(options.appDir, ...parts);\n const testDirPath = files.pathJoin(testRunnerAppDir, ...parts);\n\n files.mkdir_p(appDirPath);\n files.mkdir_p(files.pathDirname(testDirPath));\n\n if (allowSymlink) {\n // Windows can create junction links without administrator\n // privileges since both paths refer to directories.\n files.symlink(appDirPath, testDirPath, \"junction\");\n } else {\n files.cp_r(appDirPath, testDirPath, {\n preserveSymlinks: true\n });\n }\n }", "title": "" }, { "docid": "3faffabec6aa25ad7c32df639ff97511", "score": "0.45991585", "text": "copyStaticFiles() {\n\t\tif (!this.weaver.root\n\t\t\t|| !fs.existsSync(this.weaver.root)\n\t\t\t|| !fs.statSync(this.weaver.root).isDirectory()) {\n\t\t\tthrow new Error('this.weaver.root does not point to a valid directory');\n\t\t}\n\n\t\t// this will be the output directory\n\t\tlet _siteStaticPath =\n\t\t\tpath.resolve(this.weaver.root, '_site', 'static');\n\n\t\tif (fs.existsSync(_siteStaticPath)) {\n\t\t\tfs.removeSync(_siteStaticPath);\n\t\t}\n\t\tfs.mkdirpSync(_siteStaticPath);\n\n\t\tlet themesStaticPath =\n\t\t\tpath.resolve(this.weaver.root, '../themes', this.weaver.theme || 'default', 'static');\n\t\tlet staticPath = path.resolve(this.weaver.root, '../static');\n\n\t\tif (fs.existsSync(themesStaticPath)) {\n\t\t\tfs.copySync(themesStaticPath, _siteStaticPath);\n\t\t}\n\n\t\tif (fs.existsSync(staticPath)) {\n\t\t\tfs.copySync(staticPath, _siteStaticPath);\n\t\t}\n\t}", "title": "" }, { "docid": "99c07e37f0a67dd43189c07b2ada1964", "score": "0.45975506", "text": "function resetCustomShared() {\n let app_share_path = path.join(__dirname,\"node_modules\",\"lshud-shared\")\n let folders = [\"assets\",\"js\",\"lib\"]\n let files = [\n [\"move.png\",\"share.css\"],\n [\"share.js\"],\n []\n ]\n folders.forEach((fol, i) => {\n fs.mkdirSync( path.join(appdata.shared, fol ) , { recursive: true } )\n let src = path.join( app_share_path , fol )\n let dest = path.join( appdata.shared , fol )\n files[i].forEach((file, ii) => {\n fs.copyFileSync( path.join(src,file), path.join(dest,file) )\n });\n\n });\n\n\n}", "title": "" }, { "docid": "39c7ef726bfe047f2534fdf28e961d39", "score": "0.45581755", "text": "function copy_res(cb) {\n src(\"src/renderer/res/**/*\").pipe(dest(\"build/renderer/res\")).on(\"end\", cb);\n}", "title": "" }, { "docid": "29a6e8b4818e63f9a5ee8ddb7009531f", "score": "0.45438364", "text": "function createNativeApp(config) {\n var createAppExecutable = path.join(__dirname, 'Templates', 'NativeAppTemplate', 'createApp.sh');\n\n // Calling out to the shell, so re-quote the command line arguments.\n var newCommandLineArgs = buildArgsFromArgMap(config);\n var createAppProcess = exec(createAppExecutable + ' ' + newCommandLineArgs, function(error, stdout, stderr) {\n if (stdout) console.log(stdout);\n if (stderr) console.log(stderr);\n if (error) {\n console.log(outputColors.red + 'There was an error creating the app.' + outputColors.reset);\n process.exit(3);\n }\n\n // Copy dependencies\n copyDependencies(config, function(success, msg) {\n if (success) {\n if (msg) console.log(outputColors.green + msg + outputColors.reset);\n console.log(outputColors.green + 'Congratulations! You have successfully created your app.' + outputColors.reset);\n } else {\n if (msg) console.log(outputColors.red + msg + outputColors.reset);\n console.log(outputColors.red + 'There was an error creating the app.' + outputColors.reset);\n }\n });\n });\n}", "title": "" }, { "docid": "d26567a0a18c43ce2938272c2e4ad2c7", "score": "0.45237657", "text": "function copyFiles (argv, cb) {\n if (argv.app) {\n copy(path.join(__dirname, 'templates/app'), process.cwd(), argv, cb)\n } else {\n copy(path.join(__dirname, 'templates/concept'), process.cwd(), argv, cb)\n }\n}", "title": "" }, { "docid": "af22bb4a01544220879e714ee9613ddb", "score": "0.45101738", "text": "getAppPath()\n {\n return path.join(this.getRootPath(), 'app');\n }", "title": "" }, { "docid": "bbf36c28ee1b9d1366588d22b3f1ff90", "score": "0.4488205", "text": "function chromeAppAssets() {\n\tgulp.src('manifest.json')\n\t\t.pipe(gulp.dest('./build'));\n\n\treturn gulp.src('icon.png')\n\t\t.pipe(gulp.dest('./build'));\n}", "title": "" }, { "docid": "c72099f2f2fa2b419320bfd74cbb8f8b", "score": "0.4479421", "text": "function cons() {\n return src([\n 'src/js/jquery.custom.min.js',\n 'src/js/menu.min.js',\n 'src/js/swiper.custom.min.js',\n ], { sourcemaps: true })\n .pipe(concat('app.min.js'))\n .pipe(dest('dist/', { sourcemaps: true }))\n}", "title": "" }, { "docid": "ba0ebf2df8b1c0ebe71addc8536dce23", "score": "0.4452752", "text": "_setMasterStaticFolder() {\n if ( this.#isConfigured !== true ) {\n this.log.warn('[uibuilder:web.js:_setMasterStaticFolder] Cannot run. Setup has not been called.')\n return\n }\n\n // Reference static vars\n const uib = this.uib\n // const RED = this.RED\n const log = this.log\n\n try {\n fs.accessSync( path.join(uib.masterStaticFeFolder, defaultPageName), fs.constants.R_OK )\n log.trace(`[uibuilder:web:setMasterStaticFolder] Using master production build folder. ${uib.masterStaticFeFolder}`)\n this.masterStatic = uib.masterStaticFeFolder\n } catch (e) {\n throw new Error(`setMasterStaticFolder: Cannot serve master production build folder. ${uib.masterStaticFeFolder}`)\n }\n }", "title": "" }, { "docid": "ad8935e7ccfeee3b8d0403a9138265ff", "score": "0.44356745", "text": "function copy() {\n return gulp.src(PATHS.assets)\n .pipe(gulp.dest(PATHS.dist + '/assets'));\n}", "title": "" }, { "docid": "5b1046d54375c71538ed771791ebf7a0", "score": "0.44264403", "text": "function setSkin(){\n //read skin files\n skinType = \"regular\";\n}", "title": "" }, { "docid": "d3e206a328ee2eb563cd7a1c71dff44f", "score": "0.44169492", "text": "function embeddedAsmPath(scope) {\n const appAsmRoot = assemblyBuilderOf(appOf(scope)).outdir;\n const stage = core_1.Stage.of(scope) ?? appOf(scope);\n const stageAsmRoot = assemblyBuilderOf(stage).outdir;\n return path.relative(appAsmRoot, stageAsmRoot) || '.';\n}", "title": "" }, { "docid": "a816dc7d5c04f951915467d8fa0015c2", "score": "0.44148493", "text": "function copyReleaseToExamples(ctxt, callback) {\n\t\tvar exampleBundlePath = path.join(__dirname, '../examples/public/j2j-' + version + '.js');\n\t\tfs.readFile(ctxt.bundlePath, { encoding: 'utf8' }, function (err, content) {\n\t\t\tif (err) {\n\t\t\t\tcallback(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs.writeFile(exampleBundlePath, content, callback);\n\t\t});\n\t}", "title": "" }, { "docid": "b87b804c4b918a9bcb4730904cb23f77", "score": "0.4414173", "text": "get assetBundleManifestPath() {}", "title": "" }, { "docid": "49e67403c4533b75447f4965fdac6260", "score": "0.439828", "text": "function addApp(app) {\n $folderList.append(templates.app(app));\n}", "title": "" }, { "docid": "149e35b6cef5536cd8c516827feb1ba9", "score": "0.4396935", "text": "function base(){\n slushy\n .src( templates.client.base.all() )\n .pipe($.rename( _this.files().replace ) )\n .pipe($.template( filters ))\n .pipe($.conflict( _this.dirs.app ))\n .pipe( slushy.dest( _this.dirs.app ))\n }", "title": "" }, { "docid": "0f2d8168d61f85f785a571c4e7b83ffd", "score": "0.43959323", "text": "function packageMedia() {\n return gulp.src('./media/*')\n .pipe(gulp.dest(`${packageDistribution}/media`));\n}", "title": "" }, { "docid": "175813e7065909b9159be4160e1c75f7", "score": "0.43895167", "text": "function deploymentFile(targetDir) {\n return path.join(targetDir, 'deployment.json');\n}", "title": "" }, { "docid": "6d9bc66581ae6d0698a8076e21106b95", "score": "0.43862528", "text": "function copy() {\n return gulp.src(PATHS.assets)\n .pipe(gulp.dest(PATHS.dist + '/assets'));\n }", "title": "" }, { "docid": "222a055c2b0101730d2fc13af556487b", "score": "0.43840593", "text": "function create(path, name)\n{\n WScript.StdOut.WriteLine(\"Creating Cordova-WP7 Project:\");\n WScript.StdOut.WriteLine(\"\\tName : \" + name);\n WScript.StdOut.WriteLine(\"\\tDirectory : \" + path);\n\n fso.CreateFolder(path);\n\n // copy everything from standalone to project directory\n var dest = shell.NameSpace(path);\n var sourceItems = shell.NameSpace(ROOT + CREATE_TEMPLATE).items();\n if (dest != null)\n {\n dest.CopyHere(sourceItems);\n WScript.Sleep(1000);\n }\n else\n {\n WScript.StdOut.WriteLine(\"Failed to create project directory.\");\n WScript.StdOut.WriteLine(\"CREATE FAILED.\");\n WScript.Quit(1);\n }\n\n // delete any generated files that might have been in template\n if(fso.FolderExists(path + \"\\\\obj\"))\n {\n fso.DeleteFolder(path + \"\\\\obj\");\n }\n if(fso.FolderExists(path + \"\\\\Bin\"))\n {\n fso.DeleteFolder(path + \"\\\\Bin\");\n }\n\n // replace the guid in the AppManifest\n var newProjGuid = genGuid();\n replaceInFile(path + \"\\\\Properties\\\\WMAppManifest.xml\", /\\$guid1\\$/, newProjGuid);\n // replace safe-project-name in all files\n replaceInFile(path + \"\\\\Properties\\\\WMAppManifest.xml\",/\\$safeprojectname\\$/g, name);\n replaceInFile(path + \"\\\\App.xaml\",/\\$safeprojectname\\$/g, name);\n replaceInFile(path + \"\\\\App.xaml.cs\",/\\$safeprojectname\\$/g, name);\n replaceInFile(path + \"\\\\CordovaAppProj.csproj\",/\\$safeprojectname\\$/g, name);\n replaceInFile(path + \"\\\\MainPage.xaml\",/\\$safeprojectname\\$/g, name);\n replaceInFile(path + \"\\\\MainPage.xaml.cs\",/\\$safeprojectname\\$/g, name);\n\n WScript.StdOut.WriteLine(\"CREATE SUCCESS.\");\n\n}", "title": "" }, { "docid": "d9eed6d115cb8dc9495c1157ce8f7fa8", "score": "0.43837357", "text": "function createApp(){\n\tconsole.log('createApp: ')\n\tu.createMetroApp(app.name);\n}", "title": "" }, { "docid": "55d45fa38b337dc1c2d825284af9e461", "score": "0.43681806", "text": "set assetBundleManifestPath(value) {}", "title": "" }, { "docid": "cdd9b187bde0ec5390035bd1203973b6", "score": "0.43590412", "text": "rewriteConfigFiles() {\r\n const approvedPackagesPolicy = this._rushConfiguration.approvedPackagesPolicy;\r\n if (approvedPackagesPolicy.enabled) {\r\n approvedPackagesPolicy.browserApprovedPackages.saveToFile();\r\n approvedPackagesPolicy.nonbrowserApprovedPackages.saveToFile();\r\n }\r\n }", "title": "" }, { "docid": "69dfc340485880392f49f8c39269dcd3", "score": "0.43408027", "text": "function copy() {\n // Copy these folders and contents as is\n gulp.src([\n 'src/background/**',\n 'src/content/**',\n 'src/popup/**',\n 'src/styles/**',\n 'src/vendor/**'], {base: 'src'})\n .pipe(gulp.dest(OUTPUT_DIR_WEB_EXTENSION));\n\n // Compile less into css\n gulp.src('src/**/*.less', {base: 'src'})\n .pipe(less())\n .pipe(gulp.dest(OUTPUT_DIR_WEB_EXTENSION));\n\n // Copy manifest\n gulp.src('src/manifest.json')\n .pipe(gulp.dest(OUTPUT_DIR_WEB_EXTENSION));\n\n // Copy icons over\n return gulp.src('src/icons/**')\n .pipe(gulp.dest(OUTPUT_DIR_WEB_EXTENSION + 'icons'))\n .pipe(gulp.dest(OUTPUT_DIR_SAFARI + 'icons'));\n}", "title": "" }, { "docid": "a8123c4181621bdeeb10825f51c74ff9", "score": "0.43345538", "text": "function AppSettingsRoot(){\r\n\tvar sh = new ActiveXObject(\"WScript.Shell\");\r\n\tfso = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n\tif (!fso.FolderExists(sh.ExpandEnvironmentStrings(\"%APPDATA%\") + \"\\\\SuperCopy\")) fso.CreateFolder(sh.ExpandEnvironmentStrings(\"%APPDATA%\") + \"\\\\SuperCopy\");\r\n\treturn sh.ExpandEnvironmentStrings(\"%APPDATA%\") + \"\\\\SuperCopy\";\r\n\r\n}", "title": "" }, { "docid": "a8829a1047eab6d529e80e0be05c981f", "score": "0.4330273", "text": "function readBundleFromDisk(sessionPath, bundleName, wsConnect) {\n\t \tvar deferred = Q.defer();\n\n\t \tvar bundlePath = path.join(sessionPath, bundleName + '_bndl');\n\n\t \tvar bundle = {};\n\t \tbundle.ssffFiles = [];\n\n\t \tvar allFilePaths = [];\n\n\t\t// add media file path\n\t\tvar mediaFilePath = path.join(bundlePath, bundleName + '.' + wsConnect.dbConfig.mediafileExtension);\n\t\tallFilePaths.push(mediaFilePath);\n\n\t\t// add annotation file path\n\t\tvar annotFilePath = path.join(bundlePath, bundleName + '_annot.json');\n\t\tallFilePaths.push(annotFilePath);\n\n\t\t// add ssff file paths\n\t\tvar ssffFilePaths = [];\n\t\twsConnect.allTrackDefsNeededByEMUwebApp.forEach(function (td) {\n\t\t\tvar ssffFilePath = path.join(bundlePath, bundleName + '.' + td.fileExtension);\n\t\t\tallFilePaths.push(ssffFilePath);\n\t\t\tssffFilePaths.push(ssffFilePath);\n\t\t});\n\n\t\t// read in files using async.map\n\t\tasync.map(allFilePaths, fs.readFile, function (err, results) {\n\t\t\tif (err) {\n\t\t\t\tlog.error('reading bundle components:', err,\n\t\t\t\t\t'; clientID:', wsConnect.connectionID,\n\t\t\t\t\t'; clientIP:', wsConnect._socket.remoteAddress);\n\n\t\t\t\tdeferred.reject();\n\t\t\t} else {\n\t\t\t\tvar fileIdx;\n\n\t\t\t\t// set media file\n\t\t\t\tfileIdx = allFilePaths.indexOf(mediaFilePath);\n\t\t\t\tbundle.mediaFile = {\n\t\t\t\t\tencoding: 'BASE64',\n\t\t\t\t\tdata: results[fileIdx].toString('base64')\n\t\t\t\t};\n\n\t\t\t\t// set annotation file\n\t\t\t\tfileIdx = allFilePaths.indexOf(annotFilePath);\n\t\t\t\tbundle.annotation = JSON.parse(results[fileIdx].toString('utf8'));\n\n\t\t\t\t// set ssffTracks\n\t\t\t\tssffFilePaths.forEach(function (sfp) {\n\t\t\t\t\tfileIdx = allFilePaths.indexOf(sfp);\n\t\t\t\t\t// extract file ext\n\t\t\t\t\tvar fileExt = path.extname(sfp).split('.').pop();\n\t\t\t\t\tbundle.ssffFiles.push({\n\t\t\t\t\t\tfileExtension: fileExt,\n\t\t\t\t\t\tencoding: 'BASE64',\n\t\t\t\t\t\tdata: results[fileIdx].toString('base64')\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tlog.info('Finished reading bundle components. Now returning them.',\n\t\t\t\t\t'; clientID:', wsConnect.connectionID,\n\t\t\t\t\t'; clientIP:', wsConnect._socket.remoteAddress);\n\n\t\t\t\tdeferred.resolve(bundle);\n\t\t\t}\n\t\t});\n\nreturn deferred.promise;\n}", "title": "" }, { "docid": "f09cf9e07d1a638b26ba403198f1974d", "score": "0.4314283", "text": "function copyStatic() {\n return gulp.src('src/static/**/*')\n .pipe(gulp.dest('src/boot'))\n}", "title": "" }, { "docid": "1e6e41474748a3a777fcb1fcee8da0d5", "score": "0.42907912", "text": "function copyImages (version) {\n\t\t\t\t\t\tvar images = ['blue.jpg', 'green.jpg', 'orange.jpg', 'red.jpg'];\n\n\t\t\t\t\t\tfse.copy(`${appRoot}/base-template/global-images`, `${dir}/${Static}/${versions[version]}/${img}`, (err) => {\n\t\t\t \tif (err) {\n return console.error(\"error:\", err);\n }\n\n console.info(chalk.green(\"static images folder copied successfully.\"));\n\t\t\t });\n\t\t\t\t\t}", "title": "" }, { "docid": "61157996a5f51414bb5a3ead7b001e62", "score": "0.42898422", "text": "function copy() {\n return gulp.src(PATHS.assets)\n .pipe(gulp.dest(PATHS.distAssets));\n}", "title": "" }, { "docid": "24139b554a8cd7cde709f49894afad58", "score": "0.42871705", "text": "function updateApp(config) {\n var appType = config.apptype;\n if (appType !== 'native' && appType !== 'hybrid_remote' && appType !== 'hybrid_local') {\n console.log(outputColors.red + 'Unrecognized app type: \\'' + appType + '\\'.' + outputColors.reset + 'App type must be native, hybrid_remote, or hybrid_local.');\n usage();\n process.exit(4);\n }\n\n // Copy dependencies\n copyDependencies(config, function(success, msg) {\n if (success) {\n if (msg) console.log(outputColors.green + msg + outputColors.reset);\n console.log(outputColors.green + 'Congratulations! You have successfully updated your app.' + outputColors.reset);\n } else {\n if (msg) console.log(outputColors.red + msg + outputColors.reset);\n console.log(outputColors.red + 'There was an error updating the app.' + outputColors.reset);\n }\n });\n}", "title": "" }, { "docid": "30e89f2795a4ec35b4604a63998f7130", "score": "0.4283235", "text": "function target(path, projecttype, buildtype, buildarchs, buildtarget) {\n if (projecttype != \"phone\"){\n Log('ERROR: not supported yet', true);\n Log('DEPLOY FAILED.', true);\n WScript.Quit(2);\n } else {\n // We're deploying package on phone device/emulator\n // Let's find target specified by script arguments\n var cmd = APP_DEPLOY_UTILS + ' /enumeratedevices';\n var out = wscript_shell.Exec(cmd);\n while(out.Status === 0) {\n WScript.Sleep(100);\n }\n if (!out.StdErr.AtEndOfStream) {\n var error = out.StdErr.ReadAll();\n Log(\"ERROR: Error calling AppDeploy : \", true);\n Log(error, true);\n WScript.Quit(2);\n }\n else {\n if (!out.StdOut.AtEndOfStream) {\n // get output from AppDeployCmd\n var lines = out.StdOut.ReadAll().split('\\r\\n');\n // regular expression, that matches with AppDeploy /enumeratedevices output\n // e.g. ' 1 Emulator 8.1 WVGA 4 inch 512MB'\n var deviceRe = /^\\s?(\\d)+\\s+(.*)$/;\n // iterate over lines\n for (var line in lines){\n var deviceMatch = lines[line].match(deviceRe);\n // check that line contains device id and name\n // and match with 'target' parameter of script\n if (deviceMatch && deviceMatch[1] == buildtarget) {\n // start deploy to target specified\n var appxFolder = getPackage(path, projecttype, buildtype, buildarchs);\n var appxPath = appxFolder + '\\\\' + fso.GetFolder(appxFolder).Name.split('_Test').join('') + '.appx';\n Log('Deploying to target with id: ' + buildtarget);\n deployWindowsPhone(appxPath, deviceMatch[1]);\n return;\n }\n }\n Log('Error : target ' + buildtarget + ' was not found.', true);\n Log('DEPLOY FAILED.', true);\n WScript.Quit(2);\n }\n else {\n Log('Error : CordovaDeploy Failed to find any devices', true);\n Log('DEPLOY FAILED.', true);\n WScript.Quit(2);\n }\n }\n }\n}", "title": "" }, { "docid": "2b9a1ec534c58c1a1468256ea0323dfd", "score": "0.42824358", "text": "function assemble() {\n // clear previous data\n // deleteFolderSync(path.join(__dirname, '../static'));\n // fs.mkdirSync(path.join(__dirname, '../static'));\n\n // copy data to static\n copyFolderSync(path.join(__dirname, '../data'), path.join(__dirname, '../static'));\n}", "title": "" }, { "docid": "c96021fb78d0393dc3106afd7a7c0a0e", "score": "0.42719695", "text": "function buildProdHtml(cb) {\n return gulp\n .src(\"./dist/index.html\")\n .pipe(inject(gulp.src(\"./dist/app/app-*.min.css\", { read: false }), { relative: true, removeTags: true })) // css app files\n .pipe(inject(gulp.src(\"./dist/app/app-*.min.js\", { read: false }), { relative: true, removeTags: true })) // js app files\n .pipe(gulp.dest(\"./dist\"));\n}", "title": "" }, { "docid": "30c92bb8748cbd86d6a4ee96445f0d3e", "score": "0.4263947", "text": "_writingMarkup() {\n this.fs.copy(\n this.templatePath('src_markup_layouts_default.html'),\n this.destinationPath('src/markup/layouts/default.html')\n );\n this.fs.copy(\n this.templatePath('src_markup_pages_index.html'),\n this.destinationPath('src/markup/pages/index.html')\n );\n this.fs.copy(\n this.templatePath('src_markup_partials_area_footer.html'),\n this.destinationPath('src/markup/partials/area/footer.html')\n );\n this.fs.copy(\n this.templatePath('src_markup_partials_area_header.html'),\n this.destinationPath('src/markup/partials/area/header.html')\n );\n this.fs.copy(\n this.templatePath('src_markup_index.html'),\n this.destinationPath('src/markup/index.html')\n );\n }", "title": "" }, { "docid": "6c783a905287ae9e4ce8e0d5f845aef9", "score": "0.4259578", "text": "function bootstrap(app) {\r\n if (!window['mooa']) {\r\n window.mooa = {};\r\n }\r\n window.mooa.isSingleSpa = true;\r\n window.mooa.name = app.name;\r\n if (app.mode && app.mode === 'iframe') {\r\n var iframeElementExist = isIframeElementExist(app);\r\n if (app.switchMode === 'coexist' && iframeElementExist) {\r\n iframeElementExist.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationIframeContainer(app);\r\n if (app.sourceType === 'link') {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframeAndUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframe(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n }\r\n else if (app.sourceType && app.sourceType === 'link') {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsByUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssets(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "43d59f21be8b3fd482f79a63cccdf7cf", "score": "0.42527056", "text": "function deploy() {\n const publisher = gulpAwspublish.create({\n params: {\n Bucket: config.bucketName,\n },\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n });\n\n return gulp.src(config.src)\n .pipe(gulpIf(Boolean(config.folder), gulpRename((path) => {\n // Prepend the folder to all source files\n path.dirname = `${config.folder}/${path.dirname}`;// eslint-disable-line no-param-reassign\n })))\n .pipe(publisher.publish(config.headers))\n // publisher.sync() deletes all other files than the uploaded\n .pipe(gulpIf(config.sync, publisher.sync()))\n .pipe(gulpAwspublish.reporter());\n }", "title": "" }, { "docid": "4893b6bae88fa82577caf69d95c570d9", "score": "0.4251914", "text": "function main(filePath) {\n /*// NON-CHEERIO WAY:\nvar manifestObject = generateManifestObject(filePath);\nvar formattedManifest = mapManifestData(manifestObject);*/\n\n // CHEERIO WAY:\n filePath = 'imsmanifest.xml';\n generateManifestObject(filePath);\n formattedManifest = mapManifestData();\n\n return formattedManifest;\n}", "title": "" }, { "docid": "49bdfbfe80170b83a1c915191ca841f3", "score": "0.4250154", "text": "function copy() {\n return gulp.src(PATHS.assets)\n .pipe(gulp.dest(PATHS.dist));\n}", "title": "" }, { "docid": "45059f991d76f55680a3bc37c4e37a74", "score": "0.42394322", "text": "function createNW() {\n console.log('creating regular tinder.nw for updates...');\n var fs = require('fs');\n var archiver = require('archiver');\n var archive = archiver('zip');\n\n var output = fs.createWriteStream('./build/' + appName + '/tinder-' + appPkg.version + '.nw');\n output.on('close', function () {\n console.log((archive.pointer() / 1000000).toFixed(2) + 'mb compressed');\n });\n\n archive.pipe(output);\n archive.bulk([\n { expand: true, cwd: 'desktop-app', src: ['**'], dest: '.' }\n ]);\n archive.finalize();\n}", "title": "" }, { "docid": "a618838a62d757f678cb64833acd8b13", "score": "0.42361832", "text": "function emulator(path, projecttype, buildtype, buildarchs) {\n if (projecttype != \"phone\") {\n // TODO: currently we can run application on local machine only\n localMachine(path, projecttype, buildtype, buildarchs);\n } else {\n Log('Deploying to emulator ...');\n var appxFolder = getPackage(path, projecttype, buildtype, buildarchs);\n var appxPath = appxFolder + '\\\\' + fso.GetFolder(appxFolder).Name.split('_Test').join('') + '.appx';\n deployWindowsPhone(appxPath, 'xd');\n }\n}", "title": "" }, { "docid": "ef75e2e721af823939dc0a76ab58fab2", "score": "0.42329633", "text": "createWithBundle() {\n var _this2 = this;\n\n return (0, _asyncToGenerator3.default)(function* () {\n _this2.serverBundle = yield (0, _fsExtra.readJson)((0, _path2.distLavasPath)(_this2.cwd, _constants.SERVER_BUNDLE));\n\n let templatePath = (0, _path2.distLavasPath)(_this2.cwd, _this2.getTemplateName(true));\n let manifestPath = (0, _path2.distLavasPath)(_this2.cwd, _constants.CLIENT_MANIFEST);\n if (_this2.config.build.ssr) {\n _this2.template = yield (0, _fsExtra.readFile)(templatePath, 'utf-8');\n _this2.clientManifest = yield (0, _fsExtra.readJson)(manifestPath);\n }\n\n yield _this2.createRenderer();\n })();\n }", "title": "" }, { "docid": "eea35f62f8268ffbe57126d664b6a691", "score": "0.42288417", "text": "function assets() {\n return gulp.src('packages/assets/**').pipe(gulp.dest('dist/assets/'))\n}", "title": "" }, { "docid": "04f5935216d5dedd929dbcf794e0ac0c", "score": "0.42172655", "text": "function media() {\n return gulp.src('src/media/**/')\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/media'));\n}", "title": "" }, { "docid": "50692c4e6354e02737cff0c77692fc23", "score": "0.42162642", "text": "function config() {\n global.config.build.rootDirectory = path.join('../EquiTrack/assets/frontend/', global.config.appName);\n global.config.build.templateDirectory = path.join('../EquiTrack/templates/frontend/', global.config.appName);\n global.config.build.bundledDirectory = '.';\n indexPath = path.join(global.config.build.rootDirectory, 'index.html');\n bowerPath = path.join(global.config.build.rootDirectory, 'bower.json');\n templatePath = global.config.build.templateDirectory;\n}", "title": "" }, { "docid": "cde5d5240f5e4a6a0a8dbbf37298da34", "score": "0.42119107", "text": "function createHybridApp(config) {\n // console.log(\"Config:\" + JSON.stringify(config, null, 2));\n var outputDir = config.outputdir;\n if (!outputDir) outputDir = process.cwd();\n outputDir = path.resolve(outputDir);\n var projectDir = path.join(outputDir, config.appname);\n\n // Make sure the Cordova CLI client exists.\n var cordovaCliVersion = cordovaHelper.getCordovaCliVersion();\n if (cordovaCliVersion === null) {\n console.log('cordova command line tool could not be found. Make sure you install the cordova CLI from https://www.npmjs.org/package/cordova.');\n process.exit(11);\n }\n\n var minimumCordovaVersionNum = miscUtils.getVersionNumberFromString(minimumCordovaCliVersion);\n var cordovaCliVersionNum = miscUtils.getVersionNumberFromString(cordovaCliVersion);\n if (cordovaCliVersionNum < minimumCordovaVersionNum) {\n console.log('Installed cordova command line tool version (' + cordovaCliVersion + ') is less than the minimum required version (' + minimumCordovaCliVersion + '). Please update your version of Cordova.');\n process.exit(12);\n }\n\n console.log('Using cordova CLI version ' + cordovaCliVersion + ' to create the hybrid app.');\n\n shelljs.exec('cordova create \"' + projectDir + '\" ' + config.companyid + ' ' + config.appname);\n shelljs.pushd(projectDir);\n shelljs.exec('cordova platform add ios@' + cordovaPlatformVersion);\n shelljs.exec('cordova plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin');\n\n // Remove the default Cordova app.\n shelljs.rm('-rf', path.join('www', '*'));\n\n // Copy the sample app, if a local app was selected.\n if (config.apptype === 'hybrid_local') {\n var sampleAppFolder = path.join(__dirname, 'HybridShared', 'samples', 'userlist');\n shelljs.cp('-R', path.join(sampleAppFolder, '*'), 'www');\n }\n\n // Add bootconfig.json\n var bootconfig = {\n \"remoteAccessConsumerKey\": config.appid || \"3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa\",\n \"oauthRedirectURI\": config.callbackuri || \"testsfdc:///mobilesdk/detect/oauth/done\",\n \"oauthScopes\": [\"web\", \"api\"],\n \"isLocal\": config.apptype === 'hybrid_local',\n \"startPage\": config.startpage || 'index.html',\n \"errorPage\": \"error.html\",\n \"shouldAuthenticate\": true,\n \"attemptOfflineLoad\": false\n };\n // console.log(\"Bootconfig:\" + JSON.stringify(bootconfig, null, 2));\n\n fs.writeFileSync(path.join('www', 'bootconfig.json'), JSON.stringify(bootconfig, null, 2));\n shelljs.exec('cordova prepare ios');\n shelljs.popd();\n\n // Inform the user of next steps.\n var nextStepsOutput =\n ['',\n outputColors.green + 'Your application project is ready in ' + projectDir + '.',\n '',\n outputColors.cyan + 'To build the new application, do the following:' + outputColors.reset,\n ' - cd ' + projectDir,\n ' - cordova build',\n '',\n outputColors.cyan + 'To run the application, start an emulator or plug in your device and run:' + outputColors.reset,\n ' - cordova run',\n '',\n outputColors.cyan + 'To use your new application in XCode, do the following:' + outputColors.reset,\n ' - open ' + projectDir + '/platforms/ios/' + config.appname + '.xcodeproj in XCode',\n ' - build and run',\n ''].join('\\n');\n console.log(nextStepsOutput);\n console.log(outputColors.cyan + 'Before you ship, make sure to plug your OAuth Client ID,\\nCallback URI, and OAuth Scopes into '\n + outputColors.magenta + 'www/bootconfig.json' + outputColors.reset);\n}", "title": "" }, { "docid": "50fe5be26d59bf42cb320dcd42c294e7", "score": "0.42099562", "text": "getResourcesDirectory() {\n let appPath = remote.app.getAppPath();\n\n if (process.cwd() === appPath) return './';\n else return process.resourcesPath + '/';\n }", "title": "" }, { "docid": "34b33b5df9989d3c5a497aa01f0cc8f3", "score": "0.4206518", "text": "function copy() {\n return gulp.src(PATHS.miscAssets)\n .pipe(gulp.dest(PATHS.dist + '/assets'));\n}", "title": "" }, { "docid": "d3ce0228147d9f4596756b6987b979d5", "score": "0.4202806", "text": "function createStatic() {\n fs.copy(config.paths.assets_dir, config.paths.public_dir + \"/\" + config.paths.public_assets_dir)\n .then(() => {\n renderToPublic();\n })\n .catch(err => {\n console.error(err)\n })\n}", "title": "" }, { "docid": "c9f0ed63ca6b44ef8138f4f6d3592680", "score": "0.4199925", "text": "function copyFiles(callback) {\n _.map(config.files, function(dest, src) {\n gulp.src(src).pipe(gulp.dest(dest));\n });\n notify('Vendors Updated');\n if (_.isFunction(callback)) {\n callback();\n }\n}", "title": "" }, { "docid": "e4485a8f1b73703e4a41ec06aec2cc47", "score": "0.41998392", "text": "function moveFaviconHtml() {\n return src('src/assets/pwa/favicons.html')\n .pipe(dest('src/_includes/components'))\n}", "title": "" }, { "docid": "cc194fcdb5cc50e247b1ac152b0b23e1", "score": "0.41821122", "text": "function copy() {\n return gulp.src('./src/assets/{documents,images}/*.*')\n .pipe(gulp.dest('./dist/assets/'));\n}", "title": "" }, { "docid": "9db4d5a2e98f79f067b1ad4ace8cddc4", "score": "0.4180506", "text": "function assets(dest, theme) {\n const assetDirs = [\n '.pkg_cache/ui/pkg/fontawesome/fonts'\n ];\n return assetDirs.map(dir =>\n new Promise((resolve, reject) => {\n const name = dir.substr(dir.lastIndexOf('/') + 1);\n tar.pack(dir).pipe(\n tar.extract(`${dest}/${name}`, {\n finish: () => resolve({name: name, hash: null})\n })\n );\n })\n );\n}", "title": "" }, { "docid": "a74d5107e7d7d31b41a6f7dd5310bdf3", "score": "0.41655833", "text": "function copyDist() {\n let srcFiles = src(['src/app.js', 'package.json'])\n .pipe(dest('.temp/dist'));\n\n let rootFiles = src(['src/**/*', '!src/**/*.test.js'])\n .pipe(dest('.temp/dist/src'));\n\n return merge(srcFiles, rootFiles);\n}", "title": "" }, { "docid": "88782612df97eeddabcd336c6d6f84cc", "score": "0.41441345", "text": "async createBundle () {\n const name = `${this.appIdentifier}_${this.options.branch}_${this.options.arch}.flatpak`\n const dest = this.options.rename(this.options.dest, name)\n this.options.logger(`Creating package at ${dest}`)\n const extraExports = []\n if (this.options.icon && !_.isObject(this.options.icon)) {\n extraExports.push(this.pixmapIconPath)\n }\n\n const files = [\n [this.stagingDir, '/']\n ]\n const symlinks = [\n [path.join('/lib', this.appIdentifier, this.options.bin), path.join('/bin', this.options.bin)]\n ]\n\n const command = (await this.requiresSandboxWrapper()) ? 'electron-wrapper' : this.options.bin\n\n return flatpak.bundle({\n id: this.options.id,\n branch: this.options.branch,\n base: this.options.base,\n baseVersion: this.options.baseVersion.toString(),\n runtime: this.options.runtime,\n runtimeVersion: this.options.runtimeVersion.toString(),\n sdk: this.options.sdk,\n finishArgs: this.options.finishArgs,\n command,\n modules: this.options.modules\n }, {\n ...this.flatpakrefs,\n arch: this.options.arch,\n bundlePath: dest,\n extraExports: extraExports,\n extraFlatpakBuilderArgs: this.options.extraFlatpakBuilderArgs,\n files: files.concat(this.options.files),\n symlinks: symlinks.concat(this.options.symlinks)\n })\n }", "title": "" }, { "docid": "dd7eb5533bdb99dd7bae6173a756ed78", "score": "0.41440377", "text": "function prodScripts(){\n return gulp\n .src(config.scripts.src)\n .pipe($.babel())\n .pipe($.concat(config.scripts.bundle))//after babel transpiling\n .pipe($.uglify())//now minify app.js\n .pipe(gulp.dest(config.scripts.dest)); \n}", "title": "" }, { "docid": "0695a2030388e4a0c6de3ed4b86aa595", "score": "0.4143301", "text": "function copy(){\n del(tmpDir + '/paperScript.js');\n return src(paperScrptGlob).pipe(dest(tmpDir))\n}", "title": "" }, { "docid": "28da2ec961c8e6bccc9728679d2d348c", "score": "0.41326112", "text": "async function sync(deployInfo) {\n process.env.MAGENTO_INSTALL_FOLDER = path.resolve(\n deployInfo.dest,\n \".magento\"\n );\n process.env.MAGENTO_REMOTE = deployInfo.host;\n process.env.MAGENTO_MODULE = deployInfo.module || process.env.MAGENTO_MODULE;\n\n console.log(\n \"Syncing files\",\n deployInfo.src,\n `${process.env.MAGENTO_REMOTE}:${process.env.MAGENTO_INSTALL_FOLDER}`\n );\n\n await require(\"../lib/magento/sync-plugin\")();\n}", "title": "" }, { "docid": "88b68c3a753fbdb768ee88b8cef88437", "score": "0.41285628", "text": "function loadActivist (prefix, options, rsrc) {\n var config = {};\n var defaultConfig = require('./src/config');\n for (var i in defaultConfig) {\n if (defaultConfig.hasOwnProperty(i) && !options[i]) {\n config[i] = defaultConfig[i];\n } else if (options[i]) {\n config[i] = options[i];\n }\n }\n config.url = prefix + '.js';\n config.frame = prefix + '.html';\n config.offline = prefix + '-offline.html';\n\n rsrc.type = 'text/javascript';\n packager(config, function (data) {\n rsrc.body = data;\n rsrc.headers = {\n 'Cache-Control': 'public, max-age=' + Math.floor(rsrc.maxAge / 1000),\n 'ETag': etag(data)\n };\n });\n}", "title": "" }, { "docid": "8b39e8dd1bada54c51804fa8aaf0b196", "score": "0.41170725", "text": "function copyBackend() {\n return gulp.src(PATHS.nodejs)\n .pipe(gulp.dest(PATHS.dist));\n}", "title": "" }, { "docid": "bdd23188e058426efaa35f0a0fd371b1", "score": "0.41125962", "text": "_createIonicApp() {\n ['.gitignore', 'app', 'scripts', 'resources', 'tsconfig.json', 'gulpfile.js', 'webpack.config.js', 'webpack.production.config.js'].forEach((file) => {\n this._copy(file);\n });\n ['package.json'].forEach((file) => {\n this.createTemplate(file, this.answers);\n });\n }", "title": "" }, { "docid": "ac7cc1c08ed7fc17ba8ecc8a2d084fcc", "score": "0.41086257", "text": "function createManifest() {\n if (this.arrBookStructureEntries == null) return;\n if (this.arrPageXmlFiles == null) return;\n if (this.iPageXmlsLoaded != this.arrPageXmlFiles.length) return;\n //this.manifest = {label: \"Manifest for img\", sequences: \"lol\"};\n\n this.manifest = {\n label: conf.bookTitle,\n \"@type\": \"sc:Manifest\",\n \"@id\": conf.manifestUrl+this.strManifestFileName,\n \"@context\": \"http://iiif.io/api/presentation/2/context.json\",\n \"license\": conf.license,\n \"logo\": conf.logo,\n \"attribution\": conf.attribution,\n \"metadata\": [],\n \"sequences\": [],\n \"structures\": []\n };\n addMetadataToManifest();\n addSequenceAndStructureToManifest();\n writeManifestToFile();\n}", "title": "" }, { "docid": "0120cf7604df387cb4fb3c986c251b7f", "score": "0.4105815", "text": "function Controller() {\n installer.autoRejectMessageBoxes();\n\n installer.setMessageBoxAutomaticAnswer(\"OverwriteTargetDirectory\", QMessageBox.Yes);\n\n installer.setMessageBoxAutomaticAnswer(\"TargetDirectoryInUse\", QMessageBox.NO);\n\n installer.installationFinished.connect(\n function() {\n gui.clickButton(buttons.NextButton);\n }\n )\n}", "title": "" }, { "docid": "640a3f5b48da59da7dfe9035a01035e8", "score": "0.4085672", "text": "function copyAppName(srcCapId, targetCapId) {\n var sourceCap = aa.cap.getCap(srcCapId).getOutput();\n\t//logDebug(\"SourceCap is: \" + sourceCap);\n var targetCap = aa.cap.getCap(targetCapId).getOutput();\n var appName = \"\";\n if (sourceCap.getSpecialText()) {\n appName = sourceCap.getSpecialText();\n var setAppNameSuccess = targetCap.setSpecialText(appName);\n }\n\tsetNameResult = aa.cap.editCapByPK(targetCap.getCapModel());\n\n\tif (!setNameResult.getSuccess())\n\t\t{ logDebug(\"**WARNING: error setting cap name : \" + setNameResult.getErrorMessage()) ; return false }\n}", "title": "" }, { "docid": "f7c35ad01a204eb6e13fe08ee90ec228", "score": "0.40846428", "text": "async make() {\n try {\n this.log.verbose(`clearing ${this.$.env.paths.electronApp.rootName}`);\n await this.clear();\n } catch (e) {\n this.log.error(\n `error while removing ${this.$.env.paths.electronApp.root}: `, e\n );\n process.exit(1);\n }\n\n this.createAppRoot();\n\n this.copySkeletonApp();\n\n // TODO: hey, wait, .gitignore is not needed - right?\n /*\n this.log.debug('creating .gitignore');\n fs.writeFileSync(this.$.env.paths.electronApp.gitIgnore, [\n 'node_modules'\n ].join('\\n'));\n */\n this.log.verbose('writing package.json');\n fs.writeFileSync(\n this.$.env.paths.electronApp.packageJson, JSON.stringify(this.packageJson, null, 2)\n );\n }", "title": "" }, { "docid": "e91611bc342962fc572b9510f6e7ad41", "score": "0.40704358", "text": "function deploy() {\r\n\tvar dir = '/public_html/multisite/wp-content/themes/theme02';\r\n\tvar conn = ftp.create({\r\n\t\thost: 'es31.siteground.eu',\r\n\t\tuser: 'tschaefer@ipduties.de',\r\n\t\tpassword: '2vBG42WaegaaQv',\r\n\t\tparallel: 3,\r\n\t\tlog: log,\r\n\t});\r\n\tgulp.src(CONF.PATHS.package, { cwd: 'CONF.PATHS.main', buffer: false })\r\n\t\t.pipe(conn.newer(dir))\r\n\t\t.pipe(conn.dest(dir));\r\n\tgulp.src([CONF.PATHS.dist + '/**/*'], { cwd: 'CONF.PATHS.dist', buffer: false })\r\n\t\t.pipe(conn.newer(dir + '/dist'))\r\n\t\t.pipe(conn.dest(dir + '/dist'));\r\n}", "title": "" }, { "docid": "f35b6eb6f2469b57892aeb3af0fe3091", "score": "0.40693623", "text": "function setupPlugins() {\n\n mylog(\"Setting up plugins\");\n var plugin_dirs = API.ls(\"application\", \"plugins\", \"*\");\n \n for (var j = 0; j < plugin_dirs.length; j++) {\n var plugin_dir = plugin_dirs[j];\n var plugin_name = plugin_dir;\n var regexp = new RegExp(\"plugin_\" + plugin_name + \"_version = ['\\\"](.+)[\\\"']\");\n \n var version_str_app = API.fileRead(\"application\", \"plugins/\" + plugin_dir + \"/version.txt\");\n var version_appdir;\n if (version_str_app) {\n version_appdir = versionStrToNumber(version_str_app);\n mylog(\"Plugin\", plugin_name, \"in app dir:\", version_appdir);\n } else {\n mylog(\"Plugin\", plugin_name, \"in app dir: Could not find version. Skipping.\");\n continue;\n }\n \n var versionfile_workingdir = \"plugins/\" + plugin_dir + \"/version.txt\";\n var version_str_working = API.fileRead(\"working\", versionfile_workingdir);\n var version_workingdir;\n if (version_str_working) {\n version_workingdir = versionStrToNumber(version_str_working);\n mylog(\"Plugin\", plugin_name, \"in working dir:\", version_workingdir);\n }\n \n if (!version_workingdir || version_appdir > version_workingdir) {\n mylog(\"Plugin\", plugin_name, \"copying.\");\n copyDirFromAppDirToWorkingDir(\"plugins/\" + plugin_dir);\n } else {\n mylog(\"Plugin\", plugin_name, \"up to date or newer\");\n }\n }\n}", "title": "" }, { "docid": "732437c7b13d6e0b420d11fe42ae5084", "score": "0.4063246", "text": "function kia_promo_scripts_promo() {\n\treturn src(projects.kia_promo.scripts_promo.src)\n\t.pipe(concat(projects.kia_promo.scripts_promo.output))\n\t// .pipe(uglify()) // Minify js (opt.)\n\t.pipe(header(projects.kia_promo.forProd))\n\t.pipe(dest(projects.kia_promo.scripts_promo.dest))\n\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "571ba522565aa6817dc08bc587407485", "score": "0.40629628", "text": "function copyStatic() {\n console.log(\"Copying static files...\");\n fs.readdirSync(\"_static\").forEach(function(file, index) {\n var curPath = \"_static/\" + file;\n if (fs.lstatSync(curPath).isDirectory()) {\n if (!fs.existsSync(curPath.replace(\"_static\", \"_site\"))) {\n fs.mkdirSync(curPath.replace(\"_static\", \"_site\"));\n }\n fs.readdirSync(curPath).forEach(function(file, index) {\n fs.readFile(curPath + '/' + file, function(err, data) {\n fs.writeFileSync(curPath.replace(\"_static\", \"_site\") + '/' + file, data);\n });\n });\n } else {\n fs.readFile(\"_static/\" + file, function(err, data) {\n fs.writeFileSync(\"_site/\" + file, data);\n });\n }\n });\n console.log(\"Copied to _site.\");\n if (job == \"build\" || job == false) {\n preprocess();\n } else {\n finish();\n }\n}", "title": "" }, { "docid": "af0e42bb793f159f4f97727d8fc28398", "score": "0.4061786", "text": "function buildStatic(app, logger = () => {}) {\n logger('info', 'COPYING', `Copying static files in ${app.staticPath}`);\n exec(`cp -r ${app.staticPath}/. ${app.outputPath}`);\n}", "title": "" }, { "docid": "71960c62db2caad8e068af8db6c0ae3d", "score": "0.40603822", "text": "function compileAppJS() {\n return processJS(CFG.SRC.APP_JS, CFG.OUT.APP_MIN_JS)\n}", "title": "" }, { "docid": "238542b4e31f4b457f6e0bdb7dbcd695", "score": "0.40579998", "text": "function xar () {\n return src('build/**/*', { base: 'build' })\n .pipe(zip(packageName()))\n .pipe(dest('.'))\n}", "title": "" }, { "docid": "3006812d6ebe1411b8b23723d69b8192", "score": "0.40489224", "text": "copyFiles(options) {\n let {\n files,\n kitQuestions,\n folderPath,\n kitPath,\n kit,\n ver,\n isSteamerKit,\n projectName,\n kitConfig\n } = options;\n // 脚手架相关配置问题\n let prompt = inquirer.createPromptModule();\n prompt(kitQuestions)\n .then(answers => {\n\n answers = Object.assign({}, answers, {\n projectName\n });\n\n // 复制文件前的自定义行为\n if (kitConfig.beforeInstallCopy && _.isFunction(kitConfig.beforeInstallCopy)) {\n kitConfig.beforeInstallCopy.bind(this)(answers, folderPath);\n }\n\n files = files.filter(item => {\n return !this.ignoreFiles.includes(item);\n });\n\n files.forEach(item => {\n let srcFiles = path.join(kitPath, item),\n destFile = path.join(folderPath, item);\n\n if (this.fs.existsSync(srcFiles)) {\n this.fs.copySync(srcFiles, destFile);\n }\n });\n\n if (answers.webserver) {\n this.fs.ensureFileSync(\n path.join(folderPath, \"config/steamer.config.js\")\n );\n this.fs.writeFileSync(\n path.join(folderPath, \"config/steamer.config.js\"),\n \"module.exports = \" + JSON.stringify(answers, null, 4)\n );\n }\n\n // 复制文件后的自定义行为\n if (kitConfig.afterInstallCopy && _.isFunction(kitConfig.afterInstallCopy)) {\n kitConfig.afterInstallCopy.bind(this)(answers, folderPath);\n }\n\n if (isSteamerKit) {\n this.createPluginConfig(\n {\n kit: kit,\n version: ver\n },\n folderPath\n );\n }\n\n // 替换项目名称\n if (!!projectName) {\n const oldPkgJson = this.getPkgJson(folderPath);\n let pkgJson = _.merge({}, oldPkgJson, {\n name: projectName\n });\n this.fs.writeFileSync(\n path.join(folderPath, \"package.json\"),\n JSON.stringify(pkgJson, null, 4),\n \"utf-8\"\n );\n }\n // \bbeforeInstall 自定义行为\n if (kitConfig.beforeInstallDep && _.isFunction(kitConfig.beforeInstallDep)) {\n kitConfig.beforeInstallDep.bind(this)(answers, folderPath);\n }\n\n // 安装项目node_modules包\n this.spawn.sync(this.config.NPM, [\"install\"], {\n stdio: \"inherit\",\n cwd: folderPath\n });\n\n // afterInstall 自定义行为\n if (kitConfig.afterInstallDep && _.isFunction(kitConfig.afterInstallDep)) {\n kitConfig.afterInstallDep.bind(this)(answers, folderPath);\n }\n\n this.success(\n `The project is initiated success in ${folderPath}`\n );\n })\n .catch(e => {\n this.error(e.stack);\n });\n }", "title": "" }, { "docid": "0349585b8d22d567b81d6424ae91ef06", "score": "0.40467578", "text": "function xar () {\n return src('build/**/*', {base: 'build'})\n .pipe(zip(packageName()))\n .pipe(dest('.'))\n}", "title": "" }, { "docid": "92e085bcef01894a2999279a85ae951c", "score": "0.4043665", "text": "async function main(tmpBundleDir) {\n\tawait fs.emptyDir(tmpBundleDir);\n\tawait fs.copy(commonSDKJS, tmpBundleDir); // copy our common SDK JS files to tmp location\n\tawait copyPolyfills(tmpBundleDir); // copy @babel/polyfill there too\n\tawait generateBundle(tmpBundleDir, appDir); // run rollup/babel to generate single bundled ti.main.js in app\n\tconsole.log(`Removing temp dir used for bundling: ${tmpBundleDir}`);\n\tawait fs.remove(tmpBundleDir); // remove tmp location\n\tconsole.log(`Copying xcode resources: ${xcodeProjectResources} -> ${appDir}`);\n\tawait fs.copy(xcodeProjectResources, appDir, { dereference: true }); // copy our xcode app resources\n\tconsole.log('Creating i18n files');\n\tawait exec(`${localeCompiler} \"${path.join(projectDir, '..')}\" ios simulator \"${appDir}\"`); // create i18n files\n\tconsole.log('Generating index.json');\n\tawait generateIndexJSON(appDir); // generate _index_.json file for require file existence checks\n}", "title": "" }, { "docid": "4a0c97b3f130272d5ac192d07aa43028", "score": "0.40414998", "text": "function updateThemeWithAppSkinInfo(appSkinInfo) {\r\n // console.log(appSkinInfo)\r\n var panelBgColor = appSkinInfo.panelBackgroundColor.color;\r\n var bgdColor = toHex(panelBgColor);\r\n\r\n var fontColor = \"#F0F0F0\";\r\n var isLight = panelBgColor.red > 122;\r\n if (isLight) {\r\n\tfontColor = \"#000000\";\r\n\t$(\"#theme\").attr(\"href\", \"css/light.css\");\r\n } else {\r\n\tbgdColor = \"#494949\";\r\n\t$(\"#theme\").attr(\"href\", \"css/dark.css\");\r\n }\r\n var styleId = \"ppstyle\";\r\n document.body.bgColor = bgdColor;\r\n addRule(styleId, \"input select\", \"background-color:\" + toHex(panelBgColor) + \";\");\r\n addRule(styleId, \"body\", \"background-color:\" + bgdColor + \";\");\r\n addRule(styleId, \"body\", \"color:\" + fontColor + \";\");\r\n// addRule(styleId, \"body\", \"font-size:\" + appSkinInfo.baseFontSize + \"px;\");\r\n}", "title": "" }, { "docid": "71e549363ae4a31124a3954144622ae3", "score": "0.4039475", "text": "function copyAssetDir (dir) {\n mkpath(settings.assetDest + dir, function (err) {\n if (err)\n throw err;\n fs.readdir(__dirname + '/../dist/assets' + dir, function (err, filenames) {\n if (err)\n throw err;\n\n filenames.forEach(function (f) {\n fs.createReadStream(__dirname + '/../dist/assets' + dir + '/' + f)\n .pipe(fs.createWriteStream(settings.assetDest + dir +'/' + f));\n });\n });\n });\n }", "title": "" } ]
afe4e24499fb0c3982974a435b6ce35e
Logs a warning in dev mode when a component switches from controlled to uncontrolled, or vice versa A single prop should typically be used to determine whether or not a component is controlled or not.
[ { "docid": "915161cf6ba0c1455dec7732b34cb1cf", "score": "0.65272814", "text": "function useControlledSwitchWarning(controlledValue, controlledPropName, componentName) {\n if (false) { var nameCache, controlledRef; }\n}", "title": "" } ]
[ { "docid": "acb86ce8d43207d70118e41abcb4fb9a", "score": "0.70384586", "text": "function useControlledSwitchWarning(controlledValue, controlledPropName, componentName) {\n if (process.env.NODE_ENV !== \"production\") {\n var controlledRef = React.useRef(controlledValue != null);\n var nameCache = React.useRef({\n componentName: componentName,\n controlledPropName: controlledPropName\n });\n React.useEffect(function () {\n nameCache.current = {\n componentName: componentName,\n controlledPropName: controlledPropName\n };\n }, [componentName, controlledPropName]);\n React.useEffect(function () {\n var wasControlled = controlledRef.current;\n var _nameCache$current = nameCache.current,\n componentName = _nameCache$current.componentName,\n controlledPropName = _nameCache$current.controlledPropName;\n var isControlled = controlledValue != null;\n\n if (wasControlled !== isControlled) {\n console.error(\"A component is changing an \" + (wasControlled ? \"\" : \"un\") + \"controlled `\" + controlledPropName + \"` state of \" + componentName + \" to be \" + (wasControlled ? \"un\" : \"\") + \"controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled \" + componentName + \" element for the lifetime of the component.\\n More info: https://fb.me/react-controlled-components\");\n }\n }, [controlledValue]);\n }\n}", "title": "" }, { "docid": "b866462b097ba5d7f1f7153d4c4779cf", "score": "0.59254843", "text": "isControlled() {\n return this.props.checked !== undefined;\n }", "title": "" }, { "docid": "d17237e1e20e5e2922f301be98b29bd1", "score": "0.5861729", "text": "_maybeRenderDevelopmentModeWarning() {\n if (__DEV__) {\n\n return (\n <Text style={styles.developmentModeText}>\n Welcome! Where are you going?\n </Text>\n );\n } else {\n return (\n <Text style={styles.developmentModeText}>\n You are not in development mode, your app will run at full speed.\n </Text>\n );\n }\n }", "title": "" }, { "docid": "4fe71380b8e1ff6bfddb2b5ab2002af6", "score": "0.5714028", "text": "componentWillReceiveProps(nextProps) {\n this.setState({\n on: nextProps.alwaysOn || !!nextProps.value,\n });\n }", "title": "" }, { "docid": "5269b044cda755752b96bd4bb0f12fb2", "score": "0.565575", "text": "setDebugMode() {\n console.warn(\"setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.\");\n }", "title": "" }, { "docid": "5269b044cda755752b96bd4bb0f12fb2", "score": "0.565575", "text": "setDebugMode() {\n console.warn(\"setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.\");\n }", "title": "" }, { "docid": "32d52be6610db7464b6f5e7ca5844f99", "score": "0.55236274", "text": "function App() {\n return (\n <div className=\"App\">\n <Controlled/>\n {/* <Uncontrolled/> */}\n </div>\n );\n}", "title": "" }, { "docid": "a8c4b2b693ad828d9653851751bbedaa", "score": "0.54882395", "text": "if (isDisallowedContextReadInDEV) {\n console.error(\n 'Context can only be read while React is rendering. ' +\n 'In classes, you can read it in the render method or getDerivedStateFromProps. ' +\n 'In function components, you can read it directly in the function body, but not ' +\n 'inside Hooks like useReducer() or useMemo().',\n );\n }", "title": "" }, { "docid": "d1d26136601fcff19854ff93e5e57faa", "score": "0.54583234", "text": "function useControllableState(props) {\n var valueProp = props.value,\n defaultValue = props.defaultValue,\n onChange = props.onChange,\n _a = props.name,\n name = _a === void 0 ? 'Component' : _a,\n _b = props.propsMap,\n propsMap = _b === void 0 ? defaultPropsMap : _b;\n\n var _c = tslib.__read(React.useState(defaultValue), 2),\n valueState = _c[0],\n setValue = _c[1];\n\n var isControlled = React.useRef(valueProp !== undefined).current; // don't switch from controlled to uncontrolled\n\n React.useEffect(function () {\n var nextIsControlled = valueProp !== undefined;\n var nextMode = nextIsControlled ? 'a controlled' : 'an uncontrolled';\n var mode = isControlled ? 'a controlled' : 'an uncontrolled';\n warn({\n condition: isControlled !== nextIsControlled,\n message: \"Warning: \" + name + \" is changing from \" + mode + \" to \" + nextMode + \" component. \" + \"Components should not switch from controlled to uncontrolled (or vice versa). \" + (\"Use the '\" + propsMap.value + \"' with an '\" + propsMap.onChange + \"' handler. \") + (\"If you want an uncontrolled component, remove the \" + propsMap.value + \" prop and use '\" + propsMap.defaultValue + \"' instead. \\\"\") + \"More info: https://fb.me/react-controlled-components\"\n });\n }, [valueProp, isControlled, name]);\n var initialDefaultValue = React.useRef(defaultValue).current;\n React.useEffect(function () {\n warn({\n condition: initialDefaultValue !== defaultValue,\n message: \"Warning: A component is changing the default value of an uncontrolled \" + name + \" after being initialized. \" + (\"To suppress this warning opt to use a controlled \" + name + \".\")\n });\n }, [JSON.stringify(defaultValue)]);\n var value = isControlled ? valueProp : valueState;\n var updateValue = React.useCallback(function (next) {\n var nextValue = runIfFn(next, value);\n if (!isControlled) setValue(nextValue);\n onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);\n }, [onChange]);\n return [value, updateValue];\n }", "title": "" }, { "docid": "6f92a6c6463588f8d8dab96f061c8618", "score": "0.54469144", "text": "function isPropTracked(obj, prop) {\r\n var desc = Object.getOwnPropertyDescriptor(obj, prop);\r\n return (desc.get != undefined && desc.set != undefined);\r\n }", "title": "" }, { "docid": "9de144b63af6f596307022e679103f31", "score": "0.5435728", "text": "isStrict(){\n let component = this.props.component\n let key = this.props.attribute\n return component.state.data[key].strict\n }", "title": "" }, { "docid": "d2827cd7c6c65cb933556fa1a954dcf0", "score": "0.5380432", "text": "componentWillReceiveProps(nextProps) {\n this.checkDisabled.call(this, nextProps);\n }", "title": "" }, { "docid": "30a0e3d18f240ca7c044fe6771950e3a", "score": "0.5377927", "text": "shouldComponentUpdate(nextProps) {\n const hasRulesChanged = nextProps.rules !== this.props.rules;\n const hasClassNameChanged = nextProps.className !== this.props.className;\n const hasOptionsChanged = nextProps.options !== this.props.options;\n const hasLabelChanged = nextProps.label !== this.props.label;\n const isInvalid = !this.state.field.valid;\n\n return (\n !nextProps.transferProps ||\n hasRulesChanged ||\n isInvalid ||\n hasClassNameChanged ||\n hasOptionsChanged ||\n hasLabelChanged\n );\n }", "title": "" }, { "docid": "dc92a9f004954eed143fab49aa00f4a6", "score": "0.5315191", "text": "componentWillMount() {\n this.setState({\n on: this.props.alwaysOn || !!this.props.value,\n });\n }", "title": "" }, { "docid": "378ab84a4ba3565c92de43701749d60c", "score": "0.5271159", "text": "setState() {\n safeWarn('setState is called before component is mounted');\n }", "title": "" }, { "docid": "2f5b327c0ecd58d1d0929e64c3626376", "score": "0.5198804", "text": "function vaultDevPanelOnOffState () {\n devPanelVaultedState = checkboxToshowOrHideDevPanel.checked;\n vaultUserConfiguration();\n}", "title": "" }, { "docid": "b3a72e1c5b346a86709ab51cf3b7593c", "score": "0.517303", "text": "shouldComponentUpdate(nextProps, nextStates) {\n console.log(\"shouldComponentUpdate: \");\n console.log(nextProps, nextStates);\n return true; //allow to update\n //return false; //prevent state to update\n }", "title": "" }, { "docid": "6b5490acc52f171628349dca21a827c4", "score": "0.51562715", "text": "isDevMode() {\n\t\treturn this._devMode;\n\t}", "title": "" }, { "docid": "abbf7b48743e6aebc4fdc717be7044fc", "score": "0.5131421", "text": "static enableProductionMode() {\n Logger.level = LogLevel.Warning;\n }", "title": "" }, { "docid": "fc8fed09944b11ca3e8b0b217132f6ed", "score": "0.5121841", "text": "shouldComponentUpdate(){\n // 初始化时或者使用forceUpdate时不被执行。\n const {willLog} = this.state;\n if(willLog) console.log('组件接收到新的props或者state');\n // 如果shouldComponentUpdate返回false, render()则会在下一个state change之前被完全跳过。\n // (另外componentWillUpdate和 componentDidUpdate也不会被执行)\n // 默认情况下shouldComponentUpdate会返回true.\n return '组件更新' == null ? true : false;\n }", "title": "" }, { "docid": "44cb953ee6fd1d2aec9dc4baf165e462", "score": "0.51096904", "text": "componentWillReceiveProps(props) {\n if (props.disabled !== this.props.disabled) {\n this.setState({disabledInternal: props.disabled});\n }\n }", "title": "" }, { "docid": "94e0ccb0df7c14f97094790fabbd1479", "score": "0.509473", "text": "shouldComponentUpdate(nextProps, nextState) {\n return nextProps.show !== this.props.show;\n }", "title": "" }, { "docid": "524a49491e92c459dd5d6d442581bdb6", "score": "0.5089932", "text": "componentWillReceiveProps(props) {\n /* if (props.checked !== this.props.checked) {\n this.setState({checkedInternal: props.checked, indeterminateInternal: false});\n }*/\n /*if (props.disabled !== this.props.disabled) {\n this.setState({disabledInternal: props.disabled});\n }*/\n }", "title": "" }, { "docid": "90f5a3dc7890ab46ab6469d6c289b966", "score": "0.5075457", "text": "changeDialogSuppressionState() {\n this.setState(prevState => ({\n dialogSuppressionVisible: !prevState.dialogSuppressionVisible\n }));\n }", "title": "" }, { "docid": "f47a0510bda5e75b00c2cc81d3ccb37d", "score": "0.50740224", "text": "function checkDeprecatedProps() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n /* eslint-disable no-console, no-undef */\n\n DEPRECATED_PROPS.forEach(function (depProp) {\n if (props.hasOwnProperty(depProp.old)) {\n var warnMessage = getDeprecatedText(depProp.old);\n\n if (depProp.new) {\n warnMessage = \"\".concat(warnMessage, \" \").concat(getNewText(depProp.new));\n }\n\n console.warn(warnMessage);\n }\n });\n}", "title": "" }, { "docid": "7ed9cccc1b16f02d58aff7a084ced5a9", "score": "0.5069307", "text": "function check(prop) {\n if (options.exclude) {\n let ret = !~options.exclude.indexOf(prop);\n debug('%s: %s', ret ? 'enabling' : 'disabling', prop);\n return ret;\n }\n debug('enabling %s', prop);\n return true;\n }", "title": "" }, { "docid": "eae361fdbc4d1d7b0dd34815be07099c", "score": "0.5063681", "text": "function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}", "title": "" }, { "docid": "eae361fdbc4d1d7b0dd34815be07099c", "score": "0.5063681", "text": "function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}", "title": "" }, { "docid": "9cd2589d46b9ef488473646baeb50a65", "score": "0.50502217", "text": "showValidationError() {\n\n return this.props.validationError && this.props.edited;\n }", "title": "" }, { "docid": "4b44a16b2c514ac2212bfb1102533366", "score": "0.5040185", "text": "function toggleDebug() {\n DEBUG_FLAG = !DEBUG_FLAG;\n\n if (DEBUG_FLAG) {\n document.querySelector('#debug').value = 'Debug Mode {On}'\n console.log('NOW RUNNING IN DEBUG MODE');\n console.log('CERTAIN EVENTS WILL BE LOGGED TO CONSOLE');\n } else {\n document.querySelector('#debug').value = 'Debug Mode {Off}'\n }\n}", "title": "" }, { "docid": "bc02a4cd520f1f76035d1e727daf6002", "score": "0.500286", "text": "componentDidMount() {\r\n //Hide yellow warnings in the App\r\n console.disableYellowBox = true;\r\n }", "title": "" }, { "docid": "bcdd19f7206cfb42074ed07c977e93a6", "score": "0.49942628", "text": "logIfDebugMode(msg) {\n\t\tif (this.isDebugMode) this.node.warn(msg);\n\t}", "title": "" }, { "docid": "82305c176d22d875ab5bf3d3153a5f72", "score": "0.49894747", "text": "componentDidUpdate(prevProps, prevState, snapshot) {\n if(!prevProps.show && this.props.show){\n this.setDefaultState();\n }\n }", "title": "" }, { "docid": "16f0993347cd61e6cd28341cb0ffa096", "score": "0.49891275", "text": "hideErrorMessage() {\n if (!this.state.dangerLock) {\n this.setState({\n isDanger: false,\n iconColor: Colors.defaultGrey,\n });\n }\n }", "title": "" }, { "docid": "a673887601a1d31a1acf7156da4b787b", "score": "0.49837443", "text": "get untouched() {\n return !this.touched;\n }", "title": "" }, { "docid": "a673887601a1d31a1acf7156da4b787b", "score": "0.49837443", "text": "get untouched() {\n return !this.touched;\n }", "title": "" }, { "docid": "a673887601a1d31a1acf7156da4b787b", "score": "0.49837443", "text": "get untouched() {\n return !this.touched;\n }", "title": "" }, { "docid": "a673887601a1d31a1acf7156da4b787b", "score": "0.49837443", "text": "get untouched() {\n return !this.touched;\n }", "title": "" }, { "docid": "8942cf053bd97f86d350dda6cd7f91e7", "score": "0.49759808", "text": "shouldComponentUpdate(nextprops, nextstate) {\n\n if (this.props.type === \"select\" || this.props.type === \"date\") {\n return true;\n };\n\n if (this.props.disabled !== nextprops.disabled) {\n return true;\n }\n\n // untuk form biasa\n if (typeof nextprops.value !== \"undefined\") {\n if (this.props.errormessage !== nextprops.errormessage) {\n return true;\n }\n if (this.props.value === nextprops.value) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "ea61368e6f4cd5bed305a3d1c2c49e50", "score": "0.49748334", "text": "shouldComponentUpdate (nextProps, nextState) {\n this.myState.modeChanged = (this.props.keypadMode !== nextProps.keypadMode);\n return true;\n }", "title": "" }, { "docid": "d615a8cd976670cb1745784849877fdb", "score": "0.4973229", "text": "shouldComponentUpdate(nextProps, nextState){\n if(this.state.show_pieces!==nextState.show_pieces) return false;\n if(this.state.show_control!==nextState.show_control){\n this.showBoardControl(nextState.show_control);\n return false; \n }\n return true;\n }", "title": "" }, { "docid": "6eded7e98d3ff05adf6a3b1ad24a94a5", "score": "0.4959917", "text": "componentWillReceiveProps(nextProps) {\n if (nextProps.info.label !== this.state.label) this.setState({ label: nextProps.info.label });\n if (nextProps.info.visible !== this.state.checked) this.setState({ checked: nextProps.info.visible });\n }", "title": "" }, { "docid": "71153ed41f3228884480a788bb5543ad", "score": "0.49583408", "text": "function warnConditionallyRequiredProps(componentName, props, requiredProps, conditionalPropName, condition) {\n if (condition === true && \"dev\" !== 'production') {\n for (var _i = 0, requiredProps_1 = requiredProps; _i < requiredProps_1.length; _i++) {\n var requiredPropName = requiredProps_1[_i];\n if (!(requiredPropName in props)) {\n Object(_warn__WEBPACK_IMPORTED_MODULE_0__[\"warn\"])(componentName + \" property '\" + requiredPropName + \"' is required when '\" + conditionalPropName + \"' is used.'\");\n }\n }\n }\n}", "title": "" }, { "docid": "582aa0479f0600ebc13838735eaaf4e3", "score": "0.49531063", "text": "checkState() {\n if (this.getState() == this.state.connecting) {\n console.warn('connecting');\n } else if (this.getState() == this.state.connected) {\n console.warn('connected');\n } else if (this.getState() == this.state.reconnecting) {\n console.warn('reconnecting');\n } else if (this.getState() == this.state.disconnected) {\n console.warn('disconnected');\n }\n }", "title": "" }, { "docid": "7d3ec5388650c57249c9275548c016a6", "score": "0.49382964", "text": "warnIfDeprecated() {\n if (this.statics.deprecated) {\n let def;\n if (ts_types_2.has(this.statics.deprecated, 'version')) {\n def = {\n name: this.statics.name,\n type: 'command',\n ...this.statics.deprecated,\n };\n }\n else {\n def = this.statics.deprecated;\n }\n this.ux.warn(ux_1.UX.formatDeprecationWarning(def));\n }\n if (this.statics.flagsConfig) {\n // If any deprecated flags were passed, emit warnings\n for (const flag of Object.keys(this.flags)) {\n const def = this.statics.flagsConfig[flag];\n if (def && def.deprecated) {\n this.ux.warn(ux_1.UX.formatDeprecationWarning({\n name: flag,\n type: 'flag',\n ...def.deprecated,\n }));\n }\n }\n }\n }", "title": "" }, { "docid": "e1fdd0832d62cc5e7bb812039436dae8", "score": "0.4931243", "text": "function CannotSuspendWarningMessage() {\n const store = Object(react[\"useContext\"])(StoreContext);\n const areSuspenseElementsHidden = !!store.componentFilters.find(filter => filter.type === types[\"b\" /* ComponentFilterElementType */] && filter.value === types[\"n\" /* ElementTypeSuspense */] && filter.isEnabled); // Has the user filtered out Suspense nodes from the tree?\n // If so, the selected element might actually be in a Suspense tree after all.\n\n if (areSuspenseElementsHidden) {\n return /*#__PURE__*/react[\"createElement\"](\"div\", null, \"Suspended state cannot be toggled while Suspense components are hidden. Disable the filter and try again.\");\n } else {\n return /*#__PURE__*/react[\"createElement\"](\"div\", null, \"The selected element is not within a Suspense container. Suspending it would cause an error.\");\n }\n}", "title": "" }, { "docid": "3a5b3be57edc4edc2148429e7c5ac788", "score": "0.49256083", "text": "onChange(value) {\n const {name, onChange, disabled} = this.props;\n\n if (!disabled) {\n onChange(name, value);\n }\n\n }", "title": "" }, { "docid": "a728b589edbec918498f217bd7d6393e", "score": "0.491906", "text": "function setDebug(value){\n flags.DEBUG_MODE = (value === true) ? value : false;\n }", "title": "" }, { "docid": "a1f18ba38683d414173c44c010d6f939", "score": "0.49119255", "text": "set disabled( state: boolean ) {\n this.logger.error( \"ERROR: 'disabled' in APSComponent called! This should be overridden!\" )\n }", "title": "" }, { "docid": "1a4f7a8d25cb9d8b6d0cd9c194e2984a", "score": "0.49085316", "text": "function DebuggingSettings(_) {\n const {\n appendComponentStack,\n breakOnConsoleErrors,\n hideConsoleLogsInStrictMode,\n setAppendComponentStack,\n setBreakOnConsoleErrors,\n setShowInlineWarningsAndErrors,\n showInlineWarningsAndErrors,\n setHideConsoleLogsInStrictMode\n } = Object(react[\"useContext\"])(SettingsContext);\n return /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: SettingsShared_default.a.Settings\n }, /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: SettingsShared_default.a.Setting\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, /*#__PURE__*/react[\"createElement\"](\"input\", {\n type: \"checkbox\",\n checked: appendComponentStack,\n onChange: ({\n currentTarget\n }) => setAppendComponentStack(currentTarget.checked)\n }), ' ', \"Append component stacks to console warnings and errors.\")), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: SettingsShared_default.a.Setting\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, /*#__PURE__*/react[\"createElement\"](\"input\", {\n type: \"checkbox\",\n checked: showInlineWarningsAndErrors,\n onChange: ({\n currentTarget\n }) => setShowInlineWarningsAndErrors(currentTarget.checked)\n }), ' ', \"Show inline warnings and errors.\")), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: SettingsShared_default.a.Setting\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, /*#__PURE__*/react[\"createElement\"](\"input\", {\n type: \"checkbox\",\n checked: breakOnConsoleErrors,\n onChange: ({\n currentTarget\n }) => setBreakOnConsoleErrors(currentTarget.checked)\n }), ' ', \"Break on warnings\")), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: SettingsShared_default.a.Setting\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, /*#__PURE__*/react[\"createElement\"](\"input\", {\n type: \"checkbox\",\n checked: hideConsoleLogsInStrictMode,\n onChange: ({\n currentTarget\n }) => setHideConsoleLogsInStrictMode(currentTarget.checked)\n }), ' ', \"Hide logs during second render in Strict Mode\")));\n}", "title": "" }, { "docid": "a181b903920d84657b6a9a1b8fde6af6", "score": "0.49034837", "text": "function useMountedChecker() {\n const mounted = (0, _react.useRef)(false);\n (0, _react.useEffect)(() => {\n mounted.current = true; //unmount\n\n return () => {\n mounted.current = false;\n };\n }, []);\n return () => mounted.current;\n}", "title": "" }, { "docid": "c6f7544a0f1c09b0f2b40a2d283b86be", "score": "0.49000013", "text": "function isDeveloper() {\n\treturn (CONFIG_DEV_NOPROD == '1');\n}", "title": "" }, { "docid": "c82bda7e184aad2367e5bedea3cb37c3", "score": "0.4890662", "text": "function useStateLogger(state, DEBUG) {\n if (DEBUG === void 0) {\n DEBUG = false;\n }\n\n if (false) { var debugRef; }\n}", "title": "" }, { "docid": "91e0f0dc713da5f645910a2022031982", "score": "0.48879746", "text": "function ProfileForm({ updateUserInfo }) {\n const { username, firstName, lastName, email } = useContext(UserContext);\n const initialData = { username, firstName, lastName, email };\n\n const [formData, setFormData] = useState(initialData);\n const [userInfoChanges, setUserInfoChanges] = useState(false);\n const [errors, setErrors] = useState(null);\n\n function handleChange(evt) {\n const { name, value } = evt.target;\n setFormData(fData => ({\n ...fData,\n [name]: value,\n }));\n }\n\n async function handleSubmit(evt) {\n evt.preventDefault();\n const updateStatus = await updateUserInfo(formData);\n if (updateStatus === true) {\n console.log(\"updateStatus is a: ...\", updateStatus);\n setErrors(null);\n setUserInfoChanges(true);\n } else {\n console.log(\"errors is a: ...\", updateStatus);\n setUserInfoChanges(false);\n setErrors(updateStatus);\n };\n }\n\n //Question: React says: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component.\n return (\n <form className=\"ProfileForm\" onSubmit={handleSubmit}>\n <FormField\n inputName={\"username\"}\n inputValue={formData.username}\n labelName={\"Username\"}\n handleChange={handleChange}\n disabled={true} />\n <FormField\n inputName={\"firstName\"}\n inputValue={formData.firstName}\n labelName={\"First Name\"}\n handleChange={handleChange} />\n <FormField\n inputName={\"lastName\"}\n inputValue={formData.lastName}\n labelName={\"Last Name\"}\n handleChange={handleChange} />\n <FormField\n inputName={\"email\"}\n inputValue={formData.email}\n labelName={\"Email\"}\n handleChange={handleChange} />\n <FormField\n inputName={\"password\"}\n inputValue={formData.password}\n labelName={\"Password\"}\n handleChange={handleChange}\n type=\"password\" />\n {(errors) ? <Error errors={errors} /> : null}\n {userInfoChanges && <h6>Changes Saved</h6>}\n <button className=\"btn btn-primary\">Save Changes</button>\n </form>\n );\n}", "title": "" }, { "docid": "2dd2b66c3d0a8178cab8fc32470ab0bc", "score": "0.48852658", "text": "function assertDevMode(checkName) {\n if (!ngDevMode) {\n throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵRuntimeError\"](2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`);\n }\n}", "title": "" }, { "docid": "e1f23a1e92566843e863a471c83f3a1d", "score": "0.48786038", "text": "shouldComponentUpdate(np) {\n\t\treturn np.seleccionado !== this.props.seleccionado || np.turno.statusOperacion;\n\t}", "title": "" }, { "docid": "f132586074e334bd1de2069e95017d8b", "score": "0.48761296", "text": "componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.props.value || nextProps.isValuePristine) { // eslint-disable-line\n this.setState({\n value: nextProps.value,\n });\n }\n }", "title": "" }, { "docid": "e7f80d78e19613547a781091df8b30b4", "score": "0.48689637", "text": "function warnNoop(publicInstance, callerName) {\n {\n var constructor = publicInstance.constructor;\n warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');\n }\n}", "title": "" }, { "docid": "e7f80d78e19613547a781091df8b30b4", "score": "0.48689637", "text": "function warnNoop(publicInstance, callerName) {\n {\n var constructor = publicInstance.constructor;\n warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');\n }\n}", "title": "" }, { "docid": "7705c1d785d11576082bc8ed954b8e59", "score": "0.48684925", "text": "function warnDeprecations(componentName, props, deprecationMap) {\n if (true) {\n for (var propName in deprecationMap) {\n if (props && propName in props) {\n var deprecationMessage = componentName + \" property '\" + propName + \"' was used but has been deprecated.\";\n var replacementPropName = deprecationMap[propName];\n if (replacementPropName) {\n deprecationMessage += \" Use '\" + replacementPropName + \"' instead.\";\n }\n Object(_warn__WEBPACK_IMPORTED_MODULE_0__[\"warn\"])(deprecationMessage);\n }\n }\n }\n}", "title": "" }, { "docid": "b3b9323e41709e0c06b81f3fc403266c", "score": "0.4866851", "text": "openWarningModel() {\n this.setState({ showWarningModel: true });\n }", "title": "" }, { "docid": "86906321412aa532d5ab35e77ed2e65a", "score": "0.48642394", "text": "static shouldComponentUpdate(nextProps, nextState){\n console.log('[App.js] shouldComponentUpdate')\n }", "title": "" }, { "docid": "ffe61fdec62e9ae5b03d230de2d35022", "score": "0.48631257", "text": "handleChangeAcception(){\n this.setState({acception:!this.state.acception})\n }", "title": "" }, { "docid": "95356ae8f61c2650d90c5527b035c044", "score": "0.48628533", "text": "function _isDevMode() {\n _runModeLocked = true;\n return _devMode;\n }", "title": "" }, { "docid": "95356ae8f61c2650d90c5527b035c044", "score": "0.48628533", "text": "function _isDevMode() {\n _runModeLocked = true;\n return _devMode;\n }", "title": "" }, { "docid": "f3c51e3a0cc02cb580c06e329c9db45c", "score": "0.48622742", "text": "shouldComponentUpdate() {\n console.log(`${Date.now()}, This is shouldComponentUpdate.`);\n return true;\n }", "title": "" }, { "docid": "6a628b60733d9a11a3980f8372d0a11a", "score": "0.48584542", "text": "function warnMutuallyExclusive(componentName, props, exclusiveMap) {\n if (true) {\n for (var propName in exclusiveMap) {\n if (props && props[propName] !== undefined) {\n var propInExclusiveMapValue = exclusiveMap[propName];\n if (propInExclusiveMapValue && props[propInExclusiveMapValue] !== undefined) {\n Object(_warn__WEBPACK_IMPORTED_MODULE_0__[\"warn\"])(componentName + \" property '\" + propName + \"' is mutually exclusive with '\" + exclusiveMap[propName] + \"'. Use one or the other.\");\n }\n }\n }\n }\n}", "title": "" }, { "docid": "0161d5aca7ebac29716464f03e0fe4a8", "score": "0.48461717", "text": "function shouldNotUpdate(props, nextProps) {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)]\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs))\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString())\n return noPropChange && noFuncChange\n}", "title": "" }, { "docid": "14ec943ec31b304592ce5dc0ca36775e", "score": "0.4842723", "text": "shouldComponentUpdate(prevProps, nextState) {\n console.log(\"insdie shouldComponentUpdate...\");\n return true;\n }", "title": "" }, { "docid": "1b16e93c0408dfa78caa13e3590769fb", "score": "0.48417804", "text": "function enableProdMode() {\r\n if (_modeLocked) {\r\n // Cannot use BaseException as that ends up importing from facade/lang.\r\n throw 'Cannot enable prod mode after platform setup.';\r\n }\r\n _devMode = false;\r\n}", "title": "" }, { "docid": "0187864c351e05c8ffe9fe6f7b7ab26d", "score": "0.484108", "text": "shouldComponentUpdate(nextProps, nextState) {\n return this.state.status\n }", "title": "" }, { "docid": "08a5584b88cc41643861c617f93fc657", "score": "0.48213878", "text": "isDisabled() {\n return this.props.disabled === true;\n }", "title": "" }, { "docid": "7c0bccc902b180b713ddf6ff4041114f", "score": "0.48183298", "text": "static getDerivedStateFromProps(props, state) {\n // when only the src changes we are in \"limbo\" mode\n return {\n isLimbo: props.src !== state.src,\n };\n }", "title": "" }, { "docid": "e6314af00fb294f61476750281ff8705", "score": "0.48158273", "text": "get controlled(){\n\t\treturn canvas.tokens.controlled[0] || false;\n\t}", "title": "" }, { "docid": "2aeaad8bfec82a42474714c30f0b5478", "score": "0.48081952", "text": "shouldComponentUpdate(nextProps, nextState) {\n // NOTE: here you may cancel updating process so\n // DO: Decide whether to Continue or Not\n // DON'T: Cause Side-Effects\n console.log('[ App.js | Component-__-U2 ] shouldComponentUpdate');\n return true || false;\n }", "title": "" }, { "docid": "16e161ede2b6a324193737545a45f7f7", "score": "0.47979283", "text": "componentWillReceiveProps(props) {\n if (props.checked !== this.props.checked) {\n this.setState({\n checkedInternal: props.checked,\n });\n }\n\n if (props.disabled !== this.props.disabled) {\n this.setState({disabledInternal: props.disabled});\n }\n }", "title": "" }, { "docid": "656ab99c830d8311dfba2e6314883518", "score": "0.47919443", "text": "function enableProdMode() {\n if (_modeLocked) {\n // Cannot use BaseException as that ends up importing from facade/lang.\n throw 'Cannot enable prod mode after platform setup.';\n }\n _devMode = false;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "d314f18996b0b852f99f00822d931fbc", "score": "0.47909445", "text": "function isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}", "title": "" }, { "docid": "ddee2287549f1741d9f1a76407be0a19", "score": "0.4790162", "text": "componentDidUpdate(prevProps) {\n if (this.props.prefill === true && prevProps.prefill === false) {\n this.prefillForm();\n }\n }", "title": "" }, { "docid": "41bdec08f71e09889c660f2d48766c89", "score": "0.47836986", "text": "componentWillReceiveProps(nextProps) {\n let majorValue = nextProps.TriodeLink.majorValue ? nextProps.TriodeLink.majorValue : \"\";\n if (majorValue !== \"\") {\n this.setState({\n flag: true\n });\n } else {\n this.setState({\n flag: false\n });\n }\n }", "title": "" }, { "docid": "e54392673ebcee0628e51c6f8931ffb2", "score": "0.4779491", "text": "function useControllableState(props) {\n var valueProp = props.value,\n defaultValue = props.defaultValue,\n onChange = props.onChange,\n _props$shouldUpdate = props.shouldUpdate,\n shouldUpdate = _props$shouldUpdate === void 0 ? function (prev, next) {\n return prev !== next;\n } : _props$shouldUpdate;\n var onChangeProp = useCallbackRef(onChange);\n var shouldUpdateProp = useCallbackRef(shouldUpdate);\n\n var _React$useState = React.useState(defaultValue),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var isControlled = valueProp !== undefined;\n var value = isControlled ? valueProp : valueState;\n var updateValue = React.useCallback(function (next) {\n var nextValue = runIfFn(next, value);\n\n if (!shouldUpdateProp(value, nextValue)) {\n return;\n }\n\n if (!isControlled) {\n setValue(nextValue);\n }\n\n onChangeProp(nextValue);\n }, [isControlled, onChangeProp, value, shouldUpdateProp]);\n return [value, updateValue];\n}", "title": "" }, { "docid": "790e64c54a824a99fd62427c89598f49", "score": "0.4778239", "text": "if (!!value && value !== this.props.value) {\n this._handleControlledValue(children, value);\n }", "title": "" }, { "docid": "38ed499b1bfe6ae289806a1fd72f231c", "score": "0.47756565", "text": "shouldComponentUpdate(nextProps, nextState, nextContext) {\n return false;\n }", "title": "" }, { "docid": "97ba20a14ecf175ce4770958097e3b0f", "score": "0.47659898", "text": "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "title": "" }, { "docid": "c7f60381bd9d974e51ee899908fcf615", "score": "0.4756908", "text": "componentWillReceiveProps(props) {\n if (props.checked !== this.props.checked) {\n this.setState({checkedInternal: props.checked});\n }\n\n if (props.disabled !== this.props.disabled) {\n this.setState({disabledInternal: props.disabled});\n }\n }", "title": "" }, { "docid": "8a16c98e8a36303fdbd014c25a05cc98", "score": "0.4754782", "text": "shouldComponentUpdate(nextProps, nextState) {\n // if props exist and it is different from the props, then we render\n if (nextProps.ignoreProp && this.props.ignoreProp !== nextProps.ignoreProp) {\n console.log('shouldComponentUpdate - DO NOT RENDER')\n console.log('-------------------------------------')\n return false;\n }\n console.log('shouldComponentUpdate - DO RENDER')\n return true;\n }", "title": "" }, { "docid": "b7a026a5d11664852cdefb238c4de042", "score": "0.475068", "text": "componentDidUpdate(prevProps, prevState, snapshot){\n const didModeChange = this.props.mode != prevProps.mode;\n if(!didModeChange) return false;\n this.setMode(this.props.mode); \n }", "title": "" }, { "docid": "f62b032fd4503bb4774a586ae9ec62f6", "score": "0.47465757", "text": "shouldComponentUpdate(nextprops, nextstate){\n console.log(`Next state ${nextstate}`);\n console.log(`Current state ${this.state}`)\n return true;\n }", "title": "" }, { "docid": "36add26489406a3e251f4e1098e93c84", "score": "0.4746071", "text": "shouldComponentUpdate(nextProps, nextState) {\n console.log(\n \"Child ShouldComponentUpdate Runned. nextProps:\",\n nextProps,\n \"nextState:\",\n nextState\n );\n if (nextState.number > 5) {\n return true;//Enable Render\n } else {\n return false;//Disable Render\n }\n }", "title": "" }, { "docid": "c550f006b6fe83af448dda34fde6ee06", "score": "0.47443712", "text": "shouldComponentUpdate( nextProps ) {\n if ( this.props.isVisible !== nextProps.isVisible ) {\n return true;\n }\n if ( !nextProps.isVisible ) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "0d8a3d990d9a56f5f8907a0a1ab74cdf", "score": "0.47405076", "text": "function enableProdMode() {\r\n\t if (_modeLocked) {\r\n\t // Cannot use BaseException as that ends up importing from facade/lang.\r\n\t throw 'Cannot enable prod mode after platform setup.';\r\n\t }\r\n\t _devMode = false;\r\n\t}", "title": "" } ]
eb52fb8738eeac3c175cbb7b04e59a7e
Main function to start the Autorefresh process
[ { "docid": "ca369b4a4dc341df153501babbf5a9bb", "score": "0.0", "text": "function preloadAJAXRL() {\n var ajaxRLCookie = (getCookie(\"ajaxload-\" + wgPageName) == \"on\") ? true : false;\n var appTo = ($('#WikiaPageHeader').length ) ? $('#WikiaPageHeader > h1') : $('.firstHeading');\n \n appTo.append('&#160;<span style=\"font-size: xx-small; line-height: 100%;\" id=\"ajaxRefresh\"><span style=\"border-bottom: 1px dotted; cursor: help;\" id=\"ajaxToggleText\" title=\"' + refreshHover + '\">' + refreshText + ':</span><input type=\"checkbox\" style=\"margin-bottom: 0;\" id=\"ajaxToggle\"><span style=\"display: none;\" id=\"ajaxLoadProgress\"><img src=\"' + ajaxIndicator + '\" style=\"vertical-align: baseline;\" border=\"0\" alt=\"Refreshing page\" /></span></span>');\n \n $('#ajaxLoadProgress').ajaxSend(function(event, xhr, settings) {\n if (location.href == settings.url) {\n $(this).show();\n }\n } ).ajaxComplete(function(event, xhr, settings) {\n if (location.href == settings.url) {\n $(this).hide();\n for(i in ajaxCallAgain) {\n ajaxCallAgain[i]();\n }\n }\n } );\n \n $('#ajaxToggle').click(toggleAjaxReload).attr('checked', ajaxRLCookie);\n \n if (getCookie(\"ajaxload-\" + wgPageName) == \"on\") {\n loadPageData();\n }\n}", "title": "" } ]
[ { "docid": "68ad63d7f0a665ee465cb99a666827a6", "score": "0.6909747", "text": "function start() {\n interval = setInterval(refresh, 20);\n }", "title": "" }, { "docid": "973ef3416440086b608714dfd2831523", "score": "0.6631957", "text": "startUpdater() {\n }", "title": "" }, { "docid": "700c511a43495e17fbf180beefca8976", "score": "0.6414381", "text": "function startAutoRefresh(){\n\t\n\tlet refresh = function(){\n\t\ttry{\n\t\t\tconst location = new Location(window.location.href);\n\t\t\tconst module = Modules.getModule(location.module);\n\t\t\tif(module){\n\t\t\t\tconst controller = module.getController(link);\n\t\t\t\tif(controller && controller.refresh){\n\t\t\t\t\tcontroller.refresh();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e){\n\t\t\t// no action required\n\t\t}\n\t};\n\treturn window.setInterval(refresh,2000);\n\n}", "title": "" }, { "docid": "45b03cdb445e321662a1b4a7223f6737", "score": "0.6411194", "text": "function setupAutoRefresh() {\n\t\tvar settings = window.SettingsService.retrieveSettings();\n\n\t\tif (settings.autoRefresh > 0) {\n\t\t\twindow.AlertService.logMessage(\"Auto refresh set to \" + settings.autoRefresh + \" minute(s)\", \"info\");\n\n\t\t\tvar timeLeft = settings.autoRefresh * 60 * 1000;\n\t\t\tsetRefreshTimeLeft();\n\t\t\tupdateAutoRefreshCountdown();\n\n\t\t\twindow.setInterval(updateAutoRefreshCountdown, 10000);\n\t\t\twindow.setInterval(performSearch, timeLeft);\n\t\t}\n\t}", "title": "" }, { "docid": "a26d4aa1dca5c82c0380e852b91d0c48", "score": "0.631722", "text": "function start_checkupdates(){\n console.log(\"MAIN: Checking for updates\");\n updater.updater_check_updates(version_core,global.storage_settings[\"version\"],global.storage_settings[\"version_branch\"]);\n setTimeout(function(){ start_checkupdates_refresh(); }, 30);\n}", "title": "" }, { "docid": "c6812d5ad516ed60aef41670db90b6d4", "score": "0.62569696", "text": "function start_checkupdates_refresh(){\n var update_avalable=updater.updater_get_avalable(version_core,global.storage_settings[\"version\"],global.storage_settings[\"version_branch\"]);\n\n if (update_avalable==true){\n start_updates();\n win.close();\n }else{\n if (update_avalable==null){\n setTimeout(function(){ start_checkupdates_refresh(); }, 30);\n }\n }\n}", "title": "" }, { "docid": "c6502b91768d067e9ec6b149214712dd", "score": "0.6231896", "text": "function start_updates(){\n update_win = new BrowserWindow({width: 600, height: 400 });\n update_win.loadURL(url.format({\n pathname: path.join(__dirname, 'update.html'),\n protocol: 'file:',\n slashes: true\n }));\n\n console.log(\"MAIN: Installing updates\");\n updater.updater_run_updates(version_core,global.storage_settings[\"version\"],global.storage_settings[\"version_branch\"]);\n setTimeout(function(){ start_updates_status(); }, 5);\n}", "title": "" }, { "docid": "c4e6f5b97c062c5218d2428021c64b1f", "score": "0.6229487", "text": "setupRefreshRoutine() {\n this.refreshRoutine = setInterval(() => {\n this.checkAdminsFile();\n }, this.hardConfigs.refreshInterval);\n }", "title": "" }, { "docid": "b00eb2d56126846ec859001179810002", "score": "0.6104618", "text": "static startReloader() {\n\t\tio().on('reload', function() {\n\t\t\tconsole.log(' reload!!!!');\n\t\t\tlocation.reload();\n\t\t});\n\t}", "title": "" }, { "docid": "02150dce1e13e3427c901645eca62d80", "score": "0.6064172", "text": "function start(ctx, update) {\n // for now we use an update interval\n setInterval(update, (ctx.config.refreshInterval||5)*1000);\n update();\n}", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.6062707", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "391b5e571d38e79d5988b8a2cc123261", "score": "0.6027711", "text": "refresh() {}", "title": "" }, { "docid": "2ce1b84615156d42a481763d61af36be", "score": "0.6003358", "text": "function refresh() {\n refreshServer();\n}", "title": "" }, { "docid": "2ce1b84615156d42a481763d61af36be", "score": "0.6003358", "text": "function refresh() {\n refreshServer();\n}", "title": "" }, { "docid": "0f0a7cc6b6921f817844fad9e3de588c", "score": "0.59789085", "text": "function start_app() {\n //return;\n // size canvas to window\n sizeCanvas();\n\n //set up a ticker to refresh page automatically.\n NOOPBOT_TICK_SETUP(draw, 1000);\n\n //fire a draw event.\n draw();\n\n}", "title": "" }, { "docid": "f98aececd08d64aa2cc882580532256e", "score": "0.5973574", "text": "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), this.scrape_secs * 1000);\r\n }", "title": "" }, { "docid": "b903780b2fa0485329668f4ecfa08142", "score": "0.59698796", "text": "function autoRefresh() {\n clearInterval(nIntervID);\n nIntervID = window.setInterval(printQuote, 10000);\n}", "title": "" }, { "docid": "96d56f0da69f131ec2456f01dbcea87b", "score": "0.59354657", "text": "function startService()\n{\n // Refresh file list for the origin time\n getDocumentList();\n\n // Then setup timer every 5 seconds\n if(refreshTimer) \n {\n window.clearInterval(refreshTimer);\n }\n\n refreshTimer = setInterval(function(){\n getDocumentList();\n }, 5000);\n}", "title": "" }, { "docid": "53740716fc22b629efd69eab507d7e7a", "score": "0.591802", "text": "function launchApp() {\n setOrderType();\n setBeachID();\n beachForecast();\n }", "title": "" }, { "docid": "b02516c17a8c4e61c5f830c9e3fc7eff", "score": "0.5910688", "text": "function mainScrapper(){\n\tconsole.log(\"languageDB is running.....\");\n\tif(DBManager.lanFlags.length == 3){\n\t\tNewsPaper();\n\t\tclearInterval(StartScrapData);\n\t\tsetInterval(mainScrapper,20*60*1000); \n\t}\n}", "title": "" }, { "docid": "ba7a062a8fa27e191ec3083ed9939e03", "score": "0.58930033", "text": "function startMonitoring() {\n for (var _i = 0, list_2 = exports.list; _i < list_2.length; _i++) {\n var target = list_2[_i];\n target.startWatching(exports.settings.refresh);\n }\n}", "title": "" }, { "docid": "63aaa93e1d8ee6110c8865582a2b182d", "score": "0.58892214", "text": "run() {\n this.grid.init($(this.window), this);\n\n this.pubsub.setGlobal('App', this);\n this.pubsub.submit('App.Initialized', {});\n\n // TODO: instead perioically send messages\n // TODO: move to config class\n this.config.poll.forEach(p => {\n var f = () => this.onAction(p.action, p.args)\n setInterval(f, p.period);\n });\n }", "title": "" }, { "docid": "639559b0dee754af431d594c18ca4219", "score": "0.5881841", "text": "function start() {\n gw_job_process.UI();\n gw_job_process.procedure();\n }", "title": "" }, { "docid": "73522a6526e69b6d0a01e7225f20cc64", "score": "0.58691484", "text": "function launch() {}", "title": "" }, { "docid": "73522a6526e69b6d0a01e7225f20cc64", "score": "0.58691484", "text": "function launch() {}", "title": "" }, { "docid": "6ba8c9aed10756b93d64f5768fdb3873", "score": "0.5848367", "text": "function requestRefresh(){\r\n var check = refresh.running;\r\n if (check != 1){\r\n refresh.schedule(50);\r\n }\r\n}", "title": "" }, { "docid": "b8e23877f0a85f8e0fc6d04aa8258ed7", "score": "0.5830549", "text": "function setupAutoRefresh() {\n\tvar autoRefreshInterval = setInterval(function() {\n\t\tif($('#notificationTable').length) { //if the id exists then call the notification table method to update the table\n\t\t\tnotificationTable();\n\t\t} else { //if the id is not there then the user has navigated away from the page so this auto refresh can be turned off\n\t\t\tclearInterval(autoRefreshInterval);\n\t\t}\n\t}, 180000);\n}", "title": "" }, { "docid": "89bf39726ed826d986a88bc249792b3e", "score": "0.58177304", "text": "function main () {\n console.log(\"Registering Events...\");\n gm.events.register();\n console.log('Registering Commands...');\n gm.commands(gm.commandManager.add.bind(gm.commandManager));\n console.log(\"Server started!\");\n \n setInterval(function() {\n gm.events.Checks();\n }, 1000);\n\n}", "title": "" }, { "docid": "a2308af8fd60e628439892e9d7a66f1e", "score": "0.581713", "text": "function refresh() {\n /**\n * @event refresh\n */\n events.trigger('refresh');\n }", "title": "" }, { "docid": "718f89a23b402813ab7face308de176f", "score": "0.58005357", "text": "function nexusAutoRefresh(timeInterval) {\r\n\tif(!timeInterval){ timeInterval = 5000; }\r\n\twindow.setInterval(listViewRefresh, timeInterval);\r\n}", "title": "" }, { "docid": "2d0d6a347746310e50dfa77eaac4a723", "score": "0.57994837", "text": "function run() {\r\n\r\n\t// set up the script\r\n\taddPrototypeFunctions();\r\n\tloadSettingsNow();\r\n\tdoScriptUISetup();\r\n\t\r\n\t// Set up the page\r\n\tredirectHomeSubsPage();\r\n\tdoPageSetup();\r\n\taddEvents();\r\n\t\r\n\t// start interval events\r\n\tg_intervalId = window.setInterval(intervalUpdate, parseInt(g_modInterval));\r\n\t\r\n\t//alert(getCurrentPage());\r\n\t//alert(hasGuideByDefault());\r\n\t//alert(\"done\");\r\n\t\r\n}", "title": "" }, { "docid": "ee81693c4fa4027fc9ce97dc50ae8123", "score": "0.579762", "text": "refresh() {\n\n\t}", "title": "" }, { "docid": "9bfa2759f2823b81bbd80cf27e59427e", "score": "0.57963794", "text": "function start_app() {\n\n // size canvas to window\n sizeCanvas();\n\n //set up a ticker to refresh page automatically.\n let speed = 200; // how often screen refreshes, in milliseconds.\n let ticker = NOOPBOT_TICK_SETUP(draw, speed);\n\n //fire a draw event.\n draw();\n\n //redraw when canvas is clicked.\n canvas.addEventListener('click', draw);\n}", "title": "" }, { "docid": "8e05017cd20a2c99f68f4c5e07222c09", "score": "0.5775204", "text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n v_global.logic.doc_id = gw_com_api.getPageParameter(\"doc_id\");\n processRetrieve({});\n //----------\n gw_com_module.startPage();\n\n }", "title": "" }, { "docid": "5b746681f70db7da9d46ae5559e3fa63", "score": "0.57661605", "text": "installUpdate() {\n logger.info('Initializing update process (quit & install)');\n autoUpdater.quitAndInstall();\n }", "title": "" }, { "docid": "64e7f43d73665e03b15cc97c198ecc3b", "score": "0.5741233", "text": "async function refresh() {\n loadingbar();\n console.log(\"Refreshing Prices..\");\n moonScraper();\n}", "title": "" }, { "docid": "2ab2f98eaf6d5fa38f1442d2728e4dc4", "score": "0.5732379", "text": "function startup() {\n console.log(\"Starting up.\")\n selectToday();\n getAllWastage();\n}", "title": "" }, { "docid": "b08dc32aa95c57292141b4dccd87c364", "score": "0.56988186", "text": "async start() {\n // this.checkOauthIntervalId = setInterval(async () => {\n // if (this.goodreadsOauthGrantedAndNotYetStarted) {\n // this.goodreadsOauthGrantedAndNotYetStarted = false;\n\n // log.info(\"Starting...\");\n\n // // Initial startup (always run fetch as soon as possible on start() call!)\n // await this._fetch();\n // // For initial startup ONLY, notify the backend server when the fetch has completed\n // if (this.backendSocket) {\n // this.backendSocket.emit(socketCodes.INITIAL_BOOK_COLLECTION_IN_PROGRESS, false);\n // }\n\n // this.refreshIntervalId = setInterval(async () => {\n // if (this.isStopped) {\n // log.info(\"Preventing refresh, shutting down\");\n // } else if (this.currentlyFetching) {\n // log.info(\"Skipping refresh, still processing previous one\");\n // } else {\n // await this._fetch();\n // }\n // }, this.propertyManager.refreshFrequencyInMillis);\n // }\n // }, CHECK_OAUTH_ACCESS_SLEEP_TIME_IN_MILLIS);\n }", "title": "" }, { "docid": "8c1353ca802220064cd61b42e5321f87", "score": "0.56969714", "text": "function runApplication() {\n\t// 1. Load browser history; 2. Load search terms; 3. Start connection loop\n\tloadBrowserHistory(() => {\n\t\tloadSearchTerms(startConnectLoop);\n\t});\n}", "title": "" }, { "docid": "7e0af6d6b82b01068097ba98e9b90982", "score": "0.56925756", "text": "function taskListRefresh(){\n setInterval(welcomeActor, 1000);\n}", "title": "" }, { "docid": "92aca83c778080c91f3a12e5c876d25f", "score": "0.5691213", "text": "function main() {\n observeTaskLog();\n }", "title": "" }, { "docid": "f5ed5d096790f28fadbdb2fd7317b071", "score": "0.56708896", "text": "function run_app() {\n putAppVersionToFrontPage();\n methods.buildDocDef();\n methods.makeChartsOptions();\n //return; //skips sending charts to cloud-service\n methods.loadCharts(function () {\n var button = document.getElementById('generate-pdf');\n if (fconf.setAnOpenButton) {\n button.addEventListener('click', function () {\n ////solution works without timeout, but\n ////this timeout does not hurt\n setTimeout(createDoc, 1);\n });\n button.style.opacity = \"1\";\n button.title = \"Click to generate document\";\n button.innerHTML = \"Generate Report\";\n pdfMake_is_in_busy_state = false;\n } else {\n pdfMake_is_in_busy_state = false;\n button.innerHTML = \"Data loaded\";\n button.title = \"Generating document ...\";\n createDoc();\n }\n })\n }", "title": "" }, { "docid": "1bfe215188ebd0742311a80b20a74bd4", "score": "0.5645362", "text": "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 60000);\r\n }", "title": "" }, { "docid": "68436d2d97b1789231e949459c9975b6", "score": "0.56336486", "text": "async function main() {\n console.log(\"Starting up main...\");\n\n // get a list of todays events\n const todayEvents = await getCalendarFeed(\n \"https://calendar.google.com/calendar/ical/gabrielle.branin%40yale.edu/public/basic.ics\"\n );\n console.log(\"Today's events are: \", todayEvents);\n\n // pass them to the scheduler\n const breakTimes = await scheduler(todayEvents);\n console.log(\"Today's scheduled breaks are: \", breakTimes);\n}", "title": "" }, { "docid": "af65ce9078fa83222d65868505f3a12b", "score": "0.5627636", "text": "function sched_all() {\n setInterval(\n function() {\n reset();\n },\n refreshInterval*1000\n );\n sched_refresh_global();\n}", "title": "" }, { "docid": "a9a44bbf61e4aea82bba2e2126f74fa4", "score": "0.56271625", "text": "function init() {\n\t\tinstance.reset();\n\t\trunning = true;\n\t\tlastTime = Date.now();\n\t\tmain();\n\t}", "title": "" }, { "docid": "2e4f21406712d9640e4391b3940ead07", "score": "0.5610593", "text": "function Run() {\n console.log(\"Application start\");\n }", "title": "" }, { "docid": "3e68e66131f3f699a523227f0b8fc237", "score": "0.5609254", "text": "function runAPIs() {\ngetData();\nfiveDayForecast();\nsaveHistory();\n}", "title": "" }, { "docid": "d8aa1d1f48ac7b5180570d406b6b40fe", "score": "0.5602475", "text": "start() {\n FBIManager.start();\n }", "title": "" }, { "docid": "418ae73139d12b7855247926bd059331", "score": "0.5600054", "text": "function startRefresh()\n{\n\tgetCurrentRace();\n\tif( $.current != $.showing ){\n\t\tgetContentUpdate($.current);\n\t\t$.showing = $.current;\n\t}\n\n\tsetTimeout(\n\t\t\tfunction(){\n\t\t\t\tstartRefresh()\n\t\t\t},\n\t\t\t$.timeout\n\t);\n}", "title": "" }, { "docid": "11807ce8127cb9dbd618efbc37ae7289", "score": "0.5594537", "text": "function Refresh() \n {\n \n }", "title": "" }, { "docid": "9bc434422c84a295ae97cf85f93c35f6", "score": "0.5589667", "text": "function sched_refresh_global() {\n setTimeout(function() {\n client.get('refresh_interval', function(err, reply) {\n refreshInterval = reply;\n });\n client.lrange('operations', 0, -1, function(err, ops) {\n operations = ops;\n });\n client.lrange('apps', 0, -1, function(err, appList) {\n apps = appList;\n });\n sched_refresh_global();\n }, 2000);\n}", "title": "" }, { "docid": "9bc434422c84a295ae97cf85f93c35f6", "score": "0.5589667", "text": "function sched_refresh_global() {\n setTimeout(function() {\n client.get('refresh_interval', function(err, reply) {\n refreshInterval = reply;\n });\n client.lrange('operations', 0, -1, function(err, ops) {\n operations = ops;\n });\n client.lrange('apps', 0, -1, function(err, appList) {\n apps = appList;\n });\n sched_refresh_global();\n }, 2000);\n}", "title": "" }, { "docid": "6174eb89c1792e7b0064c004bbe3e367", "score": "0.5588647", "text": "function refresh( ) {\r\n taskList.dispatchEvent( refreshEvent );\r\n}", "title": "" }, { "docid": "8ffb4ef908d245e579e44770bb0580e2", "score": "0.5587228", "text": "function oneSecondCountdownToRefresh() {\n intervalId = setInterval(refresh, 1000);\n}", "title": "" }, { "docid": "339f58651fd696a4346133eb4e3a6189", "score": "0.55856055", "text": "function AutoRefresh( t ) {\n setTimeout(\"location.reload(true);\", t);\n }", "title": "" }, { "docid": "c042722b8386c41564be01a5be4c8892", "score": "0.5585236", "text": "function StartTheFun() {\n startTime = Date.now();\n MonsterRunDirectionGenerator();\n getOldSession();\n loadImages();\n setupKeyboardListeners();\n main();\n}", "title": "" }, { "docid": "4a12fdc76522e412e11a9c2075aa8d98", "score": "0.55826825", "text": "function AutoRefresh(t) {\n setTimeout(\"location.reload(true);\", t);\n}", "title": "" }, { "docid": "7ad7bbd8dd203bc2991fb23f5e5b8be2", "score": "0.5582469", "text": "function start() {\n\ttaskProcessed++;\n\tconsole.log('Task Processed: ' + taskProcessed + ' | ' + 'Number Of Tasks : ' + NUMBER_OF_TASKS);\n\tif(taskProcessed === NUMBER_OF_TASKS) {\n\t\ttaskProcessed = 0;\n\t\tNUMBER_OF_TASKS = 0;\n\t\t\n\t\t/** Load Table */\n\t\tconstructRankingTable();\n\t\t\n\t\t/** Initialise Graphics */\n\t\tinit();\n\t\tanimate();\n\t\t\n\t\t/** Initialise Interactions */\n\t\trankFilesOnClick();\n\t\taffectedFoldersOnClick();\n\t\tfilesOnClick();\n\t\t\n\t\t/** Launch Page */\n\t\tkeystrokeListener(launchPage, 32);\n\t}\n}", "title": "" }, { "docid": "f9f47fac8fc38c54aceefc6835d87427", "score": "0.5574715", "text": "function refreshBrowser () {\n setTimeout(function () {\n livereload();\n }, 2000);\n }", "title": "" }, { "docid": "1cb799376403d2c354d7ea1939f69b2f", "score": "0.55600506", "text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_module.startPage();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"user_id\", gw_com_module.v_Session.USR_ID);\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { month: -1 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate(\"\"));\n gw_com_api.setValue(\"frmOption\", 1, \"tdr_no\", gw_com_api.getPageParameter(\"tdr_no\"));\n //----------\n processRetrieve({});\n\n }", "title": "" }, { "docid": "43834b8fb0d4233953f390050a295d96", "score": "0.55589676", "text": "function run(){\n\tread_annotation_file();\n\tread_genome_file();\n\tread_variant_file();\n\t\n\tset_download_urls();\n\tuser_message(\"Info\",\"Loading data\");\n\twait_then_run_when_all_data_loaded(); \n}", "title": "" }, { "docid": "9eca49ca4761d7375d96743b5e6ec861", "score": "0.5558478", "text": "function start() {\n make_cover() ;\n hashchange() ;\n }", "title": "" }, { "docid": "d4d8eb9d222d3e6732f98f3aa7b692ec", "score": "0.5553555", "text": "function startApp() {\r\n\r\n loadData(pageNum);\r\n\r\n attachListeners();\r\n\r\n loadData(pageNum);\r\n\r\n}", "title": "" }, { "docid": "4a44a36997d3ec4c4845d6c1689af78a", "score": "0.554927", "text": "function init() {\n start()\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "a417249397370e0dd08d98ad2f5cb444", "score": "0.554889", "text": "function Start() {\n console.log(\n `%c App Initializing...`,\n \"font-weight: bold; font-size: 20px;\"\n );\n\n Main();\n }", "title": "" }, { "docid": "e7b1a35e96bfb908990f10be176fa194", "score": "0.55362684", "text": "function start_app() {\n // size canvas to window\n sizeCanvas();\n\n // set initial x & y\n currX = Math.ceil(appWidth / 10);\n currY = Math.ceil(appHeight / 10);\n\n //set up a ticker to refresh page automatically.\n let speed = 50; // how often screen refreshes, in milliseconds.\n\n let ticker = NOOPBOT_TICK_SETUP(advanceAndDraw, speed);\n window.onkeyup = ({ key }) => {\n direction = DIRECTIONS[key];\n };\n}", "title": "" }, { "docid": "208344b55a6ccd85b6363bbe9e9792d8", "score": "0.55194664", "text": "function init () {\n\n lastTime = Date.now();\n main();\n\n }", "title": "" }, { "docid": "da8a95ef7c4a87b2bbbba1c0ff35fbed", "score": "0.55128276", "text": "function start() {\n setInterval(updateNectar, 1000);\n }", "title": "" }, { "docid": "83e86deb2bdfac354bc213bed0cbd330", "score": "0.55127096", "text": "function startRefreshWatcher(startDateWithOffset) {\n const currentDate = new Date();\n\n if (isRefreshed === false && currentDate >= startDateWithOffset) {\n refreshTab();\n isRefreshed = true;\n return;\n }\n\n if (!isRefreshed) {\n setTimeout(function () {\n startRefreshWatcher(startDateWithOffset);\n }, 1)\n }\n}", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.5505386", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.5505386", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.5505386", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "876b355019af7377c5eea599a1077100", "score": "0.55003995", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "d17d16f23d2d66587ab33baf6b177148", "score": "0.54995084", "text": "function realtimeRefresh() {\n setInterval(function() {\n dateTimeLoad();\n }, 5000);\n}", "title": "" }, { "docid": "397e03fe9f7303dd3b8cdb5d051243f9", "score": "0.5490495", "text": "function main() {\n addListeners();\n\n getSyncedData(function(timestamp, products, selectedProduct, selectedModel, interval, lastAvailable) {\n lastProductSyncTimestamp = timestamp;\n availableProducts = products;\n refreshInterval = interval;\n\n setCache(lastAvailable);\n setTargetProduct(selectedProduct, selectedModel);\n restartLoop(selectedProduct, selectedModel);\n });\n}", "title": "" }, { "docid": "a8c94e7320ee4e33726fbfbe5eab21fd", "score": "0.5489204", "text": "function main() {\n if (!A.C.scandelay || parseInt(A.C.scandelay) < 5)\n A.W(`BMW Adapter scan delay was ${A.C.scandelay} set to 5 min!`, A.C.scandelay = 5);\n let scanDelay = parseInt(A.C.scandelay) * 60 * 1000; // minutes\n\n if (A.C.debug)\n A.debug = true;\n\n if (!A.C.server || typeof A.C.server !== 'string' || A.C.server.length < 10)\n A.C.server = 'www.bmw-connecteddrive.com';\n else\n A.C.server = A.C.server.trim();\n\n A.I(`BMW will scan the following services: ${A.C.services}.`);\n\n A.wait(100) // just wait a bit to give other background a chance to complete as well.\n .then(() => bmw.initialize(A.C))\n .then(() => A.makeState({\n id: bmw.renameTranslate('_RefreshData'),\n 'write': true,\n role: 'button',\n type: typeof true\n }, false))\n .then(() => getCars(A.timer = setInterval(getCars, scanDelay)))\n .then(() => A.I(`BMW Adapter initialization finished, will scan ConnectedDrive every ${A.C.scandelay} minutes.`),\n err => A.W(`BMW initialization finished with error ${err}, will stop adapter!`, A.stop(true)));\n}", "title": "" }, { "docid": "376e5b8904949a9c3529ad8595d0869e", "score": "0.5484297", "text": "function start() {\n resizeCanvas();\n loadOnStart();\n enterData();\n loadTheme();\n drawStuff();\n handleNewHash()\n window.addEventListener('hashchange', handleNewHash, false);\n}", "title": "" }, { "docid": "3efb6dfe04713b2c727680933d6c4b7c", "score": "0.5483815", "text": "function init() {\n\n if(hasPlugin('device')){\n \tAppCore.os = plugin('device').platform.toLowerCase();\n \tlog(AppCore.os);\n }\n\n\tdbInit();\n\tapnsInit();\n\tupdateOnInit();\n\t//每15分钟任务\n\tsetInterval(\n\t\t_=>{\n\t\t\tlog('[cron] start');\n\t\t\tupdateAfterInit();\n\t\t\tlog('[cron] end');\n\t\t},\n\t\t15*60*1000\n\t);\n\n document.addEventListener(\"pause\", pause, false);\n document.addEventListener(\"resume\", resume, false);\n document.addEventListener(\"backbutton\", backbutton, false);\n}", "title": "" }, { "docid": "affdae093a8da507199a1ed6e7858e81", "score": "0.54812926", "text": "start() {\n\n\t}", "title": "" }, { "docid": "112f09fd07bb019eae4a171321e83383", "score": "0.54752", "text": "function reStart() {\n\tlocation.reload();\n}", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.54701316", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.54701316", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "64b3b97e6477c9b08bb048728736c4d4", "score": "0.5466003", "text": "function init() {\n\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "db6ee92b0de03fc40d890379853caba1", "score": "0.5459883", "text": "restart() {\n\t\t\tconst args = [...process.execArgv, path.join(__dirname, \"restarter.js\"), ...process.argv.slice(1)];\n\t\t\tconst proc = this.spawn(process.execPath, args, { detached: true, stdio: \"ignore\" });\n\t\t\tproc.unref();\n\t\t\tthis.logger.info(`Restarter started. PID: ${proc.pid}`);\n\n\t\t\tthis.exitProcess(0);\n\t\t}", "title": "" }, { "docid": "e7f51f0e031c29d82be85fbe82d62320", "score": "0.54586667", "text": "function scheduleRefresh() {\n if (refreshEvent) {\n clearTimeout(refreshEvent);\n }\n refreshEvent = setTimeout(function() {refresh(); refreshEvent = null;}, refreshDelay);\n}", "title": "" }, { "docid": "0727bc70dffd7b617c18efb90d492214", "score": "0.54578316", "text": "start () {\n this.getTrack()\n setInterval(this.getTrack, REFRESH_DELAY)\n }", "title": "" }, { "docid": "ab9569c804a63082245f1ee81b2d6b81", "score": "0.54532284", "text": "startup() {}", "title": "" }, { "docid": "ce0c0da5f1fb2c837aa87b99c00fdc79", "score": "0.54503196", "text": "run() {\n this.loadModule('Syncer');\n \n if (this.config.watch) {\n this.loadModule('Watcher');\n }\n \n if (this.config.growl) {\n this.loadModule('Growler');\n }\n\n this.trigger('sync');\n }", "title": "" }, { "docid": "81f3c94319f391ead5f640844854c7fc", "score": "0.5449676", "text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // startup process.\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n if (v_global.logic.Supp) {\n v_global.logic.SuppCd = gw_com_module.v_Session.USR_ID;\n }\n else {\n v_global.logic.SuppCd = \"\";\n v_global.logic.SuppNm = \"\";\n }\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { month: -1 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate(\"\"));\n gw_com_api.setValue(\"frmOption\", 1, \"supp_cd\", v_global.logic.SuppCd);\n gw_com_module.startPage();\n\n }", "title": "" }, { "docid": "2d4ddac27e4bbdd10e3dc68b59cffaae", "score": "0.54481256", "text": "async function run() {\n await waitUntilLoad();\n checkPermission();\n loadScript('app.js', 'rc-app');\n handleEvent();\n setsink();\n}", "title": "" } ]
727a10a946d8e23f04d8aac9762db3ac
es la clase de todas las celdas Declaracion de funciones
[ { "docid": "73cc7e0c2d064758ea3a1b6fcaf26482", "score": "0.0", "text": "function ganaJugador(){\n\n}", "title": "" } ]
[ { "docid": "62a1192cad355ea810d8407179e99d96", "score": "0.6479644", "text": "function Fc(){}", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.64480954", "text": "initalizing() {}", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.64427644", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "064fc35ac5675e8ccb6223a2f134bfe4", "score": "0.642116", "text": "constructor(nome, sobrenome, email, cpf, funcao, registro){ //declaramos todos os atributos\n super(nome, sobrenome, email, cpf); //super class vem da class mae Pessoa, herda os atributos \n this._funcao = funcao; // e declara os novos atributos que nao constam na class mae\n this._registro = registro;\n }", "title": "" }, { "docid": "d4f10b400f2b87054ad7bde6ac4566e9", "score": "0.6286668", "text": "constructor(alto){\n super(alto, alto); //Con super se ejecuta el constructor de la clase padre, si se detalla el metodo con super.metodo() solo ejecutas el metodo señalado \n }", "title": "" }, { "docid": "74108be0409d5790935238d4e0ef4c9e", "score": "0.6211632", "text": "function declarada (){\n console.log(`Funcion declarada`);\n}", "title": "" }, { "docid": "3ce43d32acc7ae6545d739091e4dee84", "score": "0.6181443", "text": "constructor()\n\t{\n\t\n\t}", "title": "" }, { "docid": "ad9a99de19c1123c7268eaef568c75ed", "score": "0.6171036", "text": "constructor() {\n super(); // Sempre quando extender uma classe colocar o super\n // Nunca deve ser depois de definir as child-classes\n\n this.cmds = new Collection();\n this.prefix = ['!', '?'];\n\n /*\n * Definindo child-classes\n */\n\n this.addCommands();\n this.addEvents();\n\n // Executando os métodos\n }", "title": "" }, { "docid": "d280191a6df4feca991910adeb8d02aa", "score": "0.616593", "text": "constructor(nome, cor, modelo){\n super(nome); // vai chamar o construvtpt da classe pai\n this.cor = cor\n this.modelo = modelo\n}", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.6150486", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.6145386", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.6142853", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.6142853", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c618996d949c457576a18dbe3d2a76f7", "score": "0.61419153", "text": "enterConstructor_declaration(ctx) {\n\t}", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "f97721d3f3237d48f6c2bce76cb00314", "score": "0.6139926", "text": "constructor() {\n\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "0911e8a8d9b5b080378a02c96015d735", "score": "0.6071394", "text": "function t_object(){this.__init__.apply(this, arguments)}", "title": "" }, { "docid": "34756a39f585fb7f0636bc1a8eabf528", "score": "0.6070367", "text": "constructor() {\n this._setup(); // DO NOT REMOVE\n }", "title": "" }, { "docid": "d6e0fed5a12a6b4ef682c82fda241ed6", "score": "0.6069485", "text": "constructor(parametroNombre, parametroTemporadas, parametroCapitulos, parametroGenero){\n // crear las propiedades del objeto\n this.nombre = parametroNombre;\n this.temporadas = parametroTemporadas;\n this.capitulos = parametroCapitulos;\n this.genero = parametroGenero;\n this.publicado = false; //propiedad por defecto\n }", "title": "" }, { "docid": "59a09cbf243683f307e1a5703d001f74", "score": "0.60539234", "text": "constructor(name,type,evolutions)\n {\n /*\n Se utiliza \"this\" para hacer referencia al propietario de la función que la está invocando o en su defecto, al objeto donde dicha función es un método.\n */\n this.name=name;\n this.type=type;\n this.evolutions=evolutions;\n }", "title": "" }, { "docid": "935096abb8ed96049df10e94fcb8c211", "score": "0.60333014", "text": "constructor(nombre, edat, email) { //per crear instancias es necesita un metode constructor\n this.name = nombre, //si volem que les instancies heredin les caracteristiques han de tenir el this\n this.email = email,//coma per cada nou element\n this.age = edat; //la ultima propietat o va sense coma o va amb punt i coma\n }", "title": "" }, { "docid": "a4c1b258d8e755e1d43c587e2a0b8e35", "score": "0.6030459", "text": "constructor() {\n super(); //instead of using util.inherits (to copy prototype) and call (to copy also props and methods on the ctor function)\n this.name = 'Donkey'\n }", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.6024968", "text": "function Composition() {}", "title": "" }, { "docid": "0d10a41e2d2e15b14bd621e554dff73c", "score": "0.600208", "text": "function Ctor() {\n }", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.60012347", "text": "init() {\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.60012347", "text": "init() {\n\t}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.599836", "text": "function miFuncion(){}", "title": "" }, { "docid": "93155c75fc5e843b013278748a853153", "score": "0.5992416", "text": "function Constructor(emotion) {\n this.declarative = 'I am';\n this.emotion = emotion;\n this.declare = function() {\n console.log(this.declarative + this.emotion);\n console.log(this)\n }\n}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.5986026", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "14e171dec3b81d98fffed636dab7fc9a", "score": "0.5985613", "text": "init() {\n }", "title": "" }, { "docid": "a814e561aae46c93079a4db5f3cf3fbd", "score": "0.5981274", "text": "function casino(){\n\n}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.59750354", "text": "constructor() {\n\t}", "title": "" }, { "docid": "fa0889740237d90d6fd071bed7490439", "score": "0.59635365", "text": "constructor(nombre, telefono, direccion){\n\n\n\n\tthis.nombre = nombre;\n\tthis.telefono = telefono;\n\tthis.direccion = direccion;\n\t}", "title": "" }, { "docid": "86db019a2e91ccc589fa494c65869d23", "score": "0.5951768", "text": "function cmu() {\n\n this.__construct();\n\n}", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.5946556", "text": "function init() {\n \n }", "title": "" }, { "docid": "3c2dec7151e83d765d1e064aa8d35eb1", "score": "0.5931063", "text": "function declaracion()\n {\n TipoDato();\n if (tokenActual.TIPO == Tipo.Signo_Llave_izq) {\n Vector(); \n }\n else if (tokenActual.TIPO == Tipo.Identificador)\n {\n cadena += tab +\"var \"+ tokenActual.Valor;\n emparejar(Tipo.Identificador);\n if(tokenActual.TIPO == Tipo.Signo_Parentesis_izq){\n Funcion();\n \n }else{\n AsignacionP();\n emparejar(Tipo.Punto_Coma);\n cadena += \"\\r\\n\"; \n bodyP();\n }\n }\n\n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.59303963", "text": "constructor() {\n \n }", "title": "" }, { "docid": "81420ea1de71dac4a66f4d0791687920", "score": "0.59082395", "text": "constructor() {\r\n }", "title": "" }, { "docid": "3d708c42eba848d8c0060fcd04283db1", "score": "0.58937716", "text": "function Interfaz(){\r\n\r\n}", "title": "" }, { "docid": "f1dee0844c297518222694a85f068875", "score": "0.58914995", "text": "function chorus_obj() {\n\t\n}", "title": "" }, { "docid": "c6000fd51c31a56c4484acf3c9eb0dc3", "score": "0.5888205", "text": "function Acg(){}", "title": "" }, { "docid": "b9c36b77abf7c634e8f36f7c0044bcf0", "score": "0.5879824", "text": "constructor(){\r\n\r\n }", "title": "" }, { "docid": "891ed21ec12158fb46585d3379ebb571", "score": "0.5866719", "text": "constructor(nombre, apellido, correo, edad){\n this.nombre = nombre;\n this.apellido = apellido;\n this.correo = correo;\n this.edad = edad;\n }", "title": "" }, { "docid": "02fa778cd91a8f24b9d2e74c73b817f2", "score": "0.5861402", "text": "function exPublicFunction() {\n\n }", "title": "" }, { "docid": "d83c528b75a374af4cc974ab94f0390f", "score": "0.585108", "text": "constructor () {\n \n }", "title": "" }, { "docid": "9867bf7bb9fbfcf1c69837656c7ec870", "score": "0.5842356", "text": "function Construct () {}", "title": "" }, { "docid": "c2e79ed420771ace5eb1a7a2b0411751", "score": "0.5840056", "text": "constructor(){\r\n }", "title": "" }, { "docid": "2832696e8ee8ac31265dea83a6982adf", "score": "0.5832133", "text": "function init() {\n \n }", "title": "" }, { "docid": "2253efb1db6801628b2962e060ceca34", "score": "0.58266765", "text": "function Ala(){}", "title": "" }, { "docid": "830bddb49bd1afb9fc7d83e4c82eac2c", "score": "0.5820765", "text": "retire() {\n }", "title": "" }, { "docid": "68eb03cf9913e4432965565347dfbb1a", "score": "0.5809194", "text": "constructor(){\n\n }", "title": "" }, { "docid": "4015fe0fb08e78295ec1fcfdc105b78c", "score": "0.5808135", "text": "function da(){}", "title": "" }, { "docid": "4015fe0fb08e78295ec1fcfdc105b78c", "score": "0.5808135", "text": "function da(){}", "title": "" }, { "docid": "a4b7ce364380ff7aa8de17b536f2d8d2", "score": "0.57998914", "text": "constructor(){\n\n\n }", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.57974726", "text": "initialise () {}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.57974726", "text": "initialise () {}", "title": "" }, { "docid": "35c6aa38b32e6343a584dcaaeae6ce6e", "score": "0.57939285", "text": "function __constructor () {}", "title": "" }, { "docid": "26b3f49783708b9cafad1573eaa86dcf", "score": "0.5788243", "text": "_init(){\n\t}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5785478", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" } ]